]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Put the rsync-ssl-rsh helper script into a lib dir.
authorWayne Davison <wayne@opencoder.net>
Mon, 8 Jun 2020 00:20:58 +0000 (17:20 -0700)
committerWayne Davison <wayne@opencoder.net>
Mon, 8 Jun 2020 02:25:18 +0000 (19:25 -0700)
Makefile.in
NEWS.md
packaging/lsb/rsync.spec
rsync-ssl
rsync-ssl.yo
ssl-rsh [moved from rsync-ssl-rsh with 93% similarity]
tweak_manpage

index 13cba5d9bb49c48759290ed317095db7c94333b4..b45f3f476bde985167b2e994d4de473a8a305915 100644 (file)
@@ -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 1807fe4e3c5a86375e9fcfaceae8b4713f53c470..783064ab2b4b32b0365bc9f067873499e1cb92e3 100644 (file)
--- 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.
index 3767cd9cfbb8b4461c117c031981614242221c39..ea02c7e67cceb2e046d5c1f9d29aef394af5a94a 100644 (file)
@@ -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*
index f3e365d7cf3909663bb111d8162bea6a2f378272..c9a8db90331d41e5ce4d0a67b4a70dee8310cd4e 100755 (executable)
--- 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" "${@}"
index 29d311df11fc9492ba8983d841edc980ea25d0d4..51497420bbc6a4b32f3240c9b5dea3e2ab27dc4a 100644 (file)
@@ -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()
 
similarity index 93%
rename from rsync-ssl-rsh
rename to ssl-rsh
index f99aa901f1489176f787a8e898ddecd684017845..ea7b76c1401e7cbe35a98389343fd96bbed270c4 100755 (executable)
+++ 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
 
index 4c55c5145e76f6699fd2fed984c124aabc76fb72..76b76040cbc2ea01bd647880121fd9beec722c44 100755 (executable)
@@ -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) = @_;