From b8729267134df1f70e5fe9a3763d805a6cbd767c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Mar 2011 13:59:55 +0100 Subject: Revert "umount: call /sbin/umount. for root user too" This reverts commit c56226697342ddd663492f77768e7a7cb8e579a1. --- mount/umount.8 | 4 ++++ mount/umount.c | 33 +++++++++++++++++---------------- 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'mount') diff --git a/mount/umount.8 b/mount/umount.8 index b2d8c8569..3606caae9 100644 --- a/mount/umount.8 +++ b/mount/umount.8 @@ -155,6 +155,10 @@ where the is filesystem type or a value from "uhelper=" mtab option. The \-t option is used for filesystems with subtypes support (for example /sbin/mount.fuse -t fuse.sshfs). +The uhelper (unprivileged umount helper) is possible to used when non-root user +wants to umount a mountpoint which is not defined in the /etc/fstab file (e.g +devices mounted by HAL). + .SH FILES .I /etc/mtab table of mounted file systems diff --git a/mount/umount.c b/mount/umount.c index 3e4dc337b..42671f465 100644 --- a/mount/umount.c +++ b/mount/umount.c @@ -559,22 +559,6 @@ umount_file (char *arg) { if (!mc && verbose) printf(_("Could not find %s in mtab\n"), file); - /* - * uhelper - umount helper - * -- external umount (for example HAL mounts) - */ - if (external_allowed && mc) { - char *uhelper = NULL; - - if (mc->m.mnt_opts) - uhelper = get_option_value(mc->m.mnt_opts, "uhelper="); - if (uhelper) { - int status = 0; - if (check_special_umountprog(arg, arg, uhelper, &status)) - return status; - } - } - if (restricted) { char *mtab_user = NULL; @@ -582,6 +566,23 @@ umount_file (char *arg) { die(2, _("umount: %s is not mounted (according to mtab)"), file); + /* + * uhelper - unprivileged umount helper + * -- external umount (for example HAL mounts) + */ + if (external_allowed) { + char *uhelper = NULL; + + if (mc->m.mnt_opts) + uhelper = get_option_value(mc->m.mnt_opts, + "uhelper="); + if (uhelper) { + int status = 0; + if (check_special_umountprog(arg, arg, + uhelper, &status)) + return status; + } + } /* The 2.4 kernel will generally refuse to mount the same filesystem on the same mount point, but will accept NFS. -- cgit v1.2.3-55-g7522