extern int verbose;
extern int rsync_port;
char *auth_user;
+int sanitize_paths = 0;
int start_socket_client(char *host, char *path, int argc, char *argv[])
{
char *p, *user=NULL;
extern int remote_version;
extern int am_sender;
+ extern struct in_addr socket_address;
if (*path == '/') {
rprintf(FERROR,"ERROR: The remote path must start with a module name\n");
if (!user) user = getenv("USER");
if (!user) user = getenv("LOGNAME");
- fd = open_socket_out(host, rsync_port);
+ fd = open_socket_out(host, rsync_port, &socket_address);
if (fd == -1) {
exit_cleanup(RERR_SOCKETIO);
}
io_printf(fd,"@ERROR: chdir failed\n");
return -1;
}
+ sanitize_paths = 1;
}
if (am_root) {
request = strdup(p);
start_glob++;
}
- glob_expand(name, argv, &argc, MAX_ARGS, !use_chroot);
+ glob_expand(name, argv, &argc, MAX_ARGS);
} else {
argc++;
}
}
}
- if (!use_chroot) {
+ if (sanitize_paths) {
/*
* Note that this is applied to all parameters, whether or not
* they are filenames, but no other legal parameters contain
* and which aren't.
*/
for (i = 1; i < argc; i++) {
- sanitize_path(argv[i]);
+ sanitize_path(argv[i], NULL);
}
}
open("/dev/null", O_RDWR);
}
- set_nonblocking(STDIN_FILENO);
-
return start_daemon(STDIN_FILENO);
}