Results 1 to 6 of 6

Thread: Gnome Files app - where are the default permissions for "New Document"?

  1. #1
    Join Date
    Jul 2008
    Location
    Australia
    Posts
    29

    Default Gnome Files app - where are the default permissions for "New Document"?

    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...

    I found this old thread, but there was no answer:
    https://www.linuxquestions.org/quest...rminal-363921/

    So how does Files in Gnome create with permissions of 600? Does it have it's own umask?

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,136

    Default Re: Gnome Files app - where are the default permissions for "New Document"?

    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.

    Thus this apparently something File does.
    Henk van Velden

  3. #3
    Join Date
    Jul 2008
    Location
    Australia
    Posts
    29

    Default Re: Gnome Files app - where are the default permissions for "New Document"?

    Quote Originally Posted by hcvv View Post
    Thus this apparently something File does.
    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?

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,136

    Default Re: Gnome Files app - where are the default permissions for "New Document"?

    Quote Originally Posted by gordon_mzano View Post
    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).
    Henk van Velden

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,824
    Blog Entries
    15

    Default Re: Gnome Files app - where are the default permissions for "NewDocument"?

    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...

    I found this old thread, but there was no answer:
    http://tinyurl.com/y7q53mz2

    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;
    Code:
    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!


  6. #6
    Join Date
    Jul 2008
    Location
    Australia
    Posts
    29

    Thumbs up Re: Gnome Files app - where are the default permissions for "NewDocument"?

    Quote Originally Posted by malcolmlewis View Post
    If the 'New Document' being created vi the ~/Templates directory
    Spot on Malcolm, and explained with such clarity. The riddle is solved!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •