Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix checker compile warning.
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
acf4b88
..
b5db075
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-91,7
+91,6
@@
extern int max_delete;
extern int force_delete;
extern int one_file_system;
extern int skipped_deletes;
extern int force_delete;
extern int one_file_system;
extern int skipped_deletes;
-extern struct stats stats;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
extern uid_t our_uid;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
extern uid_t our_uid;
@@
-516,7
+515,7
@@
void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
#endif
} else if (ndx >= 0) {
enum logcode code = logfile_format_has_i ? FINFO : FCLIENT;
#endif
} else if (ndx >= 0) {
enum logcode code = logfile_format_has_i ? FINFO : FCLIENT;
- log_item(code, file,
&stats,
iflags, xname);
+ log_item(code, file, iflags, xname);
}
}
}
}
}
}
@@
-1893,6
+1892,7
@@
static void touch_up_dirs(struct file_list *flist, int ndx)
static int counter = 0;
struct file_struct *file;
char *fname;
static int counter = 0;
struct file_struct *file;
char *fname;
+ BOOL fix_dir_perms;
int i, start, end;
if (ndx < 0) {
int i, start, end;
if (ndx < 0) {
@@
-1913,11
+1913,13
@@
static void touch_up_dirs(struct file_list *flist, int ndx)
rprintf(FINFO, "touch_up_dirs: %s (%d)\n",
NS(fname), i);
}
rprintf(FINFO, "touch_up_dirs: %s (%d)\n",
NS(fname), i);
}
+ /* Be sure not to retouch permissions with --fake-super. */
+ fix_dir_perms = !am_root && !(file->mode & S_IWUSR);
if (!F_IS_ACTIVE(file) || file->flags & FLAG_MISSING_DIR
if (!F_IS_ACTIVE(file) || file->flags & FLAG_MISSING_DIR
- ||
(!need_retouch_dir_times && file->mode & S_IWUSR
))
+ ||
!(need_retouch_dir_times || fix_dir_perms
))
continue;
fname = f_name(file, NULL);
continue;
fname = f_name(file, NULL);
- if (
!(file->mode & S_IWUSR)
)
+ if (
fix_dir_perms
)
do_chmod(fname, file->mode);
if (need_retouch_dir_times) {
STRUCT_STAT st;
do_chmod(fname, file->mode);
if (need_retouch_dir_times) {
STRUCT_STAT st;