From 88a16c8b4f71413857abee83bff8788c75cfdb20 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Fri, 10 Mar 2006 15:57:03 +0000 Subject: [PATCH] Don't force S_IWUSR on a solo directory transfer. --- generator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generator.c b/generator.c index 226f44e6..fb79b2dc 100644 --- a/generator.c +++ b/generator.c @@ -1299,6 +1299,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) int save_ignore_non_existing = ignore_non_existing; int save_do_progress = do_progress; int save_make_backups = make_backups; + int dir_tweaking = !(list_only || local_name || dry_run); if (protocol_version >= 29) { itemizing = 1; @@ -1360,7 +1361,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) * them. This is then fixed after the transfer is done. */ #ifdef HAVE_CHMOD if (!am_root && S_ISDIR(file->mode) && !(file->mode & S_IWUSR) - && !list_only) { + && dir_tweaking) { mode_t mode = file->mode | S_IWUSR; /* user write */ char *fname = local_name ? local_name : fbuf; if (do_chmod(fname, mode) < 0) { @@ -1440,8 +1441,7 @@ void generate_files(int f_out, struct file_list *flist, char *local_name) if (delete_after && !local_name && flist->count > 0) do_delete_pass(flist); - if ((need_retouch_dir_perms || need_retouch_dir_times) - && !list_only && !local_name && !dry_run) { + if ((need_retouch_dir_perms || need_retouch_dir_times) && dir_tweaking) { int j = 0; /* Now we need to fix any directory permissions that were * modified during the transfer and/or re-set any tweaked -- 2.34.1