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
Make link-dest aware of --perms, --owner and --group.
[rsync/rsync.git]
/
generator.c
diff --git
a/generator.c
b/generator.c
index
3552887
..
84264dc
100644
(file)
--- a/
generator.c
+++ b/
generator.c
@@
-52,12
+52,19
@@
static int skip_file(char *fname,
return 0;
}
if (link_dest) {
return 0;
}
if (link_dest) {
- if((st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT)) {
+ extern int preserve_perms;
+ extern int preserve_uid;
+ extern int preserve_gid;
+
+ if((preserve_perms
+ && st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))
return 0;
return 0;
- }
- if (st->st_uid != file->uid || st->st_gid != file->gid) {
+
+ if (preserve_uid && st->st_uid != file->uid)
+ return 0;
+
+ if (preserve_gid && st->st_gid != file->gid)
return 0;
return 0;
- }
}
/* if always checksum is set then we use the checksum instead
}
/* if always checksum is set then we use the checksum instead