shithub: riscv

Download patch

ref: 47682ee42a1f686dbd3aa9de7375c16f7d3d95e8
parent: bab31af707aab34da9ba2b2975c05d7b3cb568cc
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Oct 9 20:09:02 EDT 2015

aux/listen1: allow alternative namespace when running as user none with -n option

--- a/sys/man/8/listen
+++ b/sys/man/8/listen
@@ -20,6 +20,8 @@
 ]
 .RB [ -p
 .IR maxprocs ]
+.RB [ -n
+.IR namespace ]
 .I addr
 .I cmd
 [
--- 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 @@
 	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");
 }
 
@@ -68,6 +69,9 @@
 		break;
 	case 'p':
 		maxprocs = atoi(EARGF(usage()));
+		break;
+	case 'n':
+		nsfile = EARGF(usage());
 		break;
 	}ARGEND