update net/rsync 3.2.4

NEWS: https://download.samba.org/pub/rsync/NEWS#3.2.4

originally from tj@ with tweaks by me:
- --with-nobody-user=_rsync
- remove compat.c (fixed)
- remove configure.sh (use --with-nobody-user=_rsync instead)
- remove receiver.c (upstreamed)
- rrsync patch: churn and moves from perl to python3
- --with-rrsync and brings in python as BUILD_DEPENDS (not RUN_DEPENDS)
    and textproc/py-commonmark, needed to run
    ${WRKSRC}/md-convert. md-convert converts rsync.1.md --> rsync.1, so
    remove patches for man pages and patch markdown files instead.
- When patching markdown files, mainly keep these two changes:
  /usr/bin --> ${PREFIX}/bin and nobody --> _rsync.
- remove rsyncd.conf.5 from ${SUBST_CMD}
- --enable-md5-asm only on amd64, as configure check fails on other
    platforms (from naddy@ to retain
    checking whether to enable MD5 ASM optimizations... yes (x86_64))

feedback from tj@ espie@ sthen@ naddy@
ok sthen@
This commit is contained in:
namn 2022-05-23 00:24:58 +00:00
parent 284aff52ac
commit dd1e1ba109
11 changed files with 70 additions and 143 deletions

View File

@ -1,7 +1,6 @@
COMMENT = mirroring/synchronization over low bandwidth links
DISTNAME = rsync-3.2.3
REVISION = 1
DISTNAME = rsync-3.2.4
CATEGORIES = net
HOMEPAGE = https://rsync.samba.org/
@ -16,6 +15,12 @@ WANTLIB = c crypto
MASTER_SITES = https://rsync.samba.org/ftp/rsync/src/ \
https://ftp.funet.fi/pub/mirrors/samba.org/pub/rsync/src/
MODULES = lang/python
MODPY_RUNDEP = No
BUILD_DEPENDS = textproc/py-commonmark${MODPY_FLAVOR}
SEPARATE_BUILD =Yes
CONFIGURE_STYLE =gnu
CONFIGURE_ARGS =--disable-lz4 \
@ -23,10 +28,18 @@ CONFIGURE_ARGS =--disable-lz4 \
--disable-zstd \
--with-included-popt \
--with-included-zlib \
--with-rrsync \
--with-rsyncd-conf="${SYSCONFDIR}/rsyncd.conf" \
--with-rsh=/usr/bin/ssh \
--with-nobody-user=_rsync \
--with-nobody-group=_rsync
.include <bsd.port.arch.mk>
.if ${ARCH:Mamd64}
CONFIGURE_ARGS +=--enable-md5-asm
.endif
.if ${FLAVOR:Miconv}
CONFIGURE_ENV +=CPPFLAGS='-I${LOCALBASE}/include' \
LDFLAGS='-L${LOCALBASE}/lib'
@ -38,12 +51,10 @@ DOCDIR = ${PREFIX}/share/doc/rsync
DEBUG_PACKAGES = ${BUILD_PACKAGES}
pre-configure:
${SUBST_CMD} ${WRKSRC}/rsyncd.conf.5 \
${WRKSRC}/support/rrsync
${SUBST_CMD} ${WRKSRC}/support/rrsync
post-install:
${INSTALL_DATA_DIR} ${DOCDIR}
${INSTALL_DATA} ${WRKSRC}/tech_report.tex ${DOCDIR}
${INSTALL_SCRIPT} ${WRKSRC}/support/rrsync ${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (rsync-3.2.3.tar.gz) = vsw8UEzupJn0FnomAEDM9Nny75SZrVaDwXmmlxRs5Q4=
SIZE (rsync-3.2.3.tar.gz) = 1069784
SHA256 (rsync-3.2.4.tar.gz) = b3YYONCAUrC2V5z39nN9k+R/AfTaBMXSTTRHt/Kl+tE=
SIZE (rsync-3.2.4.tar.gz) = 1114853

View File

@ -1,14 +0,0 @@
https://github.com/WayneD/rsync/issues/84
Index: compat.c
--- compat.c.orig
+++ compat.c
@@ -705,7 +705,7 @@ void setup_protocol(int f_out,int f_in)
do_negotiated_strings = 1;
compat_flags |= CF_VARINT_FLIST_FLAGS;
}
- if (strchr(client_info, 'V') != NULL) { /* Support a pre-release 'V' that got superseded */
+ if (!local_server && strchr(client_info, 'V') != NULL) { /* Support a pre-release 'V' that got superseded */
if (!write_batch)
compat_flags |= CF_VARINT_FLIST_FLAGS;
write_byte(f_out, compat_flags);

View File

@ -1,12 +0,0 @@
Index: configure.sh
--- configure.sh.orig
+++ configure.sh
@@ -4908,7 +4908,7 @@ fi
cat >>confdefs.h <<_ACEOF
-#define NOBODY_USER "nobody"
+#define NOBODY_USER "_rsync"
_ACEOF

View File

@ -1,17 +0,0 @@
Fixes regression introduced with commit 3a7bf54ad520 (A resumed
partial-dir file is transferred in-place.)
Fixes https://github.com/WayneD/rsync/issues/192
Index: receiver.c
--- receiver.c.orig
+++ receiver.c
@@ -878,7 +878,7 @@ int recv_files(int f_in, int f_out, char *local_name)
do_unlink(partialptr);
handle_partial_dir(partialptr, PDIR_DELETE);
}
- } else if (keep_partial && partialptr && !one_inplace) {
+ } else if (keep_partial && partialptr && (!one_inplace || delay_updates)) {
if (!handle_partial_dir(partialptr, PDIR_CREATE)) {
rprintf(FERROR,
"Unable to create partial-dir for %s -- discarding %s.\n",

View File

@ -1,12 +0,0 @@
Index: rsync.1
--- rsync.1.orig
+++ rsync.1
@@ -4253,7 +4253,7 @@ documentation.
.IP "\fBUSER\fP or \fBLOGNAME\fP"
The USER or LOGNAME environment variables are used to determine the default
username sent to an rsync daemon. If neither is set, the username defaults
-to "nobody".
+to "_rsync".
.IP "\fBHOME\fP"
The HOME environment variable is used to find the user's default .cvsignore
file.

View File

@ -0,0 +1,12 @@
Index: rsync.1.md
--- rsync.1.md.orig
+++ rsync.1.md
@@ -4417,7 +4417,7 @@ file is included or excluded.
The USER or LOGNAME environment variables are used to determine the default
username sent to an rsync daemon. If neither is set, the username defaults
- to "nobody". If both are set, `USER` takes precedence.
+ to "_rsync". If both are set, `USER` takes precedence.
0. `RSYNC_PARTIAL_DIR`

View File

@ -1,74 +0,0 @@
Index: rsyncd.conf.5
--- rsyncd.conf.5.orig
+++ rsyncd.conf.5
@@ -68,12 +68,11 @@ and a single line something like this to /etc/inetd.co
.RS 4
.P
.nf
-rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
+rsync stream tcp nowait root ${PREFIX}/rsync rsyncd --daemon
.fi
.RE
.P
-Replace "/usr/bin/rsync" with the path to where you have rsync installed on
-your system. You will then need to send inetd a HUP signal to tell it to
+You will then need to send inetd a HUP signal to tell it to
reread its config file.
.P
Note that you should \fBnot\fP send the rsync daemon a HUP signal to force it to
@@ -438,7 +437,7 @@ This parameter specifies the user name or user ID that
and from that module should take place as when the daemon was run as root.
In combination with the "gid" parameter this determines what file
permissions are available. The default when run by a super-user is to
-switch to the system's "nobody" user. The default for a non-super-user is
+switch to the system's "_rsync" user. The default for a non-super-user is
to not try to change the user. See also the "gid" parameter.
.IP
The RSYNC_USER_NAME environment variable may be used to request that rsync
@@ -458,7 +457,7 @@ accessing the module. The first one will be the defau
extra ones be set as supplemental groups. You may also specify a "\fB*\fP" as
the first gid in the list, which will be replaced by all the normal groups
for the transfer's user (see "uid"). The default when run by a super-user
-is to switch to your OS's "nobody" (or perhaps "nogroup") group with no
+is to switch to the "_rsync" group with no
other supplementary groups. The default for a non-super-user is to not
change any group attributes (and indeed, your OS may not allow a
non-super-user to try to change their group settings).
@@ -632,7 +631,7 @@ require that you specify a group password if you do no
passwords.
.IP
There is no default for the "secrets file" parameter, you must choose a
-name (such as \fB/etc/rsyncd.secrets\fP). The file must normally not be
+name (such as \fB${SYSCONFDIR}/rsyncd.secrets\fP). The file must normally not be
readable by "other"; see "strict modes". If the file is not found or is
rejected, no logins for a "user auth" module will be possible.
.IP "\fBstrict\ modes\fP"
@@ -1192,8 +1191,8 @@ A more sophisticated example would be:
.RS 4
.P
.nf
-uid = nobody
-gid = nobody
+uid = _rsync
+gid = _rsync
use chroot = yes
max connections = 4
syslog facility = local5
@@ -1219,7 +1218,7 @@ pid file = /var/run/rsyncd.pid
path = /data/cvs
comment = CVS repository (requires authentication)
auth users = tridge, susan
- secrets file = /etc/rsyncd.secrets
+ secrets file = ${SYSCONFDIR}/rsyncd.secrets
.fi
.RE
.P
@@ -1234,7 +1233,7 @@ susan:herpass
.P
.SH "FILES"
.P
-/etc/rsyncd.conf or rsyncd.conf
+${SYSCONFDIR}/rsyncd.conf or rsyncd.conf
.P
.SH "SEE ALSO"
.P

View File

@ -0,0 +1,32 @@
Index: rsyncd.conf.5.md
--- rsyncd.conf.5.md.orig
+++ rsyncd.conf.5.md
@@ -474,7 +474,7 @@ the values of parameters. See the GLOBAL PARAMETERS s
and from that module should take place as when the daemon was run as root.
In combination with the "[gid](#)" parameter this determines what file
permissions are available. The default when run by a super-user is to
- switch to the system's "nobody" user. The default for a non-super-user is
+ switch to the system's "_rsync" user. The default for a non-super-user is
to not try to change the user. See also the "[gid](#)" parameter.
The RSYNC_USER_NAME environment variable may be used to request that rsync
@@ -492,7 +492,7 @@ the values of parameters. See the GLOBAL PARAMETERS s
extra ones be set as supplemental groups. You may also specify a "`*`" as
the first gid in the list, which will be replaced by all the normal groups
for the transfer's user (see "[uid](#)"). The default when run by a super-user
- is to switch to your OS's "nobody" (or perhaps "nogroup") group with no
+ is to switch to the "_rsync" group with no
other supplementary groups. The default for a non-super-user is to not
change any group attributes (and indeed, your OS may not allow a
non-super-user to try to change their group settings).
@@ -1170,8 +1170,8 @@ A simple rsyncd.conf file that allow anonymous rsync t
A more sophisticated example would be:
> ```
-> uid = nobody
-> gid = nobody
+> uid = _rsync
+> gid = _rsync
> use chroot = yes
> max connections = 4
> syslog facility = local5

View File

@ -1,12 +1,12 @@
Index: support/rrsync
--- support/rrsync.orig
+++ support/rrsync
@@ -11,7 +11,7 @@ use File::Glob ':glob';
@@ -10,7 +10,7 @@
# You may configure these values to your liking. See also the section
# of options if you want to disable any options that rsync accepts.
-use constant RSYNC => '/usr/bin/rsync';
+use constant RSYNC => '${PREFIX}/bin/rsync';
use constant LOGFILE => 'rrsync.log';
# You may configure these 2 values to your liking. See also the section of
# short & long options if you want to disable any options that rsync accepts.
-RSYNC = '/usr/bin/rsync'
+RSYNC = '${PREFIX}/bin/rsync'
LOGFILE = 'rrsync.log' # NOTE: the file must exist for a line to be appended!
my $Usage = <<EOM;
# The following options are mainly the options that a client rsync can send

View File

@ -4,6 +4,7 @@
bin/rrsync
@bin bin/rsync
bin/rsync-ssl
@man man/man1/rrsync.1
@man man/man1/rsync-ssl.1
@man man/man1/rsync.1
@man man/man5/rsyncd.conf.5