Quellcode durchsuchen

Fix bug in git-daemon

The git-daemon command currently doesn't work and displays the following
error whenever a repository is cloned:

error: cannot run daemon: No such file or directory
[10920] unable to fork

On the client side the connection is simply terminated. The problem is,
that git-daemon tries to start a new instance of itself for every
new client that is connecting. It expects argv[0] to contain
"git-daemon", but since it is converted into a builtin command, argv[0]
only contains "daemon", which does not exist and causes the above error.
The fix simply prepends "git" to the list of arguments, so that the
resulting call looks something like "git daemon --serve ..."

Signed-off-by: Andreas Rohner <andreas.rohner@gmx.net>
Andreas Rohner vor 10 Jahren
Ursprung
Commit
19f3a40fae
2 geänderte Dateien mit 20 neuen und 1 gelöschten Zeilen
  1. 1
    1
      net/git/Makefile
  2. 19
    0
      net/git/patches/100-convert_builtin.patch

+ 1
- 1
net/git/Makefile Datei anzeigen

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=git
11 11
 PKG_VERSION:=2.1.0
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=@KERNEL/software/scm/git/

+ 19
- 0
net/git/patches/100-convert_builtin.patch Datei anzeigen

@@ -127,6 +127,25 @@
127 127
  {
128 128
  	int listen_port = 0;
129 129
  	struct string_list listen_addr = STRING_LIST_INIT_NODUP;
130
+@@ -1315,12 +1315,13 @@
131
+ 		store_pid(pid_file);
132
+ 
133
+ 	/* prepare argv for serving-processes */
134
+-	cld_argv = xmalloc(sizeof (char *) * (argc + 2));
135
+-	cld_argv[0] = argv[0];	/* git-daemon */
136
+-	cld_argv[1] = "--serve";
137
++	cld_argv = xmalloc(sizeof (char *) * (argc + 3));
138
++	cld_argv[0] = "git";
139
++	cld_argv[1] = argv[0];	/* daemon */
140
++	cld_argv[2] = "--serve";
141
+ 	for (i = 1; i < argc; ++i)
142
+-		cld_argv[i+1] = argv[i];
143
+-	cld_argv[argc+1] = NULL;
144
++		cld_argv[i+2] = argv[i];
145
++	cld_argv[argc+2] = NULL;
146
+ 
147
+ 	return serve(&listen_addr, listen_port, cred);
148
+ }
130 149
 --- a/fast-import.c
131 150
 +++ b/fast-import.c
132 151
 @@ -3343,7 +3343,7 @@ static void parse_argv(void)