1
0
forked from rpms/rsync

fix retouching dir permissions

This commit is contained in:
Jan Zeleny 2009-12-07 10:01:18 +00:00
parent 430a6b3d85
commit 03ea8e74e1
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,28 @@
diff --git a/generator.c b/generator.c
index 8038feb..4abe6a0 100644
--- a/generator.c
+++ b/generator.c
@@ -2034,6 +2034,7 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
static int counter = 0;
struct file_struct *file;
char *fname;
+ BOOL retouch_perms;
int i, start, end;
if (ndx < 0) {
@@ -2054,11 +2055,13 @@ static void touch_up_dirs(struct file_list *flist, int ndx)
rprintf(FINFO, "touch_up_dirs: %s (%d)\n",
NS(fname), i);
}
+ /* Be sure not to retouch permissions with --fake-super. */
+ retouch_perms = !am_root && !(file->mode & S_IWUSR);
if (!F_IS_ACTIVE(file) || file->flags & FLAG_MISSING_DIR
- || (!need_retouch_dir_times && file->mode & S_IWUSR))
+ || !(need_retouch_dir_times || retouch_perms))
continue;
fname = f_name(file, NULL);
- if (!(file->mode & S_IWUSR))
+ if (retouch_perms)
do_chmod(fname, file->mode);
if (need_retouch_dir_times) {
STRUCT_STAT st;

View File

@ -7,13 +7,14 @@
Summary: A program for synchronizing files over a network
Name: rsync
Version: 3.0.6
Release: 3%{?prerelease}%{?dist}
Release: 4%{?prerelease}%{?dist}
Group: Applications/Internet
URL: http://rsync.samba.org/
Source0: ftp://rsync.samba.org/pub/rsync/rsync-%{version}%{?prerelease}.tar.gz
Source1: ftp://rsync.samba.org/pub/rsync/rsync-patches-%{version}%{?prerelease}.tar.gz
Source2: rsync.xinetd
Patch0: rsync-3.0.6-permissions.patch
BuildRequires: libacl-devel, libattr-devel, autoconf, popt-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
License: GPLv3+
@ -47,6 +48,8 @@ patch -p1 -i patches/xattrs.diff
#Enable --copy-devices parameter
patch -p1 -i patches/copy-devices.diff
%patch0 -p1 -b .permissions
%build
rm -fr autom4te.cache
autoconf
@ -74,6 +77,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man5/rsyncd.conf.5*
%changelog
* Mon Dec 07 2009 Jan Zeleny <jzeleny@redhat.com> - 3.0.6-4
- applied patch to avoid retouching dir permissions (#542679)
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild