]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
umount: add support for namespaces
authorVaclav Dolezal <vdolezal@redhat.com>
Thu, 15 Mar 2018 13:06:48 +0000 (14:06 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Jun 2018 14:01:49 +0000 (16:01 +0200)
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
sys-utils/umount.c

index d522e05a97d5145c3cca236e34fcf626ea39185f..3fc1ae647c575a25a32146a71bf4832edd3e08dd 100644 (file)
@@ -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);
                }