When using Files, if I right click in a folder and select “New Document” the permissions default to 600, but if I open a terminal window in the same folder and run
touch testfile
the permissions are 644. My umask is the default 0022, so the terminal permissions are expected.
I’m used to file permission inheritance, but this obviously works differently…
The umask maskes. That is in your case of an umask of 022, it masks (removes) the w-permission bits for group and others. So on a request for file file creation you will not see those bits set, even if the creating process asks for them being set…
But umask does not set bits. So it will not add the w-permission bits for group and others when a process does not ask for them being set.
E.g. when touch asks the kernel on file creation to do this with 666 (btw, I do not know if that is what touch does, just an example), then the kernel masks them with 022 and the result is 644.
When your Files (or what the name is, asks the kernel to create with 600, the result will be 600, because masking of 022 will only switch off bits that are not set.
Yes, but why? I am simply browsing a file system using the built in file manager for Gnome - Files. Then I right click and choose to create a new file.
If I create and save a new file using other Gnome applications like Gedit, or LibreOffice, they always apply permissions of 666 - umask (022) = 644, so why wouldn’t the right click Gnome menu?
Well, LibreOffice is not really a Gnome application does I doubt they have to act following some Gnome convention.
But I leave the why question to the Gnome gurus ;). I do not use it. I only wanted to explain what umask is because I thought you had some confusion there (which wasn’t necessary true).
On Thu 07 Jun 2018 01:46:03 PM CDT, gordon mzano wrote:
Opensuse Leap 42.2
Application: Files 3.20.3
When using Files, if I right click in a folder and select “New Document”
the permissions default to 600, but if I open a terminal window in the
same folder and run > touch testfile the permissions are 644. My umask
is the default 0022, so the terminal permissions are expected.
I’m used to file permission inheritance, but this obviously works
differently…
So how does Files in Gnome create with permissions of 600? Does it have
it’s own umask?
Hi
If the ‘New Document’ being created vi the ~/Templates directory
For example if I create;
touch Templates/untitled.txt
ls -la Templates/untitled.txt
-rw-r--r-- 1 <username> users 0 Jun 7 12:26 untitled.txt
Then right click and create New Document -> untitled.txt, permissions
0644 are inherited, if I change to 0600 and create another it’s 0600 as
per the Template file.
So, suggest setting up the template via this method, permissions and
file extension as required…
–
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 RC4 | GNOME Shell 3.26.2 | 4.12.14-18-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!