diff options
author | Vaclav Dolezal | 2018-02-19 18:58:23 +0100 |
---|---|---|
committer | Karel Zak | 2018-06-11 15:56:41 +0200 |
commit | 21edc0f71a6cfff41d6ae4d8fdc960b4fc54a4ff (patch) | |
tree | 535cc4d48609feb770dbb873cf8caf42aeccf116 /sys-utils/mount.c | |
parent | libmount: added error MNT_ERR_NAMESPACE (diff) | |
download | kernel-qcow2-util-linux-21edc0f71a6cfff41d6ae4d8fdc960b4fc54a4ff.tar.gz kernel-qcow2-util-linux-21edc0f71a6cfff41d6ae4d8fdc960b4fc54a4ff.tar.xz kernel-qcow2-util-linux-21edc0f71a6cfff41d6ae4d8fdc960b4fc54a4ff.zip |
mount: add support for namespaces
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/mount.c')
-rw-r--r-- | sys-utils/mount.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 040a84a57..a4523d731 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -574,6 +574,7 @@ int main(int argc, char **argv) { "options-mode", required_argument, NULL, MOUNT_OPT_OPTMODE }, { "options-source", required_argument, NULL, MOUNT_OPT_OPTSRC }, { "options-source-force", no_argument, NULL, MOUNT_OPT_OPTSRC_FORCE}, + { "namespace", required_argument, NULL, 'N' }, { NULL, 0, NULL, 0 } }; @@ -599,7 +600,7 @@ int main(int argc, char **argv) mnt_context_set_tables_errcb(cxt, table_parser_errcb); - while ((c = getopt_long(argc, argv, "aBcfFhilL:Mno:O:rRsU:vVwt:T:", + while ((c = getopt_long(argc, argv, "aBcfFhilL:Mno:O:rRsU:vVwt:T:N:", longopts, NULL)) != -1) { /* only few options are allowed for non-root users */ @@ -690,6 +691,15 @@ int main(int argc, char **argv) oper = 1; append_option(cxt, "rbind"); 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; + } case MOUNT_OPT_SHARED: append_option(cxt, "shared"); propa = 1; |