unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21010: eject fails because of hardcoded path to umount
@ 2015-07-08 12:18 Alex Sassmannshausen
  2015-07-08 16:31 ` Andreas Enge
  2015-07-14 12:03 ` Ludovic Courtès
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Sassmannshausen @ 2015-07-08 12:18 UTC (permalink / raw)
  To: 21010

Hello,

I'm running GuixSD.

I tried to 'eject' a pen drive today using
`sudo eject /mnt/usb`

The command failed with 
-------8<---------------->8-----------
eject: unable to exec /bin/umount of `/mnt/usb'
eject: unmount of `/mnt/usb' failed
-------8<---------------->8-----------

Some more information:
-------8<---------------->8-----------
# which eject
/run/current-system/profile/bin/eject
# mount /dev/sdb /mnt/usb
# eject /mnt/usb
eject: unable to exec /bin/umount of `/mnt/usb'
eject: unmount of `/mnt/usb' failed
-------8<---------------->8-----------

HTH, let me know if you want me to test or provide anything else.

Cheers,
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21010: eject fails because of hardcoded path to umount
  2015-07-08 12:18 bug#21010: eject fails because of hardcoded path to umount Alex Sassmannshausen
@ 2015-07-08 16:31 ` Andreas Enge
  2015-07-08 22:05   ` Ludovic Courtès
  2015-07-14 12:03 ` Ludovic Courtès
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Enge @ 2015-07-08 16:31 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: 21010

On Wed, Jul 08, 2015 at 02:18:21PM +0200, Alex Sassmannshausen wrote:
> eject: unable to exec /bin/umount of `/mnt/usb'

The culprit is in the source code of util-linux-2.25.2/sys-utils/eject.c:
681:                    execl("/bin/umount", "/bin/umount", name, "-n", NULL);
683:                    execl("/bin/umount", "/bin/umount", name, NULL);
685:            errx(EXIT_FAILURE, _("unable to exec /bin/umount of `%s'"), name);

This should be easy to patch, but there are other utilities with the same
problem. A hopeless case seems to be "whereis": It looks for files in fixed
lists of locations such as
static const char *bindirs[] = {
        "/usr/bin",
        "/usr/sbin",
        "/usr/lib",
        "/usr/lib64",
        "/bin",
        "/sbin",
        "/etc",
        "/usr/etc",
        "/lib",
        "/lib64",
        "/usr/games",
        "/usr/games/bin",
        "/usr/games/lib",
        "/usr/emacs/etc",
        "/usr/lib/emacs/*/etc",
        "/usr/TeX/bin",
...

Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21010: eject fails because of hardcoded path to umount
  2015-07-08 16:31 ` Andreas Enge
@ 2015-07-08 22:05   ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-07-08 22:05 UTC (permalink / raw)
  To: Andreas Enge; +Cc: 21010

Andreas Enge <andreas@enge.fr> skribis:

> On Wed, Jul 08, 2015 at 02:18:21PM +0200, Alex Sassmannshausen wrote:
>> eject: unable to exec /bin/umount of `/mnt/usb'
>
> The culprit is in the source code of util-linux-2.25.2/sys-utils/eject.c:
> 681:                    execl("/bin/umount", "/bin/umount", name, "-n", NULL);
> 683:                    execl("/bin/umount", "/bin/umount", name, NULL);
> 685:            errx(EXIT_FAILURE, _("unable to exec /bin/umount of `%s'"), name);

This should be fixed in core-updates.

> This should be easy to patch, but there are other utilities with the same
> problem. A hopeless case seems to be "whereis": It looks for files in fixed
> lists of locations such as
> static const char *bindirs[] = {
>         "/usr/bin",
>         "/usr/sbin",

I think we should check what this list is used for, and then prepend
entries accordingly.  Volunteering?  :-)

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#21010: eject fails because of hardcoded path to umount
  2015-07-08 12:18 bug#21010: eject fails because of hardcoded path to umount Alex Sassmannshausen
  2015-07-08 16:31 ` Andreas Enge
@ 2015-07-14 12:03 ` Ludovic Courtès
  1 sibling, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-07-14 12:03 UTC (permalink / raw)
  To: Alex Sassmannshausen; +Cc: 21010-done

Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:

> I tried to 'eject' a pen drive today using
> `sudo eject /mnt/usb`

BTW, if you add this user account to “cdrom”, you won’t even need
‘sudo’.

> The command failed with 
> -------8<---------------->8-----------
> eject: unable to exec /bin/umount of `/mnt/usb'
> eject: unmount of `/mnt/usb' failed
> -------8<---------------->8-----------

Fixed in 7e51249.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-14 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08 12:18 bug#21010: eject fails because of hardcoded path to umount Alex Sassmannshausen
2015-07-08 16:31 ` Andreas Enge
2015-07-08 22:05   ` Ludovic Courtès
2015-07-14 12:03 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).