diff options
author | Sergey Ryabin <bebebeko@metacoma.io> | 2021-03-07 03:17:41 +0000 |
---|---|---|
committer | Charles Forsyth <charles.forsyth@gmail.com> | 2021-03-07 03:17:41 +0000 |
commit | b2e326f2d4281f7380036516b62928f8c02850d4 (patch) | |
tree | dc9c2e7d45f8c136b7fb614c1a304685d2238067 | |
parent | 6cde411a8ffd477459336cedf48034e46f56f913 (diff) | |
parent | ccdfdf72d8c780e9429449287968f390001c6406 (diff) |
Merged in namespace_noauth (pull request #9)
Add -A mount option for namespace(6)
Approved-by: Charles Forsyth
-rw-r--r-- | appl/lib/newns.b | 11 | ||||
-rw-r--r-- | dis/lib/newns.dis | bin | 7454 -> 7503 bytes | |||
-rw-r--r-- | man/6/namespace | 7 |
3 files changed, 15 insertions, 3 deletions
diff --git a/appl/lib/newns.b b/appl/lib/newns.b index 6a53cb75..e6864f86 100644 --- a/appl/lib/newns.b +++ b/appl/lib/newns.b @@ -196,11 +196,12 @@ Moptres: adt { keyfile: string; ignore: int; use9: int; + doauth: int; }; mopt(argv: list of string): (ref Moptres, string) { - r := ref Moptres(nil, 0, "none", nil, 0, 0); + r := ref Moptres(nil, 0, "none", nil, 0, 0, 1); arg->init(argv); while ((opt := arg->opt()) != 0) { @@ -218,6 +219,8 @@ mopt(argv: list of string): (ref Moptres, string) return (nil, "mount: missing arg to -C option"); '9' => r.use9 = 1; + 'A' => + r.doauth = 0; * => return (nil, sys->sprint("mount: bad option -%c", opt)); } @@ -275,6 +278,12 @@ mount(argv: list of string, facfd: ref Sys->FD): string c := dial->dial(dest, nil); if(c == nil) return ig(r, sys->sprint("dial: %s: %r", dest)); + + if(r.doauth != 1){ + if(sys->mount(c.dfd, nil, dir, r.flags, spec) < 0) + return ig(r, sys->sprint("mount %q %q: %r", addr, dir)); + return nil; + } if(r.use9){ factotum := load Factotum Factotum->PATH; diff --git a/dis/lib/newns.dis b/dis/lib/newns.dis Binary files differindex eaed2b2e..fca50719 100644 --- a/dis/lib/newns.dis +++ b/dis/lib/newns.dis diff --git a/man/6/namespace b/man/6/namespace index 8eee9376..09c12a25 100644 --- a/man/6/namespace +++ b/man/6/namespace @@ -65,7 +65,7 @@ This is equivalent to passing a value of to .IR sys-pctl (2). .TP -.B "mount [-abc9i] [-k \f2keyfile\fP] [-C \f2alg\fP] [\f2net\fP!]\f2machine\fP[!\f2svc\fP] \f2dir\fP [\f2spec\fP]" +.B "mount [-abc9iA] [-k \f2keyfile\fP] [-C \f2alg\fP] [\f2net\fP!]\f2machine\fP[!\f2svc\fP] \f2dir\fP [\f2spec\fP]" Mount the file tree of .I machine upon directory @@ -79,7 +79,10 @@ Options and . B i are the same as for -.BR bind . +.BR bind, +option +.BR A +is the same for mount. The tokens .I dir and |