Permissions for hal mounted drives

linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Jul 3 04:29:51 UTC 2008


William Muriithi wrote:
> Hi,
>
> When one insert a portable drive on a system running Redhat
> distributions, its automatically mounted by I think HAL. I have
> checked automount configurations and certain its not automount that is
> running this process. The problem is, no one can write to a drive
> mounted in this way other than root.
>
> Which file can one edit to fix this behaviour. I would like to change
> it so that other users can be able to save their work without
> necessarily needing to start their application as root. I have
> attempted changing the rights of /media directory, but it resort to
> its defaults permission when it mount a drive. google search had
> little of a solution, just a lot of article of other users who had the
> same problem.
>
> Regards,
> William

Sorry, this has probably broken threading. :(

*As I understand it*... HAL broadcasts changes in hardware (ie: disk being
connected) using a D-Bus signal. That's it. From there, it's up to
programs that are interested in storage devices messages to decide what to
do. In Gnome, this is, I believe, handled by the gnome virtual file
system. It may in turn call 'pmount', but that is merely a setuid wrapper
to mount with some checks in it.

So I don't have an exact answer for you (sorry, it's late or I would look
into it), but hopefully this will help point you in the right direction.

As for *why* it restricts access to you, I would suspect it is because the
listener that is reacting to HAL's dbus signal is running in user-space
and only can mount with your permissions, being essentially unprivileged
itself. It's essentially your Gnome session mounting the drive, after all.

What you could do, assuming my guesses are even close to right, is write
your own DBus application that waits for mount messages and, when it gets
a notice, checks the permissions and remounts the drive with more
permissive restrictions given whatever conditions you care about.

Again, this is a lot of guessing on my (tired) part. But I hope it might
help.

Madi

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list