From 03ea8e74e1cc3ab570db666e99368d4a3ca863f0 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Dec 07 2009 10:01:18 +0000 Subject: fix retouching dir permissions --- diff --git a/rsync-3.0.6-permissions.patch b/rsync-3.0.6-permissions.patch new file mode 100644 index 0000000..c3cd30e --- /dev/null +++ b/rsync-3.0.6-permissions.patch @@ -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; diff --git a/rsync.spec b/rsync.spec index 2ecdf6d..dfb86e5 100644 --- a/rsync.spec +++ b/rsync.spec @@ -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 - 3.0.6-4 +- applied patch to avoid retouching dir permissions (#542679) + * Sun Jul 26 2009 Fedora Release Engineering - 3.0.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild