X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/46cd1ef6bc79f5779766d5829681cb2b0a66aa80..6e310d38fcdeacb8055bb7e83d4e64c37fd54a38:/main.c diff --git a/main.c b/main.c index 2ef2f479..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; @@ -1473,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));