From d41acf740ecbe0493139582d6833db4f2938cf5d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 Nov 2013 17:55:12 +0100 Subject: [PATCH] umount: fix umount by tag for non-roots $ umount LABEL=foo currently does not work for non-root users as umount uses the LABEL= as a path in sanitize_path(). Signed-off-by: Karel Zak --- sys-utils/umount.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys-utils/umount.c b/sys-utils/umount.c index 47db5b4803..fe120dbaa1 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -627,15 +627,17 @@ int main(int argc, char **argv) rc += umount_recursive(cxt, *argv++); } else { while (argc--) { - char *path = *argv++; + char *path = *argv; - if (mnt_context_is_restricted(cxt)) + if (mnt_context_is_restricted(cxt) + && !mnt_tag_is_valid(path)) path = sanitize_path(path); rc += umount_one(cxt, path); - if (mnt_context_is_restricted(cxt)) + if (path != *argv) free(path); + argv++; } } -- 2.47.2