X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9d0d18b5909a57a28b65b2f142b318a9847dd37d..c9dc1300ba973297b411ef8418bf0712d3fe12b2:/clientserver.c diff --git a/clientserver.c b/clientserver.c index 01112b48..8ec966a5 100644 --- a/clientserver.c +++ b/clientserver.c @@ -108,7 +108,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, int i; char *sargs[MAX_ARGS]; int sargc = 0; - char line[MAXPATHLEN]; + char line[BIGPATHBUFLEN]; char *p; if (argc == 0 && !am_sender) @@ -222,8 +222,7 @@ static int rsync_module(int f_in, int f_out, int i) int argc = 0; int maxargs; char **argv; - char **argp; - char line[MAXPATHLEN]; + char line[BIGPATHBUFLEN]; uid_t uid = (uid_t)-2; /* canonically "nobody" */ gid_t gid = (gid_t)-2; char *p; @@ -498,22 +497,24 @@ static int rsync_module(int f_in, int f_out, int i) if (!(argv[argc] = strdup(p))) out_of_memory("rsync_module"); - if (start_glob) { - if (start_glob == 1) { - request = strdup(p); - start_glob++; - } - glob_expand(name, &argv, &argc, &maxargs); - } else + switch (start_glob) { + case 0: argc++; - - if (strcmp(line, ".") == 0) - start_glob = 1; + if (strcmp(line, ".") == 0) + start_glob = 1; + break; + case 1: + request = strdup(p); + start_glob = 2; + /* FALL THROUGH */ + default: + glob_expand(name, &argv, &argc, &maxargs); + break; + } } verbose = 0; /* future verbosity is controlled by client options */ - argp = argv; - ret = parse_arguments(&argc, (const char ***) &argp, 0); + ret = parse_arguments(&argc, (const char ***) &argv, 0); if (filesfrom_fd == 0) filesfrom_fd = f_in; @@ -575,7 +576,7 @@ static int rsync_module(int f_in, int f_out, int i) if (lp_timeout(i) && lp_timeout(i) > io_timeout) set_io_timeout(lp_timeout(i)); - start_server(f_in, f_out, argc, argp); + start_server(f_in, f_out, argc, argv); return 0; } @@ -601,7 +602,7 @@ static void send_listing(int fd) here */ int start_daemon(int f_in, int f_out) { - char line[200]; + char line[1024]; char *motd; int i;