hal-system-storage-mount bug

David Zeuthen david at fubar.dk
Sun Feb 12 18:44:44 PST 2006


On Fri, 2006-02-10 at 15:40 -0500, Jeffrey Stedfast wrote: 
> I've been trying to add support for the iocharset= mount option and it
> won't work because the '-' character is not allowed by the mount script.
> 
> changing to:
> 
> GIVEN_MOUNTOPTIONS=${GIVEN_MOUNTOPTIONS//[^a-zA-Z0-9_=-[:space:]]/_}
> 
> fixes the problem.

I've committed this change. I've also fixed up all the mount scripts to
allow [:alnum:] and [:space:] in mount point name meaning mount points
like "foobar der æøå サイトの" [1] should work too. Let's see how much
this breaks :-)... Though GNOME seems to be rather happy with these
entries in /proc/mounts, /etc/mtab and hal... 

It should be secure too, we use

GIVEN_MOUNTPOINT=${GIVEN_MOUNTPOINT//[^[:alnum:]_=[:space:]:.+-]/@}

in LANG=en_US.UTF-8 meaning attacks like passing `/bin/evil` as
GIVEN_MOUNTPOINT (which we expand later in the script) or other fun
tricks shouldn't work.

Also fixed is the way hal handles surprise removal, e.g. yanking a USB
stick or media without unmounting it. We used to issue '/bin/umount -l',
which could block (bad: hang in state D => kill hald entirely), now we
ask hald-runner to do the heavy lifting.

Also now.. even if you don't use gnome-[mount|umount|eject], e.g. just
do a  'umount /dev/sda1' as root we detect this and clean up the mount
point that hal's Mount() method created.

Cheers,
David

[1] : I have no idea what "サイトの" means - I just grabbed it from the
yahoo.jp homepage :-)




More information about the hal mailing list