X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/62a6b8df72d18f0b13462ee7ac33f9a8a46ef0b5..0b52f94da727c4881b58c1cd6f2cf2a824e02b30:/clientserver.c diff --git a/clientserver.c b/clientserver.c index 1e3af63a..eb83867d 100644 --- a/clientserver.c +++ b/clientserver.c @@ -35,6 +35,7 @@ extern int ignore_errors; extern int kluge_around_eof; extern int daemon_over_rsh; extern int sanitize_paths; +extern int numeric_ids; extern int filesfrom_fd; extern int remote_protocol; extern int protocol_version; @@ -54,6 +55,10 @@ extern char *tmpdir; extern struct chmod_mode_struct *chmod_modes; extern struct filter_list_struct server_filter_list; extern char curr_dir[]; +#ifdef ICONV_OPTION +extern char *iconv_opt; +extern iconv_t ic_send, ic_recv; +#endif char *auth_user; int read_only = 0; @@ -245,7 +250,7 @@ int start_inband_exchange(int f_in, int f_out, const char *user, int argc, char rprintf(FERROR, "internal: args[] overflowed in do_cmd()\n"); exit_cleanup(RERR_SYNTAX); } - if (list_only && strncmp(*argv, modname, modlen) == 0 + if (strncmp(*argv, modname, modlen) == 0 && argv[0][modlen] == '\0') sargs[sargc++] = modname; /* we send "modname/" */ else @@ -385,6 +390,13 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) pid_t pre_exec_pid = 0; char *request = NULL; +#ifdef ICONV_CONST + iconv_opt = lp_charset(i); + if (*iconv_opt) + setup_iconv(); + iconv_opt = NULL; +#endif + if (!allow_access(addr, host, lp_hosts_allow(i), lp_hosts_deny(i))) { rprintf(FLOG, "rsync denied on module %s from %s (%s)\n", name, host, addr); @@ -768,6 +780,21 @@ static int rsync_module(int f_in, int f_out, int i, char *addr, char *host) exit_cleanup(RERR_UNSUPPORTED); } + if (!iconv_opt) { + if (ic_send != (iconv_t)-1) { + iconv_close(ic_send); + ic_send = (iconv_t)-1; + } + if (ic_recv != (iconv_t)-1) { + iconv_close(ic_recv); + ic_recv = (iconv_t)-1; + } + } + + if (!numeric_ids + && (use_chroot ? lp_numeric_ids(i) != False : lp_numeric_ids(i) == True)) + numeric_ids = -1; /* Set --numeric-ids w/o breaking protocol. */ + if (lp_timeout(i) && lp_timeout(i) > io_timeout) set_io_timeout(lp_timeout(i));