X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/20accf4d06dfe020f6773a302b05491177c46ff3..fed1f3f4fe6e91c64912eb3dfb6a095735b5da6e:/clientserver.c diff --git a/clientserver.c b/clientserver.c index 9304f219..a3767255 100644 --- 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 char *tmpdir; char *auth_user; int read_only = 0; @@ -222,7 +223,6 @@ static int rsync_module(int f_in, int f_out, int i) int argc = 0; int maxargs; char **argv; - char **argp; char line[BIGPATHBUFLEN]; uid_t uid = (uid_t)-2; /* canonically "nobody" */ gid_t gid = (gid_t)-2; @@ -474,6 +474,16 @@ static int rsync_module(int f_in, int f_out, int i) 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; @@ -515,8 +525,7 @@ static int rsync_module(int f_in, int f_out, int i) } 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; @@ -578,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)); - start_server(f_in, f_out, argc, argp); + start_server(f_in, f_out, argc, argv); return 0; }