Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: How to set Gnome automount permissions?

  1. #1
    Join Date
    Mar 2007
    Location
    Helsinki, Finland, Earth
    Beans
    234
    Distro
    Ubuntu 18.04 Bionic Beaver

    How to set Gnome automount permissions?

    Hi,
    I have a cross-platform game on a Windows partition. Ubuntu 10.04 and 10.10 do not allow executing files on a NTFS partition when automatically mounted through Nautilus. I would like to know what I need to change to make my system automatically mount NTFS ( and possibly VFAT ) partitions so that the exec bits are set, at least for my user.

    I tried
    Code:
    gconftool-2 -t list --list-type string -s /system/storage/default_options/ntfs-3g/mount_options "[defaults, exec]"
    with no luck.

    Any ideas?
    Vermind

  2. #2
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: How to set Gnome automount permissions?

    two choices:

    - tweak /etc/fstab : add this partition
    - install & use mountmanager to set your prefs

  3. #3
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: How to set Gnome automount permissions?

    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

  4. #4
    Join Date
    Mar 2007
    Location
    Helsinki, Finland, Earth
    Beans
    234
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to set Gnome automount permissions?

    thanks for the answers, but if i use fstab, the settings will not apply for any past and future partitions of the given filesystem type. if i connect a bunch of usb hard disks with ntfs, it will not apply to them. I know that udisks or gnome-vfs-mount or whatever its called nowadays has a gconf key that allows setting mount options, i just cannot find it now .... I am happy with any method that lets the automount system that is already there mount them. I.e. I do not want to install extra software to do something that i know is doable without it, and I do not want my partitions automounted on boot or be visible in fstab.
    I will look at mountmanager to see what it does later, thanks.
    Vermind

  5. #5
    Join Date
    Jun 2007
    Beans
    17,337

    Re: How to set Gnome automount permissions?

    If you can't find any other way then you can re-build udisks to allow exec's on ntfs and vfat.
    Then main issue is that then all .txt files will be marked as executable, that's why the changes were made .
    2 seperate source changes - first for vfat, then ntfs.
    (check the changlelog to see.

    The edit for vfat is straightforward, for ntfs will take a little digging. (never looked here

    This was the last version to allow ntfs, and the one that instituted the change for vfat

    https://launchpad.net/ubuntu/+source/udisks/1.0.1-2

  6. #6
    Join Date
    Mar 2007
    Location
    Helsinki, Finland, Earth
    Beans
    234
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to set Gnome automount permissions?

    Hi,
    I found a question that asks how to set the mount options when udisks mounts some partitions (essentially the mechanism I am looking for). I also tried to mount my ntfs partition manually using udisks, but whatever mount options I set are either not "allowed" or just do nothing and the partition is mounted with the default options which are
    Code:
    rw,nosuid,nodev,allow_other,blksize=4096,default_permissions
    I looked into /lib/udev/rules.d, there are some interesting rules there but sadly none of them mention mount options like here. One mentions ntfs, but that is in the context of detecting recovery partitions and not showing them to the user.

    Perhaps I will use the fstab workaround if this becomes urgent.
    Mountmanager looks good for fstab tweaking and doing the udev things if this becomes the issue.
    Vermind

  7. #7
    Join Date
    Jun 2007
    Beans
    17,337

    Re: How to set Gnome automount permissions?

    Ubuntu 10.04 and 10.10 do not allow executing files on a NTFS partition
    Are you referring to binaires (.exe's) or text files (scripts) or both
    They are somewhat treated differently. (.exe's don't need to be 'set', scripts do.

    In any event, as far as 'showing' executable on either in both vfat and ntfs this is the current settings in udisk maverick source (udisks-1.0.1+git20100614/src/device.c

    /* ---------------------- vfat -------------------- */

    static const char *vfat_defaults[] = { "uid=", "gid=", "shortname=mixed", "dmask=0077", "utf8=1", "showexec", NULL };
    static const char *vfat_allow[] = { "flush", "utf8=", "shortname=", "umask=", "dmask=", "fmask=", "codepage=", "iocharset=", "usefree", "showexec", NULL };
    static const char *vfat_allow_uid_self[] = { "uid=", NULL };
    static const char *vfat_allow_gid_self[] = { "gid=", NULL };

    /* ---------------------- ntfs -------------------- */
    /* this is assuming that ntfs-3g is used */

    static const char *ntfs_defaults[] = { "uid=", "gid=", "dmask=0077", "fmask=0177", NULL };
    static const char *ntfs_allow[] = { "umask=", "dmask=", "fmask=", NULL };
    static const char *ntfs_allow_uid_self[] = { "uid=", NULL };
    static const char *ntfs_allow_gid_self[] = { "gid=", NULL };
    What's marked in blue is what's preventing scripts from being executable and .exe's from being set also (even though .exe's don't need to be

    As far as scripts - I believe it's all or nothing - either all text files or none. There is no way to set or unset files individually - you can't change/set permissions on ntfs or vfat.

    Screens show with blue removed - #3 is an .exe
    Attached Images Attached Images
    Last edited by mc4man; October 27th, 2010 at 04:20 AM.

  8. #8
    Join Date
    Mar 2007
    Location
    Helsinki, Finland, Earth
    Beans
    234
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to set Gnome automount permissions?

    Hi and thanks for the response,
    I am referring to linux binaries in particular. My current test case is Dwarf Fortress, which I have extracted on my Windows desktop. The directory contains both the Linux and Windows versions. To run dwarf fortress, I would run the shell script called df which in turn starts runs an ELF 32-bit executable. when doing this with the NTFS partition mounted, I get:
    Code:
    /media/OS/Users/Vermind/Desktop/dfg_31_16 
    $ sh ./df
    ./df: 6: ./libs/Dwarf_Fortress: Permission denied
    Executing .exe files fails:
    Code:
    /media/OS/Program Files/GIMP 2/bin 
    $ ./gimp-2.6.exe
    bash: ./gimp-2.6.exe: Permission denied
    Of course I can execute them via double-click or just by prepending wine to the command, so they are not the issue. Also text scripts are not an issue since I can prepend sh or bash to them.

    I will try the fix and report back.
    Vermind

  9. #9
    Join Date
    Mar 2007
    Location
    Helsinki, Finland, Earth
    Beans
    234
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: How to set Gnome automount permissions?

    The fix pointed out by mc4man works perfectly, thanks. I am able to run the Linux dwarf fortress from the Windows partition.
    Now to wait until I have to open text files on the FAT and NTFS partitions or a virus strikes me from them...

    The steps I did, to help people in the future:
    1. Download the sources via apt-get:
      Code:
      mkdir dev
      cd dev
      apt-get source udisks
    2. Modify src/device.c:
      Code:
      cd udisks-1.0.1+git20100614
      gedit src/device.c
      (Remove the parts in blue as shown by mc4man (with the trailing commas).)
      The relevant lines (Line 5870-) will look like this:
      Code:
      static const char *vfat_defaults[] = { "uid=", "gid=", "shortname=mixed", "dmask=0077", "utf8=1",/*"showexec",*/ NULL };
      static const char *vfat_allow[] = { "flush", "utf8=", "shortname=", "umask=", "dmask=", "fmask=","codepage=", "iocharset=", "usefree", /*"showexec",*/ NULL };
      static const char *vfat_allow_uid_self[] = { "uid=", NULL };
      static const char *vfat_allow_gid_self[] = { "gid=", NULL };
      
      /* ---------------------- ntfs -------------------- */
      /* this is assuming that ntfs-3g is used */
      
      static const char *ntfs_defaults[] = { "uid=", "gid=", "dmask=0077", /*"fmask=0177",*/ NULL };
      static const char *ntfs_allow[] = { "umask=", "dmask=", "fmask=", NULL };
    3. Download the build deps:
      Code:
      sudo apt-get build-dep udisks
    4. Build it via debuild:
      Code:
      debuild
    5. Install the package with dpkg:
      Code:
      cd ..
      sudo dpkg -i udisks_1.0.1+git20100614-3_amd64.deb


    Note to people having the same problem: Your version of udisks may differ, so substitute everything after udisks- and udisks_ with your version number.
    Last edited by Vermind; October 27th, 2010 at 10:39 AM.
    Vermind

  10. #10
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: How to set Gnome automount permissions?

    I just run DF from my Linux partition.

    You don't need to worry about viruses being on the NTFS partition, unless they're designed for Linux and for some reason you decide to run them with sudo. :P
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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