Skip to contentSkip to conversation

nonroot umount

DISCUSSION Marcos Diez 3 participants 4 messages Jul 10, 2006 – Jul 11, 2006 1 message not in the archive Kernel automounter

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

In a Unix desktop system automount is very practical for CDROMs, digital cameras, USB flash drives and any other type of removable media. But it is annoying to the unprivileged user to wait the timeout to remove the media.

Since it is insecure to allow the user to do a "killall -s SIGUSR1 automount", I wrote a program that does exactly (and only) that. Of course it must be suid root, but it makes life much easier. I double verified that there are no buffer overflows and I believe it's safe. The program is not interactive, so a malicious user can't do much with it anyway.

It gets the PIDs from instances of automount by parsing /proc/mounts It would be nice if it could be added to the autofs distribution.

http://boby.unitron.com.br/%7Emarcos/umounter.c

To compile:

gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter

To install:
cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter

To use:

./umounter
or
./umounter --verbose
(show the signaled PIDs )

Thanks

Signature · 3 lines
Marcos Diez
+49 178 507 9577
Skype: aboboraabobora
#2 lore raw
Quoted 26 lines · Marcos Diez

In a Unix desktop system automount is very practical for CDROMs, digital cameras, USB flash drives and any other type of removable media. But it is annoying to the unprivileged user to wait the timeout to remove the media.

Since it is insecure to allow the user to do a "killall -s SIGUSR1 automount", I wrote a program that does exactly (and only) that. Of course it must be suid root, but it makes life much easier. I double verified that there are no buffer overflows and I believe it's safe. The program is not interactive, so a malicious user can't do much with it anyway.

It gets the PIDs from instances of automount by parsing /proc/mounts It would be nice if it could be added to the autofs distribution.

http://boby.unitron.com.br/%7Emarcos/umounter.c

To compile:

gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter

To install:
cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter

Quoted 7 lines

To use:

./umounter
or
./umounter --verbose
(show the signaled PIDs )

It seems to me that a better architected solution might be to tie in the automounter with the eject(1) sort of command.

It is not good for a user to have to know that he needs to zing the automounter in order to remove his media.

Thanx...

ps

#3 lore raw

==> Regarding Re: [autofs] nonroot umount; Peter Staubach <[email protected]> adds:

Quoted 26 lines · staubach> Marcos Diez wrote:
Quoted 26 lines

In a Unix desktop system automount is very practical for CDROMs, digital cameras, USB flash drives and any other type of removable media. But it is annoying to the unprivileged user to wait the timeout to remove the media.

Since it is insecure to allow the user to do a "killall -s SIGUSR1 automount", I wrote a program that does exactly (and only) that. Of course it must be suid root, but it makes life much easier. I double verified that there are no buffer overflows and I believe it's safe. The program is not interactive, so a malicious user can't do much with it anyway.

It gets the PIDs from instances of automount by parsing /proc/mounts It would be nice if it could be added to the autofs distribution.

http://boby.unitron.com.br/%7Emarcos/umounter.c

To compile:

gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter

To install:
cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter

Quoted 7 lines
Quoted 7 lines

To use:

./umounter
or
./umounter --verbose
(show the signaled PIDs )

staubach> It seems to me that a better architected solution might be to tie in staubach> the automounter with the eject(1) sort of command.

staubach> It is not good for a user to have to know that he needs to zing the staubach> automounter in order to remove his media.

What "desktop" system are we talking about? If you're using hal/udev, then they have a much nicer mechanism for handling such things. Autofs isn't really a good fit for removable media, in my experience.

-Jeff

#4 lore raw
Quoted 44 lines · Jeff Moyer

==> Regarding Re: [autofs] nonroot umount; Peter Staubach <[email protected]> adds:

Quoted 28 lines · staubach> Marcos Diez wrote:
Quoted 28 lines

In a Unix desktop system automount is very practical for CDROMs, digital cameras, USB flash drives and any other type of removable media. But it is annoying to the unprivileged user to wait the timeout to remove the media.

Since it is insecure to allow the user to do a "killall -s SIGUSR1 automount", I wrote a program that does exactly (and only) that. Of course it must be suid root, but it makes life much easier. I double verified that there are no buffer overflows and I believe it's safe. The program is not interactive, so a malicious user can't do much with it anyway.

It gets the PIDs from instances of automount by parsing /proc/mounts It would be nice if it could be added to the autofs distribution.

http://boby.unitron.com.br/%7Emarcos/umounter.c

To compile:

gcc -O3 -ansi -Wall -pedantic umounter.c -o umounter

To install:
cp umounter /usr/local/bin && chmod 4711 /usr/local/bin/umounter

To use:

Quoted 7 lines
Quoted 7 lines

./umounter
or
./umounter --verbose
(show the signaled PIDs )

staubach> It seems to me that a better architected solution might be to tie in staubach> the automounter with the eject(1) sort of command.

Quoted 7 lines

staubach> It is not good for a user to have to know that he needs to zing the staubach> automounter in order to remove his media.

What "desktop" system are we talking about? If you're using hal/udev, then they have a much nicer mechanism for handling such things. Autofs isn't really a good fit for removable media, in my experience.

Cool!

My only objection was building tools to utilize automount specific implementation details. That's just wrong.

Perhaps we need to redirect Marcos Diez to better functionality to solve his problems... :-)

Thanx...

ps