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
- Extended the "refuse options" daemon setting to allow wildcards
[rsync/rsync.git]
/
rsync.c
diff --git
a/rsync.c
b/rsync.c
index
125369b
..
48aa610
100644
(file)
--- a/
rsync.c
+++ b/
rsync.c
@@
-32,8
+32,10
@@
extern int preserve_uid;
extern int preserve_gid;
extern int force_delete;
extern int recurse;
extern int preserve_gid;
extern int force_delete;
extern int recurse;
+extern int keep_dirlinks;
extern int make_backups;
extern char *backup_dir;
extern int make_backups;
extern char *backup_dir;
+extern int inplace;
/*
/*
@@
-97,7
+99,7
@@
int delete_file(char *fname)
continue;
pathjoin(buf, sizeof buf, fname, dname);
if (verbose > 0)
continue;
pathjoin(buf, sizeof buf, fname, dname);
if (verbose > 0)
- rprintf(FINFO, "deleting %s\n",
buf
);
+ rprintf(FINFO, "deleting %s\n",
safe_fname(buf)
);
if (delete_file(buf) != 0) {
closedir(d);
return -1;
if (delete_file(buf) != 0) {
closedir(d);
return -1;
@@
-186,7
+188,8
@@
int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
if (st->st_mode & (S_ISUID | S_ISGID)) {
* destination had the setuid or setgid bits set due
* to the side effect of the chown call */
if (st->st_mode & (S_ISUID | S_ISGID)) {
- link_stat(fname, st, 0);
+ link_stat(fname, st,
+ keep_dirlinks && S_ISDIR(st->st_mode));
}
updated = 1;
}
}
updated = 1;
}
@@
-239,6
+242,12
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
if (make_backups && !make_backup(fname))
return;
if (make_backups && !make_backup(fname))
return;
+ if (inplace) {
+ if (verbose > 2)
+ rprintf(FINFO, "finishing %s\n", fname);
+ goto do_set_perms;
+ }
+
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
/* move tmp file over real file */
if (verbose > 2)
rprintf(FINFO, "renaming %s to %s\n", fnametmp, fname);
@@
-248,10
+257,10
@@
void finish_transfer(char *fname, char *fnametmp, struct file_struct *file,
ret == -2 ? "copy" : "rename",
full_fname(fnametmp), fname);
do_unlink(fnametmp);
ret == -2 ? "copy" : "rename",
full_fname(fnametmp), fname);
do_unlink(fnametmp);
- } else {
- set_perms(fname, file, NULL,
- ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
+ return;
}
}
+ do_set_perms:
+ set_perms(fname, file, NULL, ok_to_set_time ? 0 : PERMS_SKIP_MTIME);
}
const char *who_am_i(void)
}
const char *who_am_i(void)