import rsync-3.1.3-14.el8

This commit is contained in:
CentOS Sources 2022-05-10 03:14:17 -04:00 committed by Stepan Oksanichenko
parent 5700cceaf3
commit 3d497b9436
2 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,38 @@
diff --git a/xattrs.c b/xattrs.c
index 508649c0..3c549192 100644
--- a/xattrs.c
+++ b/xattrs.c
@@ -1055,7 +1055,7 @@ int set_xattr(const char *fname, const struct file_struct *file, const char *fna
{
rsync_xa_list *glst = rsync_xal_l.items;
item_list *lst;
- int ndx;
+ int ndx, added_write_perm = 0;
if (dry_run)
return 1; /* FIXME: --dry-run needs to compute this value */
@@ -1084,10 +1084,23 @@ int set_xattr(const char *fname, const struct file_struct *file, const char *fna
}
#endif
+ /* If the target file lacks write permission, we try to add it
+ * temporarily so we can change the extended attributes. */
+ if (!am_root
+#ifdef SUPPORT_LINKS
+ && !S_ISLNK(sxp->st.st_mode)
+#endif
+ && access(fname, W_OK) < 0
+ && do_chmod(fname, (sxp->st.st_mode & CHMOD_BITS) | S_IWUSR) == 0)
+ added_write_perm = 1;
+
ndx = F_XATTR(file);
glst += ndx;
lst = &glst->xa_items;
- return rsync_xal_set(fname, lst, fnamecmp, sxp);
+ int return_value = rsync_xal_set(fname, lst, fnamecmp, sxp);
+ if (added_write_perm) /* remove the temporary write permission */
+ do_chmod(fname, sxp->st.st_mode);
+ return return_value;
}
#ifdef SUPPORT_ACLS

View File

@ -9,7 +9,7 @@
Summary: A program for synchronizing files over a network
Name: rsync
Version: 3.1.3
Release: 12%{?dist}
Release: 14%{?dist}
Group: Applications/Internet
URL: http://rsync.samba.org/
@ -35,6 +35,7 @@ Patch4: rsync-3.1.2-vvv-hang.patch
Patch5: rsync-3.1.3-ignore-missing.patch
Patch6: rsync-3.1.3-append-check.patch
Patch7: rsync-3.1.3-skip-compress.patch
Patch8: rsync-3.1.3-xattr.patch
%description
Rsync uses a reliable algorithm to bring remote and host files into
@ -80,6 +81,7 @@ patch -p1 -i patches/copy-devices.diff
%patch5 -p1 -b .missing
%patch6 -p1 -b .append
%patch7 -p1 -b .skip-compress
%patch8 -p1 -b .xattr
%build
%configure
@ -126,6 +128,12 @@ chmod -x support/*
%systemd_postun_with_restart rsyncd.service
%changelog
* Mon Oct 11 2021 Michal Ruprich <mruprich@redhat.com> - 3.1.3-14
- Related: #1907443 - Adding fmf plans to run tests with tmt
* Mon Sep 27 2021 Tomas Korbar <tkorbar@redhat.com> - 3.1.3-13
- Resolves: #1907443 - Read-only files that have changed xattrs fail to allow xattr changes
* Fri Dec 18 2020 Michal Ruprich <mruprich@redhat.com> - 3.1.3-12
- Resolves: #1816528 - Defaults for --skip-compress are not working, everything is being compressed