Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made delete_one() handle a failed rmdir on a symlink when
[rsync/rsync.git]
/
clientserver.c
diff --git
a/clientserver.c
b/clientserver.c
index
9f51406
..
501e6e4
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-207,7
+207,8
@@
int start_inband_exchange(char *user, char *path, int f_in, int f_out, int argc)
static int rsync_module(int f_in, int f_out, int i)
{
int argc = 0;
static int rsync_module(int f_in, int f_out, int i)
{
int argc = 0;
- char *argv[MAX_ARGS];
+ int maxargs;
+ char **argv;
char **argp;
char line[MAXPATHLEN];
uid_t uid = (uid_t)-2; /* canonically "nobody" */
char **argp;
char line[MAXPATHLEN];
uid_t uid = (uid_t)-2; /* canonically "nobody" */
@@
-385,6
+386,9
@@
static int rsync_module(int f_in, int f_out, int i)
io_printf(f_out, "@RSYNCD: OK\n");
io_printf(f_out, "@RSYNCD: OK\n");
+ maxargs = MAX_ARGS;
+ if (!(argv = new_array(char *, maxargs)))
+ out_of_memory("rsync_module");
argv[argc++] = "rsyncd";
while (1) {
argv[argc++] = "rsyncd";
while (1) {
@@
-396,23
+400,25
@@
static int rsync_module(int f_in, int f_out, int i)
p = line;
p = line;
+ if (argc == maxargs) {
+ maxargs += MAX_ARGS;
+ if (!(argv = realloc_array(argv, char *, maxargs)))
+ out_of_memory("rsync_module");
+ }
if (!(argv[argc] = strdup(p)))
if (!(argv[argc] = strdup(p)))
-
return -1
;
+
out_of_memory("rsync_module")
;
if (start_glob) {
if (start_glob == 1) {
request = strdup(p);
start_glob++;
}
if (start_glob) {
if (start_glob == 1) {
request = strdup(p);
start_glob++;
}
- glob_expand(name,
argv, &argc, MAX_ARGS
);
+ glob_expand(name,
&argv, &argc, &maxargs
);
} else
argc++;
if (strcmp(line, ".") == 0)
start_glob = 1;
} else
argc++;
if (strcmp(line, ".") == 0)
start_glob = 1;
-
- if (argc == MAX_ARGS)
- return -1;
}
argp = argv;
}
argp = argv;