Commit 20accf4d authored by Wayne Davison's avatar Wayne Davison

- Use BIGPATHBUFLEN for the length of two line buffers.

- Improved the handling of the start_glob variable.
- Made the line buffer in start_daemon() a little bigger.
parent 3fac51e2
...@@ -108,7 +108,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out, ...@@ -108,7 +108,7 @@ int start_inband_exchange(char *user, char *path, int f_in, int f_out,
int i; int i;
char *sargs[MAX_ARGS]; char *sargs[MAX_ARGS];
int sargc = 0; int sargc = 0;
char line[MAXPATHLEN]; char line[BIGPATHBUFLEN];
char *p; char *p;
if (argc == 0 && !am_sender) if (argc == 0 && !am_sender)
...@@ -223,7 +223,7 @@ static int rsync_module(int f_in, int f_out, int i) ...@@ -223,7 +223,7 @@ static int rsync_module(int f_in, int f_out, int i)
int maxargs; int maxargs;
char **argv; char **argv;
char **argp; char **argp;
char line[MAXPATHLEN]; char line[BIGPATHBUFLEN];
uid_t uid = (uid_t)-2; /* canonically "nobody" */ uid_t uid = (uid_t)-2; /* canonically "nobody" */
gid_t gid = (gid_t)-2; gid_t gid = (gid_t)-2;
char *p; char *p;
...@@ -498,17 +498,20 @@ static int rsync_module(int f_in, int f_out, int i) ...@@ -498,17 +498,20 @@ static int rsync_module(int f_in, int f_out, int i)
if (!(argv[argc] = strdup(p))) if (!(argv[argc] = strdup(p)))
out_of_memory("rsync_module"); out_of_memory("rsync_module");
if (start_glob) { switch (start_glob) {
if (start_glob == 1) { case 0:
request = strdup(p);
start_glob++;
}
glob_expand(name, &argv, &argc, &maxargs);
} else
argc++; argc++;
if (strcmp(line, ".") == 0)
if (strcmp(line, ".") == 0) start_glob = 1;
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 */ verbose = 0; /* future verbosity is controlled by client options */
...@@ -601,7 +604,7 @@ static void send_listing(int fd) ...@@ -601,7 +604,7 @@ static void send_listing(int fd)
here */ here */
int start_daemon(int f_in, int f_out) int start_daemon(int f_in, int f_out)
{ {
char line[200]; char line[1024];
char *motd; char *motd;
int i; int i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment