  | |  | USB utilities | USB utilities 2005-03-25 - By Stephen Gardner
Back
On Fri, 25 Mar 2005, Barry Gamblin wrote: > >> What are the correct entries? My /etc/updfstab.conf looks like this: >> >> include /etc/updfstab.conf.default >> >> device usbdrive { >> partition 1 >> match hd WDC >> } >> >> And when I plug in the drive I get this in /etc/fstab: >> >> /dev/sda1 /mnt/usbdrive auto noauto,owner,kudzu 0 0 >> >> But a normal user cannot mount /mnt/usbdrive. It says that only >> the superuser can mount. > > Stephen Gardner wrote: > > I think you may have found a bug with updfstab or one of the other hotplug > associated tools. If you delete the options you added to /etc/updfstab.conf > and just add the "match hd WDC" line to the "device flash" section in > /etc/updfstab.conf.default you should find it works as expected. The section > you added looks fine to me and I've just tested something similar but the > underlying problem (the cause of the message you're getting) is that > /dev/sda1 isn't being set to be owned by the console user. When the "match" > line is part of the "device flash" section in /etc/updfstab.conf.default > then /dev/sda1 gets set to the correct ownership to allow the mount to > work. Editing /etc/updfstab.conf.default isn't a long term solution but will > get you going for now. I'll do some more digging with strace and see if I can > find the underlying cause.
Just to clear up the underlying problem Barry had here.. well, if I can because it's complicated..
The underlying problem is indeed that when a custom "device" entry is added to /etc/updfstab.conf(.default) it won't get the correct permissions assigned to the /dev/<device> device node without additional changes being make to /etc/security/console.perms.
[ this may all be in the archives somewhere and I've found a few references on the web so feel free to ignore the explanation ]
Using Barry's example, when the USB device gets plugged in /usr/sbin/updfstab modifies /etc/fstab correctly and makes the directory /mnt/usbdrive. However when /usr/sbin/updfstab calls /sbin/pam_console_apply it has no permissions rules for /mnt/usbdrive (and therefore its associated /dev/sda1 device) in /etc/security/console.perms. The upshot of which is that the permissions don't get set correctly leaving /dev/sda1 still owned by root and unmountable by normal users.
Making an addition to the existing "device flash" section in /etc/updfstab.conf.default ("match hd WDC" in this case) means Barry's device will initiate the creation of /mnt/flash which *does* get a match in /etc/security/console.perms and /dev/sda1 then gets its ownership changed.
The conclusion to all of this is that if you modify /etc/updfstab.conf to include a new "device" entry you'll need to modify /etc/security/console.perms as well if you want non-root users to be able to mount it.
Barry, two things. Firstly RHEL3-U5 includes a replacement kudzu package which is likely to clobber your changes if you apply the new package (although they'll get saved in the .rpmsave version of the file). Secondly, if you bugzilla the details of the USB device (WDC) as an enhancement to the kudzu packages /etc/updfstab.conf.default file it might make it in in time for U5.
Regards, Stephen
-- Taroon-list mailing list Taroon-list@(protected) http://www.redhat.com/mailman/listinfo/taroon-list
Earn $52 per hosting referral at Lunarpages.
|
|
 |