X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/f8e1fa627219873be6d37244dc70fbfd157f1e9c..d0f2bbb83e0c9a1b4264eeadfc2d53fb5aafb657:/main.c diff --git a/main.c b/main.c index dec59f46..66412916 100644 --- a/main.c +++ b/main.c @@ -94,7 +94,8 @@ extern filter_rule_list daemon_filter_list; uid_t our_uid; gid_t our_gid; -int am_generator = 0; +int am_receiver = 0; /* Only set to 1 after the receiver/generator fork. */ +int am_generator = 0; /* Only set to 1 after the receiver/generator fork. */ int local_server = 0; int daemon_over_rsh = 0; mode_t orig_umask = 0; @@ -851,6 +852,7 @@ static int do_recv(int f_in, int f_out, char *local_name) } if (pid == 0) { + am_receiver = 1; send_msgs_to_gen = am_server; close(error_pipe[0]); @@ -1519,9 +1521,10 @@ int main(int argc,char *argv[]) exit_cleanup(RERR_SYNTAX); } - /* we set a 0 umask so that correct file permissions can be - * carried across */ - orig_umask = umask(0); + /* Get the umask for use in permission calculations. We no longer set + * it to zero; that is ugly and pointless now that all the callers that + * relied on it have been reeducated to work with default ACLs. */ + umask(orig_umask = umask(0)); #if defined CONFIG_LOCALE && defined HAVE_SETLOCALE setlocale(LC_CTYPE, "");