summaryrefslogtreecommitdiff
path: root/appl/lib
diff options
context:
space:
mode:
authorRyabin Sergey <ryabin.ss@gmail.com>2020-11-26 22:29:36 +0400
committerRyabin Sergey <ryabin.ss@gmail.com>2020-11-26 22:29:36 +0400
commite5242bb522d11e83d4ae2e9dab758ec8433940d7 (patch)
treeecbeb21d3897a8f50200f3c1d7cbd28d7fc14692 /appl/lib
parentff5ab8e7bad9f4c04b5d06dbc4290fe0f43c4467 (diff)
Add -A mount option for namespace(6)
Diffstat (limited to 'appl/lib')
-rw-r--r--appl/lib/newns.b11
1 files changed, 10 insertions, 1 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;