From 4dd461e4400b20fbb218304e53a84d3704ae8304 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 4 Jun 2021 17:44:29 +0200 Subject: [PATCH] git/serve: remove undocumented -n namespace option and -r /usr/git default This makes it easier to serve local repositories where the sandboxing gets in the way. --- sys/src/cmd/git/serve.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/sys/src/cmd/git/serve.c b/sys/src/cmd/git/serve.c index 4cfeadb42..16eb34189 100644 --- a/sys/src/cmd/git/serve.c +++ b/sys/src/cmd/git/serve.c @@ -5,8 +5,7 @@ #include "git.h" -char *pathpfx = "/usr/git"; -char *namespace = nil; +char *pathpfx = nil; int allowwrite; int @@ -498,7 +497,6 @@ void main(int argc, char **argv) { char *repo, cmd[32], buf[512]; - char *user; Conn c; ARGBEGIN{ @@ -510,9 +508,6 @@ main(int argc, char **argv) if(*pathpfx != '/') sysfatal("path prefix must begin with '/'"); break; - case 'n': - namespace=EARGF(usage()); - break; case 'w': allowwrite++; break; @@ -522,14 +517,13 @@ main(int argc, char **argv) }ARGEND; gitinit(); - user = "none"; interactive = 0; - if(allowwrite) - user = getuser(); - if(newns(user, namespace) == -1) - sysfatal("addns: %r"); - if(bind(pathpfx, "/", MREPL) == -1) - sysfatal("bind: %r"); + if(rfork(RFNAMEG) == -1) + sysfatal("rfork: %r"); + if(pathpfx != nil){ + if(bind(pathpfx, "/", MREPL) == -1) + sysfatal("bind: %r"); + } if(rfork(RFNOMNT) == -1) sysfatal("rfork: %r"); -- 2.44.0