From: Karel Zak Date: Tue, 19 Nov 2013 16:55:12 +0000 (+0100) Subject: umount: fix umount by tag for non-roots X-Git-Tag: v2.25-rc1~721 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d41acf740ecbe0493139582d6833db4f2938cf5d;p=thirdparty%2Futil-linux.git 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 --- 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++; } }