Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: How to set Gnome automount permissions?

  1. #21
    Join Date
    Oct 2009
    Beans
    8

    Re: How to set Gnome automount permissions?

    That was my idea but I have seen, for exemple, that NTFS is mentioned in other files than /src/device.c (excluding the various files in helpers directory, I refer mainly to the file /src/daemon.c and /tests/run) therefore I think that if I will add the item UFSD in this file, I will have to do even in the others.

    The strange thing, however, is that by mounting in a standard way the file-system hfs+ (however using udisks and not mount), this is mounted according to strict rules (moreover only certain options are allowed) and the same goes for the old brother (hfs) who, in turn, is mounted under other rules . This makes me think that the binaries that come with ubuntu are compiled with the rules also for hfs and hfsplus despite this rules, in source files, are not included.

    What do you think about?

    I hope I was clear.

    PS:
    I must point out that the version of the source that I downloaded is this:

    Code:
    apt-get source udisks=1.0.1-1ubuntu1
    (the same currently installed in my system)
    Last edited by bingel; March 6th, 2011 at 05:01 PM.

  2. #22
    Join Date
    Oct 2009
    Beans
    8

    Re: How to set Gnome automount permissions?

    I solved by editing the file /src/device.c in this way (the parts I've added are in red):

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

    static const char *vfat_defaults[] = { "uid=", "gid=", "shortname=mixed", "dmask=0077", "utf8=1", NULL };
    static const char *vfat_allow[] = { "flush", "utf8=", "shortname=", "umask=", "dmask=", "fmask=", "codepage=", "iocharset=", "usefree", 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", 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 };

    /* ---------------------- ufsd -------------------- */

    static const char *ufsd_defaults[] = { "uid=", "gid=", "dmask=0077", NULL };

    static const char *ufsd_allow[] = { "umask=", "dmask=", "fmask=", NULL };
    static const char *ufsd_allow_uid_self[] = { "uid=", NULL };
    static const char *ufsd_allow_gid_self[] = { "gid=", NULL };


    /* ---------------------- iso9660 -------------------- */

    static const char *iso9660_defaults[] = { "uid=", "gid=", "iocharset=utf8", "mode=0400", "dmode=0500", NULL };
    static const char *iso9660_allow[] = { "norock", "nojoliet", "iocharset=", "mode=", "dmode=", NULL };
    static const char *iso9660_allow_uid_self[] = { "uid=", NULL };
    static const char *iso9660_allow_gid_self[] = { "gid=", NULL };

    /* ---------------------- udf -------------------- */

    static const char *udf_defaults[] = { "uid=", "gid=", "iocharset=utf8", "umask=0077", NULL };
    static const char *udf_allow[] = { "iocharset=", "umask=", NULL };
    static const char *udf_allow_uid_self[] = { "uid=", NULL };
    static const char *udf_allow_gid_self[] = { "gid=", NULL };

    /* ------------------------------------------------ */
    /* TODO: support context= */

    static const char *any_allow[] = { "exec", "noexec", "nodev", "nosuid", "atime", "noatime", "nodiratime", "ro", "rw", "sync", "dirsync", NULL };

    static const FSMountOptions fs_mount_options[] =
    {
    { "vfat", vfat_defaults, vfat_allow, vfat_allow_uid_self, vfat_allow_gid_self },
    { "ntfs", ntfs_defaults, ntfs_allow, ntfs_allow_uid_self, ntfs_allow_gid_self },
    { "ufsd", ufsd_defaults, ufsd_allow, ufsd_allow_uid_self, ufsd_allow_gid_self },
    { "iso9660", iso9660_defaults, iso9660_allow, iso9660_allow_uid_self, iso9660_allow_gid_self },
    { "udf", udf_defaults, udf_allow, udf_allow_uid_self, udf_allow_gid_self },
    };

    /* ------------------------------------------------ */

  3. #23
    Join Date
    May 2007
    Beans
    3

    Re: How to set Gnome automount permissions?

    This is pathetic. I'm just going to undelete a file and i was mounting my usb disks to hold the program since the main partition has to be unmounted and now i have to compile ******* udisks just because of this.

    Who thought it's a good idea to not allow the superuser to change the permissions of a mounted partition without recompiling the automount program?


  4. #24
    Join Date
    Jan 2008
    Beans
    127

    Re: How to set Gnome automount permissions?

    Thanks to mc4man and Vermind for the solution, although I agree with you all that its ridiculous that we need to adapt the source code to fulfill this simple requirement.
    I post here, because I'm using Ubuntu 12.10 (Linux Mint 14 to be concrete) and here there is a new udisks release (udisks2) that gets used.

    So here is an adapted version of Verminds guide for udisks2:

    1. Download the sources via apt-get:
      Code:
      mkdir dev
      cd dev
      apt-get source udisks2
    2. Modify src/udiskslinuxfilesystem.c:
      Code:
      cd udisks2-2.0.0
      gedit src/udiskslinuxfilesystem.c
      (Remove or comment out the parts in blue as shown by mc4man (including the trailing commas) see http://ubuntuforums.org/showpost.php...03&postcount=7)
      The relevant lines (277 to 286) 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 udisks2
    4. Build it via debuild: (you can safely ignore the fatal-error telling you that you can't gpg sign the built deb package because you don't have the secret key
      Code:
      debuild
    5. Install the package with dpkg:
      Code:
      cd ..
      sudo dpkg -i udisks2_2.0.0-1ubuntu1_amd64.deb

Page 3 of 3 FirstFirst 123

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
  •