Page 1 of 4 123 ... LastLast
Results 1 to 10 of 40

Thread: Setting default permissions for removable drives

  1. #1
    heyjoe NNTP User

    Question Setting default permissions for removable drives

    I just noticed that after mounting an SD card all files and dirs in it are with 700 permissions which is wrong (a PDF is not executable). IIRC it wasn't like that before.

    What could be the reason for this change and how can I set default permissions for removable storage?

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,703
    Blog Entries
    1

    Default Re: Setting default permissions for removable drives

    Quote Originally Posted by heyjoe View Post
    I just noticed that after mounting an SD card all files and dirs in it are with 700 permissions which is wrong (a PDF is not executable). IIRC it wasn't like that before.

    What could be the reason for this change and how can I set default permissions for removable storage?
    How did you mount?

    Can you show us relevant output from the following?
    Code:
    mount|grep sd
    Code:
    dir /media

  3. #3
    heyjoe NNTP User

    Default Re: Setting default permissions for removable drives

    I simply inserted the SD card in the USB card reader and KDE shows it in Dolphin.

    It gets mounted in /run/media/<myusername>/EOS_DIGITAL

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,703
    Blog Entries
    1

    Default Re: Setting default permissions for removable drives

    Quote Originally Posted by heyjoe View Post
    I simply inserted the SD card in the USB card reader and KDE shows it in Dolphin.

    It gets mounted in /run/media/<myusername>/EOS_DIGITAL
    Ok, so Udisks/desktop mounted.

    Please at least show us some definitive output...
    Code:
    mount|grep sd
    Code:
    dir /run/media/<myusername>

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    29,777

    Default Re: Setting default permissions for removable drives

    I can not reproduce this on my Leap 42.3 system. The bits set are rw-r--r-- (as it was on earlier openSUSE versions).

    So why is it different at your's?

    While I admit that a desktop mount should not set any x-bits (for security reasons, do not execute a file from an external, untrusted source), I think your talking about PDF files has no ground. The mount is really not going to check the contents of all files to find out if setting an x-bit might be useful.
    Henk van Velden

  6. #6
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,925
    Blog Entries
    14

    Default Re: Setting default permissions for removable drives

    We don't even know what the file system on the SD card is. F.e. FAT cannot write linux permissions, and FAT is what lots of cameras ( EOS = Canon ) use/used.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    23,703
    Blog Entries
    1

    Default Re: Setting default permissions for removable drives

    Quote Originally Posted by Knurpht View Post
    We don't even know what the file system on the SD card is. F.e. FAT cannot write linux permissions, and FAT is what lots of cameras ( EOS = Canon ) use/used.
    Which is one of the reasons I requested the output of mount. Vague descriptions with out all the necessary supporting definitive information leads to speculation.

  8. #8
    heyjoe NNTP User

    Default Re: Setting default permissions for removable drives

    Quote Originally Posted by deano_ferrari View Post
    Ok, so Udisks/desktop mounted.

    Please at least show us some definitive output...
    Code:
    mount|grep sd
    Code:
    dir /run/media/<myusername>
    The 2 entries which appear in the command's output after mounting the SD card are:

    Code:
    /dev/sdf1 on /run/media/<myusername>/EOS_DIGITAL type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
    /dev/sdf1 on /var/run/media/<myusername>/EOS_DIGITAL type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
    Code:
    [~]: dir /run/media/$USER
    total 256
    drwx------ 1 <myusername> users 262144 Jan  1  1970 EOS_DIGITAL

    Quote Originally Posted by hcvv View Post
    I can not reproduce this on my Leap 42.3 system. The bits set are rw-r--r-- (as it was on earlier openSUSE versions).

    So why is it different at your's?
    That's what I am trying to find too. Which is even more interesting - I noticed this just recently. Previously (think months and years) it was not like that. FWIW in .bashrc I have 'umask 0077' but it has always been like that, so that is not something new or recently changed.

    While I admit that a desktop mount should not set any x-bits (for security reasons, do not execute a file from an external, untrusted source), I think your talking about PDF files has no ground. The mount is really not going to check the contents of all files to find out if setting an x-bit might be useful.
    I mentioned PDF just to say that it is regardless of file type, just like you explained.

    Quote Originally Posted by Knurpht View Post
    We don't even know what the file system on the SD card is. F.e. FAT cannot write linux permissions, and FAT is what lots of cameras ( EOS = Canon ) use/used.
    It is a 32GB SD card formatted inside the Canon camera. mount and 'df -T' show that type is fuseblk.

  9. #9
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,925
    Blog Entries
    14

    Default Re: Setting default permissions for removable drives

    fuseblk is not the file system. Mount the card manually on /mnt as root, the run
    Code:
    mount | grep sd
    again and show the output. Another thing I see is that the date is Jan 1st 1970 .....
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  10. #10
    heyjoe NNTP User

    Default Re: Setting default permissions for removable drives

    I used 'sdf' instead of 'sd' for grep filtering because there are quite a few HDD partitions starting with sd*
    As far as I see the FS is exfat. (the card is in write protected mode, so the other message is correct)

    Code:
    [~]: mount | grep sdf
    /dev/sdf1 on /run/media/<myusername>/EOS_DIGITAL type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
    /dev/sdf1 on /var/run/media/<myusername>/EOS_DIGITAL type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
    [~]: su -
    Password: 
    # umount /dev/sdf1 
    # mount | grep sdf
    # mount /dev/sdf1 /mnt
    FUSE exfat 1.2.7
    WARN: '/dev/sdf1' is write-protected, mounting read-only.
    # mount | grep sdf
    /dev/sdf1 on /mnt type fuseblk (ro,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
    #
    After that /mnt and all files and dirs in it are with permissions 777 and ownership root:root.

    Quote Originally Posted by Knurpht View Post
    Another thing I see is that the date is Jan 1st 1970 .....
    I noticed that too. But the files and dirs inside the mount dir are with correct timestamps.

Page 1 of 4 123 ... LastLast

Tags for this Thread

Posting Permissions

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