Bug 248318 - net/rsync: Fails to patch with ACL=ON (3.2.2)
Summary: net/rsync: Fails to patch with ACL=ON (3.2.2)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Rodrigo Osorio
URL:
Keywords: needs-patch, regression
: 248388 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-28 09:39 UTC by Daniel Engberg
Modified: 2020-08-20 07:21 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (rodrigo)
koobs: merge-quarterly?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2020-07-28 09:39:23 UTC
===>  Patching for rsync-3.2.2
===>  Applying extra patch /usr/ports/net/rsync/work/rsync-3.2.2/patches/acls.diff
===>  Applying extra patch /usr/ports/net/rsync/files/extrapatch-acl
Ignoring previously applied (or reversed) patch.
2 out of 2 hunks ignored--saving rejects to rsync.c.rej
===>  FAILED Applying extra patch /usr/ports/net/rsync/files/extrapatch-acl
*** Error code 1
Comment 1 dewayne 2020-07-31 22:12:57 UTC
(In reply to daniel.engberg.lists from comment #0)
Thanks Daniel, I'm having the same problem on FreeBSD12.1S amd64, with 
# make -C /usr/ports/net/rsync showconfig
===> The following configuration options are available for rsync-3.2.2:
     DOCS=on: Build and/or install documentation
     ICONV=on: Encoding conversion support via iconv
     POPT_PORT=off: Use popt from devel/popt instead of bundled one
     SSH=on: Use SSH instead of RSH
     ZLIB_BASE=off: Use zlib from base instead of bundled one
====> Functionality provided by third party patches: you can only select none or one of them
     TIMELIMIT=off: Time limit patch
     RENAMED=off: Add support for renamed file detection
     FLAGS=off: File system flags support patch, adds --fileflags
     ATIMES=off: Preserve access times, adds --atimes (BROKEN)
     ACL=on: Add backward-compatibility for the --acls option
Comment 2 dewayne 2020-07-31 22:16:35 UTC
*** Bug 248388 has been marked as a duplicate of this bug. ***
Comment 3 dewayne 2020-07-31 23:37:01 UTC
(In reply to dewayne from comment #1)
Solution: remove the /usr/ports/net/rsync/files/extrapatch-acl patch, and its call in Makefile

Detail:
Have checked these parts of /usr/ports/net/rsync/files/extrapatch-acl in
rsync.h, rsync.c, lib/sysacls.h, lib/sysacls.c but not others,
and our patch seems to have been applied upstream. 

So running the following tests on rsync 3.1.3, and then rsync 3.2.2 without the files/extrapatch-acl, the results were the same.

Note: In building 3.2.2, I only commented out 
#ACL_EXTRA_PATCHES=             ${WRKSRC}/patches/acls.diff \
#                               ${FILESDIR}/extrapatch-acl
---
Test using rsync 3.1.3 and 3.2.2 after removing files/extrapatch-acl. Results were identical.

rm /tmp/file.txt /tmp/b2/file.txt || true

echo Hello> /tmp/file.txt
setextattr system s text1 /tmp/file.txt
setextattr user u text2 /tmp/file.txt
getextattr system s /tmp/file.txt
getextattr user u /tmp/file.txt
setfacl -m u:www:rx /tmp/file.txt
getfacl /tmp/file.txt

rsync -Av /tmp/file.txt /tmp/b2/
getfacl /tmp/b2/file.txt
# As expected

rm /tmp/b2/file.txt

rsync -Xv /tmp/file.txt /tmp/b2/
getextattr system s /tmp/b2/file.txt
getextattr user u /tmp/b2/file.txt
# As expected. system namespace isn't copied (its the way it is...)

rm /tmp/b2/file.txt

rsync -AXv /tmp/file.txt /tmp/b2/
getextattr system s /tmp/b2/file.txt
getextattr user u /tmp/b2/file.txt
getfacl /tmp/b2/file.txt
# As expected.  All good! :)

Interesting comparison:
# For 3.1.3
# ldd `which rsync`
/usr/local/bin/rsync:
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x8012d9000)
        libc.so.7 => /lib/libc.so.7 (0x8015d2000)

# For 3.2.2
# ldd `which rsync`
/usr/local/bin/rsync:
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x8012de000)
        liblz4.so.1 => /usr/local/lib/liblz4.so.1 (0x8015d7000)
        libzstd.so.1 => /usr/local/lib/libzstd.so.1 (0x801803000)
        libxxhash.so.0 => /usr/local/lib/libxxhash.so.0 (0x801ad0000)
        libcrypto.so.11 => /usr/local/lib/libcrypto.so.11 (0x801e00000)
        libc.so.7 => /lib/libc.so.7 (0x8022bc000)
        libthr.so.3 => /lib/libthr.so.3 (0x801cdc000)

Rodrigo, thank-you for your efforts to update and provide a functioning rsync.
:)
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-08-16 17:08:43 UTC
A commit references this bug:

Author: rodrigo
Date: Sun Aug 16 17:08:02 UTC 2020
New revision: 545124
URL: https://svnweb.freebsd.org/changeset/ports/545124

Log:
  net/rsync upgrade to 3.2.3

  major changes:
   - Fix multiple bugs in xattr code.
   - Restored the ability to use --bwlimit=0 to specify no bandwidth limit.
   - Fix a bug when combining --delete-missing-args with --no-implied-dirs & -R where rsync might create the destination path of a missing arg.
   - Fixed an issue where hard-linked devices could cause the rdev_major value to get out of sync between the sender and the receiver.
   - Rsync now complains about a missing --temp-dir before starting any file transfers.
   - A completely empty source arg is now a fatal error.

  See full changelog: https://download.samba.org/pub/rsync/NEWS#3.2.3

  Also, fix build issue with ACL option (patch is not required anymore)

  PR:		248318 247795

Changes:
  head/net/rsync/Makefile
  head/net/rsync/distinfo
  head/net/rsync/files/extrapatch-acl
Comment 5 commit-hook freebsd_committer freebsd_triage 2020-08-20 07:18:27 UTC
A commit references this bug:

Author: rodrigo
Date: Thu Aug 20 07:17:52 UTC 2020
New revision: 545504
URL: https://svnweb.freebsd.org/changeset/ports/545504

Log:
  MFH: r543580 r543582 r543637 r544331 r545124

  net/rsync upgrade to 3.2.2

  Major changes and bugfixes:
   3.1.3 -> 3.2.0
   * Avoid potential out-of-bounds read in daemon mode
   * Fix defaul list list of skip-compress files for non-daemon transfers
   * Fix xattr filter rules losing an 'x' attribute in a non-local transfer
   * zlib fixes for CVE-2016-9843, CVE-2016-9842, CVE-2016-9841, and CVE-2016-9840
   * Fixed a crash in the --iconv code
   * Checksum enhancements, including the addition of xxhash
   * The checksum preference order of the negotiation can be customized or forced
   * Compression enhancements, including the addition of zstd and lz4 compression algorithms
   * Added openssl & preliminary gnutls support to the rsync-ssl script
   * Added the proxy protocol daemon parameter that allows your rsyncd to know the real remote
     IP when it is setup behind a proxy

   3.2.0 -> 3.2.1
   * Fix potential issue with MD5 assembly-language code
   * option --backup-dir=STR now implies --backup

   3.2.1 -> 3.2.2
   * Avoid a crash when a daemon module enables transfer logging without setting a log format value

  Full release message: https://download.samba.org/pub/rsync/NEWS#3.2.2

  Security: CVE-2016-9843 CVE-2016-9842 CVE-2016-9841 CVE-2016-9840
  MFH after: 2 weeks

  rsync: Unbreak fetch

  rsync: Unbreak and fix depends

  rsync now depends on stuff in LOCALBASE. Previously, clang only needed to know
  about LOCALBASE if POPT or ICONV was enabled. When those options are off, xxhash
  and zstd were not found by configure.

  Also, a depend on libssl was missing, and there were some noop reinplaces.

  With hat: portmgr

  - Fix fetch
  - Fix license and add LICENSE_FILE
  - Add missing dependency on liblz4
  - Whitespace fixes
  - Switch to options helpers

  Approved by:	portmgr blanket

  net/rsync upgrade to 3.2.3

  major changes:
   - Fix multiple bugs in xattr code.
   - Restored the ability to use --bwlimit=0 to specify no bandwidth limit.
   - Fix a bug when combining --delete-missing-args with --no-implied-dirs & -R where rsync might create the destination path of a missing arg.
   - Fixed an issue where hard-linked devices could cause the rdev_major value to get out of sync between the sender and the receiver.
   - Rsync now complains about a missing --temp-dir before starting any file transfers.
   - A completely empty source arg is now a fatal error.

  See full changelog: https://download.samba.org/pub/rsync/NEWS#3.2.3

  Also, fix build issue with ACL option (patch is not required anymore)

  PR:		248318 247795

  Approved by:	ports-secteam (joenum)

Changes:
_U  branches/2020Q3/
  branches/2020Q3/net/rsync/Makefile
  branches/2020Q3/net/rsync/distinfo
  branches/2020Q3/net/rsync/files/extrapatch-acl
  branches/2020Q3/net/rsync/files/patch-siginfo
  branches/2020Q3/net/rsync/pkg-plist
Comment 6 Rodrigo Osorio freebsd_committer freebsd_triage 2020-08-20 07:21:59 UTC
Build with ACL=ON is now fixed. Thanks for reporting the issue