[PATCH] sanitize instead of rejecting mountpoints with funny characters

Ludwig Nussel ludwig.nussel at suse.de
Mon Feb 27 07:43:46 PST 2006


On Monday 27 February 2006 01:19, David Zeuthen wrote:
> On Fri, 2006-02-24 at 15:41 +0100, Ludwig Nussel wrote:
> > Since front-ends that call the Mount method have no way to determine
> > the whitelist used for filtering invalid mount points it's better to
> > not completely reject "invalid" ones IMO. If the Mount call fails a
> > front-end only has the possibility to call it again without a mount
> > point which results in the device beeing mounted on "disk". By
> > replacing invalid characters with eg. an underscore the mount point
> > at least looks similar to what the user actually entered.
> 
> So, I'd rather we precisely define what mount points are acceptable and
> then the front-ends can replace invalid characters with underscores
> themselves.. Right now I think we allow
> 
>  [:alnum:]_=[:space:]:.,+-
> 
> in the en_US.UTF-8 locale... That might change a bit when we rewrite
> this stuff in C.. What do you think?

Defining the whitelist is good but as you said it might change. So I'd still
vote for having the backend substitute invalid characters rather than rejecting
to mount. The requested mountpoint gets modified anyways if it already exists
so frontends already have to query the actual mount point after the mount call.

> > I think the is_ascii check in the fdi file for setting the
> > desired_mount_point property should also be removed as it prevents
> > mountpoints with umlauts from beeing used by default although the
> > hal-system-storage-mount allows them.
> 
> [storage|volume].policy.desired_mount_point is obsolete. You should
> change code that relies on it. For example, these properties are not
> available in the HAL in the Fedora development tree...

Good to know ...

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE LINUX Products GmbH, Development
 V_/_  http://www.suse.de/




More information about the hal mailing list