X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/ebeacb36fb298218bf4195ba3bdddaf8752488bb..4ce838e1f107239f1b18f3f8cd7c7fbab65e0bd5:/rsync.c diff --git a/rsync.c b/rsync.c index a97357d9..1b28c35e 100644 --- a/rsync.c +++ b/rsync.c @@ -161,6 +161,11 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, change_uid = am_root && preserve_uid && st->st_uid != file->uid; change_gid = preserve_gid && file->gid != GID_NONE && st->st_gid != file->gid; +#if !HAVE_LCHOWN && !CHOWN_MODIFIES_SYMLINK + if (S_ISLNK(st->st_mode)) + ; + else +#endif if (change_uid || change_gid) { if (verbose > 2) { if (change_uid) { @@ -235,19 +240,19 @@ void sig_int(void) /* finish off a file transfer, renaming the file and setting the permissions and ownership */ void finish_transfer(char *fname, char *fnametmp, struct file_struct *file, - int ok_to_set_time) + int ok_to_set_time, int overwriting_basis) { int ret; - if (make_backups && !make_backup(fname)) - return; - if (inplace) { if (verbose > 2) rprintf(FINFO, "finishing %s\n", fname); goto do_set_perms; } + if (make_backups && overwriting_basis && !make_backup(fname)) + return; + /* Change permissions before putting the file into place. */ set_perms(fnametmp, file, NULL, ok_to_set_time ? 0 : PERMS_SKIP_MTIME);