]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/commitdiff
rsync: Update to 3.1.2.
authorStefan Schantl <stefan.schantl@ipfire.org>
Wed, 11 May 2016 09:32:20 +0000 (11:32 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 11 May 2016 15:10:03 +0000 (16:10 +0100)
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>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
rsync/patches/rsync-3.0.7-buf-overflow.patch [deleted file]
rsync/rsync.nm
rsync/rsyncd.conf [new file with mode: 0644]
rsync/systemd/rsyncd.service [new file with mode: 0644]
rsync/systemd/rsyncd.socket [new file with mode: 0644]
rsync/systemd/rsyncd@.service [new file with mode: 0644]

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 (file)
index 2c6b195..0000000
+++ /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') {
index 3af7d69f9e63f7c613423d37fb241b283888f868..36e04b2c15745d4fdc9118b627d60c630c48029a 100644 (file)
@@ -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 (file)
index 0000000..09e768f
--- /dev/null
@@ -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 (file)
index 0000000..30c3ca0
--- /dev/null
@@ -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 (file)
index 0000000..7306ad0
--- /dev/null
@@ -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 (file)
index 0000000..beef5c9
--- /dev/null
@@ -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