The branch, master has been updated via 7dbbde8c Use ZSTD_CLEVEL_DEFAULT define. via 888f4f95 Put the rsync-ssl-rsh helper script into a lib dir. via 2c6f0581 A couple minor fixes. from 916faecb Only sender can output non-final stats on error
https://git.samba.org/?p=rsync.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 7dbbde8c5e68f0c78176077bd4ef93620c00864f Author: Wayne Davison <wa...@opencoder.net> Date: Sun Jun 7 18:58:30 2020 -0700 Use ZSTD_CLEVEL_DEFAULT define. commit 888f4f9503676339be03b2ec53277478c9e3a318 Author: Wayne Davison <wa...@opencoder.net> Date: Sun Jun 7 17:20:58 2020 -0700 Put the rsync-ssl-rsh helper script into a lib dir. commit 2c6f0581ac927a35a411ac1fe9068d6df947054d Author: Wayne Davison <wa...@opencoder.net> Date: Thu Jun 4 22:54:38 2020 -0700 A couple minor fixes. ----------------------------------------------------------------------- Summary of changes: Makefile.in | 11 ++++++----- NEWS.md | 6 +++--- clientserver.c | 4 ++-- main.c | 1 - packaging/lsb/rsync.spec | 2 +- rsync-ssl | 3 ++- rsync-ssl.yo | 7 +++---- rsync-ssl-rsh => ssl-rsh | 8 ++++---- token.c | 6 ++++-- tweak_manpage | 16 ++++++++++++++++ 10 files changed, 41 insertions(+), 23 deletions(-) rename rsync-ssl-rsh => ssl-rsh (93%) Changeset truncated at 500 lines: diff --git a/Makefile.in b/Makefile.in index 13cba5d9..b45f3f47 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,8 +4,8 @@ prefix=@prefix@ datarootdir=@datarootdir@ exec_prefix=@exec_prefix@ -stunnel4=@STUNNEL4@ bindir=@bindir@ +libdir=@libdir@/rsync mandir=@mandir@ LIBS=@LIBS@ @@ -71,9 +71,10 @@ all: Makefile rsync$(EXEEXT) stunnel-rsyncd.conf @MAKE_MAN@ install: all -${MKDIR_P} ${DESTDIR}${bindir} + -${MKDIR_P} ${DESTDIR}${libdir} ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir} ${INSTALLCMD} -m 755 rsync-ssl ${DESTDIR}${bindir} - ${INSTALLCMD} -m 755 rsync-ssl-rsh ${DESTDIR}${bindir} + ${INSTALLCMD} -m 755 ssl-rsh ${DESTDIR}${libdir} -${MKDIR_P} ${DESTDIR}${mandir}/man1 -${MKDIR_P} ${DESTDIR}${mandir}/man5 if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi @@ -227,15 +228,15 @@ man-copy: fi ; \ done -rsync.1: rsync.yo +rsync.1: rsync.yo $(srcdir)/tweak_manpage yodl2man -o rsync.1 $(srcdir)/rsync.yo -$(srcdir)/tweak_manpage rsync.1 -rsync-ssl.1: rsync-ssl.yo +rsync-ssl.1: rsync-ssl.yo $(srcdir)/tweak_manpage yodl2man -o rsync-ssl.1 $(srcdir)/rsync-ssl.yo -$(srcdir)/tweak_manpage rsync-ssl.1 -rsyncd.conf.5: rsyncd.conf.yo +rsyncd.conf.5: rsyncd.conf.yo $(srcdir)/tweak_manpage yodl2man -o rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo -$(srcdir)/tweak_manpage rsyncd.conf.5 diff --git a/NEWS.md b/NEWS.md index 1807fe4e..783064ab 100644 --- a/NEWS.md +++ b/NEWS.md @@ -85,9 +85,9 @@ Protocol: 31 (unchanged) - Added the `--write-devices` option based on the long-standing patch. - - Added openssl support to the rsync-ssl script via its renamed helper script, - rsync-ssl-rsh. Both bash scripts are now installed by default (removing the - install-ssl-client make target). Rsync was also enhanced to set the + - Added openssl support to the rsync-ssl script via a (lib installed) helper + script, ssl-rsh. Both bash scripts are now installed by default, removing + the install-ssl-client make target. Rsync was also enhanced to set the `RSYNC_PORT` environment variable when running a daemon-over-rsh script. Its value is the user-specified port number (set via `--port` or an rsync:// URL) or 0 if the user didn't override the port. diff --git a/clientserver.c b/clientserver.c index 8df14947..91f78b7b 100644 --- a/clientserver.c +++ b/clientserver.c @@ -1173,7 +1173,7 @@ static void create_pid_file(void) fail = "lock"; else if (do_fstat(pid_file_fd, &st1) < 0) fail = "fstat opened"; - else if (st1.st_size >= (int)sizeof pidbuf) + else if (st1.st_size > (int)sizeof pidbuf) fail = "find small"; else if (do_lstat(pid_file, &st2) < 0) fail = "lstat"; @@ -1190,7 +1190,7 @@ static void create_pid_file(void) int len = snprintf(pidbuf, sizeof pidbuf, "%d\n", (int)pid); #ifndef HAVE_FTRUNCATE /* What can we do with a too-long file and no truncate? I guess we'll add extra newlines. */ - while (len < st1.st_size) /* We already verified that st_size+1 chars fits in the buffer. */ + while (len < st1.st_size) /* We already verified that st_size chars fits in the buffer. */ pidbuf[len++] = '\n'; /* We don't need the buffer to end in a '\0' (and we may not have room to add it). */ #endif diff --git a/main.c b/main.c index ed1a210f..98bbaa68 100644 --- a/main.c +++ b/main.c @@ -88,7 +88,6 @@ extern char *partial_dir; extern char *dest_option; extern char *rsync_path; extern char *shell_cmd; -extern char *batch_name; extern char *password_file; extern char *backup_dir; extern char *copy_as; diff --git a/packaging/lsb/rsync.spec b/packaging/lsb/rsync.spec index 3767cd9c..ea02c7e6 100644 --- a/packaging/lsb/rsync.spec +++ b/packaging/lsb/rsync.spec @@ -70,7 +70,7 @@ rm -rf $RPM_BUILD_ROOT %config(noreplace) /etc/xinetd.d/rsync %{_prefix}/bin/rsync %{_prefix}/bin/rsync-ssl -%{_prefix}/bin/rsync-ssl-rsh +%{_prefix}/lib/rsync/ssl-rsh %{_mandir}/man1/rsync.1* %{_mandir}/man1/rsync-ssl.1* %{_mandir}/man5/rsyncd.conf.5* diff --git a/rsync-ssl b/rsync-ssl index f3e365d7..c9a8db90 100755 --- a/rsync-ssl +++ b/rsync-ssl @@ -18,5 +18,6 @@ case "$@" in esac mydir="${0%/*}" +libdir="$mydir/../lib/rsync" -exec "$mydir/rsync" --rsh="$mydir/rsync-ssl-rsh" "${@}" +exec "$mydir/rsync" --rsh="$libdir/ssl-rsh" "${@}" diff --git a/rsync-ssl.yo b/rsync-ssl.yo index 29d311df..51497420 100644 --- a/rsync-ssl.yo +++ b/rsync-ssl.yo @@ -23,9 +23,8 @@ bf(rsync) manpage for more information on how it works. Note that the stunnel connection type requires at least version 4 of stunnel, which should be the case on modern systems. -This script requires that a helper script named bf(rsync-ssl-rsh) be installed -in the same directory as this bf(rsync-ssl) script so that rsync can use it as -its remote-shell command. +This script requires that a helper script named bf(ssl-rsh) be installed the +@libdir@ dir so that rsync can use it as its remote-shell command. manpagesection(ENVIRONMENT VARIABLES) @@ -67,7 +66,7 @@ verb( rsync-ssl --type=openssl -aiv example.com::src/ dest) manpagefiles() -rsync-ssl-rsh +@libdir@/ssl-rsh manpageseealso() diff --git a/rsync-ssl-rsh b/ssl-rsh similarity index 93% rename from rsync-ssl-rsh rename to ssl-rsh index f99aa901..ea7b76c1 100755 --- a/rsync-ssl-rsh +++ b/ssl-rsh @@ -1,16 +1,16 @@ #!/bin/bash # This must be called as (note the trailing dot): # -# rsync-ssl-rsh HOSTNAME rsync --server --daemon . +# ssl-rsh HOSTNAME rsync --server --daemon . # # ... which is typically done via the rsync-ssl script, which results in something like this: # -# rsync --rsh=rsync-ssl-rsh -aiv HOSTNAME::module [ARGS] +# rsync --rsh=/usr/lib/rsync/ssl-rsh -aiv HOSTNAME::module [ARGS] # # This SSL setup based on the files by: http://dozzie.jarowit.net/trac/wiki/RsyncSSL # Note that an stunnel connection requires at least version 4.x of stunnel. -# The environment can override our defaults using RSYNC_SSL_* variables +# The environment can override our defaults using RSYNC_SSL_* variables. See `man rsync-ssl`. function path_search { IFS_SAVE="$IFS" @@ -106,7 +106,7 @@ hostname="$1" shift if [[ -z "$hostname" || "$1" != rsync || "$2" != --server || "$3" != --daemon ]]; then - echo "Usage: rsync-ssl-helper HOSTNAME rsync --server --daemon ." 1>&2 + echo "Usage: ssl-rsh HOSTNAME rsync --server --daemon ." 1>&2 exit 1 fi diff --git a/token.c b/token.c index cfcfdcc6..ebecd8ab 100644 --- a/token.c +++ b/token.c @@ -58,7 +58,7 @@ void init_compression_level(void) switch (do_compression) { case CPRES_NONE: - break; + return; case CPRES_ZLIB: case CPRES_ZLIBX: min_level = 1; @@ -72,8 +72,10 @@ void init_compression_level(void) case CPRES_ZSTD: min_level = skip_compression_level = ZSTD_minCLevel(); max_level = ZSTD_maxCLevel(); - def_level = 3; + def_level = ZSTD_CLEVEL_DEFAULT; off_level = CLVL_NOT_SPECIFIED; + if (do_compression_level == 0) + do_compression_level = def_level; break; #endif #ifdef SUPPORT_LZ4 diff --git a/tweak_manpage b/tweak_manpage index 4c55c514..76b76040 100755 --- a/tweak_manpage +++ b/tweak_manpage @@ -3,6 +3,20 @@ use strict; use warnings; +our %subs; + +BEGIN { + open IN, '<', 'Makefile' or die $!; + while (<IN>) { + my ($var, $val) = /^(\w+)=(.+)/; + next unless defined $val; + $val =~ s/\$\{(\w+)\}/$subs{$1}/ while $val =~ /\$\{/; + $subs{$var} = $val; + last if $var eq 'libdir'; + } + close IN; +} + # We only need to use "\&'" or "\&." at the start of a line. s/(?<=.)\\\&(['.])/$1/g; @@ -19,6 +33,8 @@ s/(\\f(B|\(CW).*?\\fP)/ realquotes($1) /egs; s/^\\\&(\\\(oq)/$1/gm; +s/\@libdir\@/$subs{libdir}/g; + sub realquotes { my($txt) = @_; -- The rsync repository. _______________________________________________ rsync-cvs mailing list rsync-cvs@lists.samba.org https://lists.samba.org/mailman/listinfo/rsync-cvs