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
Mention that the dir used with --delay-updates cannot be on a
[rsync/rsync.git]
/
clientserver.c
diff --git
a/clientserver.c
b/clientserver.c
index
01112b4
..
a376725
100644
(file)
--- a/
clientserver.c
+++ b/
clientserver.c
@@
-48,6
+48,7
@@
extern char *bind_address;
extern struct filter_list_struct server_filter_list;
extern char *config_file;
extern char *files_from;
extern struct filter_list_struct server_filter_list;
extern char *config_file;
extern char *files_from;
+extern char *tmpdir;
char *auth_user;
int read_only = 0;
char *auth_user;
int read_only = 0;
@@
-108,7
+109,7
@@
int start_inband_exchange(char *user, char *path, int f_in, int f_out,
int i;
char *sargs[MAX_ARGS];
int sargc = 0;
int i;
char *sargs[MAX_ARGS];
int sargc = 0;
- char line[
MAXPATH
LEN];
+ char line[
BIGPATHBUF
LEN];
char *p;
if (argc == 0 && !am_sender)
char *p;
if (argc == 0 && !am_sender)
@@
-222,8
+223,7
@@
static int rsync_module(int f_in, int f_out, int i)
int argc = 0;
int maxargs;
char **argv;
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;
uid_t uid = (uid_t)-2; /* canonically "nobody" */
gid_t gid = (gid_t)-2;
char *p;
@@
-474,6
+474,16
@@
static int rsync_module(int f_in, int f_out, int i)
am_root = (MY_UID() == 0);
}
am_root = (MY_UID() == 0);
}
+ if (lp_temp_dir(i) && *lp_temp_dir(i)) {
+ tmpdir = lp_temp_dir(i);
+ if (strlen(tmpdir) >= MAXPATHLEN - 10) {
+ rprintf(FLOG,
+ "the 'temp dir' value for %s is WAY too long -- ignoring.\n",
+ name);
+ tmpdir = NULL;
+ }
+ }
+
io_printf(f_out, "@RSYNCD: OK\n");
maxargs = MAX_ARGS;
io_printf(f_out, "@RSYNCD: OK\n");
maxargs = MAX_ARGS;
@@
-498,22
+508,24
@@
static int rsync_module(int f_in, int f_out, int i)
if (!(argv[argc] = strdup(p)))
out_of_memory("rsync_module");
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++;
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 */
}
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;
if (filesfrom_fd == 0)
filesfrom_fd = f_in;
@@
-575,7
+587,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));
if (lp_timeout(i) && lp_timeout(i) > io_timeout)
set_io_timeout(lp_timeout(i));
- start_server(f_in, f_out, argc, arg
p
);
+ start_server(f_in, f_out, argc, arg
v
);
return 0;
}
return 0;
}
@@
-601,7
+613,7
@@
static void send_listing(int fd)
here */
int start_daemon(int f_in, int f_out)
{
here */
int start_daemon(int f_in, int f_out)
{
- char line[
200
];
+ char line[
1024
];
char *motd;
int i;
char *motd;
int i;