X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ac13ad106a17c1a47955925c20d467d8ce87efa3..fb4c98c2c8a618855ebe4d11c36f8a120fab2aa1:/util.c diff --git a/util.c b/util.c index 940bf28a..9b54c05a 100644 --- a/util.c +++ b/util.c @@ -179,7 +179,8 @@ pid_t piped_child(char **command, int *f_in, int *f_out) return pid; } -pid_t local_child(int argc, char **argv,int *f_in,int *f_out) +pid_t local_child(int argc, char **argv,int *f_in,int *f_out, + int (*child_main)(int, char **)) { pid_t pid; int to_child_pipe[2]; @@ -215,7 +216,7 @@ pid_t local_child(int argc, char **argv,int *f_in,int *f_out) } if (to_child_pipe[0] != STDIN_FILENO) close(to_child_pipe[0]); if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]); - start_server(STDIN_FILENO, STDOUT_FILENO, argc, argv); + child_main(argc, argv); } if (close(from_child_pipe[1]) < 0 || @@ -985,6 +986,18 @@ void show_progress(OFF_T ofs, OFF_T size) /** * Determine if a symlink points outside the current directory tree. + * This is considered "unsafe" because e.g. when mirroring somebody + * else's machine it might allow them to establish a symlink to + * /etc/passwd, and then read it through a web server. + * + * @param dest Target of the symlink in question. + * + * @param src Top source directory currently applicable. Basically this + * is the first parameter to rsync in a simple invocation, but it's + * modified by flist.c in slightly complex ways. + * + * @retval True if unsafe + * @retval False is unsafe **/ int unsafe_symlink(char *dest, char *src) {