From 47682ee42a1f686dbd3aa9de7375c16f7d3d95e8 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 10 Oct 2015 00:09:02 +0200 Subject: [PATCH] aux/listen1: allow alternative namespace when running as user none with -n option --- sys/man/8/listen | 2 ++ sys/src/cmd/aux/listen1.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/man/8/listen b/sys/man/8/listen index e45f3aefe..79a405696 100644 --- a/sys/man/8/listen +++ b/sys/man/8/listen @@ -20,6 +20,8 @@ listen, listen1, tcp7, tcp9, tcp19, tcp21, tcp22, tcp23, tcp25, tcp53, tcp110, t ] .RB [ -p .IR maxprocs ] +.RB [ -n +.IR namespace ] .I addr .I cmd [ diff --git a/sys/src/cmd/aux/listen1.c b/sys/src/cmd/aux/listen1.c index 1b65074b2..19d62aa13 100644 --- a/sys/src/cmd/aux/listen1.c +++ b/sys/src/cmd/aux/listen1.c @@ -5,6 +5,7 @@ int maxprocs; int verbose; int trusted; +char *nsfile; void usage(void) @@ -22,7 +23,7 @@ becomenone(void) if(fd < 0 || write(fd, "none", strlen("none")) < 0) sysfatal("can't become none: %r"); close(fd); - if(newns("none", nil) < 0) + if(newns("none", nsfile) < 0) sysfatal("can't build namespace: %r"); } @@ -69,6 +70,9 @@ main(int argc, char **argv) case 'p': maxprocs = atoi(EARGF(usage())); break; + case 'n': + nsfile = EARGF(usage()); + break; }ARGEND if(argc < 2)