git_connect: remove artificial limit of a remote command
Since day one, function git_connect() had a limit on the command line of the command that is invoked to make a connection. 7a33bcbe converted the code that constructs the command to strbuf. This would have been the right time to remove the limit, but it did not happen. Remove it now. git_connect() uses start_command() to invoke the command; consequently, the limits of the system still apply, but are diagnosed only at execve() time. But these limits are more lenient than the 1K that git_connect() imposed. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Nov 28, 2013 at 20:48 UTC
d98d109979760bed1909fbf5e56cbb6239980095
1 file changed
+1
-6
connect.c
+1
-6
@@ -527,8 +527,6 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
527
return proxy;
528
}
529
530
-#define MAX_CMD_LEN 1024
531
-
530
static char *get_port(char *host)
531
{
532
char *end;
@@ -570,7 +568,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
568
int free_path = 0;
569
char *port = NULL;
570
const char **arg;
573
- struct strbuf cmd;
571
+ struct strbuf cmd = STRBUF_INIT;
572
573
/* Without this we cannot rely on waitpid() to tell
574
* what happened to our children.
@@ -676,12 +674,9 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
674
675
conn = xcalloc(1, sizeof(*conn));
676
679
- strbuf_init(&cmd, MAX_CMD_LEN);
677
strbuf_addstr(&cmd, prog);
678
strbuf_addch(&cmd, ' ');
679
sq_quote_buf(&cmd, path);
683
- if (cmd.len >= MAX_CMD_LEN)
684
- die("command line too long");
680
681
conn->in = conn->out = -1;
682
conn->argv = arg = xcalloc(7, sizeof(*arg));