[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taroon-list
Subject:    Re: USB utilities
From:       Barry Gamblin <bgamblin () hao ! ucar ! edu>
Date:       2005-03-28 14:59:16
Message-ID: 200503281459.j2SExGZ16109 () jabba ! hao ! ucar ! edu
[Download RAW message or body]

|> 
|> 
|> 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
|> 

Thanks for the explanation! I'll look into the bugzilla report.

Barry

--
Taroon-list mailing list
Taroon-list@redhat.com
http://www.redhat.com/mailman/listinfo/taroon-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic