X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/bc40a305032db262e72b92c938203fd2bd42e4c9..3b83a22057b71e7df2b960d3997fb4474910f30e:/main.c diff --git a/main.c b/main.c index ec2e43ae..da6fafc3 100644 --- a/main.c +++ b/main.c @@ -77,12 +77,15 @@ extern char *rsync_path; extern char *shell_cmd; extern char *batch_name; extern char *password_file; +extern char *backup_dir; extern char curr_dir[MAXPATHLEN]; +extern char backup_dir_buf[MAXPATHLEN]; extern char *basis_dir[MAX_BASIS_DIRS+1]; extern struct file_list *first_flist; -extern struct filter_list_struct daemon_filter_list; +extern filter_rule_list daemon_filter_list; uid_t our_uid; +gid_t our_gid; int am_generator = 0; int local_server = 0; int daemon_over_rsh = 0; @@ -817,6 +820,16 @@ static int do_recv(int f_in, int f_out, char *local_name) exit_cleanup(RERR_IPC); } + if (backup_dir) { + int ret = make_path(backup_dir_buf, MKP_DROP_NAME); /* drops trailing slash */ + if (ret < 0) + exit_cleanup(RERR_SYNTAX); + if (ret) + rprintf(FINFO, "Created backup_dir %s\n", backup_dir_buf); + else if (INFO_GTE(BACKUP, 1)) + rprintf(FINFO, "backup_dir is %s\n", backup_dir_buf); + } + io_flush(NORMAL_FLUSH); if ((pid = do_fork()) == -1) { @@ -988,7 +1001,7 @@ static void do_server_recv(int f_in, int f_out, int argc, char *argv[]) if (daemon_filter_list.head) { char **dir_p; - struct filter_list_struct *elp = &daemon_filter_list; + filter_rule_list *elp = &daemon_filter_list; for (dir_p = basis_dir; *dir_p; dir_p++) { char *dir = *dir_p; @@ -1091,7 +1104,6 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]) if (write_batch && !am_server) start_write_batch(f_out); flist = send_file_list(f_out, argc, argv); - set_msg_fd_in(-1); if (DEBUG_GTE(FLIST, 3)) rprintf(FINFO,"file list sent\n"); @@ -1474,6 +1486,7 @@ int main(int argc,char *argv[]) starttime = time(NULL); our_uid = MY_UID(); + our_gid = MY_GID(); am_root = our_uid == 0; memset(&stats, 0, sizeof(stats));