Steve Ling
Cadet
- Joined
- Oct 12, 2016
- Messages
- 5
While configuring TFTP so I could upload a firmware update to my router I noticed if the umask value in the TFTP service configuration starts with a zero then the umask value is interpreted as hex, else the umask value is interpreted as decimal. I'm relatively new to FreeNAS so posting here first in case this is a hex vs decimal numerical convention I'm not aware of.
Steps to reproduce:
1 - In the 9.10-stable GUI go to Services and open the TFTP configuration dialog
2 - Set the umask to 117 (expecting this to enable owner rw, group rw in files that are received)
3 - I pointed the TFPT directory to a new dataset I created for TFTP root.
4 - The underlying dataset directory has owner as my new tftp user rwx and group as wheel rwx
5 - I allowed new files to be created
6 - I set the TFTP user to the new tftp user I created
7 - Enabled TFTP
8 - I wrote a file to the TFTP server
Results:
When files are received they have permissions: owner rw and other w, not the expected permissions.
If I convert the umask value 117 to hex 0x75 then these permissions make sense because group rwx and other rx are masked.
If I add a leading zero to the umask value (0117) then the umask is interpreted as hex and the permissions on received files are as expected
Let me know if this is a valid bug and I will report it.
Steps to reproduce:
1 - In the 9.10-stable GUI go to Services and open the TFTP configuration dialog
2 - Set the umask to 117 (expecting this to enable owner rw, group rw in files that are received)
3 - I pointed the TFPT directory to a new dataset I created for TFTP root.
4 - The underlying dataset directory has owner as my new tftp user rwx and group as wheel rwx
5 - I allowed new files to be created
6 - I set the TFTP user to the new tftp user I created
7 - Enabled TFTP
8 - I wrote a file to the TFTP server
Results:
When files are received they have permissions: owner rw and other w, not the expected permissions.
Code:
[steve@freenas] ~% ls -al /mnt/TftpRoot drwxrwxrwx 2 tftp wheel 5 Dec 3 19:27 ./ drwxr-xr-x 10 root wheel 10 Dec 3 14:24 ../ -rw-----w- 1 tftp wheel 6 Dec 3 17:22 file.txt
If I convert the umask value 117 to hex 0x75 then these permissions make sense because group rwx and other rx are masked.
If I add a leading zero to the umask value (0117) then the umask is interpreted as hex and the permissions on received files are as expected
Code:
[steve@freenas] ~% ls -al /mnt/TftpRoot drwxrwxrwx 2 tftp wheel 5 Dec 3 19:27 ./ drwxr-xr-x 10 root wheel 10 Dec 3 14:24 ../ -rw-rw---- 1 tftp wheel 6 Dec 3 19:27 file.txt
Let me know if this is a valid bug and I will report it.
Last edited by a moderator: