--- rsync-3.1.0.orig/debian/README.source +++ rsync-3.1.0/debian/README.source @@ -0,0 +1,4 @@ +The debian/ subdirectory contains everything that's needed to patch the +sources and build the binary package. The rules file applies the patches +in the debian/patches/ subdirectory to a copy of the sources in +debian/buildtree/ before compiling it there. --- rsync-3.1.0.orig/debian/changelog +++ rsync-3.1.0/debian/changelog @@ -0,0 +1,1196 @@ +rsync (3.1.0-2ubuntu0.4+esm2) trusty-security; urgency=medium + + * SECURITY REGRESSION: flag collision (LP: #2095004) + - d/p/z-fix_flag_got_dir_flist_collision.diff: change the flag bit to 13 + + -- Sudhakar Verma Thu, 16 Jan 2025 17:10:59 +0530 + +rsync (3.1.0-2ubuntu0.4+esm1) trusty-security; urgency=medium + + * SECURITY UPDATE: safe links bypass vulnerability + - d/p/z-CVE-2024-12088-0001-make-safe-links-stricter.diff: reject + links where a "../" component is included in the destination + - CVE-2024-12088 + * SECURITY UPDATE: arbitrary file write via symbolic links + - d/p/z-CVE-2024-12087-0001-Refuse-a-duplicate-dirlist.diff: refuse + malicious duplicate flist for dir + - d/p/z-CVE-2024-12087-0002-range-check-dir_ndx-before-use.diff: refuse + invalid dir_ndx + - CVE-2024-12087 + * SECURITY UPDATE: arbitrary client file leak + - d/p/z-CVE-2024-12086-0001-refuse-fuzzy-options-when-fuzzy-not-selected.diff: + refuse fuzzy options when not selected + - d/p/z-CVE-2024-12086-0002-added-secure_relative_open.diff: safe + implementation to open a file relative to a base directory + - d/p/z-CVE-2024-12086-0003-receiver-use-secure_relative_open-for-basis-file.diff: + ensure secure file access for basis file + - d/p/z-CVE-2024-12086-0004-disallow-.-elements-in-relpath-for-secure_relative_o.diff: + disallow "../" in relative path + - CVE-2024-12086 + * SECURITY UPDATE: information leak via uninitialized stack contents + - d/p/z-CVE-2024-12085-0001-prevent-information-leak-off-the-stack.diff: + prevent information leak by zeroing + - CVE-2024-12085 + * SECURITY UPDATE: symlink race condition + - d/p/z-CVE-2024-12747-0001-fixed-symlink-race-condition-in-sender.diff: + do_open_checklinks to prevent symlink race + - CVE-2024-12747 + + -- Sudhakar Verma Tue, 14 Jan 2025 20:31:16 +0530 + +rsync (3.1.0-2ubuntu0.4) trusty-security; urgency=medium + + * SECURITY UPDATE: receive_xattr function does not check + for '\0' character allowing denial of service attacks + - debian/patches/CVE-2017-16548.patch: enforce trailing + \0 when receiving xattr values in xattrs.c. + - CVE-2017-16548 + * SECURITY UPDATE: Allows remote attacker to bypass argument + - debian/patches/CVE-2018-5764.patch: Ignore --protect-args + when already sent by client in options.c. + - CVE-2018-5764 + + -- Leonidas S. Barbosa Thu, 18 Jan 2018 17:00:13 -0300 + +rsync (3.1.0-2ubuntu0.3) trusty-security; urgency=medium + + * SECURITY UPDATE: bypass intended access restrictions + - debian/patches/CVE-2017-17433.patch: check fname in + recv_files sooner in receiver.c. + - CVE-2017-17433 + * SECURITY UPDATE: not check for fnamecmp filenames and + does not apply sanitize_paths + - debian/patches/CVE-2017-17434-part1.patch: check daemon + filter against fnamecmp in receiver.c. + - debian/patches/CVE-2017-17434-part2.patch: sanitize xname + in rsync.c. + - CVE-2017-17434 + + -- Leonidas S. Barbosa Wed, 06 Dec 2017 11:36:31 -0300 + +rsync (3.1.0-2ubuntu0.2) trusty-security; urgency=medium + + * SECURITY UPDATE: rsync path spoofing attack + - debian/patches/CVE-2014-9512-0.patch: reject invalid filenames in + filelist in flist.c, rsync.h, util.c. + - debian/patches/CVE-2014-9512-1.patch: complain if an inc-recursive + path is not right for its dir in flist.c, io.c, main.c, rsync.c. + - debian/patches/CVE-2014-9512-2.patch: add parent-dir validation for + --no-inc-recurse too in flist.c, generator.c. + - CVE-2014-9512 + + -- Marc Deslauriers Tue, 19 Jan 2016 15:27:53 -0500 + +rsync (3.1.0-2ubuntu0.1) trusty-security; urgency=medium + + * SECURITY UPDATE: denial of service via invalid username (LP: #1307230) + - debian/patches/CVE-2014-2855.diff: avoid infinite wait reading + secrets file in authenticate.c. + - CVE-2014-2855 + + -- Marc Deslauriers Thu, 17 Apr 2014 12:56:34 -0400 + +rsync (3.1.0-2) unstable; urgency=low + + * fix build failure if zlib1g-dev package is not installed; + solved by building without the included zlib source and adding a + build-depends on zlib1g-dev >= 1:1.2.8 + closes:32379 + + -- Paul Slootman Sun, 27 Oct 2013 12:01:10 +0100 + +rsync (3.1.0-1) unstable; urgency=low + + * new upstream release. + * Bumped Standards-Version to 3.9.4.0 (no change necessary). + * Patches cast--1-size_t.diff, delete-delay.diff, manpages.GPL.diff, + partial-timestamp.diff, progress-cursor-pos.diff, rsyncd.conf.5.comment.diff + no longer needed (integrated into upstream source). + + -- Paul Slootman Mon, 30 Sep 2013 17:19:55 +0200 + +rsync (3.0.9-4) unstable; urgency=low + + * mark rsync package as Multi-Arch: foreign. + closes:#688940 + * fixed cross-builds, thanks to patches from Colin Watson. + closes:#693991 + * Fixed some lintian messages: + - call strip with --remove-section=.comment --remove-section=.note + - added watch file + - change conflicts with duplicity << 0.6.11 to breaks + See changelog for 3.0.9-1 for more detail + - properly state "GNU General Public License" in the manpages + * Added some overrides for lintian: + - init.d-script-does-not-provide-itself + (historically the daemon is referred to as rsyncd) + - spelling-error-in-binary usr/bin/rsync dont don't + "dont compress" is a config option. Adding an apostrophe would + make things quite complicated! + + -- Paul Slootman Sun, 02 Dec 2012 16:02:36 +0100 + +rsync (3.0.9-3) unstable; urgency=low + + * enabled hardening build flags. + closes:#652248 + * set mtime of partially transferred file to 0 (1 Jan 1970) to solve problem + of file being skipped when rerun with --partial --update + closes:#624826 + + -- Paul Slootman Mon, 18 Jun 2012 13:48:46 +0200 + +rsync (3.0.9-2) unstable; urgency=low + + * Enhance comment about pid file line in sample rsyncd.conf. + closes:#547922 + + -- Paul Slootman Thu, 03 Nov 2011 18:39:30 +0100 + +rsync (3.0.9-1) unstable; urgency=low + + * new upstream release. + * Bumped Standards-Version to 3.9.2.0 (no change necessary). + * manpage no longer shows erroneous default for --delete-before. + (upstream fix) + closes:#640869,#587567 + * manpage now mentions that --files-from sorts the filenames. + (upstream fix) + closes:#536755 + * init.d script checks nice value correctly now. + closes:#586707 + * fixed typo in comment in sample script rrsync. + closes:#635603 + * Updated package description and included homepage line. + closes:#614098 + * Correct error message when using --delete-delay when dying in certain cases. + See also #587567 + closes:#586551 + * included rsync.service file for systemd, supplied by Michael Stapelberg. + closes:#639632 + * conflict with duplicity < 0.6.11 as that tries to use rsync:// in + combination with ::module syntax, which is not allowed (but used to be + accepted in older rsync versions). + closes:#605731 + + -- Paul Slootman Tue, 04 Oct 2011 18:54:56 +0200 + +rsync (3.0.9~pre2-2) experimental; urgency=low + + * updated lintian override. This is a modified version optimized for the + rsync protocol. I.e. the standard zlib version will not work as well. + * included rsync.service file supplied by Michael Stapelberg, + see bug#639632 + + -- Paul Slootman Tue, 13 Sep 2011 15:52:42 +0200 + +rsync (3.0.9~pre2-1) experimental; urgency=low + + * new upstream prerelease. + + -- Paul Slootman Tue, 13 Sep 2011 15:03:03 +0200 + +rsync (3.0.8-1) unstable; urgency=low + + * new upstream release. + * Bumped Standards-Version to 3.9.1.0 (no change necessary). + + -- Paul Slootman Thu, 14 Apr 2011 15:10:52 +0200 + +rsync (3.0.7-2) unstable; urgency=low + + * Remove symlink for stop script in rc1.d/ as S01killprocs should take care + of this. Lintian override also no longer necessary. + closes:#563864 + * init script doesn't exit with fail if /etc/rsyncd.conf doesn't exist. + closes:#515769 + * Bumped Standards-Version to 3.8.4 (no chenge necessary). + + -- Paul Slootman Wed, 17 Feb 2010 17:38:22 +0100 + +rsync (3.0.7-1) unstable; urgency=low + + * new upstream release. + * Use $DAEMON consistently in the init.d script. Also use RSYNC_PID_FILE and + RSYNC_DEFAULTS_FILE while we're at it. + closes:#558771 + * Remove stop links, they serve no useful purpose. Also start it a bit later + so that startup seems faster. (However, dependency-based boot sequencing + may interfere with this.) Lintian override was necessary for omitting the + stop scripts in 0 and 6. + closes:#534577 + * Add support for running rsync under ionice, via an entry in + /etc/default/rsync . + closes:#553458 + * The --delete option displays a better message now when used without -d. + closes:#544719 + + -- Paul Slootman Tue, 05 Jan 2010 12:50:44 +0100 + +rsync (3.0.6-1) unstable; urgency=low + + * new upstream release. + * Manpage now states that MD5 is used for protocol version 30 and higher. + closes:#520330 + * Updated to standards version 3.8.2. Added debian/README.source . + * Added lintian override for embedded-zlib, as this is a modified version + optimized for the rsync protocol. I.e. the standard zlib version will not + work as well. + * Added a 'status' option to the init.d script. + closes:#492138 + * Manpage now declares --delete-during to be the default in the summary. + closes:#472767,#476368 + + -- Paul Slootman Wed, 17 Jun 2009 13:43:12 +0200 + +rsync (3.0.5-1) unstable; urgency=low + + * new upstream release. + * From the upstream NEWS file: + Fixed a bug when using --sparse on a sparse file that has over 2GB of + consecutive sparse data. + closes:#512635 + + -- Paul Slootman Thu, 22 Jan 2009 15:05:27 +0100 + +rsync (3.0.4-3) unstable; urgency=low + + * When transferring files from an older rsync daemon without any options, + the daemon complained about "unknown option: -". Fixed that with a + patch from Matt McCutchen. + closes:#493559 + * Sometimes rsync crashed with a segfault when transferring files with -X + (preserve extended attributes). Fixed that with a patch from upstream + (Wayne Davison). + closes:#498083 + + -- Paul Slootman Wed, 24 Sep 2008 11:35:15 +0200 + +rsync (3.0.4-2) unstable; urgency=low + + * The log format '%P' patch accidentally reverted an ability to transform a + relative module path into an absolute one when chroot was not enabled. + + -- Paul Slootman Fri, 12 Sep 2008 11:00:20 +0200 + +rsync (3.0.4-1) unstable; urgency=low + + * new upstream release. + * Fix log format '%P' when a module is chrooted. + closes:#493539 + * Add a comment to the rsyncd.conf manpage that a hash sign (for comments) + can only be used at the beginning of a line. + closes:#498332 + + -- Paul Slootman Thu, 11 Sep 2008 11:57:46 +0200 + +rsync (3.0.3-2) unstable; urgency=low + + * Included some patches from the upcoming 3.0.4 release, which I consider + important enough to include now. See debian/patches/README for the + details. + * Ensure that the build bails out if patching fails. + * Added md5sums for this package. + closes:#484343 + * Updated to standards version 3.7.3. No changes necessary. + + -- Paul Slootman Fri, 25 Jul 2008 10:43:00 +0200 + +rsync (3.0.3-1) unstable; urgency=low + + * New upstream release + + -- Paul Slootman Wed, 02 Jul 2008 11:07:22 +0200 + +rsync (3.0.2-2) unstable; urgency=low + + * Fixed a crash if a non-incremental-recursion transfer has a skipped file + in a set of hard-links. + closes:#477931 + + -- Paul Slootman Mon, 28 Apr 2008 13:06:35 +0200 + +rsync (3.0.2-1) unstable; urgency=high + + * new upstream release + * fixes security problem: potential buffer overflow in the + extended attribute support. For more info, see + http://rsync.samba.org/security.html + + -- Paul Slootman Tue, 08 Apr 2008 19:34:22 +0200 + +rsync (3.0.1-1) unstable; urgency=low + + * new upstream release + * call ssh with -6 option if rsync was called with -6 option, + and ditto for -4 option. + Upstream considers the -4 and -6 options for use only when talking to a + daemon, hence this change will remain a Debian-only feature. + closes:367319 + + -- Paul Slootman Fri, 04 Apr 2008 12:36:56 +0200 + +rsync (3.0.1~pre3-1) experimental; urgency=low + + * prerelease version + + -- Paul Slootman Mon, 31 Mar 2008 15:29:51 +0200 + +rsync (3.0.0-3) unstable; urgency=low + + * unreleased + * call ssh with -6 option if rsync was called with -6 option, + and ditto for -4 option. + closes:367319 + + -- Paul Slootman Tue, 04 Mar 2008 18:51:47 +0100 + +rsync (3.0.0-2) unstable; urgency=low + + * patch from upstream to fix crash in single-use daemon mode. + see #469172, although this only fixes the secondary part of that report. + + -- Paul Slootman Tue, 04 Mar 2008 12:34:03 +0100 + +rsync (3.0.0-1) unstable; urgency=low + + * new upstream release + * manpage typo fixed upstream. + closes:#414636 + * fixed LSB header in init.d script. + closes:#458442 + * the progress display will not show negative values, if the file changes + (becomes shorter) during the transfer. + closes:#415648 + * manpage now correctly show the short form of copy-dirlinks as -k, not -K + closes:#418923 + * invalid free() pointer doesn't occur anymore. + closes:#451558 + * rsync will now write in log when --exclude-from is stdin. + closes:#466950 + * check for rsyncd.conf in init.d script when starting or restarting. + closes:#412448 + * include scripts from upstream support directory in + /usr/share/doc/rsync/scripts/ + closes:#458200 + * include example logrotate config file in /usr/share/doc/rsync/examples/ + closes:#416316 + * filename conversion is now possible with the --iconv option. Noe exactly + what was asked, but close enough IMHO to close:#320223 + + -- Paul Slootman Sun, 02 Mar 2008 13:45:09 +0100 + +rsync (3.0.0~pre10-1) experimental; urgency=low + + * OK, one more prerelease version + * fixed LSB header in init.d script. + closes:#458442 + * manpage typo fixed. + closes:#414636 + + -- Paul Slootman Wed, 20 Feb 2008 11:20:47 +0100 + +rsync (3.0.0~pre9-1) experimental; urgency=low + + * prerelease version 9 of 3.0.0, hopefully the last before official 3.0.0 + * Updated fsf.org link to GPL-3 text in copyright file. + + -- Paul Slootman Mon, 11 Feb 2008 11:35:13 +0100 + +rsync (3.0.0~pre8-2) experimental; urgency=low + + * fix hardlinking 64-bit inodes + + -- Paul Slootman Mon, 04 Feb 2008 16:25:54 +0100 + +rsync (3.0.0~pre8-1) experimental; urgency=low + + * prerelease version 8 of 3.0.0 + + -- Paul Slootman Sun, 13 Jan 2008 13:37:17 +0100 + +rsync (3.0.0~pre7-1) experimental; urgency=low + + * prerelease version 7 of 3.0.0 + * includes fix for the recent CVE-2007-6199, CVE-2007-6200 vulnerabilities + * modified the way supplemental patches from debian/patches/ are applied + (accept both .patch and .diff extensions) + + -- Paul Slootman Thu, 20 Dec 2007 12:53:35 +0100 + +rsync (3.0.0~pre6-1) experimental; urgency=low + + * prerelease version 6 of 3.0.0 + + -- Paul Slootman Wed, 28 Nov 2007 12:54:15 +0100 + +rsync (3.0.0~pre5-1) experimental; urgency=low + + * prerelease version 5 of 3.0.0 + + -- Paul Slootman Mon, 12 Nov 2007 12:30:38 +0100 + +rsync (3.0.0~pre4-1) experimental; urgency=low + + * prerelease version 4 of 3.0.0 + + -- Paul Slootman Thu, 08 Nov 2007 19:32:18 +0100 + +rsync (3.0.0~pre1-1) experimental; urgency=low + + * prerelease version 1 of 3.0.0 + + -- Paul Slootman Fri, 05 Oct 2007 11:06:31 +0200 + +rsync (2.6.9-5) unstable; urgency=high + + * fix two off-by-one errors leading to potential buffer overflow which may + corrupt the stack (CVE-2007-4091) + closes:#438125 + + -- Paul Slootman Wed, 15 Aug 2007 21:24:47 +0200 + +rsync (2.6.9-4) unstable; urgency=low + + * Check for empty filename (buggy kernel may have that in /sys) + * include README.Debian in the package... + * init.d script checks whether rsync stays running, or whether it was + running during a restart. + closes:#412448 + * fixed typos in manpage + closes:414636 + + -- Paul Slootman Thu, 26 Jul 2007 19:03:54 +0200 + +rsync (2.6.9-3) unstable; urgency=low + + * Add patch from upstream to fix error when using -vv together with --stats. + closes:#402381 + * treat errno == ENOSYS the same as errno == ENOTSUP on hppa as far as ACL + support is concerned. + closes:#401189 + + -- Paul Slootman Tue, 12 Dec 2006 14:39:43 +0100 + +rsync (2.6.9-2) unstable; urgency=low + + * Applied patch from upstream to fix problem + with --acl together with --delete + (see http://lists.samba.org/archiv:ee/rsync/2006-November/016706.html) + * Couple of adjustments to manpage formatting. + + -- Paul Slootman Mon, 20 Nov 2006 15:43:12 +0100 + +rsync (2.6.9-1) unstable; urgency=low + + * New upstream release. + * (from experimental version 2.6.9~pre3-1) + Applied a mix of the patches from Martin Pitt and David Härdeman for + LSBfying init script. + closes:#375985,#385877 + * Upstream now includes the patch for replacing a dir with a symlink when + using --delete-after. + closes:#350522 + * Now includes the ACL patch. + + -- Paul Slootman Tue, 7 Nov 2006 12:32:20 +0100 + +rsync (2.6.9~pre3-1) experimental; urgency=low + + * 2.6.9-pre3 + * Applied a mix of the patches from Martin Pitt and David Härdeman for + LSBfying init script. + closes:#375985,#385877 + * Updated policy version from 3.6.2 to 3.7.2; no changes needed + * Applied ACL patch. Please test :-) + + -- Paul Slootman Fri, 27 Oct 2006 12:27:45 +0200 + +rsync (2.6.9~pre1-1) experimental; urgency=low + + * 1st prerelease of rsync-2.6.9 + + -- Paul Slootman Sat, 14 Oct 2006 18:48:27 +0200 + +rsync (2.6.8-2) unstable; urgency=low + + * Ignore empty value for RSYNC_NICE. + closes:#365261 + + -- Paul Slootman Sat, 29 Apr 2006 13:07:43 +0200 + +rsync (2.6.8-1) unstable; urgency=low + + * new upstream version + * Updated standards version to 3.6.2 (no changes necessary). + * (from experimental version 2.6.7-2.6.8pre1): + Split ssh suggestion into openssh-server and openssh-client. + Also added blurb about supplying daemon functionality in the description. + closes:#356994 + * (from experimental version 2.6.7-2.6.8pre1): + Added support for running rsyncd at a nice value via the defaults file. + closes:#354306 + + -- Paul Slootman Mon, 24 Apr 2006 12:26:19 +0200 + +rsync (2.6.7-2.6.8pre1) experimental; urgency=low + + * new upstream version (prerelease 2.6.8pre1). + * Split ssh suggestion into openssh-server and openssh-client + as suggested in #356994 (not closing yet). Also added blurb + about supplying daemon functionality in the description. + * Added support for running rsyncd at a nice value via the defaults file, + as suggested in #354306 (not closing yet). + + -- Paul Slootman Thu, 13 Apr 2006 10:51:39 +0200 + +rsync (2.6.7-1) unstable; urgency=low + + * new upstream version. + closes:#357314 + * Includes a patch for an exclude bug when dealing with --relative + while copying an absolute path. This bug will lead to 2.6.8 being released + within the next couple of weeks, but this way 2.6.7 can get some Debian + exposure before then. + * Removed mention of ssh being a suitable replacement for rsh. + closes:#324200 + * Fixed "!" in ~/.cvsignore. + closes:#314473 + + -- Paul Slootman Fri, 17 Mar 2006 11:39:22 +0100 + +rsync (2.6.6-1) unstable; urgency=low + + * new upstream version. + bug-fix release to handle a null-pointer bug that turned up in rsync's + version of zlib 1.1.4 (this is not the recent zlib 1.2.2 security fix, + which did not affect rsync) and to squash a few other minor bugs. To deal + with the zlib issue, rsync has been upgraded to include zlib 1.2.3. + * Now use the --min-size patch as included by upstream, instead of the + (minimally different) Debian patch. + * Fixed some minor typos in the manpage. + closes:#309100 + * Clarified text about pidfile in sample rsyncd.conf. + closes:#319335 + + -- Paul Slootman Fri, 29 Jul 2005 10:47:04 +0200 + +rsync (2.6.5-1) unstable; urgency=low + + * new upstream version. + Contains the patches previously applied in 2.6.4-3 from CVS. + * Now should handle locale-specific characters better in logging output + (i.e. the correct chars should be displayed, not '?'). + + -- Paul Slootman Fri, 3 Jun 2005 19:17:28 +0200 + +rsync (2.6.4-6) unstable; urgency=high + + * Fixed grave bug: + replaced the Debian-specific patch to log.c with the upstream CVS version, + as upstream changes conflict with the Debian patch, causing syslog logging + (the default!) to fail, meaning that for most people the rsync as daemon + doesn't work. + This includes people using systemimager-server, as that generates the + rsyncd.conf on the fly without a log file line, hence the rsync bug + causes a total failure of that package. + closes:#307923,#308428 + * fixed the rsync.1 manpage, where cut&paste from a diff was not done + correctly (the leading '+'s were still there). + + -- Paul Slootman Tue, 10 May 2005 21:44:29 +0200 + +rsync (2.6.4-5) unstable; urgency=high + + * Fixed not backupping deleted files when --backup is used in combination + with --delete-after (this was considered a critical bug). + closes:#306981 + * Removed spurious log.c.DEBIAN file from source (diff, actually). + * Removed old rsyncstats script from diff. + * Install rsyncstats script to /usr/sbin/. + * Fixed some typos in the man page. + closes:#305627 + * Implemented a --min-size option. + closes#:27126 + + -- Paul Slootman Wed, 27 Apr 2005 10:54:43 +0200 + +rsync (2.6.4-4) unstable; urgency=low + + * Fix from upstream for incompatibility with older rsync versions when using + --exclude (and not --delete). + closes:#306368 + + -- Paul Slootman Tue, 26 Apr 2005 17:39:55 +0200 + +rsync (2.6.4-3) unstable; urgency=low + + * Added comment to /etc/default/rsync that the rsyncd.conf specified there + is not used when accessing the daemon via a remote shell. + closes:#298002 + * Correctly report whether what we're not creating is a file or a directory. + closes:#142258 + * Concat the upstream NEWS & OLDNEWS together as changelog instead of as-is. + closes:#306250 + * assorted recommended patches from upstream, collected in debian/patches/ + in the source package: + - fix for sending a single file with -H + - improper handling of --one-file-system in some cases + - --link-dest / --hard-links problem + - new hard-links in not-yet-created directories + + -- Paul Slootman Tue, 26 Apr 2005 17:05:55 +0200 + +rsync (2.6.4-2) unstable; urgency=low + + (voor 2.6.5 close 266373) + * Fixed problem with rsyncd when use chroot = no and module path = / + closes:#303900 + * Added comment to example rsyncd.conf to make it clear that read only is + the default. + closes:#290905,#290882 + + -- Paul Slootman Sun, 10 Apr 2005 14:06:28 +0200 + +rsync (2.6.4-1) unstable; urgency=low + + * New upstream version. + * --bwlimit-mod is now removed. + + -- Paul Slootman Mon, 4 Apr 2005 15:46:38 +0200 + +rsync (2.6.3-2) unstable; urgency=low + + * Now supports alternate location for rsync daemon config file through + /etc/default/rsync . + closes:#271713,#282092 + * If the daemon isn't set to be started, only give a message is there is an + rsyncd.conf file. + closes:#252441 + * RSYNC_ENABLE may now also be set to "inetd" for those who want to start + rsyncd from inetd; all this does is prevent the init.d script from + outputting a message. You still need to add rsyncd to inetd's config + yourself. + * Fixed a few unescaped hyphens in the manpage, thanks to Joseph Nahmias for + finding them. + closes:#279586 + * Removed a double line from the man page left behind while editing. + closes:#282148 + * Patch for --bwlimit when used in daemon mode, which enables the behaviour + that rsync had previous to 2.6.3 i.e. specifying a default bwlimit (_not_ + a maximum!). + closes:#281519 + + -- Paul Slootman Wed, 17 Nov 2004 18:22:36 +0100 + +rsync (2.6.3-1) unstable; urgency=low + + * New upstream version. + * --bwlimit-mod is now deprecated, as the standard --bwlimit implementation + now uses ideas from --bwlimit-mod and should always work satisfactorily. + closes 181336 + * Corrected example rsyncd.conf + closes 256938 + + -- Paul Slootman Mon, 4 Oct 2004 11:58:18 +0200 + +rsync (2.6.2.pre3.2-1) experimental; urgency=low + + * Second preliminary version of what is to be 2.6.3. + + -- Paul Slootman Wed, 22 Sep 2004 12:57:38 +0200 + +rsync (2.6.2.pre3.1-1) experimental; urgency=low + + * preliminary version of what is to be 2.6.3. + * --bwlimit-mod is now deprecated, as the standard --bwlimit implementation + now uses ideas from --bwlimit-mod and should always work satisfactorily. + closes 181336 + * Corrected example rsyncd.conf + closes 256938 + + -- Paul Slootman Tue, 17 Aug 2004 11:16:13 +0200 + +rsync (2.6.2-3) unstable; urgency=high + + * security: directory traversal in daemon mode fix + (advisory CAN-2004-0792) + closes:#265662 + + -- Paul Slootman Sat, 14 Aug 2004 14:11:22 +0200 + +rsync (2.6.2-2) unstable; urgency=low + + * Build with -g by default. + closes:#239906 + * Check value of RSYNC_ENABLE as set in the defaults file, that it's + either 'true' or 'false'. + closes:#256791 + * If set to start the daemon, print an error if the rsyncd.conf file + doesn't exist. + closes:#238222 + * Added description of --bwlimit-mod to rsync manpage. + closes:#245579 + + -- Paul Slootman Tue, 29 Jun 2004 15:20:06 +0200 + +rsync (2.6.2-1) unstable; urgency=medium + + * New upstream version. + - fixes bug with --relative option in 2.6.1 that can cause files to be + transferred incorrectly. + * Additional patch to fix possible segmentation violation with --delete + option. + + -- Paul Slootman Mon, 3 May 2004 14:05:15 +0200 + +rsync (2.6.1-1) unstable; urgency=high + + * New upstream version. + + -- Paul Slootman Tue, 27 Apr 2004 14:07:30 +0200 + +rsync (2.6.0-3) unstable; urgency=low + + * Fix for .cvsignore in one dir affecting other dirs. + closes#239791 + + -- Paul Slootman Wed, 24 Mar 2004 20:23:34 +0100 + +rsync (2.6.0-2) unstable; urgency=low + + * Fixed building on GNU/KNetBSD (by adding DEB_BUILD_GNU_TYPE and + DEB_HOST_GNU_TYPE settings after backwards compatibilty stuff in rules). + closes:#223267 + * Experimental modification of --bwlimit option to limit the size of writes + when using small bwlimit values. Use --bwlimit-mod instead of --bwlimit. + Note that this needs an rsync version at both ends that has this + modification. See bug 191557 for more info. + * Removed own kludge to fix #146045 (interrupting while ssh is asking for a + password leaves tty in non-echoing state) as upstream rsync now has its + own kludge for this in another place. + * Added init.d script for those who want to start rsync in daemon mode + automatically. You'll need to edit /etc/default/rsync and create an + appropriate rsyncd.conf file to actually get it to start. + closes:#211007 + + -- Paul Slootman Mon, 5 Jan 2004 16:00:22 +0100 + +rsync (2.6.0-1) unstable; urgency=low + + * New Year's Day official release of 2.6.0. + * In short, the most important points from NEWS: + * - ssh is now the default remote shell for rsync. + * - Added --files-from, --no-relative, --no-implied-dirs, and --from0. + * - Fixed several exclude/include matching bugs when using wild-cards. + Please check the NEWS file for details on subtle changes in + exclude/include matching. + * - Make --link-dest honor the absence of -p, -o, and -g. + * - Fixed file I/O error detection. + * - Improved file-related error messages to better indicate exactly what + pathname failed. + * - Fixed bug that prevented regular files from replacing special files and + caused a directory in --link-dest or --compare-dest to block the creation + of a file with the same path. A directory still cannot be replaced by a + regular file unless --delete specified. (J.W. Schultz) + + -- Paul Slootman Thu, 1 Jan 2004 21:09:52 +0100 + +rsync (2.5.99pre2-1) unstable; urgency=low + + * Test release of version 2.6.0pre2 + Final version of rsync 2.6.0 is scheduled for January 1st. + + -- Paul Slootman Mon, 29 Dec 2003 10:03:08 +0100 + +rsync (2.5.99pre1-1) experimental; urgency=low + + * Test release of version 2.6.0pre1 + * manpage hasn't all the proper patches, for the rest it should be like the + final version as far as Debian is concerned. + + -- Paul Slootman Fri, 19 Dec 2003 22:54:33 +0100 + +rsync (2.5.7-1) unstable; urgency=high + + * New upstream version + * Fixes heap overflow vulnerability when run as a server. + + -- Paul Slootman Thu, 4 Dec 2003 11:20:26 +0100 + +rsync (2.5.6-2) unstable; urgency=low + + * If the specified log file can't be opened, don't segfault trying to write + to the file pointer; fall back to syslog instead (and log an appropriate + message there). This was especially irritating when starting it in daemon + mode. + closes:#165839 + + -- Paul Slootman Mon, 17 Nov 2003 16:51:41 +0100 + +rsync (2.5.6-1) unstable; urgency=low + + * New maintainer + * Added a small delay when an interrupt is received so that child processes + can clean up (i.e. ssh can restore tty settings) before the child + processes are killed. + closes:#146045 + * Removed the backslashes before single quotes in the manpage to prevent + them getting turned into acute accents. Also changed - to \- and + " to \(lq and \(rq, and ' to \(oq and \(cq where appropriate. + closes:#152135 + * Moved the /usr/share/doc/rsync/sample.rsyncd.conf to + /usr/share/doc/examples/rsyncd.conf . Also removed debian/dirs as it + wasn't being used... + closes:#193024 + * Added upstream's NEWS, OLDNEWS, and TODO to doc directory. Removed + debian/docs as it wasn't being used... + closes:#128708 + * Removed the description for --csum-length from the manpage, as there's no + such option in the program. + closes:#122629 + * Removed postinst, all it did was add a link to /usr/doc/ + * Updated the Fix for "mkstemp: filename too long" (#183667) + to the current upstream CVS version. + + -- Paul Slootman Thu, 25 Sep 2003 20:48:00 +0200 + +rsync (2.5.6-0.1) unstable; urgency=low + + * NMU + * New upstream version + - with updated manpage for rsyncd.conf for the exclude option, + closes:#172778 + * Updated manpage text for --perms option to clarify its behaviour. + closes:#181582 + * Fix for "mkstemp: filename too long". closes:#183667 + + -- Paul Slootman Fri, 7 Mar 2003 12:03:45 +0100 + +rsync (2.5.5-0.2) unstable; urgency=medium + + * NMU + * Be sure to use "nogroup" instead of "nobody" for server group + (Closes: #144570). + + -- Colin Walters Tue, 7 May 2002 17:23:01 -0400 + +rsync (2.5.5-0.1) unstable; urgency=high + + * NMU + * New upstream release. + - Includes fix for --whole-file option defaulting to on. + (Closes: #141552) + + -- Colin Walters Sat, 6 Apr 2002 20:36:16 -0500 + +rsync (2.5.4-1) unstable; urgency=high + + * New upstream release + * includes fix for zlib double-free bug (closes: #137958) + * update copyright to mention Martin Pool as upstream maintainer + + -- Philip Hands Fri, 15 Mar 2002 15:23:06 +0000 + +rsync (2.5.2-0.1) unstable; urgency=high + + * NMU + * new upstream release from 2001-01-26 + * new version fixes security problem (remote exploit) + (closes: Bug#130924) + * new version added new option "--ignore-existing" + (closes: Bug#124286) + * added debian/docs with NEWS, OLDNEWS, TODO + (closes: Bug#128708) + * added Makefile.in changes from 2.5.1-0.1 + * downloaded http://rsync.samba.org/ftp/rsync/cvs.log and added + it to the package but its not uptodate.:( + * added "RSYNC=/usr/bin/rsync" to test.sh like previous version + * changed group in loadparm.c from nobody to nogroup + like previous version + + -- Noel Koethe Sat, 26 Jan 2002 20:40:00 +0100 + +rsync (2.5.1-0.1) unstable; urgency=low + + * NMU + * New upstream version (Closes: #96193). + + -- Colin Walters Thu, 3 Jan 2002 20:00:01 -0500 + +rsync (2.5.0-0.3) unstable; urgency=medium + + * NMU + * debian/rules: + - Configure for the correct host and target. + * Backport patch to configure.in and config.h from CVS so we build on + alpha, ia64, etc. Yes, this horridly bloats the Debian diff... + + -- Colin Walters Mon, 31 Dec 2001 03:53:47 -0500 + +rsync (2.5.0-0.2) unstable; urgency=medium + + * NMU + * debian/control: + - Add Build-Depends. + - Clean up description a bit. + + -- Colin Walters Sun, 30 Dec 2001 03:46:11 -0500 + +rsync (2.5.0-0.1) unstable; urgency=medium + + * NMU + * New upstream release + (Closes: #83597, #62160, #26775, #31208, #41805, #44710, #121249). + * debian/rules: + - Modernize a bit; add stock code from current policy, change to use + $(INSTALL), etc. + - Install cvs.log and sample rsyncd.conf in /usr/share/doc/rsync + (Closes: #71406, #121792) + + -- Colin Walters Mon, 24 Dec 2001 02:13:13 -0500 + +rsync (2.4.6-1) unstable; urgency=low + + * New upstream release (closes: #67674) + + -- Philip Hands Sun, 10 Sep 2000 21:40:07 +0100 + +rsync (2.4.4-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sat, 29 Jul 2000 11:55:30 +0100 + +rsync (2.4.3-1) unstable; urgency=low + + * New upstream release (closes: #63840) + + -- Philip Hands Wed, 28 Jun 2000 23:48:58 +0100 + +rsync (2.4.2-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sun, 2 Apr 2000 00:24:52 +0100 + +rsync (2.4.1-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 3 Feb 2000 00:42:38 +0000 + +rsync (2.3.2-1.2) frozen unstable; urgency=low + + * Apply patch from Jason Gunthorpe, to fix rsync segfaults. Closes: + #51705, #54850. + + -- Adam Heath Thu, 20 Jan 2000 00:31:00 -0600 + +rsync (2.3.2-1.1) unstable; urgency=low + + * Use rsync zlib again (closes:Bug#50248). + + -- Joel Klecker Tue, 7 Dec 1999 09:46:25 -0800 + +rsync (2.3.2-1) unstable; urgency=low + + * New upstream release + * use zlib from zlib1g-dev (closes: 38273) + * switch to using /usr/share for docs, and add compatibility /usr/doc link + + -- Philip Hands Thu, 11 Nov 1999 15:30:14 +0000 + +rsync (2.3.1-2) unstable; urgency=low + + * apply Patrik Rak's fix for directory atribute setting (closes: #36179) + + -- Philip Hands Mon, 10 May 1999 12:24:16 +0100 + +rsync (2.3.1-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sat, 8 May 1999 10:53:53 +0100 + +rsync (2.3.0-1) unstable; urgency=low + + * New upstream release + * change rsyncd's default group to ``nogroup'' (closes: #25299) + + -- Philip Hands Tue, 16 Mar 1999 12:22:05 +0000 + +rsync (2.2.1-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sun, 6 Dec 1998 11:14:23 +0000 + +rsync (2.2.0-2) unstable; urgency=low + + * check if local ssh conections are allowed before using it as part of the + test script. + + -- Philip Hands Fri, 6 Nov 1998 10:23:07 +0000 + +rsync (2.2.0-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 5 Nov 1998 15:47:05 +0000 + +rsync (2.1.1-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 17 Sep 1998 17:35:41 +0100 + +rsync (2.1.0-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Mon, 20 Jul 1998 11:52:26 +0100 + +rsync (2.0.19-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sat, 18 Jul 1998 01:19:18 +0100 + +rsync (2.0.18-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 18 Jun 1998 15:52:11 +0100 + +rsync (2.0.16-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Mon, 1 Jun 1998 15:04:58 +0100 + +rsync (2.0.14-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Fri, 29 May 1998 15:26:18 +0100 + +rsync (2.0.13-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 28 May 1998 01:17:34 +0100 + +rsync (2.0.12-1) unstable; urgency=high + + * New upstream release + (fixes bug that could result in loss of data in files stored in deep + directory trees i.e. with path names of more than 255 characters) + + -- Philip Hands Tue, 26 May 1998 18:12:14 +0100 + +rsync (2.0.11-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Sat, 23 May 1998 12:00:28 +0100 + +rsync (2.0.10-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Wed, 20 May 1998 01:58:45 +0100 + +rsync (2.0.9-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Mon, 18 May 1998 15:44:56 +0100 + +rsync (2.0.3-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Fri, 15 May 1998 09:47:18 +0100 + +rsync (2.0.0-1) unstable; urgency=low + + * New upstream release + (this includes the new --daemon code, which needs testing, so consider + this to be beta software, and use with care) + + The alpha version that I released a couple of days ago, + is incompatible with this version, and should be discarded. + + -- Philip Hands Thu, 14 May 1998 11:22:25 +0100 + +rsync (1.7.4-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Fri, 17 Apr 1998 10:50:44 +0100 + +rsync (1.7.2-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Thu, 9 Apr 1998 10:19:08 +0100 + +rsync (1.7.1-0bo1) bo-unstable; urgency=low + + * recompiled for libc5 + + -- Philip Hands Thu, 26 Mar 1998 10:27:48 +0000 + +rsync (1.7.1-1) unstable; urgency=low + + * New upstream release (closes: #16181 #16860) + * Fixed typo in description (closes: #18948) + * add /usr/doc/rsync/test.sh + + -- Philip Hands Thu, 26 Mar 1998 09:35:24 +0000 + +rsync (1.6.9-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Tue, 13 Jan 1998 17:16:06 +0000 + +rsync (1.6.8-2) unstable; urgency=low + + * Add upstream patch to fix --suffix option + (From Andrew Tridgell on the rsync mailing list) + + -- Philip Hands Tue, 30 Dec 1997 10:54:57 +0000 + +rsync (1.6.8-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Mon, 29 Dec 1997 10:46:41 +0000 + +rsync (1.6.7-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Wed, 17 Dec 1997 09:04:16 +0000 + +rsync (1.6.3-2) unstable; urgency=low + + * recompile with libc6 + + -- Philip Hands Wed, 20 Aug 1997 10:21:04 +0100 + +rsync (1.6.3-1) unstable; urgency=low + + * New upstream release + + -- Philip Hands Tue, 22 Apr 1997 15:17:38 +0100 + +rsync (1.6.2-1) unstable; urgency=low + + * Initial Release + + -- Philip Hands Wed, 9 Oct 1996 23:45:08 +0100 + + --- rsync-3.1.0.orig/debian/control +++ rsync-3.1.0/debian/control @@ -0,0 +1,26 @@ +Source: rsync +Section: net +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Paul Slootman +Build-Depends: libpopt-dev,libacl1-dev,libattr1-dev,zlib1g-dev(>= 1:1.2.8) +Standards-Version: 3.9.4 +Homepage: http://rsync.samba.org/ + +Package: rsync +Architecture: any +Multi-Arch: foreign +Depends: ${shlibs:Depends}, lsb-base (>= 3.2-14), base-files (>= 4.0.1) +Breaks: duplicity (<< 0.6.11) +Suggests: openssh-client, openssh-server +Description: fast, versatile, remote (and local) file-copying tool + rsync is a fast and versatile file-copying tool which can copy locally + and to/from a remote host. It offers many options to control its behavior, + and its remote-update protocol can minimize network traffic to make + transferring updates between machines fast and efficient. + . + It is widely used for backups and mirroring and as an improved copy + command for everyday use. + . + This package provides both the rsync command line tool and optional + daemon functionality. --- rsync-3.1.0.orig/debian/copyright +++ rsync-3.1.0/debian/copyright @@ -0,0 +1,38 @@ +This is Debian's prepackaged version of Andrew Tridgell and +Paul Mackerras' rsync utility. + +This package provides the rsync program, which is a replacement +for rcp that uses the rsync algorythm to transfer only the +differences between two sets of files. + +This package was put together by Philip Hands , +from sources obtained from: + http://rsync.samba.org/ftp/rsync/rsync-2.5.4.tar.gz +The current version was downloaded from: + http://rsync.samba.org/ftp/rsync/src/rsync-3.1.0.tar.gz +on 2013-09-30 by Paul Slootman . + +The changes were very minimal - merely adding support for the Debian +package maintenance scheme by adding various debian/* files. +The only significant change is passing the -4 / -6 options through to ssh. +See the debian/patches/ directory. + + + +COPYRIGHT +--------- + +Copyright (C) 1996-2011 by Andrew Tridgell, Wayne Davison, and others. + +Rsync was originally written by Andrew Tridgell and is currently +maintained by Wayne Davison. It has been improved by many developers +from around the world. + +Rsync may be used, modified and redistributed only under the terms of +the GNU General Public License, found in the file: + + /usr/share/common-licenses/GPL-3 + +on Debian systems, or at + + http://www.fsf.org/licensing/licenses/gpl.html --- rsync-3.1.0.orig/debian/default +++ rsync-3.1.0/debian/default @@ -0,0 +1,41 @@ +# defaults file for rsync daemon mode + +# start rsync in daemon mode from init.d script? +# only allowed values are "true", "false", and "inetd" +# Use "inetd" if you want to start the rsyncd from inetd, +# all this does is prevent the init.d script from printing a message +# about not starting rsyncd (you still need to modify inetd's config yourself). +RSYNC_ENABLE=false + +# which file should be used as the configuration file for rsync. +# This file is used instead of the default /etc/rsyncd.conf +# Warning: This option has no effect if the daemon is accessed +# using a remote shell. When using a different file for +# rsync you might want to symlink /etc/rsyncd.conf to +# that file. +# RSYNC_CONFIG_FILE= + +# what extra options to give rsync --daemon? +# that excludes the --daemon; that's always done in the init.d script +# Possibilities are: +# --address=123.45.67.89 (bind to a specific IP address) +# --port=8730 (bind to specified port; default 873) +RSYNC_OPTS='' + +# run rsyncd at a nice level? +# the rsync daemon can impact performance due to much I/O and CPU usage, +# so you may want to run it at a nicer priority than the default priority. +# Allowed values are 0 - 19 inclusive; 10 is a reasonable value. +RSYNC_NICE='' + +# run rsyncd with ionice? +# "ionice" does for IO load what "nice" does for CPU load. +# As rsync is often used for backups which aren't all that time-critical, +# reducing the rsync IO priority will benefit the rest of the system. +# See the manpage for ionice for allowed options. +# -c3 is recommended, this will run rsync IO at "idle" priority. Uncomment +# the next line to activate this. +# RSYNC_IONICE='-c3' + +# Don't forget to create an appropriate config file, +# else the daemon will not start. --- rsync-3.1.0.orig/debian/init.d +++ rsync-3.1.0/debian/init.d @@ -0,0 +1,153 @@ +#! /bin/sh + +### BEGIN INIT INFO +# Provides: rsyncd +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Should-Start: $named +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: fast remote file copy program daemon +# Description: rsync is a program that allows files to be copied to and +# from remote machines in much the same way as rcp. +# This provides rsyncd daemon functionality. +### END INIT INFO + +set -e + +# /etc/init.d/rsync: start and stop the rsync daemon + +DAEMON=/usr/bin/rsync +RSYNC_ENABLE=false +RSYNC_OPTS='' +RSYNC_DEFAULTS_FILE=/etc/default/rsync +RSYNC_CONFIG_FILE=/etc/rsyncd.conf +RSYNC_PID_FILE=/var/run/rsync.pid +RSYNC_NICE_PARM='' +RSYNC_IONICE_PARM='' + +test -x $DAEMON || exit 0 + +. /lib/lsb/init-functions + +if [ -s $RSYNC_DEFAULTS_FILE ]; then + . $RSYNC_DEFAULTS_FILE + case "x$RSYNC_ENABLE" in + xtrue|xfalse) ;; + xinetd) exit 0 + ;; + *) log_failure_msg "Value of RSYNC_ENABLE in $RSYNC_DEFAULTS_FILE must be either 'true' or 'false';" + log_failure_msg "not starting rsync daemon." + exit 1 + ;; + esac + case "x$RSYNC_NICE" in + x[0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";; + x1[0-9]) RSYNC_NICE_PARM="--nicelevel $RSYNC_NICE";; + x) ;; + *) log_warning_msg "Value of RSYNC_NICE in $RSYNC_DEFAULTS_FILE must be a value between 0 and 19 (inclusive);" + log_warning_msg "ignoring RSYNC_NICE now." + ;; + esac + case "x$RSYNC_IONICE" in + x-c[123]*) RSYNC_IONICE_PARM="$RSYNC_IONICE";; + x) ;; + *) log_warning_msg "Value of RSYNC_IONICE in $RSYNC_DEFAULTS_FILE must be -c1, -c2 or -c3;" + log_warning_msg "ignoring RSYNC_IONICE now." + ;; + esac +fi + +export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" + +rsync_start() { + if [ ! -s "$RSYNC_CONFIG_FILE" ]; then + log_failure_msg "missing or empty config file $RSYNC_CONFIG_FILE" + log_end_msg 1 + exit 0 + fi + # See ionice(1) + if [ -n "$RSYNC_IONICE_PARM" ] && [ -x /usr/bin/ionice ] && + /usr/bin/ionice "$RSYNC_IONICE_PARM" true 2>/dev/null; then + /usr/bin/ionice "$RSYNC_IONICE_PARM" -p$$ > /dev/null 2>&1 + fi + if start-stop-daemon --start --quiet --background \ + --pidfile $RSYNC_PID_FILE --make-pidfile \ + $RSYNC_NICE_PARM --exec $DAEMON \ + -- --no-detach --daemon --config "$RSYNC_CONFIG_FILE" $RSYNC_OPTS + then + rc=0 + sleep 1 + if ! kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then + log_failure_msg "rsync daemon failed to start" + rc=1 + fi + else + rc=1 + fi + if [ $rc -eq 0 ]; then + log_end_msg 0 + else + log_end_msg 1 + rm -f $RSYNC_PID_FILE + fi +} # rsync_start + + +case "$1" in + start) + if "$RSYNC_ENABLE"; then + log_daemon_msg "Starting rsync daemon" "rsync" + if [ -s $RSYNC_PID_FILE ] && kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then + log_progress_msg "apparently already running" + log_end_msg 0 + exit 0 + fi + rsync_start + else + if [ -s "$RSYNC_CONFIG_FILE" ]; then + [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in $RSYNC_DEFAULTS_FILE, not starting..." + fi + fi + ;; + stop) + log_daemon_msg "Stopping rsync daemon" "rsync" + start-stop-daemon --stop --quiet --oknodo --pidfile $RSYNC_PID_FILE + log_end_msg $? + rm -f $RSYNC_PID_FILE + ;; + + reload|force-reload) + log_warning_msg "Reloading rsync daemon: not needed, as the daemon" + log_warning_msg "re-reads the config file whenever a client connects." + ;; + + restart) + set +e + if $RSYNC_ENABLE; then + log_daemon_msg "Restarting rsync daemon" "rsync" + if [ -s $RSYNC_PID_FILE ] && kill -0 $(cat $RSYNC_PID_FILE) >/dev/null 2>&1; then + start-stop-daemon --stop --quiet --oknodo --pidfile $RSYNC_PID_FILE || true + sleep 1 + else + log_warning_msg "rsync daemon not running, attempting to start." + rm -f $RSYNC_PID_FILE + fi + rsync_start + else + if [ -s "$RSYNC_CONFIG_FILE" ]; then + [ "$VERBOSE" != no ] && log_warning_msg "rsync daemon not enabled in $RSYNC_DEFAULTS_FILE, not starting..." + fi + fi + ;; + + status) + status_of_proc -p $RSYNC_PID_FILE "$DAEMON" rsync + exit $? # notreached due to set -e + ;; + *) + echo "Usage: /etc/init.d/rsync {start|stop|reload|force-reload|restart|status}" + exit 1 +esac + +exit 0 --- rsync-3.1.0.orig/debian/lintian.overrides +++ rsync-3.1.0/debian/lintian.overrides @@ -0,0 +1,3 @@ +rsync: embedded-library usr/bin/rsync: zlib +rsync: spelling-error-in-binary usr/bin/rsync dont don't +rsync: init.d-script-does-not-provide-itself etc/init.d/rsync --- rsync-3.1.0.orig/debian/logrotate.conf.rsync +++ rsync-3.1.0/debian/logrotate.conf.rsync @@ -0,0 +1,8 @@ +/var/log/rsyncd.log { + weekly + rotate 99 + missingok + notifempty + compress + delaycompress +} --- rsync-3.1.0.orig/debian/patches/CVE-2014-2855.diff +++ rsync-3.1.0/debian/patches/CVE-2014-2855.diff @@ -0,0 +1,83 @@ +From 0dedfbce2c1b851684ba658861fe9d620636c56a Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Sun, 13 Apr 2014 13:44:58 -0700 +Subject: [PATCH] Avoid infinite wait reading secrets file. + +--- + authenticate.c | 24 +++++++++++++----------- + 1 files changed, 13 insertions(+), 11 deletions(-) + +diff --git a/authenticate.c b/authenticate.c +index 3381b8c..c92746c 100644 +--- a/authenticate.c ++++ b/authenticate.c +@@ -102,15 +102,16 @@ static const char *check_secret(int module, const char *user, const char *group, + char pass2[MAX_DIGEST_LEN*2]; + const char *fname = lp_secrets_file(module); + STRUCT_STAT st; +- int fd, ok = 1; ++ int ok = 1; + int user_len = strlen(user); + int group_len = group ? strlen(group) : 0; + char *err; ++ FILE *fh; + +- if (!fname || !*fname || (fd = open(fname, O_RDONLY)) < 0) ++ if (!fname || !*fname || (fh = fopen(fname, "r")) == NULL) + return "no secrets file"; + +- if (do_fstat(fd, &st) == -1) { ++ if (do_fstat(fileno(fh), &st) == -1) { + rsyserr(FLOG, errno, "fstat(%s)", fname); + ok = 0; + } else if (lp_strict_modes(module)) { +@@ -123,29 +124,30 @@ static const char *check_secret(int module, const char *user, const char *group, + } + } + if (!ok) { +- close(fd); ++ fclose(fh); + return "ignoring secrets file"; + } + + if (*user == '#') { + /* Reject attempt to match a comment. */ +- close(fd); ++ fclose(fh); + return "invalid username"; + } + + /* Try to find a line that starts with the user (or @group) name and a ':'. */ + err = "secret not found"; +- while ((user || group) && read_line_old(fd, line, sizeof line, 1)) { +- const char **ptr, *s; ++ while ((user || group) && fgets(line, sizeof line, fh) != NULL) { ++ const char **ptr, *s = strtok(line, "\n\r"); + int len; +- if (*line == '@') { ++ if (!s) ++ continue; ++ if (*s == '@') { + ptr = &group; + len = group_len; +- s = line+1; ++ s++; + } else { + ptr = &user; + len = user_len; +- s = line; + } + if (!*ptr || strncmp(s, *ptr, len) != 0 || s[len] != ':') + continue; +@@ -158,7 +160,7 @@ static const char *check_secret(int module, const char *user, const char *group, + *ptr = NULL; /* Don't look for name again. */ + } + +- close(fd); ++ fclose(fh); + + memset(line, 0, sizeof line); + memset(pass2, 0, sizeof pass2); +-- +1.7.0.4 + --- rsync-3.1.0.orig/debian/patches/CVE-2014-9512-0.diff +++ rsync-3.1.0/debian/patches/CVE-2014-9512-0.diff @@ -0,0 +1,98 @@ +Backport of: + +From 4cad402ea8a91031f86c53961d78bb7f4f174790 Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Sun, 13 Apr 2014 10:36:59 -0700 +Subject: [PATCH] Receiver now rejects invalid filenames in filelist. + +If the receiver gets a filename with a leading slash (w/o --relative) +and/or a filename with an embedded ".." dir in the path, it dies with +an error (rather than continuing). Those invalid paths should never +happen in reality, so just reject someone trying to pull a fast one. +--- + flist.c | 14 ++++++++------ + rsync.h | 1 + + util.c | 14 ++++++++++---- + 3 files changed, 19 insertions(+), 10 deletions(-) + +diff -Naurp rsync-3.1.0.ori/flist.c rsync-3.1.0/flist.c +--- rsync-3.1.0.ori/flist.c 2013-06-16 19:33:32.000000000 -0400 ++++ rsync-3.1.0/flist.c 2016-01-19 15:23:45.778033418 -0500 +@@ -736,8 +736,11 @@ static struct file_struct *recv_file_ent + } + #endif + +- if (*thisname) +- clean_fname(thisname, 0); ++ if (*thisname ++ && (clean_fname(thisname, CFN_REFUSE_DOT_DOT_DIRS) < 0 || (!relative_paths && *thisname == '/'))) { ++ rprintf(FERROR, "ABORTING due to unsafe pathname from sender: %s\n", thisname); ++ exit_cleanup(RERR_PROTOCOL); ++ } + + if (sanitize_paths) + sanitize_path(thisname, thisname, "", 0, SP_DEFAULT); +diff -Naurp rsync-3.1.0.ori/rsync.h rsync-3.1.0/rsync.h +--- rsync-3.1.0.ori/rsync.h 2013-09-28 16:55:54.000000000 -0400 ++++ rsync-3.1.0/rsync.h 2016-01-19 15:23:45.778033418 -0500 +@@ -208,6 +208,7 @@ + #define CFN_KEEP_TRAILING_SLASH (1<<1) + #define CFN_DROP_TRAILING_DOT_DIR (1<<2) + #define CFN_COLLAPSE_DOT_DOT_DIRS (1<<3) ++#define CFN_REFUSE_DOT_DOT_DIRS (1<<4) + + #define SP_DEFAULT 0 + #define SP_KEEP_DOT_DIRS (1<<0) +diff -Naurp rsync-3.1.0.ori/util.c rsync-3.1.0/util.c +--- rsync-3.1.0.ori/util.c 2013-06-11 16:36:44.000000000 -0400 ++++ rsync-3.1.0/util.c 2016-01-19 15:23:45.778033418 -0500 +@@ -858,7 +858,7 @@ int count_dir_elements(const char *p) + * CFN_KEEP_TRAILING_SLASH is flagged, and will also collapse ".." elements + * (except at the start) if CFN_COLLAPSE_DOT_DOT_DIRS is flagged. If the + * resulting name would be empty, returns ".". */ +-unsigned int clean_fname(char *name, int flags) ++int clean_fname(char *name, int flags) + { + char *limit = name - 1, *t = name, *f = name; + int anchored; +@@ -866,6 +866,8 @@ unsigned int clean_fname(char *name, int + if (!name) + return 0; + ++#define DOT_IS_DOT_DOT_DIR(bp) (bp[1] == '.' && (bp[2] == '/' || !bp[2])) ++ + if ((anchored = *f == '/') != 0) { + *t++ = *f++; + #ifdef __CYGWIN__ +@@ -878,7 +880,8 @@ unsigned int clean_fname(char *name, int + } else if (flags & CFN_KEEP_DOT_DIRS && *f == '.' && f[1] == '/') { + *t++ = *f++; + *t++ = *f++; +- } ++ } else if (flags & CFN_REFUSE_DOT_DOT_DIRS && *f == '.' && DOT_IS_DOT_DOT_DIR(f)) ++ return -1; + while (*f) { + /* discard extra slashes */ + if (*f == '/') { +@@ -894,9 +897,10 @@ unsigned int clean_fname(char *name, int + if (f[1] == '\0' && flags & CFN_DROP_TRAILING_DOT_DIR) + break; + /* collapse ".." dirs */ +- if (flags & CFN_COLLAPSE_DOT_DOT_DIRS +- && f[1] == '.' && (f[2] == '/' || !f[2])) { ++ if (flags & (CFN_COLLAPSE_DOT_DOT_DIRS|CFN_REFUSE_DOT_DOT_DIRS) && DOT_IS_DOT_DOT_DIR(f)) { + char *s = t - 1; ++ if (flags & CFN_REFUSE_DOT_DOT_DIRS) ++ return -1; + if (s == name && anchored) { + f += 2; + continue; +@@ -919,6 +923,8 @@ unsigned int clean_fname(char *name, int + *t++ = '.'; + *t = '\0'; + ++#undef DOT_IS_DOT_DOT_DIR ++ + return t - name; + } + --- rsync-3.1.0.orig/debian/patches/CVE-2014-9512-1.diff +++ rsync-3.1.0/debian/patches/CVE-2014-9512-1.diff @@ -0,0 +1,107 @@ +From 962f8b90045ab331fc04c9e65f80f1a53e68243b Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Wed, 31 Dec 2014 12:41:03 -0800 +Subject: [PATCH] Complain if an inc-recursive path is not right for its dir. + This ensures that a malicious sender can't use a just-sent symlink as a + trasnfer path. + +--- + NEWS | 7 ++++++- + flist.c | 22 ++++++++++++++++++++-- + io.c | 2 +- + main.c | 4 ++-- + rsync.c | 2 +- + 5 files changed, 30 insertions(+), 7 deletions(-) + +diff -Naurp rsync-3.1.0.ori/flist.c rsync-3.1.0/flist.c +--- rsync-3.1.0.ori/flist.c 2016-01-19 15:23:45.778033418 -0500 ++++ rsync-3.1.0/flist.c 2016-01-19 15:25:56.571250457 -0500 +@@ -2428,8 +2428,9 @@ struct file_list *send_file_list(int f, + return flist; + } + +-struct file_list *recv_file_list(int f) ++struct file_list *recv_file_list(int f, int dir_ndx) + { ++ const char *good_dirname = NULL; + struct file_list *flist; + int dstart, flags; + int64 start_read; +@@ -2485,6 +2486,23 @@ struct file_list *recv_file_list(int f) + flist_expand(flist, 1); + file = recv_file_entry(f, flist, flags); + ++ if (inc_recurse) { ++ static const char empty_dir[] = "\0"; ++ const char *cur_dir = file->dirname ? file->dirname : empty_dir; ++ if (relative_paths && *cur_dir == '/') ++ cur_dir++; ++ if (cur_dir != good_dirname) { ++ const char *d = dir_ndx >= 0 ? f_name(dir_flist->files[dir_ndx], NULL) : empty_dir; ++ if (strcmp(cur_dir, d) != 0) { ++ rprintf(FERROR, ++ "ABORTING due to invalid dir prefix from sender: %s (should be: %s)\n", ++ cur_dir, d); ++ exit_cleanup(RERR_PROTOCOL); ++ } ++ good_dirname = cur_dir; ++ } ++ } ++ + if (S_ISREG(file->mode)) { + /* Already counted */ + } else if (S_ISDIR(file->mode)) { +@@ -2605,7 +2623,7 @@ void recv_additional_file_list(int f) + rprintf(FINFO, "[%s] receiving flist for dir %d\n", + who_am_i(), ndx); + } +- flist = recv_file_list(f); ++ flist = recv_file_list(f, ndx); + flist->parent_ndx = ndx; + } + } +diff -Naurp rsync-3.1.0.ori/io.c rsync-3.1.0/io.c +--- rsync-3.1.0.ori/io.c 2013-05-28 15:59:47.000000000 -0400 ++++ rsync-3.1.0/io.c 2016-01-19 15:25:56.571250457 -0500 +@@ -1694,7 +1694,7 @@ void wait_for_receiver(void) + rprintf(FINFO, "[%s] receiving flist for dir %d\n", + who_am_i(), ndx); + } +- flist = recv_file_list(iobuf.in_fd); ++ flist = recv_file_list(iobuf.in_fd, ndx); + flist->parent_ndx = ndx; + #ifdef SUPPORT_HARD_LINKS + if (preserve_hard_links) +diff -Naurp rsync-3.1.0.ori/main.c rsync-3.1.0/main.c +--- rsync-3.1.0.ori/main.c 2016-01-19 15:23:05.753678749 -0500 ++++ rsync-3.1.0/main.c 2016-01-19 15:25:56.575250495 -0500 +@@ -1027,7 +1027,7 @@ static void do_server_recv(int f_in, int + filesfrom_fd = -1; + } + +- flist = recv_file_list(f_in); ++ flist = recv_file_list(f_in, -1); + if (!flist) { + rprintf(FERROR,"server_recv: recv_file_list error\n"); + exit_cleanup(RERR_FILESELECT); +@@ -1201,7 +1201,7 @@ int client_run(int f_in, int f_out, pid_ + + if (write_batch && !am_server) + start_write_batch(f_in); +- flist = recv_file_list(f_in); ++ flist = recv_file_list(f_in, -1); + if (inc_recurse && file_total == 1) + recv_additional_file_list(f_in); + +diff -Naurp rsync-3.1.0.ori/rsync.c rsync-3.1.0/rsync.c +--- rsync-3.1.0.ori/rsync.c 2013-05-26 19:22:56.000000000 -0400 ++++ rsync-3.1.0/rsync.c 2016-01-19 15:25:56.575250495 -0500 +@@ -364,7 +364,7 @@ int read_ndx_and_attrs(int f_in, int f_o + } + /* Send all the data we read for this flist to the generator. */ + start_flist_forward(ndx); +- flist = recv_file_list(f_in); ++ flist = recv_file_list(f_in, ndx); + flist->parent_ndx = ndx; + stop_flist_forward(); + } --- rsync-3.1.0.orig/debian/patches/CVE-2014-9512-2.diff +++ rsync-3.1.0/debian/patches/CVE-2014-9512-2.diff @@ -0,0 +1,97 @@ +From e12a6c087ca1eecdb8eae5977be239c24f4dd3d9 Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Sat, 4 Jul 2015 16:08:08 -0700 +Subject: [PATCH] Add parent-dir validation for --no-inc-recurse too. + +--- + flist.c | 32 ++++++++++++++++++++++++++++++-- + generator.c | 14 ++++++++++++++ + 2 files changed, 44 insertions(+), 2 deletions(-) + +diff -Naurp rsync-3.1.0.ori/flist.c rsync-3.1.0/flist.c +--- rsync-3.1.0.ori/flist.c 2016-01-19 15:25:56.571250457 -0500 ++++ rsync-3.1.0/flist.c 2016-01-19 15:26:23.375508345 -0500 +@@ -2495,8 +2495,8 @@ struct file_list *recv_file_list(int f, + const char *d = dir_ndx >= 0 ? f_name(dir_flist->files[dir_ndx], NULL) : empty_dir; + if (strcmp(cur_dir, d) != 0) { + rprintf(FERROR, +- "ABORTING due to invalid dir prefix from sender: %s (should be: %s)\n", +- cur_dir, d); ++ "ABORTING due to invalid path from sender: %s/%s\n", ++ cur_dir, file->basename); + exit_cleanup(RERR_PROTOCOL); + } + good_dirname = cur_dir; +@@ -2679,6 +2679,34 @@ int flist_find(struct file_list *flist, + return -1; + } + ++/* Search for a name in the file list. You must specify want_dir_match as: ++ * 1=match directories, 0=match non-directories, or -1=match either. */ ++int flist_find_name(struct file_list *flist, const char *fname, int want_dir_match) ++{ ++ struct { /* We have to create a temporary file_struct for the search. */ ++ struct file_struct f; ++ char name_space[MAXPATHLEN]; ++ } t; ++ char fbuf[MAXPATHLEN]; ++ const char *slash = strrchr(fname, '/'); ++ const char *basename = slash ? slash+1 : fname; ++ ++ memset(&t.f, 0, FILE_STRUCT_LEN); ++ memcpy((void *)t.f.basename, basename, strlen(basename)+1); ++ ++ if (slash) { ++ strlcpy(fbuf, fname, slash - fname + 1); ++ t.f.dirname = fbuf; ++ } else ++ t.f.dirname = NULL; ++ ++ t.f.mode = want_dir_match > 0 ? S_IFDIR : S_IFREG; ++ ++ if (want_dir_match < 0) ++ return flist_find_ignore_dirness(flist, &t.f); ++ return flist_find(flist, &t.f); ++} ++ + /* Search for an identically-named item in the file list. Differs from + * flist_find in that an item that agrees with "f" in directory-ness is + * preferred but one that does not is still found. */ +diff -Naurp rsync-3.1.0.ori/generator.c rsync-3.1.0/generator.c +--- rsync-3.1.0.ori/generator.c 2013-01-19 14:05:53.000000000 -0500 ++++ rsync-3.1.0/generator.c 2016-01-19 15:26:23.375508345 -0500 +@@ -1167,6 +1167,7 @@ static void recv_generator(char *fname, + int itemizing, enum logcode code, int f_out) + { + static const char *parent_dirname = ""; ++ static struct file_struct *prior_dir_file = NULL; + /* Missing dir not created due to --dry-run; will still be scanned. */ + static struct file_struct *dry_missing_dir = NULL; + /* Missing dir whose contents are skipped altogether due to +@@ -1246,6 +1247,18 @@ static void recv_generator(char *fname, + const char *dn = file->dirname ? file->dirname : "."; + dry_missing_dir = NULL; + if (parent_dirname != dn && strcmp(parent_dirname, dn) != 0) { ++ /* Each parent dir must be in the file list or the flist data is bad. ++ * Optimization: most of the time the parent dir will be the last dir ++ * this function was asked to process in the file list. */ ++ if (!inc_recurse ++ && (*dn != '.' || dn[1]) /* Avoid an issue with --relative and the "." dir. */ ++ && (prior_dir_file && strcmp(dn, f_name(prior_dir_file, NULL)) != 0) ++ && flist_find_name(cur_flist, dn, 1) < 0) { ++ rprintf(FERROR, ++ "ABORTING due to invalid path from sender: %s/%s\n", ++ dn, file->basename); ++ exit_cleanup(RERR_PROTOCOL); ++ } + if (relative_paths && !implied_dirs + && do_stat(dn, &sx.st) < 0) { + if (dry_run) +@@ -1455,6 +1468,7 @@ static void recv_generator(char *fname, + else + change_local_filter_dir(fname, strlen(fname), F_DEPTH(file)); + } ++ prior_dir_file = file; + goto cleanup; + } + --- rsync-3.1.0.orig/debian/patches/CVE-2017-16548.patch +++ rsync-3.1.0/debian/patches/CVE-2017-16548.patch @@ -0,0 +1,25 @@ +From 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Sun, 5 Nov 2017 11:33:15 -0800 +Subject: [PATCH] Enforce trailing \0 when receiving xattr name values. Fixes + bug 13112. + +--- + xattrs.c | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: rsync-3.1.0/xattrs.c +=================================================================== +--- rsync-3.1.0.orig/xattrs.c ++++ rsync-3.1.0/xattrs.c +@@ -694,6 +694,10 @@ void receive_xattr(int f, struct file_st + out_of_memory("receive_xattr"); + name = ptr + dget_len + extra_len; + read_buf(f, name, name_len); ++ if (name_len < 1 || name[name_len-1] != '\0') { ++ rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n"); ++ exit_cleanup(RERR_FILEIO); ++ } + if (dget_len == datum_len) + read_buf(f, ptr, dget_len); + else { --- rsync-3.1.0.orig/debian/patches/CVE-2017-17433.patch +++ rsync-3.1.0/debian/patches/CVE-2017-17433.patch @@ -0,0 +1,39 @@ +From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 2 Nov 2017 23:44:19 -0700 +Subject: [PATCH] Check fname in recv_files sooner. + +--- + receiver.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +Index: rsync-3.1.0/receiver.c +=================================================================== +--- rsync-3.1.0.orig/receiver.c ++++ rsync-3.1.0/receiver.c +@@ -576,6 +576,12 @@ int recv_files(int f_in, int f_out, char + file = dir_flist->files[cur_flist->parent_ndx]; + fname = local_name ? local_name : f_name(file, fbuf); + ++ if (daemon_filter_list.head ++ && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { ++ rprintf(FERROR, "attempt to hack rsync failed.\n"); ++ exit_cleanup(RERR_PROTOCOL); ++ } ++ + if (DEBUG_GTE(RECV, 1)) + rprintf(FINFO, "recv_files(%s)\n", fname); + +@@ -647,12 +653,6 @@ int recv_files(int f_in, int f_out, char + + cleanup_got_literal = 0; + +- if (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) { +- rprintf(FERROR, "attempt to hack rsync failed.\n"); +- exit_cleanup(RERR_PROTOCOL); +- } +- + if (read_batch) { + int wanted = redoing + ? we_want_redo(ndx) --- rsync-3.1.0.orig/debian/patches/CVE-2017-17434-part1.patch +++ rsync-3.1.0/debian/patches/CVE-2017-17434-part1.patch @@ -0,0 +1,22 @@ +From 5509597decdbd7b91994210f700329d8a35e70a1 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 16 Nov 2017 17:26:03 -0800 +Subject: [PATCH] Check daemon filter against fnamecmp in recv_files(). + +--- + receiver.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: rsync-3.1.0/receiver.c +=================================================================== +--- rsync-3.1.0.orig/receiver.c ++++ rsync-3.1.0/receiver.c +@@ -725,7 +725,7 @@ int recv_files(int f_in, int f_out, char + break; + } + if (!fnamecmp || (daemon_filter_list.head +- && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) { ++ && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) { + fnamecmp = fname; + fnamecmp_type = FNAMECMP_FNAME; + } --- rsync-3.1.0.orig/debian/patches/CVE-2017-17434-part2.patch +++ rsync-3.1.0/debian/patches/CVE-2017-17434-part2.patch @@ -0,0 +1,36 @@ +From 70aeb5fddd1b2f8e143276f8d5a085db16c593b9 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Thu, 16 Nov 2017 17:05:42 -0800 +Subject: [PATCH] Sanitize xname in read_ndx_and_attrs. + +--- + rsync.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/rsync.c b/rsync.c +index b82e598..a0945ba 100644 +--- a/rsync.c ++++ b/rsync.c +@@ -49,6 +49,7 @@ extern int flist_eof; + extern int file_old_total; + extern int keep_dirlinks; + extern int make_backups; ++extern int sanitize_paths; + extern struct file_list *cur_flist, *first_flist, *dir_flist; + extern struct chmod_mode_struct *daemon_chmod_modes; + #ifdef ICONV_OPTION +@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr, + if (iflags & ITEM_XNAME_FOLLOWS) { + if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0) + exit_cleanup(RERR_PROTOCOL); ++ ++ if (sanitize_paths) { ++ sanitize_path(buf, buf, "", 0, SP_DEFAULT); ++ len = strlen(buf); ++ } + } else { + *buf = '\0'; + len = -1; +-- +1.9.1 + --- rsync-3.1.0.orig/debian/patches/CVE-2018-5764.patch +++ rsync-3.1.0/debian/patches/CVE-2018-5764.patch @@ -0,0 +1,38 @@ +From 7706303828fcde524222babb2833864a4bd09e07 Mon Sep 17 00:00:00 2001 +From: Jeriko One +Date: Mon, 20 Nov 2017 14:42:30 -0800 +Subject: [PATCH] Ignore --protect-args when already sent by client + +In parse_arguments when --protect-args is encountered the function exits +early. The caller is expected to check protect_args, and recall +parse_arguments setting protect_args to 2. This patch prevents the +client from resetting protect_args during the second pass of +parse_arguments. This prevents parse_arguments returning early the +second time before it's able to sanitize the arguments it received. +--- + options.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Index: rsync-3.1.0/options.c +=================================================================== +--- rsync-3.1.0.orig/options.c ++++ rsync-3.1.0/options.c +@@ -1292,6 +1292,7 @@ int parse_arguments(int *argc_p, const c + const char *arg, **argv = *argv_p; + int argc = *argc_p; + int opt; ++ int orig_protect_args = protect_args; + + if (ref && *ref) + set_refuse_options(ref); +@@ -1885,6 +1886,10 @@ int parse_arguments(int *argc_p, const c + if (fuzzy_basis > 1) + fuzzy_basis = basis_dir_cnt + 1; + ++ /* Don't let the client reset protect_args if it was already processed */ ++ if (orig_protect_args == 2 && am_server) ++ protect_args = orig_protect_args; ++ + if (protect_args == 1 && am_server) + return 1; + --- rsync-3.1.0.orig/debian/patches/README +++ rsync-3.1.0/debian/patches/README @@ -0,0 +1,10 @@ +These are the main patches to the rsync source. +(The changes to the manpages for correct hyphens +and quotes is a bit big, so not included.) + +If you're wondering about the lack of patches, the +explanation is that upstream has adopted most of them :-) + +logdir.diff - fix the location of the logdir +ssh-6-option.diff - call ssh with -6 option if rsync was called with -6, + ditto with -4 --- rsync-3.1.0.orig/debian/patches/logdir.diff +++ rsync-3.1.0/debian/patches/logdir.diff @@ -0,0 +1,11 @@ +--- rsync-2.6.9.orig/support/rsyncstats.orig 2006-11-20 15:50:42.711007850 +0100 ++++ rsync-2.6.9/support/rsyncstats 2006-11-20 15:51:05.531353306 +0100 +@@ -12,7 +12,7 @@ + use Getopt::Long; + + # You may wish to edit the next line to customize for your default log file. +-$usage_file = "/var/log/rsyncd.log"; ++$usage_file = "/var/log/rsyncd"; + + # Edit the following lines for default report settings. + # Entries defined here will be over-ridden by the command line. --- rsync-3.1.0.orig/debian/patches/ssh-6-option.diff +++ rsync-3.1.0/debian/patches/ssh-6-option.diff @@ -0,0 +1,34 @@ +--- a/main.c 2008-03-01 21:01:41.000000000 +0100 ++++ b/main.c 2008-03-04 18:55:10.933488013 +0100 +@@ -82,6 +82,7 @@ + #ifdef ICONV_OPTION + extern iconv_t ic_send; + #endif ++extern int default_af_hint; + + uid_t our_uid; + int local_server = 0; +@@ -381,6 +382,23 @@ + *t++ = '\0'; + } + ++#ifdef AF_INET ++ if (default_af_hint == AF_INET) { ++ if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) { ++ /* we're using ssh so we can add a -4 option */ ++ args[argc++] = "-4"; ++ } ++ } ++#endif ++#ifdef AF_INET6 ++ if (default_af_hint == AF_INET6) { ++ if (strncmp(cmd, "ssh", 3) == 0 || strstr(cmd, "/ssh") != NULL) { ++ /* we're using ssh so we can add a -6 option */ ++ args[argc++] = "-6"; ++ } ++ } ++#endif ++ + /* check to see if we've already been given '-l user' in + * the remote-shell command */ + for (i = 0; i < argc-1; i++) { --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12085-0001-prevent-information-leak-off-the-stack.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12085-0001-prevent-information-leak-off-the-stack.diff @@ -0,0 +1,27 @@ +From cf620065502f065d4ea44f5df4f81295a738aa21 Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Thu, 14 Nov 2024 09:57:08 +1100 +Subject: [PATCH] prevent information leak off the stack + +prevent leak of uninitialised stack data in hash_search +--- + match.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/match.c b/match.c +index 36e78ed2..dfd6af2c 100644 +--- a/match.c ++++ b/match.c +@@ -147,6 +147,9 @@ static void hash_search(int f,struct sum_struct *s, + int more; + schar *map; + ++ // prevent possible memory leaks ++ memset(sum2, 0, sizeof sum2); ++ + /* want_i is used to encourage adjacent matches, allowing the RLL + * coding of the output to work more efficiently. */ + want_i = 0; +-- +2.34.1 + --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12086-0001-refuse-fuzzy-options-when-fuzzy-not-selected.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12086-0001-refuse-fuzzy-options-when-fuzzy-not-selected.diff @@ -0,0 +1,33 @@ +From 3feb8669d875d03c9ceb82e208ef40ddda8eb908 Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Sat, 23 Nov 2024 11:08:03 +1100 +Subject: [PATCH 1/4] refuse fuzzy options when fuzzy not selected + +this prevents a malicious server providing a file to compare to when +the user has not given the fuzzy option +--- + receiver.c | 5 +++++ + 1 file changed, 5 insertions(+) + +Index: rsync-3.1.3/receiver.c +=================================================================== +--- rsync-3.1.3.orig/receiver.c ++++ rsync-3.1.3/receiver.c +@@ -63,5 +63,6 @@ extern char sender_file_sum[MAX_DIGEST_L + extern struct file_list *cur_flist, *first_flist, *dir_flist; + extern filter_rule_list daemon_filter_list; ++extern int fuzzy_basis; + + static struct bitbag *delayed_bits = NULL; + static int phase = 0, redoing = 0; +@@ -700,6 +701,10 @@ int recv_files(int f_in, int f_out, char + fnamecmp = get_backup_name(fname); + break; + case FNAMECMP_FUZZY: ++ if (fuzzy_basis == 0) { ++ rprintf(FERROR_XFER, "rsync: refusing malicious fuzzy operation for %s\n", xname); ++ exit_cleanup(RERR_PROTOCOL); ++ } + if (file->dirname) { + pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, file->dirname, xname); + fnamecmp = fnamecmpbuf; --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12086-0002-added-secure_relative_open.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12086-0002-added-secure_relative_open.diff @@ -0,0 +1,234 @@ +From 33385aefe4773e7a3982d41995681eb079c92d12 Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Sat, 23 Nov 2024 12:26:10 +1100 +Subject: [PATCH 2/4] added secure_relative_open() + +this is an open that enforces no symlink following for all path +components in a relative path +--- + syscall.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 74 insertions(+) + +Index: rsync-3.1.3/syscall.c +=================================================================== +--- rsync-3.1.3.orig/syscall.c ++++ rsync-3.1.3/syscall.c +@@ -33,6 +33,8 @@ + #include + #endif + ++#include "ifuncs.h" ++ + extern int dry_run; + extern int am_root; + extern int am_sender; +@@ -578,3 +580,75 @@ int do_open_nofollow(const char *pathnam + + return fd; + } ++ ++/* ++ open a file relative to a base directory. The basedir can be NULL, ++ in which case the current working directory is used. The relpath ++ must be a relative path, and the relpath must not contain any ++ elements in the path which follow symlinks (ie. like O_NOFOLLOW, but ++ applies to all path components, not just the last component) ++*/ ++int secure_relative_open(const char *basedir, const char *relpath, int flags, mode_t mode) ++{ ++ if (!relpath || relpath[0] == '/') { ++ // must be a relative path ++ errno = EINVAL; ++ return -1; ++ } ++ ++#if !defined(O_NOFOLLOW) || !defined(O_DIRECTORY) ++ // really old system, all we can do is live with the risks ++ if (!basedir) { ++ return open(relpath, flags, mode); ++ } ++ char fullpath[MAXPATHLEN]; ++ pathjoin(fullpath, sizeof fullpath, basedir, relpath); ++ return open(fullpath, flags, mode); ++#else ++ int dirfd = AT_FDCWD; ++ if (basedir != NULL) { ++ dirfd = openat(AT_FDCWD, basedir, O_RDONLY | O_DIRECTORY); ++ if (dirfd == -1) { ++ return -1; ++ } ++ } ++ int retfd = -1; ++ ++ char *path_copy = my_strdup(relpath, __FILE__, __LINE__); ++ if (!path_copy) { ++ return -1; ++ } ++ ++ for (const char *part = strtok(path_copy, "/"); ++ part != NULL; ++ part = strtok(NULL, "/")) ++ { ++ int next_fd = openat(dirfd, part, O_RDONLY | O_DIRECTORY | O_NOFOLLOW); ++ if (next_fd == -1 && errno == ENOTDIR) { ++ if (strtok(NULL, "/") != NULL) { ++ // this is not the last component of the path ++ errno = ELOOP; ++ goto cleanup; ++ } ++ // this could be the last component of the path, try as a file ++ retfd = openat(dirfd, part, flags | O_NOFOLLOW, mode); ++ goto cleanup; ++ } ++ if (next_fd == -1) { ++ goto cleanup; ++ } ++ if (dirfd != AT_FDCWD) close(dirfd); ++ dirfd = next_fd; ++ } ++ ++ // the path must be a directory ++ errno = EINVAL; ++ ++cleanup: ++ free(path_copy); ++ if (dirfd != AT_FDCWD) { ++ close(dirfd); ++ } ++ return retfd; ++#endif // O_NOFOLLOW, O_DIRECTORY ++} +Index: rsync-3.1.3/ifuncs.h +=================================================================== +--- rsync-3.1.3.orig/ifuncs.h ++++ rsync-3.1.3/ifuncs.h +@@ -104,3 +104,11 @@ free_stat_x(stat_x *sx_p) + } + #endif + } ++ ++static inline char *my_strdup(const char *str, const char *file, int line) ++{ ++ int len = strlen(str)+1; ++ char *buf = my_alloc(NULL, len, 1, file, line); ++ memcpy(buf, str, len); ++ return buf; ++} +\ No newline at end of file +Index: rsync-3.1.3/util2.c +=================================================================== +--- rsync-3.1.3.orig/util2.c ++++ rsync-3.1.3/util2.c +@@ -25,6 +25,9 @@ + #include "itypes.h" + #include "inums.h" + ++extern size_t max_alloc; ++ ++char *do_calloc = "42"; + /** + * Sleep for a specified number of milliseconds. + * +@@ -77,6 +80,26 @@ void *_realloc_array(void *ptr, unsigned + return realloc(ptr, size * num); + } + ++void *my_alloc(void *ptr, size_t num, size_t size, const char *file, int line) ++{ ++ if (max_alloc && num >= max_alloc/size) { ++ if (!file) ++ return NULL; ++ rprintf(FERROR, "[%s] exceeded --max-alloc=%s setting (file=%s, line=%d)\n", ++ who_am_i(), do_big_num(max_alloc, 0, NULL), src_file(file), line); ++ exit_cleanup(RERR_MALLOC); ++ } ++ if (!ptr) ++ ptr = malloc(num * size); ++ else if (ptr == do_calloc) ++ ptr = calloc(num, size); ++ else ++ ptr = realloc(ptr, num * size); ++ if (!ptr && file) ++ _out_of_memory("my_alloc caller", file, line); ++ return ptr; ++} ++ + const char *sum_as_hex(const char *sum) + { + static char buf[MAX_DIGEST_LEN*2+1]; +@@ -99,6 +122,27 @@ const char *sum_as_hex(int csum_type, co + return buf; + } + ++NORETURN void _out_of_memory(const char *msg, const char *file, int line) ++{ ++ rprintf(FERROR, "[%s] out of memory: %s (file=%s, line=%d)\n", who_am_i(), msg, src_file(file), line); ++ exit_cleanup(RERR_MALLOC); ++} ++ ++const char *src_file(const char *file) ++{ ++ static const char *util2 = __FILE__; ++ static int prefix = -1; ++ ++ if (prefix < 0) { ++ const char *cp = strrchr(util2, '/'); ++ prefix = cp ? cp - util2 + 1 : 0; ++ } ++ ++ if (prefix && strncmp(file, util2, prefix) == 0) ++ return file + prefix; ++ return file; ++} ++ + NORETURN void out_of_memory(const char *str) + { + rprintf(FERROR, "ERROR: out of memory in %s [%s]\n", str, who_am_i()); +Index: rsync-3.1.3/options.c +=================================================================== +--- rsync-3.1.3.orig/options.c ++++ rsync-3.1.3/options.c +@@ -185,6 +185,9 @@ int link_dest = 0; + int basis_dir_cnt = 0; + char *dest_option = NULL; + ++#define DEFAULT_MAX_ALLOC (1024L * 1024 * 1024) ++size_t max_alloc = DEFAULT_MAX_ALLOC; ++ + static int remote_option_alloc = 0; + int remote_option_cnt = 0; + const char **remote_options = NULL; +Index: rsync-3.1.3/Makefile.in +=================================================================== +--- rsync-3.1.3.orig/Makefile.in ++++ rsync-3.1.3/Makefile.in +@@ -46,7 +46,7 @@ popt_OBJS=popt/findme.o popt/popt.o po + popt/popthelp.o popt/poptparse.o + OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@ + +-TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@ ++TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@ + + # Programs we must have to run the test cases + CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \ +@@ -128,7 +128,7 @@ getgroups$(EXEEXT): getgroups.o + getfsdev$(EXEEXT): getfsdev.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS) + +-TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o ++TRIMSLASH_OBJ = trimslash.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o + trimslash$(EXEEXT): $(TRIMSLASH_OBJ) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS) + +Index: rsync-3.1.3/t_stub.c +=================================================================== +--- rsync-3.1.3.orig/t_stub.c ++++ rsync-3.1.3/t_stub.c +@@ -31,6 +31,7 @@ int module_dirlen = 0; + int preserve_acls = 0; + int preserve_times = 0; + int preserve_xattrs = 0; ++size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */ + char *partial_dir; + char *module_dir; + filter_rule_list daemon_filter_list; --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12086-0003-receiver-use-secure_relative_open-for-basis-file.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12086-0003-receiver-use-secure_relative_open-for-basis-file.diff @@ -0,0 +1,99 @@ +From e59ef9939d3f0ccc8f9bab51442989a81be0c914 Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Sat, 23 Nov 2024 12:28:13 +1100 +Subject: [PATCH 3/4] receiver: use secure_relative_open() for basis file + +this prevents attacks where the basis file is manipulated by a +malicious sender to gain information about files outside the +destination tree +--- + receiver.c | 42 ++++++++++++++++++++++++++---------------- + 1 file changed, 26 insertions(+), 16 deletions(-) + +Index: rsync-3.1.3/receiver.c +=================================================================== +--- rsync-3.1.3.orig/receiver.c ++++ rsync-3.1.3/receiver.c +@@ -537,6 +537,8 @@ int recv_files(int f_in, int f_out, char + delayed_bits = bitbag_create(cur_flist->used + 1); + + while (1) { ++ const char *basedir = NULL; ++ + cleanup_disable(); + + /* This call also sets cur_flist. */ +@@ -706,27 +708,29 @@ int recv_files(int f_in, int f_out, char + exit_cleanup(RERR_PROTOCOL); + } + if (file->dirname) { +- pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, file->dirname, xname); +- fnamecmp = fnamecmpbuf; +- } else +- fnamecmp = xname; ++ basedir = file->dirname; ++ } ++ fnamecmp = xname; + break; + default: + if (fnamecmp_type > FNAMECMP_FUZZY && fnamecmp_type-FNAMECMP_FUZZY <= basis_dir_cnt) { + fnamecmp_type -= FNAMECMP_FUZZY + 1; + if (file->dirname) { +- stringjoin(fnamecmpbuf, sizeof fnamecmpbuf, +- basis_dir[fnamecmp_type], "/", file->dirname, "/", xname, NULL); +- } else +- pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, basis_dir[fnamecmp_type], xname); ++ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, basis_dir[fnamecmp_type], file->dirname); ++ basedir = fnamecmpbuf; ++ } else { ++ basedir = basis_dir[fnamecmp_type]; ++ } ++ fnamecmp = xname; + } else if (fnamecmp_type >= basis_dir_cnt) { + rprintf(FERROR, + "invalid basis_dir index: %d.\n", + fnamecmp_type); + exit_cleanup(RERR_PROTOCOL); +- } else +- pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, basis_dir[fnamecmp_type], fname); +- fnamecmp = fnamecmpbuf; ++ } else { ++ basedir = basis_dir[fnamecmp_type]; ++ fnamecmp = fname; ++ } + break; + } + if (!fnamecmp || (daemon_filter_list.head +@@ -749,7 +753,7 @@ int recv_files(int f_in, int f_out, char + } + + /* open the file */ +- fd1 = do_open(fnamecmp, O_RDONLY, 0); ++ fd1 = secure_relative_open(basedir, fnamecmp, O_RDONLY, 0); + + if (fd1 == -1 && protocol_version < 29) { + if (fnamecmp != fname) { +@@ -759,13 +763,19 @@ int recv_files(int f_in, int f_out, char + + if (fd1 == -1 && basis_dir[0]) { + /* pre-29 allowed only one alternate basis */ +- pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, +- basis_dir[0], fname); +- fnamecmp = fnamecmpbuf; +- fd1 = do_open(fnamecmp, O_RDONLY, 0); ++ basedir = basis_dir[0]; ++ fnamecmp = fname; ++ fd1 = secure_relative_open(basedir, fnamecmp, O_RDONLY, 0); + } + } + ++ if (basedir) { ++ // for the following code we need the full ++ // path name as a single string ++ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, basedir, fnamecmp); ++ fnamecmp = fnamecmpbuf; ++ } ++ + updating_basis_or_equiv = inplace + && (fnamecmp == fname || fnamecmp_type == FNAMECMP_BACKUP); + --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12086-0004-disallow-.-elements-in-relpath-for-secure_relative_o.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12086-0004-disallow-.-elements-in-relpath-for-secure_relative_o.diff @@ -0,0 +1,34 @@ +From c78e53edb802d04f7e4e070fe8314f2544749e7a Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Tue, 26 Nov 2024 09:16:31 +1100 +Subject: [PATCH 4/4] disallow ../ elements in relpath for secure_relative_open + +--- + syscall.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: rsync-3.1.3/syscall.c +=================================================================== +--- rsync-3.1.3.orig/syscall.c ++++ rsync-3.1.3/syscall.c +@@ -587,6 +587,8 @@ int do_open_nofollow(const char *pathnam + must be a relative path, and the relpath must not contain any + elements in the path which follow symlinks (ie. like O_NOFOLLOW, but + applies to all path components, not just the last component) ++ ++ The relpath must also not contain any ../ elements in the path + */ + int secure_relative_open(const char *basedir, const char *relpath, int flags, mode_t mode) + { +@@ -595,6 +597,11 @@ int secure_relative_open(const char *bas + errno = EINVAL; + return -1; + } ++ if (strncmp(relpath, "../", 3) == 0 || strstr(relpath, "/../")) { ++ // no ../ elements allowed in the relpath ++ errno = EINVAL; ++ return -1; ++ } + + #if !defined(O_NOFOLLOW) || !defined(O_DIRECTORY) + // really old system, all we can do is live with the risks --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12087-0001-Refuse-a-duplicate-dirlist.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12087-0001-Refuse-a-duplicate-dirlist.diff @@ -0,0 +1,42 @@ +From 0ebc19ee486a8e928a68d8f98d07d40f176770aa Mon Sep 17 00:00:00 2001 +From: Wayne Davison +Date: Thu, 14 Nov 2024 15:46:50 -0800 +Subject: [PATCH 1/2] Refuse a duplicate dirlist. + +--- + flist.c | 9 +++++++++ + rsync.h | 1 + + 2 files changed, 10 insertions(+) + +Index: rsync-3.1.3/flist.c +=================================================================== +--- rsync-3.1.3.orig/flist.c ++++ rsync-3.1.3/flist.c +@@ -2456,6 +2456,15 @@ struct file_list *recv_file_list(int f, + init_hard_links(); + #endif + ++ if (inc_recurse && dir_ndx >= 0) { ++ struct file_struct *file = dir_flist->files[dir_ndx]; ++ if (file->flags & FLAG_GOT_DIR_FLIST) { ++ rprintf(FERROR_XFER, "rsync: refusing malicious duplicate flist for dir %d\n", dir_ndx); ++ exit_cleanup(RERR_PROTOCOL); ++ } ++ file->flags |= FLAG_GOT_DIR_FLIST; ++ } ++ + flist = flist_new(0, "recv_file_list"); + + if (inc_recurse) { +Index: rsync-3.1.3/rsync.h +=================================================================== +--- rsync-3.1.3.orig/rsync.h ++++ rsync-3.1.3/rsync.h +@@ -75,6 +75,7 @@ + #define FLAG_DUPLICATE (1<<4) /* sender */ + #define FLAG_MISSING_DIR (1<<4) /* generator */ + #define FLAG_HLINKED (1<<5) /* receiver/generator (checked on all types) */ ++#define FLAG_GOT_DIR_FLIST (1<<5)/* sender/receiver/generator - dir_flist only */ + #define FLAG_HLINK_FIRST (1<<6) /* receiver/generator (w/FLAG_HLINKED) */ + #define FLAG_IMPLIED_DIR (1<<6) /* sender/receiver/generator (dirs only) */ + #define FLAG_HLINK_LAST (1<<7) /* receiver/generator */ --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12087-0002-range-check-dir_ndx-before-use.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12087-0002-range-check-dir_ndx-before-use.diff @@ -0,0 +1,24 @@ +From b3e16be18d582dac1513c0a932d146b36e867b1b Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Tue, 26 Nov 2024 16:12:45 +1100 +Subject: [PATCH 2/2] range check dir_ndx before use + +--- + flist.c | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: rsync-3.1.3/flist.c +=================================================================== +--- rsync-3.1.3.orig/flist.c ++++ rsync-3.1.3/flist.c +@@ -2457,6 +2457,10 @@ struct file_list *recv_file_list(int f, + #endif + + if (inc_recurse && dir_ndx >= 0) { ++ if (dir_ndx >= dir_flist->used) { ++ rprintf(FERROR_XFER, "rsync: refusing invalid dir_ndx %u >= %u\n", dir_ndx, dir_flist->used); ++ exit_cleanup(RERR_PROTOCOL); ++ } + struct file_struct *file = dir_flist->files[dir_ndx]; + if (file->flags & FLAG_GOT_DIR_FLIST) { + rprintf(FERROR_XFER, "rsync: refusing malicious duplicate flist for dir %d\n", dir_ndx); --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12088-0001-make-safe-links-stricter.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12088-0001-make-safe-links-stricter.diff @@ -0,0 +1,132 @@ +From 535f8f816539ba681ef0f12015d2cb587ae61b6d Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Sat, 23 Nov 2024 15:15:53 +1100 +Subject: [PATCH] make --safe-links stricter + +when --safe-links is used also reject links where a '../' component is +included in the destination as other than the leading part of the +filename +--- + testsuite/safe-links.test | 55 ++++++++++++++++++++++++++++++++++++ + testsuite/unsafe-byname.test | 2 +- + util.c | 26 ++++++++++++++++- + 3 files changed, 81 insertions(+), 2 deletions(-) + create mode 100644 testsuite/safe-links.test + +Index: rsync-3.1.3/testsuite/safe-links.test +=================================================================== +--- /dev/null ++++ rsync-3.1.3/testsuite/safe-links.test +@@ -0,0 +1,55 @@ ++#!/bin/sh ++ ++. "$suitedir/rsync.fns" ++ ++test_symlink() { ++ is_a_link "$1" || test_fail "File $1 is not a symlink" ++} ++ ++test_regular() { ++ if [ ! -f "$1" ]; then ++ test_fail "File $1 is not regular file or not exists" ++ fi ++} ++ ++test_notexist() { ++ if [ -e "$1" ]; then ++ test_fail "File $1 exists" ++ fi ++ if [ -h "$1" ]; then ++ test_fail "File $1 exists as a symlink" ++ fi ++} ++ ++cd "$tmpdir" ++ ++mkdir from ++ ++mkdir "from/safe" ++mkdir "from/unsafe" ++ ++mkdir "from/safe/files" ++mkdir "from/safe/links" ++ ++touch "from/safe/files/file1" ++touch "from/safe/files/file2" ++touch "from/unsafe/unsafefile" ++ ++ln -s ../files/file1 "from/safe/links/" ++ln -s ../files/file2 "from/safe/links/" ++ln -s ../../unsafe/unsafefile "from/safe/links/" ++ln -s a/a/a/../../../unsafe2 "from/safe/links/" ++ ++#echo "LISTING FROM" ++#ls -lR from ++ ++echo "rsync with relative path and just -a" ++$RSYNC -avv --safe-links from/safe/ to ++ ++#echo "LISTING TO" ++#ls -lR to ++ ++test_symlink to/links/file1 ++test_symlink to/links/file2 ++test_notexist to/links/unsafefile ++test_notexist to/links/unsafe2 +Index: rsync-3.1.3/testsuite/unsafe-byname.test +=================================================================== +--- rsync-3.1.3.orig/testsuite/unsafe-byname.test ++++ rsync-3.1.3/testsuite/unsafe-byname.test +@@ -41,7 +41,7 @@ test_unsafe ..//../dest from/dir uns + test_unsafe .. from/file safe + test_unsafe ../.. from/file unsafe + test_unsafe ..//.. from//file unsafe +-test_unsafe dir/.. from safe ++test_unsafe dir/.. from unsafe + test_unsafe dir/../.. from unsafe + test_unsafe dir/..//.. from unsafe + +Index: rsync-3.1.3/util.c +=================================================================== +--- rsync-3.1.3.orig/util.c ++++ rsync-3.1.3/util.c +@@ -1418,7 +1418,14 @@ int handle_partial_dir(const char *fname + * + * "src" is the top source directory currently applicable at the level + * of the referenced symlink. This is usually the symlink's full path +- * (including its name), as referenced from the root of the transfer. */ ++ * (including its name), as referenced from the root of the transfer. ++ * ++ * NOTE: this also rejects dest names with a .. component in other ++ * than the first component of the name ie. it rejects names such as ++ * a/b/../x/y. This needs to be done as the leading subpaths 'a' or ++ * 'b' could later be replaced with symlinks such as a link to '.' ++ * resulting in the link being transferred now becoming unsafe ++ */ + int unsafe_symlink(const char *dest, const char *src) + { + const char *name, *slash; +@@ -1428,6 +1435,23 @@ int unsafe_symlink(const char *dest, con + if (!dest || !*dest || *dest == '/') + return 1; + ++ // reject destinations with /../ in the name other than at the start of the name ++ const char *dest2 = dest; ++ while (strncmp(dest2, "../", 3) == 0) { ++ dest2 += 3; ++ while (*dest2 == '/') { ++ // allow for ..//..///../foo ++ dest2++; ++ } ++ } ++ if (strstr(dest2, "/../")) ++ return 1; ++ ++ // reject if the destination ends in /.. ++ const size_t dlen = strlen(dest); ++ if (dlen > 3 && strcmp(&dest[dlen-3], "/..") == 0) ++ return 1; ++ + /* find out what our safety margin is */ + for (name = src; (slash = strchr(name, '/')) != 0; name = slash+1) { + /* ".." segment starts the count over. "." segment is ignored. */ --- rsync-3.1.0.orig/debian/patches/z-CVE-2024-12747-0001-fixed-symlink-race-condition-in-sender.diff +++ rsync-3.1.0/debian/patches/z-CVE-2024-12747-0001-fixed-symlink-race-condition-in-sender.diff @@ -0,0 +1,151 @@ +From f45f48055e548851bc7230f454dfeba139be6c04 Mon Sep 17 00:00:00 2001 +From: Andrew Tridgell +Date: Wed, 18 Dec 2024 08:59:42 +1100 +Subject: [PATCH] fixed symlink race condition in sender + +when we open a file that we don't expect to be a symlink use +O_NOFOLLOW to prevent a race condition where an attacker could change +a file between being a normal file and a symlink +--- + +diff --git a/checksum.c b/checksum.c +index cb21882..66e8089 100644 +--- a/checksum.c ++++ b/checksum.c +@@ -406,7 +406,7 @@ void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum) + + memset(sum, 0, MAX_DIGEST_LEN); + +- fd = do_open(fname, O_RDONLY, 0); ++ fd = do_open_checklinks(fname); + if (fd == -1) + return; + +diff --git a/generator.c b/generator.c +index 110db28..3f13bb9 100644 +--- a/generator.c ++++ b/generator.c +@@ -1867,7 +1867,7 @@ static void recv_generator(char *fname, struct file_struct *file, int ndx, + } + + /* open the file */ +- if ((fd = do_open(fnamecmp, O_RDONLY, 0)) < 0) { ++ if ((fd = do_open_checklinks(fnamecmp)) < 0) { + rsyserr(FERROR, errno, "failed to open %s, continuing", + full_fname(fnamecmp)); + pretend_missing: +diff --git a/receiver.c b/receiver.c +index 8031b8f..edfbb21 100644 +--- a/receiver.c ++++ b/receiver.c +@@ -775,7 +775,7 @@ int recv_files(int f_in, int f_out, char *local_name) + if (fd1 == -1 && protocol_version < 29) { + if (fnamecmp != fname) { + fnamecmp = fname; +- fd1 = do_open(fnamecmp, O_RDONLY, 0); ++ fd1 = do_open_nofollow(fnamecmp, O_RDONLY); + } + + if (fd1 == -1 && basis_dir[0]) { +diff --git a/sender.c b/sender.c +index 2bbff2f..a4d46c3 100644 +--- a/sender.c ++++ b/sender.c +@@ -350,7 +350,7 @@ void send_files(int f_in, int f_out) + exit_cleanup(RERR_PROTOCOL); + } + +- fd = do_open(fname, O_RDONLY, 0); ++ fd = do_open_checklinks(fname); + if (fd == -1) { + if (errno == ENOENT) { + enum logcode c = am_daemon +diff --git a/syscall.c b/syscall.c +index 47c5ea5..c55ae5f 100644 +--- a/syscall.c ++++ b/syscall.c +@@ -39,6 +39,8 @@ extern int read_only; + extern int list_only; + extern int preserve_perms; + extern int preserve_executability; ++extern int copy_links; ++extern int copy_unsafe_links; + + #define RETURN_ERROR_IF(x,e) \ + do { \ +@@ -793,3 +795,21 @@ cleanup: + return retfd; + #endif // O_NOFOLLOW, O_DIRECTORY + } ++ ++/* ++ varient of do_open/do_open_nofollow which does do_open() if the ++ copy_links or copy_unsafe_links options are set and does ++ do_open_nofollow() otherwise ++ ++ This is used to prevent a race condition where an attacker could be ++ switching a file between being a symlink and being a normal file ++ ++ The open is always done with O_RDONLY flags ++ */ ++int do_open_checklinks(const char *pathname) ++{ ++ if (copy_links || copy_unsafe_links) { ++ return do_open(pathname, O_RDONLY, 0); ++ } ++ return do_open_nofollow(pathname, O_RDONLY); ++} +diff --git a/t_unsafe.c b/t_unsafe.c +index 010cac5..e10619a 100644 +--- a/t_unsafe.c ++++ b/t_unsafe.c +@@ -28,6 +28,9 @@ int am_root = 0; + int human_readable = 0; + int preserve_perms = 0; + int preserve_executability = 0; ++int copy_links = 0; ++int copy_unsafe_links = 0; ++ + short info_levels[COUNT_INFO], debug_levels[COUNT_DEBUG]; + + int +diff --git a/tls.c b/tls.c +index e6b0708..858f8f1 100644 +--- a/tls.c ++++ b/tls.c +@@ -49,6 +49,9 @@ int list_only = 0; + int nsec_times = 0; + int preserve_perms = 0; + int preserve_executability = 0; ++int safe_symlinks = 0; ++int copy_links = 0; ++int copy_unsafe_links = 0; + + #ifdef SUPPORT_XATTRS + +diff --git a/trimslash.c b/trimslash.c +index 1ec928c..f2774cd 100644 +--- a/trimslash.c ++++ b/trimslash.c +@@ -26,6 +26,8 @@ int am_root = 0; + int list_only = 0; + int preserve_perms = 0; + int preserve_executability = 0; ++int copy_links = 0; ++int copy_unsafe_links = 0; + + int + main(int argc, char **argv) +diff --git a/util.c b/util.c +index f260d39..d84bc41 100644 +--- a/util.c ++++ b/util.c +@@ -365,7 +365,7 @@ int copy_file(const char *source, const char *dest, int tmpfilefd, mode_t mode) + OFF_T preallocated_len = 0, offset = 0; + #endif + +- if ((ifd = do_open(source, O_RDONLY, 0)) < 0) { ++ if ((ifd = do_open_nofollow(source, O_RDONLY)) < 0) { + int save_errno = errno; + rsyserr(FERROR_XFER, errno, "open %s", full_fname(source)); + errno = save_errno; --- rsync-3.1.0.orig/debian/patches/z-fix_flag_got_dir_flist_collision.diff +++ rsync-3.1.0/debian/patches/z-fix_flag_got_dir_flist_collision.diff @@ -0,0 +1,33 @@ +From efb85fd8db9e8f74eb3ab91ebf44f6ed35e3da5b Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 15 Jan 2025 15:10:24 +0100 +Subject: [PATCH] Fix FLAG_GOT_DIR_FLIST collission with FLAG_HLINKED + +fixes commit 688f5c379a43 (Refuse a duplicate dirlist.) + +Fixes: https://github.com/RsyncProject/rsync/issues/702 +Fixes: https://github.com/RsyncProject/rsync/issues/697 +--- + rsync.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rsync.h b/rsync.h +index 9be1297b..479ac484 100644 +--- a/rsync.h ++++ b/rsync.h +@@ -84,7 +84,6 @@ + #define FLAG_DUPLICATE (1<<4) /* sender */ + #define FLAG_MISSING_DIR (1<<4) /* generator */ + #define FLAG_HLINKED (1<<5) /* receiver/generator (checked on all types) */ +-#define FLAG_GOT_DIR_FLIST (1<<5)/* sender/receiver/generator - dir_flist only */ + #define FLAG_HLINK_FIRST (1<<6) /* receiver/generator (w/FLAG_HLINKED) */ + #define FLAG_IMPLIED_DIR (1<<6) /* sender/receiver/generator (dirs only) */ + #define FLAG_HLINK_LAST (1<<7) /* receiver/generator */ +@@ -93,6 +92,7 @@ + #define FLAG_SKIP_GROUP (1<<10) /* receiver/generator */ + #define FLAG_TIME_FAILED (1<<11)/* generator */ + #define FLAG_MOD_NSEC (1<<12) /* sender/receiver/generator */ ++#define FLAG_GOT_DIR_FLIST (1<<13)/* sender/receiver/generator - dir_flist only */ + + /* These flags are passed to functions but not stored. */ + --- rsync-3.1.0.orig/debian/postinst +++ rsync-3.1.0/debian/postinst @@ -0,0 +1,30 @@ +#!/bin/sh -e + +action="$1" +oldversion="$2" + +if [ "$action" != configure ]; then + exit 0 +fi + + +if [ -x /etc/init.d/rsync ]; then + if dpkg --compare-versions "$oldversion" lt "3.0.7-2"; then + update-rc.d -f rsync remove + fi + + update-rc.d rsync defaults + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d rsync restart + else + /etc/init.d/rsync restart + fi +fi + +# # Remove shutdown and reboot links; this init script does not need them. +# # The wildcards are needed as we can't predict the number anymore... +# if dpkg --compare-versions "$oldversion" lt "3.0.7-2"; then +# rm -f /etc/rc0.d/K??rsync /etc/rc1.d/K??rsync /etc/rc6.d/K??rsync +# fi + +exit 0 --- rsync-3.1.0.orig/debian/postrm +++ rsync-3.1.0/debian/postrm @@ -0,0 +1,8 @@ +#!/bin/sh -e +# postrm for rsync + +if [ "$1" = "purge" ] ; then + update-rc.d rsync remove >/dev/null +fi + +exit 0 --- rsync-3.1.0.orig/debian/prerm +++ rsync-3.1.0/debian/prerm @@ -0,0 +1,30 @@ +#!/bin/sh -e +# prerm for rsync + +case "$1" in + remove|deconfigure) + if [ -h /usr/doc/rsync ]; then + rm -f /usr/doc/rsync + fi + if [ -x /etc/init.d/rsync ]; then + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d rsync stop + else + /etc/init.d/rsync stop + fi + fi + ;; + upgrade) + if [ -h /usr/doc/rsync ]; then + rm -f /usr/doc/rsync + fi + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 0 + ;; +esac + +exit 0 --- rsync-3.1.0.orig/debian/rsync.service +++ rsync-3.1.0/debian/rsync.service @@ -0,0 +1,9 @@ +[Unit] +Description=fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf + +[Service] +ExecStart=/usr/bin/rsync --daemon --no-detach + +[Install] +WantedBy=multi-user.target --- rsync-3.1.0.orig/debian/rsyncd.conf +++ rsync-3.1.0/debian/rsyncd.conf @@ -0,0 +1,44 @@ +# sample rsyncd.conf configuration file + +# GLOBAL OPTIONS + +#motd file=/etc/motd +#log file=/var/log/rsyncd +# for pid file, do not use /var/run/rsync.pid if +# you are going to run rsync out of the init.d script. +# The init.d script does its own pid file handling, +# so omit the "pid file" line completely in that case. +# pid file=/var/run/rsyncd.pid +#syslog facility=daemon +#socket options= + +# MODULE OPTIONS + +[ftp] + + comment = public archive + path = /var/www/pub + use chroot = yes +# max connections=10 + lock file = /var/lock/rsyncd +# the default for read only is yes... + read only = yes + list = yes + uid = nobody + gid = nogroup +# exclude = +# exclude from = +# include = +# include from = +# auth users = +# secrets file = /etc/rsyncd.secrets + strict modes = yes +# hosts allow = +# hosts deny = + ignore errors = no + ignore nonreadable = yes + transfer logging = no +# log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes. + timeout = 600 + refuse options = checksum dry-run + dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz --- rsync-3.1.0.orig/debian/rules +++ rsync-3.1.0/debian/rules @@ -0,0 +1,149 @@ +#!/usr/bin/make -f +# debian.rules file for rsync +# Copyright 1996 by Philip Hands. +# Copyright 2001 Colin Walters +# Based on the sample debian.rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) + + +SHELL = /bin/bash +BINS = rsync +CFLAGS= -Wall +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 + +CFLAGS += `dpkg-buildflags --get CFLAGS` +LDFLAGS = `dpkg-buildflags --get LDFLAGS` + +CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) + +# policy stuff +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +else +CFLAGS += -g -O2 +endif + +# backwards compatibility stuff, from dpkg-architecture manpage +DEB_BUILD_ARCH := $(shell dpkg --print-architecture) +DEB_BUILD_GNU_CPU := $(patsubst hurd-%,%,$(DEB_BUILD_ARCH)) +ifeq ($(filter-out hurd-%,$(DEB_BUILD_ARCH)),) +DEB_BUILD_GNU_SYSTEM := gnu +else +DEB_BUILD_GNU_SYSTEM := linux +endif +DEB_BUILD_GNU_TYPE=$(DEB_BUILD_GNU_CPU)-$(DEB_BUILD_GNU_SYSTEM) + +DEB_HOST_ARCH=$(DEB_BUILD_ARCH) +DEB_HOST_GNU_CPU=$(DEB_BUILD_GNU_CPU) +DEB_HOST_GNU_SYSTEM=$(DEB_BUILD_GNU_SYSTEM) +DEB_HOST_GNU_TYPE=$(DEB_BUILD_GNU_TYPE) + +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +INSTALL_CROSS := +else +INSTALL_CROSS := INSTALLCMD='$(INSTALL) --strip-program=$(DEB_HOST_GNU_TYPE)-strip' +endif + +# keep lintian happy: +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp + +build-stamp: + @echo building build tree + -rm -rf debian/buildtree + mkdir debian/buildtree + cp -p * debian/buildtree || true + cp -r lib popt support testsuite zlib debian/buildtree + @echo applying misc Debian patches + for i in debian/patches/*.patch debian/patches/*.diff; do if [ -s $$i ]; then echo " $$i ..."; cat $$i | (cd debian/buildtree; patch -p1) || exit 1; fi; done + @echo configuring + (cd debian/buildtree; ./configure --with-included-zlib=no --prefix=/usr --mandir='$${prefix}/share/man' --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) LDFLAGS="$(LDFLAGS)") + @echo building + $(MAKE) --directory=debian/buildtree CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" all + touch build-stamp + @echo done + +clean: checkdir + -rm -f build-stamp + -rm -rf debian/buildtree + -rm -rf *~ debian/tmp debian/*~ debian/*.bak debian/files* debian/substvars + +binary-indep: checkroot build +# nothing to do + +binary-arch: checkroot build + -rm -rf debian/tmp + $(INSTALL_DIR) debian/tmp \ + debian/tmp/DEBIAN \ + debian/tmp/usr/bin \ + debian/tmp/usr/share/doc/rsync/examples \ + debian/tmp/usr/share/doc/rsync/scripts \ + debian/tmp/usr/share/man/man1 \ + debian/tmp/usr/share/man/man5 \ + debian/tmp/usr/share/lintian/overrides \ + debian/tmp/lib/systemd/system \ + debian/tmp/etc \ + debian/tmp/etc/default \ + debian/tmp/etc/init.d + # debian/tmp/usr/lib/debian-test/tests +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + $(MAKE) --directory=debian/buildtree install-strip prefix=`pwd`/debian/tmp/usr exec_prefix=`pwd`/debian/tmp/usr $(INSTALL_CROSS) +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + strip --remove-section=.comment --remove-section=.note debian/tmp/usr/bin/rsync +else + $(DEB_HOST_GNU_TYPE)-strip --remove-section=.comment --remove-section=.note debian/tmp/usr/bin/rsync +endif +else + $(MAKE) --directory=debian/buildtree install prefix=`pwd`/debian/tmp/usr exec_prefix=`pwd`/debian/tmp/usr +endif + $(INSTALL_FILE) debian/changelog debian/tmp/usr/share/doc/rsync/changelog.Debian + $(INSTALL_FILE) README tech_report.tex debian/tmp/usr/share/doc/rsync/ + $(INSTALL_FILE) TODO debian/tmp/usr/share/doc/rsync/ + $(INSTALL_FILE) NEWS debian/tmp/usr/share/doc/rsync/changelog + $(INSTALL_FILE) packaging/cull_options debian/tmp/usr/share/doc/rsync/scripts/ + $(INSTALL_FILE) support/atomic-rsync support/cvs2includes support/file-attr-restore support/files-to-excludes support/git-set-file-times support/logfilter support/lsh support/mnt-excl support/munge-symlinks support/rrsync support/rsyncstats debian/tmp/usr/share/doc/rsync/scripts/ + # $(INSTALL_FILE) debian/README.Debian debian/tmp/usr/share/doc/rsync/ + echo -e '\n\f' >> debian/tmp/usr/share/doc/rsync/changelog + cat OLDNEWS >> debian/tmp/usr/share/doc/rsync/changelog + gzip -9fr `find debian/tmp/usr/share/doc/ debian/tmp/usr/share/man/ -type f` + $(INSTALL_FILE) debian/rsyncd.conf debian/logrotate.conf.rsync debian/tmp/usr/share/doc/rsync/examples/ + $(INSTALL_FILE) debian/copyright debian/tmp/usr/share/doc/rsync/ + # $(INSTALL_SCRIPT) test.sh debian/tmp/usr/lib/debian-test/tests/rsync + $(INSTALL_SCRIPT) debian/postinst debian/tmp/DEBIAN/ + $(INSTALL_SCRIPT) debian/prerm debian/tmp/DEBIAN/ + $(INSTALL_SCRIPT) debian/postrm debian/tmp/DEBIAN/ + $(INSTALL_FILE) debian/rsync.service debian/tmp/lib/systemd/system/ + $(INSTALL_FILE) debian/default debian/tmp/etc/default/rsync + $(INSTALL_SCRIPT) debian/init.d debian/tmp/etc/init.d/rsync + $(INSTALL_FILE) debian/lintian.overrides debian/tmp/usr/share/lintian/overrides/rsync + (cd debian/tmp; find ./etc -type f | sed s,.,,) > debian/tmp/DEBIAN/conffiles + (cd debian/tmp; find lib usr -type f -print0 | xargs -0 md5sum) > debian/tmp/DEBIAN/md5sums + dpkg-shlibdeps debian/tmp/usr/bin/$(BINS) + dpkg-gencontrol -isp + chown -R root.root debian/tmp + chmod -R go=rX debian/tmp + dpkg --build debian/tmp .. + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkdir: + @test -f rsync.c -a -f debian/rules + +checkroot: checkdir + @test 0 = `id -u` || { echo "Error: not super-user"; exit 1; } + +.PHONY: binary binary-arch binary-indep clean checkroot checkdir build build-arch build-indep --- rsync-3.1.0.orig/debian/source/format +++ rsync-3.1.0/debian/source/format @@ -0,0 +1 @@ +1.0 --- rsync-3.1.0.orig/debian/watch +++ rsync-3.1.0/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://rsync.samba.org/ftp/rsync/ rsync-(.+)\.tar\.gz --- rsync-3.1.0.orig/support/rrsync +++ rsync-3.1.0/support/rrsync @@ -31,7 +31,7 @@ # command="rrsync logs/client" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAzGhEeNlPr... # command="rrsync -ro results" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAmkHG1WCjC... # -# Format of the envrionment variables set by sshd: +# Format of the environment variables set by sshd: # SSH_ORIGINAL_COMMAND=rsync --server -vlogDtpr --partial . ARG # push # SSH_ORIGINAL_COMMAND=rsync --server --sender -vlogDtpr --partial . ARGS # pull # SSH_CONNECTION=client_addr client_port server_port