From: Vaclav Dolezal Date: Thu, 15 Mar 2018 13:06:48 +0000 (+0100) Subject: umount: add support for namespaces X-Git-Tag: v2.33-rc1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3dc9a8bad62b706c9d79d2e1e81f2f08664ddde;p=thirdparty%2Futil-linux.git umount: add support for namespaces Signed-off-by: Vaclav Dolezal --- diff --git a/sys-utils/umount.c b/sys-utils/umount.c index d522e05a97..3fc1ae647c 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -424,6 +424,7 @@ int main(int argc, char **argv) { "types", required_argument, NULL, 't' }, { "verbose", no_argument, NULL, 'v' }, { "version", no_argument, NULL, 'V' }, + { "namespace", required_argument, NULL, 'N' }, { NULL, 0, NULL, 0 } }; @@ -449,7 +450,7 @@ int main(int argc, char **argv) mnt_context_set_tables_errcb(cxt, table_parser_errcb); - while ((c = getopt_long(argc, argv, "aAcdfhilnRrO:t:vV", + while ((c = getopt_long(argc, argv, "aAcdfhilnRrO:t:vVN:", longopts, NULL)) != -1) { @@ -509,6 +510,15 @@ int main(int argc, char **argv) case 'V': print_version(); break; + case 'N': + { + int tmp; + if ((tmp = mnt_context_set_target_ns(cxt, optarg))) { + errno = -tmp; + err(MNT_EX_SYSERR, _("failed to set target namespace")); + } + break; + } default: errtryhelp(MNT_EX_USAGE); }