summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys-utils/umount.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys-utils/umount.c b/sys-utils/umount.c
index 47db5b480..fe120dbaa 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++;
}
}