aux/listen1: allow alternative namespace when running as user none with -n option
This commit is contained in:
parent
bab31af707
commit
47682ee42a
2 changed files with 7 additions and 1 deletions
|
@ -20,6 +20,8 @@ listen, listen1, tcp7, tcp9, tcp19, tcp21, tcp22, tcp23, tcp25, tcp53, tcp110, t
|
||||||
]
|
]
|
||||||
.RB [ -p
|
.RB [ -p
|
||||||
.IR maxprocs ]
|
.IR maxprocs ]
|
||||||
|
.RB [ -n
|
||||||
|
.IR namespace ]
|
||||||
.I addr
|
.I addr
|
||||||
.I cmd
|
.I cmd
|
||||||
[
|
[
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
int maxprocs;
|
int maxprocs;
|
||||||
int verbose;
|
int verbose;
|
||||||
int trusted;
|
int trusted;
|
||||||
|
char *nsfile;
|
||||||
|
|
||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
|
@ -22,7 +23,7 @@ becomenone(void)
|
||||||
if(fd < 0 || write(fd, "none", strlen("none")) < 0)
|
if(fd < 0 || write(fd, "none", strlen("none")) < 0)
|
||||||
sysfatal("can't become none: %r");
|
sysfatal("can't become none: %r");
|
||||||
close(fd);
|
close(fd);
|
||||||
if(newns("none", nil) < 0)
|
if(newns("none", nsfile) < 0)
|
||||||
sysfatal("can't build namespace: %r");
|
sysfatal("can't build namespace: %r");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +70,9 @@ main(int argc, char **argv)
|
||||||
case 'p':
|
case 'p':
|
||||||
maxprocs = atoi(EARGF(usage()));
|
maxprocs = atoi(EARGF(usage()));
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
nsfile = EARGF(usage());
|
||||||
|
break;
|
||||||
}ARGEND
|
}ARGEND
|
||||||
|
|
||||||
if(argc < 2)
|
if(argc < 2)
|
||||||
|
|
Loading…
Reference in a new issue