ref: 09645d2dd7a2832f0e2292c70d4b63fc5d31f2ac
parent: 8f23baaca1d59979d22a06a4ec3aea27bae631b7
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jun 4 13:44:29 EDT 2021
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.
--- 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 @@
main(int argc, char **argv)
{char *repo, cmd[32], buf[512];
- char *user;
Conn c;
ARGBEGIN{@@ -510,9 +508,6 @@
if(*pathpfx != '/')
sysfatal("path prefix must begin with '/'");break;
- case 'n':
- namespace=EARGF(usage());
- break;
case 'w':
allowwrite++;
break;
@@ -522,14 +517,13 @@
}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");--
⑨