summaryrefslogtreecommitdiff
path: root/mount/umount.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2007-04-12 14:35:46 +0200
committerKarel Zak <kzak@redhat.com>2007-04-25 00:20:40 +0200
commitdd9f213ab6efd352f67bc18071c16239d1002b94 (patch)
treee390f57c96ff0c348fce7edf6eef311fe7d7b077 /mount/umount.c
parent0b44c6155b8430fdf832fabc42d3f4b8dfa9f072 (diff)
downloadutil-linux-old-dd9f213ab6efd352f67bc18071c16239d1002b94.tar.gz
mount: add support for mtab "uhelper" option
The helper is an external /sbin/umount.<suffix> program where the suffix is a value from the uhelper= option from /etc/mtab. 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). This option is already supported by HAL upstream. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/umount.c')
-rw-r--r--mount/umount.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/mount/umount.c b/mount/umount.c
index 676ed8cc..8a59f120 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -565,6 +565,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_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.
So, unmounting must be possible. */