]> git.lizzy.rs Git - plan9front.git/commitdiff
git/serve: remove undocumented -n namespace option and -r /usr/git default
authorcinap_lenrek <cinap_lenrek@felloff.net>
Fri, 4 Jun 2021 15:44:29 +0000 (17:44 +0200)
committercinap_lenrek <cinap_lenrek@felloff.net>
Fri, 4 Jun 2021 15:44:29 +0000 (17:44 +0200)
This makes it easier to serve local repositories where the sandboxing
gets in the way.

sys/src/cmd/git/serve.c

index 4cfeadb42ea2fea42303c2a6a4ab885cbacd55e7..16eb341894f49ad8b2edf2146a80c7d0803cada2 100644 (file)
@@ -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");