summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorKarel Zak2011-04-01 09:03:39 +0200
committerKarel Zak2011-04-01 09:03:39 +0200
commitf19c952b2fc07ddd7a698cf3a213a9a16d13e7ba (patch)
treeeb591be7c2d1b45cff2595770e7fecf0b92f4be8 /mount
parentlibmount: support /run/mount rather than /dev/.mount (diff)
downloadkernel-qcow2-util-linux-f19c952b2fc07ddd7a698cf3a213a9a16d13e7ba.tar.gz
kernel-qcow2-util-linux-f19c952b2fc07ddd7a698cf3a213a9a16d13e7ba.tar.xz
kernel-qcow2-util-linux-f19c952b2fc07ddd7a698cf3a213a9a16d13e7ba.zip
umount: use helper= for all UIDs
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r--mount/mount.c4
-rw-r--r--mount/umount.89
-rw-r--r--mount/umount.c16
3 files changed, 15 insertions, 14 deletions
diff --git a/mount/mount.c b/mount/mount.c
index dc357a098..b508de674 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -209,7 +209,7 @@ static const struct opt_map opt_map[] = {
static int opt_nofail = 0;
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit,
- *opt_encryption, *opt_speed, *opt_comment, *opt_uhelper, *opt_phelper;
+ *opt_encryption, *opt_speed, *opt_comment, *opt_uhelper, *opt_helper;
static int is_readonly(const char *node);
static int mounted (const char *spec0, const char *node0);
@@ -229,7 +229,7 @@ static struct string_opt_map {
{ "speed=", 0, &opt_speed },
{ "comment=", 1, &opt_comment },
{ "uhelper=", 0, &opt_uhelper },
- { "phelper=", 0, &opt_phelper },
+ { "helper=", 0, &opt_helper },
{ NULL, 0, NULL }
};
diff --git a/mount/umount.8 b/mount/umount.8
index 69196e539..4bce485c2 100644
--- a/mount/umount.8
+++ b/mount/umount.8
@@ -151,17 +151,16 @@ The syntax of external umount helpers is:
.IR type.subtype ]
.br
-where the <suffix> is filesystem type or a value from "uhelper=" or "phelper="
+where the <suffix> is filesystem type or a value from "uhelper=" or "helper="
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
+The uhelper= (unprivileged umount helper) is possible to use when non-root user
wants to umount a mountpoint which is not defined in the /etc/fstab file (e.g
devices mounted by udisk).
-The phelper (privileged umount helper) is possible to used when root user wants
-to umount a mountpoint which should not be directly umounted by umount(8) (e.g.
-devices mounted by pam_mount).
+The helper= mount option redirects all umount requests to the
+/sbin/umount.<helper> independently on UID.
.SH FILES
.I /etc/mtab
diff --git a/mount/umount.c b/mount/umount.c
index f69e5bf33..2e7bd31ce 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -654,6 +654,15 @@ umount_file (char *arg) {
if (!mc && verbose)
printf(_("Could not find %s in mtab\n"), file);
+ if (mc) {
+ /*
+ * helper - umount helper (e.g. pam_mount)
+ */
+ if (check_helper_umountprog(arg, arg, mc->m.mnt_opts,
+ "helper=", &status))
+ return status;
+ }
+
if (restricted) {
char *mtab_user = NULL;
@@ -738,13 +747,6 @@ umount_file (char *arg) {
mtab_user ? mtab_user : "root",
fs->m.mnt_fsname, fs->m.mnt_dir);
- } else if (mc) {
- /*
- * phelper - privileged umount helper (e.g. pam_mount)
- */
- if (check_helper_umountprog(arg, arg, mc->m.mnt_opts,
- "phelper=", &status))
- return status;
}
if (mc)