From 9e4b0bf82d346c3cd999241332a0439ebc48836b Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Wed, 14 Oct 2020 21:54:13 -0700 Subject: [PATCH] RHEL 9.0.0 Alpha bootstrap The content of this branch was automatically imported from Fedora ELN with the following as its source: https://src.fedoraproject.org/rpms/rsync#47694dc9540f95cb1551999121cac4aab283e718 --- .gitignore | 16 + Makefile | 21 + rsync-3.0.6-iconv-logging.patch | 22 + rsync-3.2.2-runtests.patch | 12 + rsync-3.2.2-ssl-verify-hostname.patch | 22 + rsync-man.patch | 10 + rsync-noatime.patch | 147 ++++ rsync.spec | 658 ++++++++++++++++++ rsyncd.conf | 20 + rsyncd.service | 12 + rsyncd.socket | 10 + rsyncd.sysconfig | 1 + rsyncd@.service | 8 + sources | 2 + .../Makefile | 64 ++ .../PURPOSE | 16 + .../rsyncd@.service | 8 + .../runtest.sh | 361 ++++++++++ tests/setting-group-acls/Makefile | 64 ++ tests/setting-group-acls/PURPOSE | 3 + tests/setting-group-acls/runtest.sh | 71 ++ tests/tests.yml | 23 + 22 files changed, 1571 insertions(+) create mode 100644 Makefile create mode 100644 rsync-3.0.6-iconv-logging.patch create mode 100644 rsync-3.2.2-runtests.patch create mode 100644 rsync-3.2.2-ssl-verify-hostname.patch create mode 100644 rsync-man.patch create mode 100644 rsync-noatime.patch create mode 100644 rsync.spec create mode 100644 rsyncd.conf create mode 100644 rsyncd.service create mode 100644 rsyncd.socket create mode 100644 rsyncd.sysconfig create mode 100644 rsyncd@.service create mode 100644 sources create mode 100644 tests/definig-the-set-of-files-to-transfer/Makefile create mode 100644 tests/definig-the-set-of-files-to-transfer/PURPOSE create mode 100644 tests/definig-the-set-of-files-to-transfer/rsyncd@.service create mode 100755 tests/definig-the-set-of-files-to-transfer/runtest.sh create mode 100644 tests/setting-group-acls/Makefile create mode 100644 tests/setting-group-acls/PURPOSE create mode 100644 tests/setting-group-acls/runtest.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index e69de29..9da767c 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,16 @@ +rsync-3.0.8.tar.gz +rsync-patches-3.0.8.tar.gz +/rsync-3.0.9.tar.gz +/rsync-patches-3.0.9.tar.gz +/rsync-3.1.0pre1.tar.gz +/rsync-patches-3.1.0pre1.tar.gz +/rsync-3.1.0.tar.gz +/rsync-patches-3.1.0.tar.gz +/rsync-3.1.2.tar.gz +/rsync-patches-3.1.2.tar.gz +/rsync-3.1.3.tar.gz +/rsync-patches-3.1.3.tar.gz +/rsync-3.2.2.tar.gz +/rsync-patches-3.2.2.tar.gz +/rsync-3.2.3.tar.gz +/rsync-patches-3.2.3.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f887b2 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: rsync +# $Id$ +NAME := rsync +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attempt a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/rsync-3.0.6-iconv-logging.patch b/rsync-3.0.6-iconv-logging.patch new file mode 100644 index 0000000..bf7d943 --- /dev/null +++ b/rsync-3.0.6-iconv-logging.patch @@ -0,0 +1,22 @@ +diff --git a/log.c b/log.c +index 34a013b..1aca728 100644 +--- a/log.c ++++ b/log.c +@@ -377,10 +377,13 @@ output_msg: + filtered_fwrite(f, convbuf, outbuf.len, 0); + outbuf.len = 0; + } +- if (!ierrno || ierrno == E2BIG) +- continue; +- fprintf(f, "\\#%03o", CVAL(inbuf.buf, inbuf.pos++)); +- inbuf.len--; ++ /* Log one byte of illegal/incomplete sequence and continue with ++ * the next character. Check that the buffer is non-empty for the ++ * sake of robustness. */ ++ if ((ierrno == EILSEQ || ierrno == EINVAL) && inbuf.len) { ++ fprintf(f, "\\#%03o", CVAL(inbuf.buf, inbuf.pos++)); ++ inbuf.len--; ++ } + } + } else + #endif diff --git a/rsync-3.2.2-runtests.patch b/rsync-3.2.2-runtests.patch new file mode 100644 index 0000000..0f682e5 --- /dev/null +++ b/rsync-3.2.2-runtests.patch @@ -0,0 +1,12 @@ +diff --git a/runtests.sh.old b/runtests.sh +index ecb383e..1cd1d1a 100755 +--- a/runtests.sh.old ++++ b/runtests.sh +@@ -276,6 +276,7 @@ do + + case "$testscript" in + *hardlinks*) TESTRUN_TIMEOUT=600 ;; ++ *default-acls*) continue ;; + *) TESTRUN_TIMEOUT=300 ;; + esac + diff --git a/rsync-3.2.2-ssl-verify-hostname.patch b/rsync-3.2.2-ssl-verify-hostname.patch new file mode 100644 index 0000000..8319561 --- /dev/null +++ b/rsync-3.2.2-ssl-verify-hostname.patch @@ -0,0 +1,22 @@ +From Mon Sep 17 00:00:00 2001 +From: Matt McCutchen +Date: Wed, 26 Aug 2020 12:16:08 -0400 + +rsync-ssl: Verify the hostname in the certificate when using openssl. +--- + rsync-ssl | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rsync-ssl b/rsync-ssl +index 8101975a..46701af1 100755 +--- a/rsync-ssl ++++ b/rsync-ssl +@@ -129,7 +129,7 @@ function rsync_ssl_helper { + fi + + if [[ $RSYNC_SSL_TYPE == openssl ]]; then +- exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt -quiet -verify_quiet -servername $hostname -connect $hostname:$port ++ exec $RSYNC_SSL_OPENSSL s_client $caopt $certopt -quiet -verify_quiet -servername $hostname -verify_hostname $hostname -connect $hostname:$port + elif [[ $RSYNC_SSL_TYPE == gnutls ]]; then + exec $RSYNC_SSL_GNUTLS --logfile=/dev/null $gnutls_cert_opt $gnutls_opts $hostname:$port + else diff --git a/rsync-man.patch b/rsync-man.patch new file mode 100644 index 0000000..36ddc53 --- /dev/null +++ b/rsync-man.patch @@ -0,0 +1,10 @@ +--- rsync-3.0.9/rsync.1 2011-09-23 18:42:26.000000000 +0200 ++++ rsync-3.0.9/rsync.1 2012-09-19 10:40:19.698802861 +0200 +@@ -445,6 +445,7 @@ + \-o, \-\-owner preserve owner (super\-user only) + \-g, \-\-group preserve group + \-\-devices preserve device files (super\-user only) ++ \-\-copy-devices copy device contents as regular file + \-\-specials preserve special files + \-D same as \-\-devices \-\-specials + \-t, \-\-times preserve modification times diff --git a/rsync-noatime.patch b/rsync-noatime.patch new file mode 100644 index 0000000..85626ef --- /dev/null +++ b/rsync-noatime.patch @@ -0,0 +1,147 @@ +Optionally preserve atimes. + +Based on https://bugzilla.samba.org/show_bug.cgi?id=7249#c1 by Nicolas George. + +Index: rsync-3.1.0/options.c +=================================================================== +--- rsync-3.1.0.orig/options.c ++++ rsync-3.1.0/options.c +@@ -125,6 +125,7 @@ int delay_updates = 0; + long block_size = 0; /* "long" because popt can't set an int32. */ + char *skip_compress = NULL; + item_list dparam_list = EMPTY_ITEM_LIST; ++int noatime = 0; + + /** Network address family. **/ + int default_af_hint +@@ -802,6 +803,7 @@ void usage(enum logcode F) + rprintf(F," --iconv=CONVERT_SPEC request charset conversion of filenames\n"); + #endif + rprintf(F," --checksum-seed=NUM set block/file checksum seed (advanced)\n"); ++ rprintf(F," --noatime do not alter atime when opening source files\n"); + rprintf(F," -4, --ipv4 prefer IPv4\n"); + rprintf(F," -6, --ipv6 prefer IPv6\n"); + rprintf(F," --version print version number\n"); +@@ -1019,6 +1021,7 @@ static struct poptOption long_options[] + {"iconv", 0, POPT_ARG_STRING, &iconv_opt, 0, 0, 0 }, + {"no-iconv", 0, POPT_ARG_NONE, 0, OPT_NO_ICONV, 0, 0 }, + #endif ++ {"noatime", 0, POPT_ARG_VAL, &noatime, 1, 0, 0 }, + {"ipv4", '4', POPT_ARG_VAL, &default_af_hint, AF_INET, 0, 0 }, + {"ipv6", '6', POPT_ARG_VAL, &default_af_hint, AF_INET6, 0, 0 }, + {"8-bit-output", '8', POPT_ARG_VAL, &allow_8bit_chars, 1, 0, 0 }, +@@ -2739,6 +2742,12 @@ void server_options(char **args, int *ar + if (preallocate_files && am_sender) + args[ac++] = "--preallocate"; + ++ /* ++ * Do we want remote atime preservation when we preserve local ones? ++ if (noatime) ++ args[ac++] = "--noatime"; ++ */ ++ + if (ac > MAX_SERVER_ARGS) { /* Not possible... */ + rprintf(FERROR, "argc overflow in server_options().\n"); + exit_cleanup(RERR_MALLOC); +Index: rsync-3.1.0/rsync.yo +=================================================================== +--- rsync-3.1.0.orig/rsync.yo ++++ rsync-3.1.0/rsync.yo +@@ -454,6 +454,7 @@ to the detailed description below for a + --protocol=NUM force an older protocol version to be used + --iconv=CONVERT_SPEC request charset conversion of filenames + --checksum-seed=NUM set block/file checksum seed (advanced) ++ --noatime do not alter atime when opening source files + -4, --ipv4 prefer IPv4 + -6, --ipv6 prefer IPv6 + --version print version number +@@ -2543,6 +2544,13 @@ daemon uses the charset specified in its + regardless of the remote charset you actually pass. Thus, you may feel free to + specify just the local charset for a daemon transfer (e.g. bf(--iconv=utf8)). + ++dit(bf(--noatime)) Use the O_NOATIME open flag on systems that support it. ++The effect of this flag is to avoid altering the access time (atime) of the ++opened files. ++If the system does not support the O_NOATIME flag, this option does nothing. ++Currently, systems known to support O_NOATIME are Linux >= 2.6.8 with glibc ++>= 2.3.4. ++ + dit(bf(-4, --ipv4) or bf(-6, --ipv6)) Tells rsync to prefer IPv4/IPv6 + when creating sockets. This only affects sockets that rsync has direct + control over, such as the outgoing socket when directly contacting an +diff --git a/syscall.c b/syscall.c +index c46a8b4..6620563 100644 +--- a/syscall.c ++++ b/syscall.c +@@ -42,6 +42,7 @@ extern int inplace; + extern int preallocate_files; + extern int preserve_perms; + extern int preserve_executability; ++extern int noatime; + + #ifndef S_BLKSIZE + # if defined hpux || defined __hpux__ || defined __hpux +@@ -189,6 +190,10 @@ int do_open(const char *pathname, int fl + RETURN_ERROR_IF(dry_run, 0); + RETURN_ERROR_IF_RO_OR_LO; + } ++#ifdef O_NOATIME ++ if (noatime) ++ flags |= O_NOATIME; ++#endif + + return open(pathname, flags | O_BINARY, mode); + } +Index: rsync/tls.c +=================================================================== +--- rsync.orig/tls.c ++++ rsync/tls.c +@@ -53,6 +53,7 @@ int preserve_perms = 0; + int preserve_executability = 0; + int preallocate_files = 0; + int inplace = 0; ++int noatime = 0; + + #ifdef SUPPORT_XATTRS + +Index: rsync/t_unsafe.c +=================================================================== +--- rsync.orig/t_unsafe.c ++++ rsync/t_unsafe.c +@@ -33,6 +33,10 @@ int preserve_perms = 0; + int preserve_executability = 0; + short info_levels[COUNT_INFO], debug_levels[COUNT_DEBUG]; + ++/* This is to make syscall.o shut up. */ ++int noatime = 0; ++ ++ + int + main(int argc, char **argv) + { +Index: rsync/wildtest.c +=================================================================== +--- rsync.orig/wildtest.c ++++ rsync/wildtest.c +@@ -32,6 +32,9 @@ int fnmatch_errors = 0; + + int wildmatch_errors = 0; + ++/* This is to make syscall.o shut up. */ ++int noatime = 0; ++ + typedef char bool; + + int output_iterations = 0; +Index: rsync/trimslash.c +=================================================================== +--- rsync.orig/trimslash.c ++++ rsync/trimslash.c +@@ -30,6 +30,7 @@ int preserve_perms = 0; + int preserve_executability = 0; + int preallocate_files = 0; + int inplace = 0; ++int noatime = 0; + + int + main(int argc, char **argv) diff --git a/rsync.spec b/rsync.spec new file mode 100644 index 0000000..2feca58 --- /dev/null +++ b/rsync.spec @@ -0,0 +1,658 @@ +%global _hardened_build 1 + +%define isprerelease 0 + +%if %isprerelease +%define prerelease pre1 +%endif + +Summary: A program for synchronizing files over a network +Name: rsync +Version: 3.2.3 +Release: 1%{?dist} +URL: http://rsync.samba.org/ + +Source0: https://download.samba.org/pub/rsync/src/rsync-%{version}%{?prerelease}.tar.gz +Source1: https://download.samba.org/pub/rsync/src/rsync-patches-%{version}%{?prerelease}.tar.gz +Source2: rsyncd.socket +Source3: rsyncd.service +Source4: rsyncd.conf +Source5: rsyncd.sysconfig +Source6: rsyncd@.service + +BuildRequires: gcc gcc-c++ +BuildRequires: libacl-devel, libattr-devel, autoconf, popt-devel, systemd +BuildRequires: lz4-devel openssl-devel libzstd-devel +#Added virtual provide for zlib due to https://fedoraproject.org/wiki/Bundled_Libraries?rd=Packaging:Bundled_Libraries +Provides: bundled(zlib) = 1.2.8 +License: GPLv3+ + +#Added temporarily until new rebase +Patch0: rsync-3.2.2-ssl-verify-hostname.patch +#Added due to rhbz#1873975 - default-acls test fail on s390x due to libacl +Patch1: rsync-3.2.2-runtests.patch + +%description +Rsync uses a reliable algorithm to bring remote and host files into +sync very quickly. Rsync is fast because it just sends the differences +in the files over the network instead of sending the complete +files. Rsync is often used as a very powerful mirroring process or +just as a more capable replacement for the rcp command. A technical +report which describes the rsync algorithm is included in this +package. + +%package daemon +Summary: Service for anonymous access to rsync +BuildArch: noarch +Requires: %{name} = %{version}-%{release} +%{?systemd_requires} +%description daemon +Rsync can be used to offer read only access to anonymous clients. This +package provides the anonymous rsync service. + +%prep +# TAG: for pre versions use + +%if %isprerelease +%setup -q -n rsync-%{version}%{?prerelease} +%setup -q -b 1 -n rsync-%{version}%{?prerelease} +%else +%setup -q +%setup -q -b 1 +%endif + +#Enable --copy-devices parameter +patch -p1 -i patches/copy-devices.diff + +%patch0 -p1 -b .verify-hostname +%patch1 -p1 -b .runtests + +%build + +%configure --disable-xxhash +# --with-included-zlib=no temporary disabled because of #1043965 + +make %{?_smp_mflags} + +%check +make check +chmod -x support/* + +%install +rm -rf $RPM_BUILD_ROOT + +%makeinstall INSTALLCMD='install -p' INSTALLMAN='install -p' + +install -D -m644 %{SOURCE3} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd.service +install -D -m644 %{SOURCE2} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd.socket +install -D -m644 %{SOURCE4} $RPM_BUILD_ROOT/%{_sysconfdir}/rsyncd.conf +install -D -m644 %{SOURCE5} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/rsyncd +install -D -m644 %{SOURCE6} $RPM_BUILD_ROOT/%{_unitdir}/rsyncd@.service + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc support/ tech_report.tex +%{_bindir}/%{name} +%{_bindir}/%{name}-ssl +%{_mandir}/man1/%{name}.1* +%{_mandir}/man1/%{name}-ssl.1* +%{_mandir}/man5/rsyncd.conf.5* +%config(noreplace) %{_sysconfdir}/rsyncd.conf + +%files daemon +%config(noreplace) %{_sysconfdir}/sysconfig/rsyncd +%{_unitdir}/rsyncd.socket +%{_unitdir}/rsyncd.service +%{_unitdir}/rsyncd@.service + +%post daemon +%systemd_post rsyncd.service + +%preun daemon +%systemd_preun rsyncd.service + +%postun daemon +%systemd_postun_with_restart rsyncd.service + +%changelog +* Mon Aug 31 2020 Michal Ruprich - 3.2.3-1 +- New version 3.2.3 +- Removed upstream patches acls.diff and xattrs.diff + +* Sat Aug 01 2020 Fedora Release Engineering - 3.2.2-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 3.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 21 2020 Michal Ruprich - 3.2.2-1 +- New version 3.2.2 + +* Thu Jan 30 2020 Fedora Release Engineering - 3.1.3-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 10 2019 Michal Ruprich - 3.1.3-10 +- Enabling upstream test suite during build rhbz#1533846 + +* Fri Jul 26 2019 Fedora Release Engineering - 3.1.3-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon Apr 15 2019 Michal Ruprich - 3.1.3-8 +- Resolves: #1452187 - move man page rsyncd.conf(5) from rsync-daemon to rsync package +- Moving the config file as well + +* Tue Mar 19 2019 Michal Ruprich - 3.1.3-7 +- Resolves: #1683737 - [abrt] rsync: utf8_internal_loop(): rsync killed by SIGSEGV + +* Sat Feb 02 2019 Fedora Release Engineering - 3.1.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Wed Jan 02 2019 Michal Ruprich - 3.1.3-5 +- Fix for rhbz#1586346 - rsyncd.service fails to start at boot if address is configured + +* Sat Jul 14 2018 Fedora Release Engineering - 3.1.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Feb 09 2018 Igor Gnatenko - 3.1.3-3 +- Escape macros in %%changelog + +* Tue Jan 30 2018 Michal Ruprich - 3.1.3-2 +- removed dependencies on systemd-units + +* Mon Jan 29 2018 Michal Ruprich - 3.1.3-1 +- new version 3.1.3 +- Resolves CVE-2018-5764 + +* Thu Aug 03 2017 Fedora Release Engineering - 3.1.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 3.1.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Wed Jun 28 2017 Michal Ruprich - 3.1.2-5 +- Resolves: #1459681 - rpmscripts for rsyncd.service are in the wrong package + +* Wed May 03 2017 Michal Ruprich - 3.1.2-4 +- Added virtual provide for zlib library + +* Sat Feb 11 2017 Fedora Release Engineering - 3.1.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 3.1.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Fri Jan 08 2016 Luboš Uhliarik - 3.1.2-1 +- new version 3.1.2 + +* Mon Nov 09 2015 Luboš Uhliarik - 3.1.1-8 +- Resolves: #1233893 - added noatime patch + +* Thu Jun 18 2015 Fedora Release Engineering - 3.1.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Mon Aug 18 2014 Fedora Release Engineering - 3.1.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Wed Aug 13 2014 Pavel Šimerda - 3.1.1-5 +- Related: #1123813 - fix rsync-daemon subpackage dependencywq + +* Wed Aug 13 2014 Pavel Šimerda - 3.1.1-4 +- Related: #1123813 - build rsync-daemon as noarch + +* Tue Aug 12 2014 Pavel Šimerda - 3.1.1-3 +- Resolves: #1123813 - Reduce dependencies + +* Mon Aug 4 2014 Tom Callaway - 3.1.1-2 +- fix license handling + +* Wed Jun 25 2014 Michal Luscon - 3.1.1-1 +- Update to latest upstream version 3.1.1 + +* Sun Jun 08 2014 Fedora Release Engineering - 3.1.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Fri May 30 2014 Michal Luscon - 3.1.0-5 +- Reverted: #1050081 - breaks rawhide live installation + +* Mon May 26 2014 Michal Luscon - 3.1.0-4 +- Fixed: #1050081 undo the hard-link xattr optimization + +* Wed Apr 16 2014 Michal Luscon - 3.1.0-3 +- Fixed: CVE-2014-2855 - denial of service +- Reverted: compilation with system provided zlib (#1043965) + +* Sun Oct 20 2013 Michal Lusocn - 3.1.0-2 +- Update to latest upstream 3.1.0 +- Fixed #1018520 - missing rsyncd@.service + +* Wed Aug 07 2013 Michal Luscon - 3.1.0-1pre1 +- Upstream 3.1.0 pre release +- Fixed: #495310 - rsync contains forked copy of zlib +- Fixed: #926459 - building aarch64 +- Fixed: bogus dates in changelog + +* Sun Aug 04 2013 Fedora Release Engineering - 3.0.9-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Jun 28 2013 Michal Luscon - 3.0.9-11 +- Add BuildRequires: systemd-units + +* Mon Jun 17 2013 Michal Luscon - 3.0.9-10 +- Fixed: #947765 - rsync daemon chooses wrong destination place + +* Fri May 17 2013 Michal Luscon - 3.0.9-9 +- Fix missing man page and help options + +* Thu Feb 14 2013 Fedora Release Engineering - 3.0.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Nov 15 2012 Michal Luscon 3.0.9-6 +- Systemd units for rsync + +* Tue Oct 23 2012 Michal Luscon 3.0.9-5 +- Reverted: #495310 - rsync contains forked copy of zlib + +* Tue Oct 16 2012 Michal Luscon 3.0.9-4 +- Fixed: #823088 - rsync loses track of files with different directory prefixes +- Fixed: #495310 - rsync contains forked copy of zlib + +* Sat Jul 21 2012 Fedora Release Engineering - 3.0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Sat Jan 14 2012 Fedora Release Engineering - 3.0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Sep 14 2011 Vojtech Vitek (V-Teq) - 3.0.9-1 +- Rebase to 3.0.9 (#741004) + +* Wed Sep 14 2011 Vojtech Vitek (V-Teq) - 3.0.8-2 +- Fix security context of symbolic links (#709779) + +* Tue Mar 29 2011 Vojtech Vitek - 3.0.8-1 +- Rebase to 3.0.8, remove buffer overflow patch (#691362, #675036) + +* Wed Feb 09 2011 Fedora Release Engineering - 3.0.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Mar 29 2010 Jan Zeleny - 3.0.7-3 +- buffer overflow patch replaced by upstream version + +* Fri Jan 22 2010 Jan Zeleny - 3.0.7-2 +- fixed issue with buffer overflow when using long filenames (#557916) + +* Tue Jan 19 2010 Jan Zeleny - 3.0.7-1 +- rebased to 3.0.7 + +* 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 + +* Mon Jun 1 2009 Simo Sorce 3.0.6-2 +- Final 3.0.6 release + +* Thu May 21 2009 Ján ONDREJ (SAL) - 3.0.6-1pre1 +- Enabled patches/copy-devices.diff patch (bz#494313) + +* Wed Apr 15 2009 Simo Sorce 3.0.6-0pre1 +- First 3.0.6 pre release +- Also change the spec to simplify releasing pre-releases + +* Wed Feb 25 2009 Fedora Release Engineering - 3.0.5-1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Thu Jan 1 2009 Simo Sorce 3.0.5-0.fc11 +- New upstream bugfix release + +* Mon Sep 8 2008 Simo Sorce 3.0.4-0.fc10 +- New upstream bugfix release + +* Mon Jun 30 2008 Simo Sorce 3.0.3-0.fc10 +- New upstream release + +* Tue Apr 8 2008 Simo Sorce 3.0.2-0.fc9 +- Security release: http://rsync.samba.org/security.html#s3_0_2 + +* Fri Apr 4 2008 Simo Sorce 3.0.1-2.fc9 +- Make sure support scripts are not executable so that no bad perl dependecies + are created + +* Fri Apr 4 2008 Simo Sorce 3.0.1-1.fc9 +- Add NEWS and support/ scripts in the docs section +- 3.0.1 final + +* Mon Mar 31 2008 Simo Sorce 3.0.1-0.3.pre3.fc9 +- 3.0.1 pre release #3 +- Fixes some annoying minor bugs (see release notes) + +* Thu Mar 27 2008 Simo Sorce 3.0.1-0.2.pre2.fc9 +- 3.0.1 pre release #2 +- Fixes #439074 + +* Tue Mar 25 2008 Simo Sorce 3.0.1-0.1.pre1.fc9 +- 3.0.1 pre release #1 +- Fixes #438694 + +* Sun Mar 2 2008 Simo Sorce 3.0.0-1.fc9 +- Final 3.0.0 release + +* Sat Feb 23 2008 Simo Sorce 3.0.0-0.pre10.fc9 +- Tenth preprelease of the 3.0.0 series + +* Sat Feb 16 2008 Simo Sorce 3.0.0-0.pre9.fc9 +- Ninth preprelease of the 3.0.0 series + +* Sat Feb 2 2008 Simo Sorce 3.0.0-0.pre8.fc9 +- Eight prerelease +- Add second source, now patches are in a separate file +- Add temporary fix to the xattrs.diff patch line as, in this version + the patch contains one extra humk already contained in acls.diff + +* Sat Oct 27 2007 Simo Sorce 3.0.0-0.pre4.fc9 +- Fourth prerelease + +* Mon Oct 15 2007 Simo Sorce 3.0.0-0.pre2.1.fc9 +- Add support for IPv6 by default with xinetd + +* Fri Oct 12 2007 Simo Sorce 3.0.0-0.pre2.fc9 +- Second prerelease + +* Wed Oct 10 2007 Simo Sorce 3.0.0-0.pre1.fc9 +- New Major version prerelease + +* Wed Sep 5 2007 Simo Sorce 2.6.9-3.fc8 +- Add patch to fix crash bug with hardlinks and ACLs patches + +* Mon Feb 19 2007 Adam Jackson 2.6.9-2 +- Add dist tag to Release to fix upgrades from FC5 or FC6. + +* Mon Feb 19 2007 Simo Sorce - 2.6.9-2 +- fix acl/xattr bug with --delete: (bz#229145) + +* Wed Nov 22 2006 Florian La Roche - 2.6.9-1 +- update to 2.6.9 + +* Wed Jul 12 2006 Jesse Keating - 2.6.8-3.1 +- rebuild + +* Fri Jun 9 2006 Jay Fenlason 2.6.8-3 +- Add my xattrs_bug patch to fix a bug where xattrs don't get sent correctly. +- Add BuildRequires to make sure libattr-devel and libacl-devel are avaliable +- replace --with... with --enable... so they actually work +- Add make, autoconf and gcc to BuildRequires + +* Mon May 8 2006 Jay Fenlason 2.6.8-2 +- New upstream release +- Use the upstream xattr patch instead of mine. This closes + bz#190208 CVE-2006-2083 rsync buffer overflow issue + +* Fri Feb 10 2006 Jesse Keating - 2.6.6-2.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.6.6-2.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Thu Jul 28 2005 Jay Fenlason 2.6.6-2 +- New upstream release. See the NEWS file for details. + +* Thu Jun 2 2005 Jay Fenlason 2.6.5-2 +- New upstream release + +* Tue May 17 2005 Jay Fenlason 2.6.5-0.pre1.0 +- new upstream pre-release + +* Tue May 17 2005 Jay Fenlason 2.6.4-3 +- Include the -address patch from upstream, to close + bz#154752 Unable to use --address in client mode + +* Thu Mar 31 2005 Jay Fenlason 2.6.4-2 +- New upstream version + +* Wed Mar 2 2005 Jay Fenlason 2.6.3-3 +- bump release, rebuild with gcc4 +- pass RPM_OPT_FLAGS to make + +* Thu Feb 10 2005 Jay Fenlason 2.6.3-2 +- Added my -xattr patch, which is based on the -acl patch. + +* Thu Sep 30 2004 Jay Fenlason 2.6.3-1 +- New upstream release. + +* Tue Sep 21 2004 Jay Fenlason 2.6.3-0.pre2 +- new upstream version. + +* Tue Aug 17 2004 Jay Fenlason 2.6.3-0.pre1 +- New upstream version with security fix for CAN-2004-0792 +- This obsoletes the -lastdir-corruption patch. + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Tue May 25 2004 Mark McLoughlin - 2.6.2-1 +- Backport fix for crasher when passing multiple directories of the same + length (bug #123708) + +* Fri Apr 30 2004 Jay Fenlason 2.6.2-0 +- New upstream version to correct the problems with 2.6.1. + This obsoletes all the patches to 2.6.1 + +* Thu Apr 29 2004 Jay Fenlason 2.6.1-1 +- Rsync 2.6.1 final. +- Add a patch from Wayne Davison that fixes a + use of uninitilized memory in the map_uid and map_gid functions. +- Add another patch from Wayne Davidson that fixes the -R option. +- Add a patch (extracted from a patch by Sami Farin + ) to not ignore the return value + of close(). + +* Thu Mar 25 2004 Jay Fenlason 2.6.1-0.pre1 +- New upstream version + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Mon Jan 5 2004 Jay Fenlason 2.6.0-0 +- New upstream version, obsoletes the rsync-2.5.6-signal.patch + +* Wed Dec 3 2003 Bill Nottingham 2.5.7-2 +- rebuild + +* Wed Dec 3 2003 Bill Nottingham 2.5.7-1 +- update to 2.5.7 + +* Tue Aug 05 2003 Hardy Merrill 2.5.6-20 +- rebuild in new build env + +* Tue Aug 05 2003 Lon Hohberger 2.5.6-19 +- spec file fix + +* Tue Aug 05 2003 Hardy Merrill 2.5.6-18 +- rebuild in new build env + +* Tue Aug 05 2003 Hardy Merrill 2.5.6-17 +- fixed spec - added patch0 to prep. + +* Tue Aug 05 2003 Hardy Merrill 2.5.6-16 +- rebuild in new build env + +* Mon Aug 04 2003 Hardy Merrill 2.5.6-15 +- add rsync-2.5.6-signal.patch to fix kernel warnings that + appear because socket.c sets SIGCHLD to SIG_IGN and then + calls wait. This is in response to bug#98740. This patch + *has* been committed to CVS upstream and will be in + upstream rsync-2.5.7. + +* Fri Jun 13 2003 Hardy Merrill 2.5.6-14 +- build scratch - for compile warnings + +* Fri Jun 13 2003 Hardy Merrill 2.5.6-13 +- build scratch - for compile warnings + +* Thu Jun 12 2003 Hardy Merrill 2.5.6-12 +- rebuild in new build env + +* Thu Jun 12 2003 Hardy Merrill 2.5.6-11 +- removed rsync-2.5.6-sign.patch. Upstream code + incorporates signed vs unsigned changes. + +* Wed Jun 11 2003 Hardy Merrill 2.5.6-10_CVSHEAD_signpatch +- build scratch - added rsync-2.5.6-sign.patch. + +* Wed Jun 11 2003 Hardy Merrill 2.5.6-9_CVSHEAD_nopatches +- build scratch. + +* Wed Jun 11 2003 Hardy Merrill 2.5.6-8 +- build scratch - deleted rsync-2.5.6-sign.patch. + +* Mon Jun 09 2003 Hardy Merrill 2.5.6-7 +- rebuild in new build env + +* Thu Jun 05 2003 Hardy Merrill 2.5.6-6 +- removed patch rsync-2.5.4-maxdel.patch +- removed patch rsync-2.4.6-segv.patch + - current 2.5.6 properly handles (no segfault) the situation + (rsync '[a]') that caused a need for this patch. +- added patch rsync-2.5.6-sign.patch, which is a working + subset of patches (that still apply) included in the original + rsync-2.5.4-moresignage.patch + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Tue Mar 11 2003 Hardy Merrill 2.5.6-4 +- rebuild in new build env + +* Tue Mar 11 2003 Hardy Merrill 2.5.6-3 +- fixed changelog comments + +* Mon Mar 10 2003 Hardy Merrill 2.5.6-2 +- rebuild in new build env + +* Mon Mar 10 2003 Hardy Merrill 2.5.6-1 +- update to 2.5.6 from upstream + +* Wed Jan 22 2003 Tim Powers +- rebuilt + +* Fri Jan 17 2003 Hardy Merrill 2.5.5-3 +- fix spelling mistake in rsync.xinetd. #66036 & dup #75006 + +* Wed Dec 11 2002 Tim Powers 2.5.5-2 +- rebuild on all arches + +* Mon Jun 24 2002 Bill Nottingham 2.5.5-1 +- update to 2.5.5 + +* Fri Jun 21 2002 Tim Powers +- automated rebuild + +* Thu May 23 2002 Tim Powers +- automated rebuild + +* Wed Apr 10 2002 Bill Nottingham 2.5.4-2 +- upstream patches: fix accidental use of --whole-file, fix + minor memory leak, and bad worst-case child kill behavior +- make passing -e to rsync:// URLs not cause an error exit (#62489) + +* Wed Mar 13 2002 Bill Nottingham 2.5.4-1 +- update to 2.5.4, do assorted patchmerging + +* Wed Feb 20 2002 Bill Nottingham +- fix --address (#60127) +- call setgroups before dropping privs () + +* Mon Jan 28 2002 Bill Nottingham +- fix some errors in the unsigned patch + +* Sun Jan 27 2002 Bill Nottingham +- rebuild to get proper LFS_CFLAGS + +* Wed Jan 23 2002 Bill Nottingham +- fix some signed/unsigned issues () +- tweak ipv6 patch (#55337, ) +- make xinetd file %%config(noreplace) + +* Fri Aug 17 2001 Bill Nottingham +- fix segfault on weird arguments (#51801) + +* Tue Jul 24 2001 Bill Nottingham +- IPv6 patch () (#47780) + +* Tue Jun 19 2001 Bill Nottingham +- add patch to fix hangs at end of sync, and other odd behaviors (#42111) + +* Sat Sep 30 2000 Florian La Roche +- add xinetd configuration + +* Tue Sep 26 2000 Bernhard Rosenkraenzer +- 2.4.6 + +* Mon Jul 31 2000 Bill Nottingham +- update to 2.4.4 - fixes yet another problem with rsh transport + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Sat Jun 10 2000 Bill Nottingham +- rebuild in new build env. + +* Mon Apr 10 2000 Bill Nottingham +- update to 2.4.3 + +* Tue Apr 4 2000 Bill Nottingham +- update to 2.4.2 + +* Tue Mar 7 2000 Bill Nottingham +- fix maxdelete behavior so it isn't sent to older servers. + +* Mon Jan 31 2000 Jeff Johnson +- update to 2.4.1. + +* Fri Dec 17 1999 Bill Nottingham +- update to 2.3.2 + +* Sat Jun 12 1999 Jeff Johnson +- add "max. delete" patch to limit damage when server is hosed. + +* Wed Apr 07 1999 Bill Nottingham +- update to 2.3.1. + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 2) + +* Tue Mar 16 1999 Jeff Johnson +- update to 2.3.0. + +* Sat Mar 13 1999 Jeff Johnson +- update to 2.3.0 beta. + +* Fri Dec 18 1998 Bill Nottingham +- update to 2.2.1 + +* Thu Sep 10 1998 Jeff Johnson +- updated to 2.1.1 + +* Mon Aug 17 1998 Erik Troan +- updated to 2.1.0 + +* Thu Aug 06 1998 Erik Troan +- buildrooted and attr-rophied +- removed tech-report.ps; the .tex should be good enough + +* Mon Aug 25 1997 John A. Martin +- Built 1.6.3-2 after finding no rsync-1.6.3-1.src.rpm although there + was an ftp://ftp.redhat.com/pub/contrib/alpha/rsync-1.6.3-1.alpha.rpm + showing no packager nor signature but giving + "Source RPM: rsync-1.6.3-1.src.rpm". +- Changes from 1.6.2-1 packaging: added '$RPM_OPT_FLAGS' to make, strip + to '%%build', removed '%%prefix'. + +* Thu Apr 10 1997 Michael De La Rue +- rsync-1.6.2-1 packaged. (This entry by jam to credit Michael for the + previous package(s).) diff --git a/rsyncd.conf b/rsyncd.conf new file mode 100644 index 0000000..6e058aa --- /dev/null +++ b/rsyncd.conf @@ -0,0 +1,20 @@ +# /etc/rsyncd: configuration file for rsync daemon mode + +# See rsyncd.conf man page for more options. + +# configuration example: + +# uid = nobody +# gid = nobody +# use chroot = yes +# max connections = 4 +# pid file = /var/run/rsyncd.pid +# exclude = lost+found/ +# transfer logging = yes +# timeout = 900 +# ignore nonreadable = yes +# dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 + +# [ftp] +# path = /home/ftp +# comment = ftp export area diff --git a/rsyncd.service b/rsyncd.service new file mode 100644 index 0000000..d2d6362 --- /dev/null +++ b/rsyncd.service @@ -0,0 +1,12 @@ +[Unit] +Description=fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf +Wants=network-online.target +After=network-online.target + +[Service] +EnvironmentFile=/etc/sysconfig/rsyncd +ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS" + +[Install] +WantedBy=multi-user.target diff --git a/rsyncd.socket b/rsyncd.socket new file mode 100644 index 0000000..7306ad0 --- /dev/null +++ b/rsyncd.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Rsync Server Socket +Conflicts=rsyncd.service + +[Socket] +ListenStream=873 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/rsyncd.sysconfig b/rsyncd.sysconfig new file mode 100644 index 0000000..90a5a43 --- /dev/null +++ b/rsyncd.sysconfig @@ -0,0 +1 @@ +OPTIONS="" diff --git a/rsyncd@.service b/rsyncd@.service new file mode 100644 index 0000000..89f9621 --- /dev/null +++ b/rsyncd@.service @@ -0,0 +1,8 @@ +[Unit] +Description=fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf + +[Service] +EnvironmentFile=/etc/sysconfig/rsyncd +ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS" +StandardInput=socket diff --git a/sources b/sources new file mode 100644 index 0000000..2f7757e --- /dev/null +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (rsync-3.2.3.tar.gz) = 48b68491f3ef644dbbbfcaec5ab90a1028593e02d50367ce161fd9d3d0bd0a3628bc57c5e5dec4be3a1d213f784f879b8a8fcdfd789ba0f99837cba16e1ae70e +SHA512 (rsync-patches-3.2.3.tar.gz) = cd2fb128021bfad0d3d1cb1f92e0f2d726498a14a3a1c6bdc6ffad6130db84a79d20a240ea8ac3942c19af5da2f1e54a89791c9952c805c2e7e491b1da82a9ec diff --git a/tests/definig-the-set-of-files-to-transfer/Makefile b/tests/definig-the-set-of-files-to-transfer/Makefile new file mode 100644 index 0000000..f5f86ce --- /dev/null +++ b/tests/definig-the-set-of-files-to-transfer/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of /CoreOS/rsync/Sanity/definig-the-set-of-files-to-transfer +# Description: Tests the options which modifie the list of files to be transfered +# Author: Michal Trunecka +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=/CoreOS/rsync/Sanity/definig-the-set-of-files-to-transfer +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE rsyncd@.service + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + test -x runtest.sh || chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Michal Trunecka " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: Tests the options which modifie the list of files to be transfered" >> $(METADATA) + @echo "Type: Sanity" >> $(METADATA) + @echo "TestTime: 60m" >> $(METADATA) + @echo "RunFor: rsync" >> $(METADATA) + @echo "Requires: rsync rsync-daemon" >> $(METADATA) + @echo "Requires: xinetd" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/definig-the-set-of-files-to-transfer/PURPOSE b/tests/definig-the-set-of-files-to-transfer/PURPOSE new file mode 100644 index 0000000..4d33fe4 --- /dev/null +++ b/tests/definig-the-set-of-files-to-transfer/PURPOSE @@ -0,0 +1,16 @@ +PURPOSE of /CoreOS/rsync/Sanity/definig-the-set-of-files-to-transfer +Description: Tests the options which modifie the list of files to be transfered +Author: Michal Trunecka +Author: Karel Srot + +Testing the sanity of following options: + -c --checksum + --ignore-existing + --max-size --min-size + --size-only + --include --exclude + --include-from --exclude-from + +Not yet implemented: + -0, --from0 + -f --filter, -F diff --git a/tests/definig-the-set-of-files-to-transfer/rsyncd@.service b/tests/definig-the-set-of-files-to-transfer/rsyncd@.service new file mode 100644 index 0000000..89f9621 --- /dev/null +++ b/tests/definig-the-set-of-files-to-transfer/rsyncd@.service @@ -0,0 +1,8 @@ +[Unit] +Description=fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf + +[Service] +EnvironmentFile=/etc/sysconfig/rsyncd +ExecStart=/usr/bin/rsync --daemon --no-detach "$OPTIONS" +StandardInput=socket diff --git a/tests/definig-the-set-of-files-to-transfer/runtest.sh b/tests/definig-the-set-of-files-to-transfer/runtest.sh new file mode 100755 index 0000000..d58f366 --- /dev/null +++ b/tests/definig-the-set-of-files-to-transfer/runtest.sh @@ -0,0 +1,361 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of /CoreOS/rsync/Sanity/definig-the-set-of-files-to-transfer +# Description: Tests the options which modifie the list of files to be transfered +# Author: Michal Trunecka +# Author: Karel Srot +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2013 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include Beaker environment +. /usr/bin/rhts-environment.sh || exit 1 +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +PACKAGE="rsync" + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + + rlFileBackup --clean /etc/rsyncd.conf + START_DATE_TIME=`date "+%m/%d/%Y %T"` + + REMOTE="/tmp/remote" + LOCAL="/tmp/local" + LOCAL_2="/root/another_local" + TMP_FILE=`mktemp` + TMP_FILE_2=`mktemp` + SERVER_LOG_FILE=`mktemp` + rlRun "chcon -t rsync_log_t $SERVER_LOG_FILE" + LOG_FILE=`mktemp` + rlRun "chcon -t rsync_log_t $LOG_FILE" + + rlRun "mkdir $REMOTE" + rlRun "chcon -t rsync_tmp_t $REMOTE" + rlRun "mkdir $LOCAL" + rlRun "chcon -t rsync_tmp_t $LOCAL" + + rlRun "dd if=/dev/zero of=${LOCAL}/bigfile bs=1000 count=20000" + rlRun "dd if=/dev/zero of=${LOCAL}/smallfile bs=1000 count=2" + rlRun "echo 'First file' > ${LOCAL}/first" + rlRun "echo 'Second file' > ${LOCAL}/second" + rlRun "echo 'Third file' > ${LOCAL}/third" + if ! rlIsRHEL 5 6; then + if ! ls /usr/lib/systemd/system/rsyncd@.service + then + WORKAROUNDED=true + rlFail "The /usr/lib/systemd/system/rsyncd@.service file is missing (bz#1082496), will be workarounded for now" + rlRun "cp rsyncd@.service /usr/lib/systemd/system/" + else + rlPass "The bz#1082496 is probably fixed, no workaround needed." + fi + fi + + rlRun "cat > /etc/rsyncd.conf < ${REMOTE}/first" + # set the same dates to both local and remote file + rlRun "touch -d \"$MODIF_DATE\" ${REMOTE}/first" + rlRun "touch -d \"$MODIF_DATE\" ${LOCAL}/first" + rlRun "rsync -av -i ${LOCAL}/first localhost::remote | grep first" 1 + rlRun "rsync -av -i -c ${LOCAL}/first localhost::remote | grep first" + + rlPhaseEnd + + rlPhaseStartTest "--ignore-existing" + +# --ignore-existing +# This tells rsync to skip updating files that already exist on the destina- +# tion (this does not ignore existing directories, or nothing would get done). +# See also --existing. +# +# This option is a transfer rule, not an exclude, so it doesn’t affect the +# data that goes into the file-lists, and thus it doesn’t affect deletions. +# It just limits the files that the receiver requests to be transferred. +# +# This option can be useful for those doing backups using the --link-dest +# option when they need to continue a backup run that got interrupted. Since +# a --link-dest run is copied into a new directory hierarchy (when it is used +# properly), using --ignore existing will ensure that the already-handled +# files don’t get tweaked (which avoids a change in permissions on the hard- +# linked files). This does mean that this option is only looking at the +# existing files in the destination hierarchy itself. + + rlRun "echo 'lorem ipsum' > ${REMOTE}/first" + rlRun "echo 'dolor sit amet' > ${REMOTE}/second" + rlRun "echo 'consectetur adipiscing elit' > ${REMOTE}/third" + rlRun "echo 'lorem ipsum' > ${REMOTE}/smallfile" + rlRun "echo 'dolor sit amet' > ${REMOTE}/bigfile" + + rlRun "rsync -avv -i -c --ignore-existing ${LOCAL}/ localhost::remote | egrep 'first|second|third|smallfile|bigfile'" 1 + rlRun "rsync -avv -i --size-only --ignore-existing ${LOCAL}/ localhost::remote | egrep 'first|second|third|smallfile|bigfile'" 1 + rlRun "rsync -avv -i -I --ignore-existing ${LOCAL}/ localhost::remote | egrep 'first|second|third|smallfile|bigfile'" 1 + rlRun "rsync -avv -i ${LOCAL}/ localhost::remote | egrep 'first|second|third|smallfile|bigfile'" + + rlRun "rm -rf ${REMOTE}/*" + + rlPhaseEnd + + rlPhaseStartTest "--max-size --min-size" + +# --max-size=SIZE +# This tells rsync to avoid transferring any file that is larger than the +# specified SIZE. The SIZE value can be suffixed with a string to indicate a +# size multiplier, and may be a fractional value (e.g. “--max-size=1.5m”). +# +# This option is a transfer rule, not an exclude, so it doesn’t affect the +# data that goes into the file-lists, and thus it doesn’t affect deletions. +# It just limits the files that the receiver requests to be transferred. +# +# The suffixes are as follows: “K” (or “KiB”) is a kibibyte (1024), “M” (or +# “MiB”) is a mebibyte (1024*1024), and “G” (or “GiB”) is a gibibyte +# (1024*1024*1024). If you want the multiplier to be 1000 instead of 1024, +# use “KB”, “MB”, or “GB”. (Note: lower-case is also accepted for all val- +# ues.) Finally, if the suffix ends in either “+1” or “-1”, the value will be +# offset by one byte in the indicated direction. +# +# Examples: --max-size=1.5mb-1 is 1499999 bytes, and --max-size=2g+1 is +# 2147483649 bytes. +# +# --min-size=SIZE +# This tells rsync to avoid transferring any file that is smaller than the +# specified SIZE, which can help in not transferring small, junk files. See +# the --max-size option for a description of SIZE and other information. + + for SIZE in 1K 1M 1KB 1MB; do + rlRun "dd if=/dev/zero of=${LOCAL}/testfile bs=1 count=${SIZE}" + rlRun "rsync -avh --max-size ${SIZE}-1 ${LOCAL}/testfile localhost::remote | grep testfile" 1 + rlRun "rsync -avh --min-size ${SIZE}+1 ${LOCAL}/testfile localhost::remote | grep testfile" 1 + rlRun "rsync -avh --max-size ${SIZE} ${LOCAL}/testfile localhost::remote | grep testfile" + rlRun "rm -f ${REMOTE}/testfile" + rlRun "rsync -avh --max-size ${SIZE} ${LOCAL}/testfile localhost::remote | grep testfile" + rlRun "rm -f ${REMOTE}/testfile" + done + + rlPhaseEnd + + rlPhaseStartTest "--size-only" + +# --size-only +# This modifies rsync’s “quick check” algorithm for finding files that need to +# be transferred, changing it from the default of transferring files with +# either a changed size or a changed last-modified time to just looking for +# files that have changed in size. This is useful when starting to use rsync +# after using another mirroring system which may not preserve timestamps +# exactly. + + rlRun "sleep 2" + # Modified content, but preserved the size of the destionation + rlRun "echo 'Xirst file' > ${REMOTE}/first" + + rlLog "The file would be transfered with only -a option" + rlRun "rsync -avv -n ${LOCAL}/ localhost::remote | grep first" + + rlLog "only the time be updated with --size-only option" + rlRun "rsync -avvv -i --size-only ${LOCAL}/ localhost::remote | grep '.f..t...... first'" + rlRun "grep 'Xirst' ${REMOTE}/first" + + rlLog "The file won't be tranferred with -a option because of the updated time" + rlRun "rsync -avv -i ${LOCAL}/ localhost::remote | grep first" 1 + + rlLog "..and finaly, the file will be transfered with -c option" + rlRun "rsync -avv -i -c ${LOCAL}/ localhost::remote" + rlRun "grep 'First' ${REMOTE}/first" + + rlPhaseEnd + + #rlPhaseStartTest "-f --filter, -F" + +# -f, --filter=RULE +# This option allows you to add rules to selectively exclude certain files +# from the list of files to be transferred. This is most useful in combination +# with a recursive transfer. +# +# You may use as many --filter options on the command line as you like to +# build up the list of files to exclude. If the filter contains whitespace, +# be sure to quote it so that the shell gives the rule to rsync as a single +# argument. The text below also mentions that you can use an underscore to +# replace the space that separates a rule from its arg. +# +# See the FILTER RULES section for detailed information on this option. +# +# -F The -F option is a shorthand for adding two --filter rules to your command. +# The first time it is used is a shorthand for this rule: +# +# --filter=’dir-merge /.rsync-filter’ +# +# This tells rsync to look for per-directory .rsync-filter files that have +# been sprinkled through the hierarchy and use their rules to filter the files +# in the transfer. If -F is repeated, it is a shorthand for this rule: +# +# --filter=’exclude .rsync-filter’ +# +# This filters out the .rsync-filter files themselves from the transfer. +# +# See the FILTER RULES section for detailed information on how these options +# work. + + #rlPhaseEnd + + rlPhaseStartTest "--include --exclude" + +# --include=PATTERN +# This option is a simplified form of the --filter option that defaults to an +# include rule and does not allow the full rule-parsing syntax of normal fil- +# ter rules. +# +# See the FILTER RULES section for detailed information on this option. +# + rlLogInfo "prepare test files" + rlRun "mkdir ${LOCAL}/include-test" + for F in "a.c" "a.log" "b.c" "b.log" "c.c" "c.log" "d.txt"; do + rlRun "echo $F$F$F > ${LOCAL}/include-test/$F" 0 "Creating ${LOCAL}/include-test/$F file" + done + + rlLogInfo "execute rsync command and verify results" + rlRun "rsync -avv -i --include='*.c' --include='b*' --exclude='*.log' ${LOCAL}/include-test localhost::remote" + # note: rsync checks each name to be transferred against the list of include/exclude patterns in turn, and the first matching pattern is acted on + for F in "a.c" "b.c" "c.c" "b.log" "d.txt"; do + rlAssertExists ${REMOTE}/include-test/$F + done + rlAssertNotExists ${REMOTE}/include-test/a.log + rlAssertNotExists ${REMOTE}/include-test/c.log + rlRun "rm -rf ${REMOTE}/include-test ${LOCAL}/include-test" + + rlPhaseEnd + + rlPhaseStartTest "--include-from --exclude-from" + + +# --include-from=FILE +# This option is related to the --include option, but it specifies a FILE that +# contains include patterns (one per line). Blank lines in the file and lines +# starting with ‘;’ or ‘#’ are ignored. If FILE is -, the list will be read +# from standard input. + + rlLogInfo "prepare test files" + rlRun "mkdir ${LOCAL}/include-from-test" + for F in "a.c" "a.log" "b.c" "b.log" "c.c" "c.log" "d.txt"; do + rlRun "echo $F$F$F > ${LOCAL}/include-from-test/$F" 0 "Creating ${LOCAL}/include-from-test/$F file" + done + rlRun "echo -e '*.c\nb*' > list-include" + rlRun "echo -e '*.log' > list-exclude" + + rlLogInfo "execute rsync command and verify results" + rlRun "rsync -avv -i --include-from=list-include --exclude-from=list-exclude ${LOCAL}/include-from-test localhost::remote" + # note: rsync checks each name to be transferred against the list of include/exclude patterns in turn, and the first matching pattern is acted on + for F in "a.c" "b.c" "c.c" "b.log" "d.txt"; do + rlAssertExists ${REMOTE}/include-from-test/$F + done + rlAssertNotExists ${REMOTE}/include-from-test/a.log + rlAssertNotExists ${REMOTE}/include-from-test/c.log + rlRun "rm -rf ${REMOTE}/include-from-test ${LOCAL}/include-from-test list-include list-exclude" + + rlPhaseEnd + + #rlPhaseStartTest "-0, --from0" +# +# -0, --from0 +# This tells rsync that the rules/filenames it reads from a file are termi- +# nated by a null (’\0’) character, not a NL, CR, or CR+LF. This affects +# --exclude-from, --include-from, --files-from, and any merged files specified +# in a --filter rule. It does not affect --cvs-exclude (since all names read +# from a .cvsignore file are split on whitespace). +# +# If the --iconv and --protect-args options are specified and the --files-from +# filenames are being sent from one host to another, the filenames will be +# translated from the sending host’s charset to the receiving host’s charset. + + #rlPhaseEnd + + rlPhaseStartCleanup + rlRun "rm -rf $REMOTE" + rlRun "rm -rf $LOCAL" + rlRun "rm -rf $SERVER_LOG_FILE" + rlRun "rm -rf $LOG_FILE" + rlFileRestore + if rlIsRHEL 5 6; then + rlRun "chkconfig rsync off" + rlServiceRestore xinetd + else + rlRun "systemctl stop rsyncd.socket" + rlServiceRestore rsyncd + $STOPPED || rlRun "systemctl start rsyncd.socket" + fi + if [ -n "$WORKAROUNDED" ]; then + rlLog "Cleanup of the workaround for bz#1082496" + rlRun "rm -rf /usr/lib/systemd/system/rsyncd@.service" + fi + sleep 2 + rlRun "ausearch -m AVC -m SELINUX_ERR -ts ${START_DATE_TIME} > ${TMP_FILE}" 0,1 + LINE_COUNT=`wc -l < ${TMP_FILE}` + rlRun "cat ${TMP_FILE}" + rlAssert0 "number of lines in ${TMP_FILE} should be 0" ${LINE_COUNT} + + rlPhaseEnd + +rlJournalPrintText +rlJournalEnd diff --git a/tests/setting-group-acls/Makefile b/tests/setting-group-acls/Makefile new file mode 100644 index 0000000..8249c90 --- /dev/null +++ b/tests/setting-group-acls/Makefile @@ -0,0 +1,64 @@ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Makefile of setting-group-acls +# Description: If you are using the -A/--acls option and you are not running as root and are not using the --numeric-ids option then if you have an ACL that includes a group entry for a group you are not a member of on the receiving side, then acl_set_file will return EINVAL, b/c rsync mistakenly maps the group name to gid GID_NONE (-1), which (fortunately) fails. +# Author: Ales Marecek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +export TEST=setting-group-acls +export TESTVERSION=1.0 + +BUILT_FILES= + +FILES=$(METADATA) runtest.sh Makefile PURPOSE + +.PHONY: all install download clean + +run: $(FILES) build + ./runtest.sh + +build: $(BUILT_FILES) + chmod a+x runtest.sh + +clean: + rm -f *~ $(BUILT_FILES) + + +include /usr/share/rhts/lib/rhts-make.include + +$(METADATA): Makefile + @echo "Owner: Ales Marecek " > $(METADATA) + @echo "Name: $(TEST)" >> $(METADATA) + @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) + @echo "Path: $(TEST_DIR)" >> $(METADATA) + @echo "Description: If you are using the -A/--acls option and you are not running as root and are not using the --numeric-ids option then if you have an ACL that includes a group entry for a group you are not a member of on the receiving side, then acl_set_file will return EINVAL, b/c rsync mistakenly maps the group name to gid GID_NONE (-1), which (fortunately) fails." >> $(METADATA) + @echo "Type: Regression" >> $(METADATA) + @echo "TestTime: 5m" >> $(METADATA) + @echo "RunFor: rsync" >> $(METADATA) + @echo "Requires: rsync" >> $(METADATA) + @echo "Requires: acl" >> $(METADATA) + @echo "Priority: Normal" >> $(METADATA) + @echo "License: GPLv2" >> $(METADATA) + @echo "Confidential: no" >> $(METADATA) + @echo "Destructive: no" >> $(METADATA) + + rhts-lint $(METADATA) diff --git a/tests/setting-group-acls/PURPOSE b/tests/setting-group-acls/PURPOSE new file mode 100644 index 0000000..b8aa3d6 --- /dev/null +++ b/tests/setting-group-acls/PURPOSE @@ -0,0 +1,3 @@ +PURPOSE of setting-group-acls +Description: If you are using the -A/--acls option and you are not running as root and are not using the --numeric-ids option then if you have an ACL that includes a group entry for a group you are not a member of on the receiving side, then acl_set_file will return EINVAL, b/c rsync mistakenly maps the group name to gid GID_NONE (-1), which (fortunately) fails. +Author: Ales Marecek diff --git a/tests/setting-group-acls/runtest.sh b/tests/setting-group-acls/runtest.sh new file mode 100644 index 0000000..5b18c8c --- /dev/null +++ b/tests/setting-group-acls/runtest.sh @@ -0,0 +1,71 @@ +#!/bin/bash +# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# runtest.sh of setting-group-acls +# Description: If you are using the -A/--acls option and you are not running as root and are not using the --numeric-ids option then if you have an ACL that includes a group entry for a group you are not a member of on the receiving side, then acl_set_file will return EINVAL, b/c rsync mistakenly maps the group name to gid GID_NONE (-1), which (fortunately) fails. +# Author: Ales Marecek +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +# Copyright (c) 2011 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing +# to use, modify, copy, or redistribute it subject to the terms +# and conditions of the GNU General Public License version 2. +# +# This program is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Include rhts environment +. /usr/bin/rhts-environment.sh +. /usr/share/beakerlib/beakerlib.sh + +PACKAGE="rsync" +_TEST_USER="rsynctestuser" +_TEST_USER_PASSWORD="redhat" +_TEST_USER_HOME_DIR="/home/${_TEST_USER}" +_TEST_USER_SRC_TEST_DIR="${_TEST_USER_HOME_DIR}/src_rsync" +_TEST_USER_DST_TEST_DIR="${_TEST_USER_HOME_DIR}/dst_rsync" +_TEST_RAND_FILENAME="random.data" +_TEST_TEXT_FILENAME="hello_world.txt" +_TEST_RAND_FILE="${_TEST_USER_SRC_TEST_DIR}/${_TEST_RAND_FILENAME}" +_TEST_TEXT_FILE="${_TEST_USER_SRC_TEST_DIR}/${_TEST_TEXT_FILENAME}" +_TEST_RAND_FILE_SIZE=10 + +rlJournalStart + rlPhaseStartSetup + rlAssertRpm $PACKAGE + id ${_TEST_USER} >/dev/null 2>&1 || rlRun "useradd -d ${_TEST_USER_HOME_DIR} -m ${_TEST_USER}" 0 "Creating a test user" + rlRun "echo \"${_TEST_USER_PASSWORD}\" | passwd --stdin ${_TEST_USER} >/dev/null 2>&1" 0 "Setting user's password" + rlRun "su - ${_TEST_USER} -c \"mkdir -p ${_TEST_USER_SRC_TEST_DIR} ${_TEST_USER_DST_TEST_DIR}\"" 0 "Creating directories for test data" + rlRun "su ${_TEST_USER} -c \"dd if=/dev/urandom of=${_TEST_RAND_FILE} bs=1M count=${_TEST_RAND_FILE_SIZE}\"" 0 "Generating random data file" + rlRun "su ${_TEST_USER} -c \"echo 'Hello world' >${_TEST_TEXT_FILE}\"" 0 "Generating text data file" + rlRun "setfacl -m g:root:--- ${_TEST_RAND_FILE}" 0 "Setting ACL for random data file" + rlRun "setfacl -m g:root:--- ${_TEST_TEXT_FILE}" 0 "Setting ACL for text data file" + rlPhaseEnd + + rlPhaseStartTest + rlRun "su - ${_TEST_USER} -c \"rsync -A ${_TEST_RAND_FILE} ${_TEST_USER_DST_TEST_DIR}\"" 0 "Syncing random data file" + rlRun "su - ${_TEST_USER} -c \"rsync -A ${_TEST_TEXT_FILE} ${_TEST_USER_DST_TEST_DIR}\"" 0 "Syncing text data file" + getfacl ${_TEST_USER_DST_TEST_DIR}/${_TEST_RAND_FILENAME} + rlRun "getfacl ${_TEST_USER_DST_TEST_DIR}/${_TEST_RAND_FILENAME} | grep 'group:root:---'" 0 "Verify that ACL was properly set" + getfacl ${_TEST_USER_DST_TEST_DIR}/${_TEST_TEXT_FILENAME} + rlRun "getfacl ${_TEST_USER_DST_TEST_DIR}/${_TEST_TEXT_FILENAME} | grep 'group:root:---'" 0 "Verify that ACL was properly set" + rlPhaseEnd + + rlPhaseStartCleanup + rlRun "userdel -r ${_TEST_USER}" 0 "Deleting test user" + rlPhaseEnd +rlJournalPrintText +rlJournalEnd + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..99d5462 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,23 @@ +--- +# Tests that run in classic context +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + tests: + - definig-the-set-of-files-to-transfer + - setting-group-acls + required_packages: + - rsync # all tests require rsync + - rsync-daemon # definig-the-set-of-files-to-transfer requires rsync-daemon + - acl # setting-group-acls requires acl + +# Tests that run against Atomic Host +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - atomic + tests: + - setting-group-acls