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
Fixed an ACL/xattr corruption issue where the --backup option could cause
[rsync/rsync.git]
/
backup.c
diff --git
a/backup.c
b/backup.c
index
a81f947
..
5805f16
100644
(file)
--- a/
backup.c
+++ b/
backup.c
@@
-106,19
+106,25
@@
int make_bak_dir(const char *fullpath)
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(rel, &sx);
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(rel, &sx);
- cache_acl(file, &sx);
+ cache_
tmp_
acl(file, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(rel, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(rel, &sx);
- cache_xattr(file, &sx);
+ cache_
tmp_
xattr(file, &sx);
free_xattr(&sx);
}
#endif
set_file_attrs(fbuf, file, NULL, NULL, 0);
unmake_file(file);
free_xattr(&sx);
}
#endif
set_file_attrs(fbuf, file, NULL, NULL, 0);
unmake_file(file);
+#ifdef SUPPORT_ACLS
+ uncache_tmp_acls();
+#endif
+#ifdef SUPPORT_XATTRS
+ uncache_tmp_xattrs();
+#endif
}
}
*p = '/';
}
}
*p = '/';
@@
-219,14
+225,14
@@
int make_backup(const char *fname, BOOL prefer_rename)
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(fname, &sx);
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(fname, &sx);
- cache_acl(file, &sx);
+ cache_
tmp_
acl(file, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(fname, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(fname, &sx);
- cache_xattr(file, &sx);
+ cache_
tmp_
xattr(file, &sx);
free_xattr(&sx);
}
#endif
free_xattr(&sx);
}
#endif
@@
-284,7
+290,7
@@
int make_backup(const char *fname, BOOL prefer_rename)
#ifdef SUPPORT_LINKS
if (!ret && preserve_links && S_ISLNK(file->mode)) {
const char *sl = F_SYMLINK(file);
#ifdef SUPPORT_LINKS
if (!ret && preserve_links && S_ISLNK(file->mode)) {
const char *sl = F_SYMLINK(file);
- if (safe_symlinks && unsafe_symlink(sl,
buf
)) {
+ if (safe_symlinks && unsafe_symlink(sl,
fname
)) {
if (INFO_GTE(SYMSAFE, 1)) {
rprintf(FINFO, "ignoring unsafe symlink %s -> %s\n",
full_fname(buf), sl);
if (INFO_GTE(SYMSAFE, 1)) {
rprintf(FINFO, "ignoring unsafe symlink %s -> %s\n",
full_fname(buf), sl);
@@
-313,6
+319,12
@@
int make_backup(const char *fname, BOOL prefer_rename)
rprintf(FINFO, "make_bak: skipping non-regular file %s\n",
fname);
unmake_file(file);
rprintf(FINFO, "make_bak: skipping non-regular file %s\n",
fname);
unmake_file(file);
+#ifdef SUPPORT_ACLS
+ uncache_tmp_acls();
+#endif
+#ifdef SUPPORT_XATTRS
+ uncache_tmp_xattrs();
+#endif
return 2;
}
return 2;
}
@@
-322,6
+334,12
@@
int make_backup(const char *fname, BOOL prefer_rename)
rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"",
full_fname(fname), buf);
unmake_file(file);
rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"",
full_fname(fname), buf);
unmake_file(file);
+#ifdef SUPPORT_ACLS
+ uncache_tmp_acls();
+#endif
+#ifdef SUPPORT_XATTRS
+ uncache_tmp_xattrs();
+#endif
return 0;
}
ret = 2;
return 0;
}
ret = 2;
@@
-333,6
+351,12
@@
int make_backup(const char *fname, BOOL prefer_rename)
preserve_xattrs = save_preserve_xattrs;
unmake_file(file);
preserve_xattrs = save_preserve_xattrs;
unmake_file(file);
+#ifdef SUPPORT_ACLS
+ uncache_tmp_acls();
+#endif
+#ifdef SUPPORT_XATTRS
+ uncache_tmp_xattrs();
+#endif
success:
if (INFO_GTE(BACKUP, 1)) {
success:
if (INFO_GTE(BACKUP, 1)) {