[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: concurrent X users and gnome-volume-manager

On Sat, Dec 18, 2004 at 04:42:10PM +1100, Graham Williams wrote:

 > Thanks.  Looks like I'm out of luck with g-v-m in this setup then.
 > Back to my Disk Mounter applets!

 I was looking a bit more into this, just out curiosity.

 The use of pmount is hard-coded in g-v-m:

 $ strings /usr/bin/gnome-volume-manager | grep pmount 
 /usr/bin/pmount-hal %h

 so no configurability there.

 pmount's "policy" is also hard-coded (look at the source)[0], no
 configurability here either.

 Part of pmount's policy is that you need to be able to run pmount in
 order to mount a device.  This leads to the "you need to be in the
 plugdev to mount a device" default requirement.

 An entry in /etc/fstab overrides pmount's policy.

 In order to be able to umount a device, pmount requires that this
 device has been mounted by you.  This is enforced by checking /etc/mtab
 and parsing the mount options looking for "uid=n".  n needs to be the
 uid of the user trying to unmount the device.  I wonder how mount
 enforces the user and users option.

 In short, your problem, as I see it, is this:

    * pmount's policy is that if you can run pmount and fulfill certain
      criteria, you can mount a device.

    * pumount's policy is that you can run pumount, you are the user who
      mounted the device and fulfill certain criteria, you can unmount
      the device.

 The problem with g-v-m is that if you have two g-v-m's running, both
 will get messages from HAL which means that they will race for mounting
 the device.  As I said before, one of them should go to sleep, but even
 that solution is highly unsatisfactory.


 [0] Here I have to say that in the grand tradition of documenting
     programs incompletely, what pmount actually does is a bit more than
     what the manpages say it does.  For starters, it supports a certain
     subset of filesystems (all of them likely to be present in
     removable media); it creates directories with a mode of 0755
     (modifies by the user's umask); it constructs the arguments it
     passes to mount in a certain way and assumes that the information
     found in /etc/mtab has been constructed in this way; it requires
     devices to be under /dev and it follows symlinks in the device name
     that it gets (to enforce this among other things), which is not
     quite consistent with this wording:

       pmount device [ label ]

       This  will  mount  device  to a directory below /media if policy
       is met (see below). If label is given, the mount point will  be
       /media/label, otherwise it will be /media/device.

     I expected "pmount /dev/dvd" to mount the dvd under /media/dvd
     (following the wording above), instead it ends up in /media/hdc.

Reply to: