Skip to content

Commit

Permalink
git_connect: remove artificial limit of a remote command
Browse files Browse the repository at this point in the history
Since day one, function git_connect() had a limit on the command line of
the command that is invoked to make a connection. 7a33bcb 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>
  • Loading branch information
Johannes Sixt authored and Junio C Hamano committed Dec 9, 2013
1 parent 2171f3d commit d98d109
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ static struct child_process *git_proxy_connect(int fd[2], char *host)
return proxy;
}

#define MAX_CMD_LEN 1024

static char *get_port(char *host)
{
char *end;
Expand Down Expand Up @@ -570,7 +568,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
int free_path = 0;
char *port = NULL;
const char **arg;
struct strbuf cmd;
struct strbuf cmd = STRBUF_INIT;

/* Without this we cannot rely on waitpid() to tell
* what happened to our children.
Expand Down Expand Up @@ -676,12 +674,9 @@ struct child_process *git_connect(int fd[2], const char *url_orig,

conn = xcalloc(1, sizeof(*conn));

strbuf_init(&cmd, MAX_CMD_LEN);
strbuf_addstr(&cmd, prog);
strbuf_addch(&cmd, ' ');
sq_quote_buf(&cmd, path);
if (cmd.len >= MAX_CMD_LEN)
die("command line too long");

conn->in = conn->out = -1;
conn->argv = arg = xcalloc(7, sizeof(*arg));
Expand Down

0 comments on commit d98d109

Please sign in to comment.