This is a minor update to the latest stable version of rsync.
* Drop patch which got upstream. * Link/Use system libpopt and zlib instead of bundled ones. * Enable testsuite. * Drop xinetd support and add service files for systemd. * Ship a sample configuration file.
Fixes #11118.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org --- rsync/patches/rsync-3.0.7-buf-overflow.patch | 39 ------------------- rsync/rsync.nm | 58 ++++++++++++++++++++++++++-- rsync/rsyncd.conf | 20 ++++++++++ rsync/systemd/rsyncd.service | 9 +++++ rsync/systemd/rsyncd.socket | 10 +++++ rsync/systemd/rsyncd@.service | 7 ++++ 6 files changed, 100 insertions(+), 43 deletions(-) delete mode 100644 rsync/patches/rsync-3.0.7-buf-overflow.patch create mode 100644 rsync/rsyncd.conf create mode 100644 rsync/systemd/rsyncd.service create mode 100644 rsync/systemd/rsyncd.socket create mode 100644 rsync/systemd/rsyncd@.service
diff --git a/rsync/patches/rsync-3.0.7-buf-overflow.patch b/rsync/patches/rsync-3.0.7-buf-overflow.patch deleted file mode 100644 index 2c6b195..0000000 --- a/rsync/patches/rsync-3.0.7-buf-overflow.patch +++ /dev/null @@ -1,39 +0,0 @@ -index 7139b10..fef15aa 100644 ---- a/flist.c -+++ b/flist.c -@@ -1640,21 +1640,29 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len, - } - - p = fbuf + len; -- if (len != 1 || *fbuf != '/') -+ if (len == 1 && *fbuf == '/') -+ remainder = MAXPATHLEN - 1; -+ else if (len < MAXPATHLEN-1) { - *p++ = '/'; -- *p = '\0'; -- remainder = MAXPATHLEN - (p - fbuf); -+ *p = '\0'; -+ remainder = MAXPATHLEN - (len + 1); -+ } else -+ remainder = 0; - - for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) { - char *dname = d_name(di); - if (dname[0] == '.' && (dname[1] == '\0' - || (dname[1] == '.' && dname[2] == '\0'))) - continue; -- if (strlcpy(p, dname, remainder) >= remainder) { -+ unsigned name_len = strlcpy(p, dname, remainder); -+ if (name_len >= remainder) { -+ char save = fbuf[len]; -+ fbuf[len] = '\0'; - io_error |= IOERR_GENERAL; - rprintf(FERROR_XFER, -- "cannot send long-named file %s\n", -- full_fname(fbuf)); -+ "filename overflows max-path len by %u: %s/%s\n", -+ name_len - remainder + 1, fbuf, dname); -+ fbuf[len] = save; - continue; - } - if (dname[0] == '\0') { diff --git a/rsync/rsync.nm b/rsync/rsync.nm index 3af7d69..36e04b2 100644 --- a/rsync/rsync.nm +++ b/rsync/rsync.nm @@ -4,7 +4,7 @@ ###############################################################################
name = rsync -version = 3.0.7 +version = 3.1.2 release = 1
groups = Applications/Internet @@ -31,8 +31,17 @@ build libacl-devel libattr-devel popt-devel + zlib-devel + + # Testsuite. + %{bindir}/setfacl end
+ configure_options += \ + --without-included-popt \ + --without-included-zlib + + prepare_cmds # Fix permission issure. cd %{DIR_APP} && chmod -x support/* @@ -52,19 +61,60 @@ build
make_build_targets = proto all
+ test + # Fix permissions of testsuite helper script. + # + # Otherwise some tests of the testsuite will fail, + # because the script is not allowed to be executed. + chmod +x ./support/lsh.sh + + make check + end + make_install_targets += \ INSTALLCMD="install -p" \ INSTALLMAN="install -p"
install_cmds - mkdir -pv %{BUILDROOT}/etc/xinetd.d - install -p -m 644 %{DIR_SOURCE}/rsync.xinetd \ - %{BUILDROOT}/etc/xinetd.d/rsync + + # Install config file. + mkdir -pv %{BUILDROOT}%{sysconfdir} + + install -m 0644 %{DIR_SOURCE}/rsyncd.conf \ + %{BUILDROOT}%{sysconfdir}/ + + # Create directory for pidfile. + mkdir -pv %{BUILDROOT}/run/rsyncd end + end
packages package %{name} + configfiles + %{sysconfdir}/rsyncd.conf + end + + script postin + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script preun + systemctl --no-reload disable rsyncd.service >/dev/null 2>&1 || : + systemctl --no-reload disable rsyncd.socket >/dev/null 2>&1 || : + systemctl stop rsyncd.service >/dev/null 2>&1 || : + systemctl stop rsyncd.socket >/dev/null 2>&1 || : + systemctl stop rsyncd@.service >/dev/null 2>&1 || : + end + + script postun + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart rsyncd.service >/dev/null 2>&1 || : + end end
package %{name}-debuginfo diff --git a/rsync/rsyncd.conf b/rsync/rsyncd.conf new file mode 100644 index 0000000..09e768f --- /dev/null +++ b/rsync/rsyncd.conf @@ -0,0 +1,20 @@ +# /etc/rsyncd: configuration file for rsync daemon mode + +# See rsyncd.conf man page for more options. + +# configuration example: + +# uid = nobody +# gid = nobody +# use chroot = yes +# max connections = 4 +# pid file = /run/rsyncd/rsyncd.pid +# exclude = lost+found/ +# transfer logging = yes +# timeout = 900 +# ignore nonreadable = yes +# dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2 + +# [ftp] +# path = /home/ftp +# comment = ftp export area diff --git a/rsync/systemd/rsyncd.service b/rsync/systemd/rsyncd.service new file mode 100644 index 0000000..30c3ca0 --- /dev/null +++ b/rsync/systemd/rsyncd.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 diff --git a/rsync/systemd/rsyncd.socket b/rsync/systemd/rsyncd.socket new file mode 100644 index 0000000..7306ad0 --- /dev/null +++ b/rsync/systemd/rsyncd.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Rsync Server Socket +Conflicts=rsyncd.service + +[Socket] +ListenStream=873 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/rsync/systemd/rsyncd@.service b/rsync/systemd/rsyncd@.service new file mode 100644 index 0000000..beef5c9 --- /dev/null +++ b/rsync/systemd/rsyncd@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf + +[Service] +ExecStart=/usr/bin/rsync --daemon --no-detach +StandardInput=socket
Hi,
I merged this. However, you create /run/rsyncd which is not re-created in a systemd tempfile. Could you please send a new commit that adds that and bump the release?
Best, -Michael
On Wed, 2016-05-11 at 11:32 +0200, Stefan Schantl wrote:
This is a minor update to the latest stable version of rsync.
- Drop patch which got upstream.
- Link/Use system libpopt and zlib instead of bundled ones.
- Enable testsuite.
- Drop xinetd support and add service files for systemd.
- Ship a sample configuration file.
Fixes #11118.
Signed-off-by: Stefan Schantl stefan.schantl@ipfire.org
rsync/patches/rsync-3.0.7-buf-overflow.patch | 39 ------------------- rsync/rsync.nm | 58 ++++++++++++++++++++++++++-
rsync/rsyncd.conf | 20 ++++++++++ rsync/systemd/rsyncd.service | 9 +++++ rsync/systemd/rsyncd.socket | 10 +++++ rsync/systemd/rsyncd@.service | 7 ++++ 6 files changed, 100 insertions(+), 43 deletions(-) delete mode 100644 rsync/patches/rsync-3.0.7-buf-overflow.patch create mode 100644 rsync/rsyncd.conf create mode 100644 rsync/systemd/rsyncd.service create mode 100644 rsync/systemd/rsyncd.socket create mode 100644 rsync/systemd/rsyncd@.service
diff --git a/rsync/patches/rsync-3.0.7-buf-overflow.patch b/rsync/patches/rsync-3.0.7-buf-overflow.patch deleted file mode 100644 index 2c6b195..0000000 --- a/rsync/patches/rsync-3.0.7-buf-overflow.patch +++ /dev/null @@ -1,39 +0,0 @@ -index 7139b10..fef15aa 100644 ---- a/flist.c -+++ b/flist.c -@@ -1640,21 +1640,29 @@ static void send_directory(int f, struct file_list *flist, char *fbuf, int len, - } - - p = fbuf + len; -- if (len != 1 || *fbuf != '/') -+ if (len == 1 && *fbuf == '/') -+ remainder = MAXPATHLEN - 1; -+ else if (len < MAXPATHLEN-1) { - *p++ = '/'; -- *p = '\0'; -- remainder = MAXPATHLEN - (p - fbuf); -+ *p = '\0'; -+ remainder = MAXPATHLEN - (len + 1); -+ } else -+ remainder = 0; - - for (errno = 0, di = readdir(d); di; errno = 0, di = readdir(d)) { - char *dname = d_name(di); - if (dname[0] == '.' && (dname[1] == '\0' - || (dname[1] == '.' && dname[2] == '\0'))) - continue; -- if (strlcpy(p, dname, remainder) >= remainder) { -+ unsigned name_len = strlcpy(p, dname, remainder); -+ if (name_len >= remainder) { -+ char save = fbuf[len]; -+ fbuf[len] = '\0'; - io_error |= IOERR_GENERAL; - rprintf(FERROR_XFER, -- "cannot send long-named file %s\n", -- full_fname(fbuf)); -+ "filename overflows max-path len by %u: %s/%s\n", -+ name_len - remainder + 1, fbuf, dname); -+ fbuf[len] = save; - continue; - } - if (dname[0] == '\0') { diff --git a/rsync/rsync.nm b/rsync/rsync.nm index 3af7d69..36e04b2 100644 --- a/rsync/rsync.nm +++ b/rsync/rsync.nm @@ -4,7 +4,7 @@ ############################################################################# ## name = rsync -version = 3.0.7 +version = 3.1.2 release = 1 groups = Applications/Internet @@ -31,8 +31,17 @@ build libacl-devel libattr-devel popt-devel
zlib-devel
# Testsuite.
%{bindir}/setfacl
end
- configure_options += \
--without-included-popt \
--without-included-zlib
prepare_cmds # Fix permission issure. cd %{DIR_APP} && chmod -x support/* @@ -52,19 +61,60 @@ build make_build_targets = proto all
- test
# Fix permissions of testsuite helper script.
#
# Otherwise some tests of the testsuite will fail,
# because the script is not allowed to be executed.
chmod +x ./support/lsh.sh
make check
- end
make_install_targets += \ INSTALLCMD="install -p" \ INSTALLMAN="install -p" install_cmds
mkdir -pv %{BUILDROOT}/etc/xinetd.d
install -p -m 644 %{DIR_SOURCE}/rsync.xinetd \
%{BUILDROOT}/etc/xinetd.d/rsync
# Install config file.
mkdir -pv %{BUILDROOT}%{sysconfdir}
install -m 0644 %{DIR_SOURCE}/rsyncd.conf \
%{BUILDROOT}%{sysconfdir}/
# Create directory for pidfile.
mkdir -pv %{BUILDROOT}/run/rsyncd
end
end packages package %{name}
configfiles
%{sysconfdir}/rsyncd.conf
end
script postin
systemctl daemon-reload >/dev/null 2>&1 || :
end
script preun
systemctl --no-reload disable rsyncd.service
/dev/null 2>&1 || :
systemctl --no-reload disable rsyncd.socket
/dev/null 2>&1 || :
systemctl stop rsyncd.service >/dev/null 2>&1 || :
systemctl stop rsyncd.socket >/dev/null 2>&1 || :
systemctl stop rsyncd@.service >/dev/null 2>&1 || :
end
script postun
systemctl daemon-reload >/dev/null 2>&1 || :
end
script postup
systemctl daemon-reload >/dev/null 2>&1 || :
systemctl try-restart rsyncd.service >/dev/null 2>&1
|| :
end
end package %{name}-debuginfo diff --git a/rsync/rsyncd.conf b/rsync/rsyncd.conf new file mode 100644 index 0000000..09e768f --- /dev/null +++ b/rsync/rsyncd.conf @@ -0,0 +1,20 @@ +# /etc/rsyncd: configuration file for rsync daemon mode
+# See rsyncd.conf man page for more options.
+# configuration example:
+# uid = nobody +# gid = nobody +# use chroot = yes +# max connections = 4 +# pid file = /run/rsyncd/rsyncd.pid +# exclude = lost+found/ +# transfer logging = yes +# timeout = 900 +# ignore nonreadable = yes +# dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
+# [ftp] +# path = /home/ftp +# comment = ftp export area diff --git a/rsync/systemd/rsyncd.service b/rsync/systemd/rsyncd.service new file mode 100644 index 0000000..30c3ca0 --- /dev/null +++ b/rsync/systemd/rsyncd.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 diff --git a/rsync/systemd/rsyncd.socket b/rsync/systemd/rsyncd.socket new file mode 100644 index 0000000..7306ad0 --- /dev/null +++ b/rsync/systemd/rsyncd.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Rsync Server Socket +Conflicts=rsyncd.service
+[Socket] +ListenStream=873 +Accept=yes
+[Install] +WantedBy=sockets.target diff --git a/rsync/systemd/rsyncd@.service b/rsync/systemd/rsyncd@.service new file mode 100644 index 0000000..beef5c9 --- /dev/null +++ b/rsync/systemd/rsyncd@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Fast remote file copy program daemon +ConditionPathExists=/etc/rsyncd.conf
+[Service] +ExecStart=/usr/bin/rsync --daemon --no-detach +StandardInput=socket