[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Thu Jan 13 04:06:20 UTC 2022


The branch, master has been updated
       via  8c4ceb3b Avoid a -8 in the progress output's remaining time
       via  30a59095 Some symlink improvements to the man page.
       via  e841944b Change manpage headings in html to use h2 tags with an id target.
      from  635d8c06 A repeated `--old-args` does more escape disabling.

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8c4ceb3b86749523573fec0df38a3b315575735c
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Jan 12 19:50:58 2022 -0800

    Avoid a -8 in the progress output's remaining time
    
    If the double "remain" value is so large that it overflows an int, make
    the estimated seconds output as :00 instead of :-8.  Similar for the
    estimated remaining minutes.  Support larger hours values.

commit 30a590954416fa0ab2a2b27cd8098b310794446d
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Jan 12 16:42:40 2022 -0800

    Some symlink improvements to the man page.

commit e841944b47613c242a016184255b6855c8181d32
Author: Wayne Davison <wayne at opencoder.net>
Date:   Wed Jan 12 16:41:36 2022 -0800

    Change manpage headings in html to use h2 tags with an id target.

-----------------------------------------------------------------------

Summary of changes:
 NEWS.md             |   5 ++
 md-convert          |  14 +++-
 progress.c          |   8 +-
 rsync-ssl.1.md      |  24 +++---
 rsync.1.md          | 231 +++++++++++++++++++++++++++++++++-------------------
 rsyncd.conf.5.md    |  36 ++++----
 support/rrsync.1.md |  12 +--
 7 files changed, 201 insertions(+), 129 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS.md b/NEWS.md
index 8bab61cf..4eebaa44 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -88,6 +88,11 @@
    check to see if the allowed time is over, which should make rsync exit more
    consistently.
 
+ - Tweak the snprintf() in progress.c that turns the remaining time into a
+   HHHH:MM:SS value to avoid putting a -8 into the SS or MM spots when the
+   remaining seconds is so large that it overflows the integer arithmetic
+   trying to perform a modulus.
+
 ### ENHANCEMENTS:
 
  - Use openssl's `-verify_hostname` option in the rsync-ssl script.
diff --git a/md-convert b/md-convert
index 7780d06b..d1266f45 100755
--- a/md-convert
+++ b/md-convert
@@ -32,7 +32,7 @@
 import os, sys, re, argparse, subprocess, time
 from html.parser import HTMLParser
 
-CONSUMES_TXT = set('h1 h2 p li pre'.split())
+CONSUMES_TXT = set('h1 h2 h3 p li pre'.split())
 
 HTML_START = """\
 <html><head>
@@ -332,6 +332,12 @@ class TransformHtml(HTMLParser):
         st.at_first_tag_in_dd = False
 
 
+    def add_anchor(self, txt):
+        st = self.state
+        txt = txt.lower().replace(' ', '-')
+        st.html_out.append('<span id="' + txt + '"></span>')
+
+
     def handle_endtag(self, tag):
         st = self.state
         if args.debug:
@@ -342,10 +348,12 @@ class TransformHtml(HTMLParser):
         else:
             txt = None
         add_to_txt = None
-        if tag == 'h1':
+        if tag == 'h1' or tag == 'h2':
             st.man_out.append(st.p_macro + '.SH "' + manify(txt) + '"\n')
-        elif tag == 'h2':
+            self.add_anchor(txt)
+        elif tag == 'h3':
             st.man_out.append(st.p_macro + '.SS "' + manify(txt) + '"\n')
+            self.add_anchor(txt)
         elif tag == 'p':
             if st.dt_from == 'p':
                 tag = 'dt'
diff --git a/progress.c b/progress.c
index 8da52862..6e39ce99 100644
--- a/progress.c
+++ b/progress.c
@@ -118,10 +118,10 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now, int is_l
 	if (remain < 0)
 		strlcpy(rembuf, "  ??:??:??", sizeof rembuf);
 	else {
-		snprintf(rembuf, sizeof rembuf, "%4d:%02d:%02d",
-			 (int) (remain / 3600.0),
-			 (int) (remain / 60.0) % 60,
-			 (int) remain % 60);
+		snprintf(rembuf, sizeof rembuf, "%4lu:%02u:%02u",
+			 (unsigned long) (remain / 3600.0),
+			 (unsigned int) (remain / 60.0) % 60,
+			 (unsigned int) remain % 60);
 	}
 
 	output_needs_newline = 0;
diff --git a/rsync-ssl.1.md b/rsync-ssl.1.md
index 32ab31e2..c09603f9 100644
--- a/rsync-ssl.1.md
+++ b/rsync-ssl.1.md
@@ -1,14 +1,14 @@
-# NAME
+## NAME
 
 rsync-ssl - a helper script for connecting to an ssl rsync daemon
 
-# SYNOPSIS
+## SYNOPSIS
 
 ```
 rsync-ssl [--type=SSL_TYPE] RSYNC_ARGS
 ```
 
-# DESCRIPTION
+## DESCRIPTION
 
 The rsync-ssl script helps you to run an rsync copy to/from an rsync daemon
 that requires ssl connections.
@@ -20,7 +20,7 @@ environment.  You can specify an overriding port via `--port` or by including
 it in the normal spot in the URL format, though both of those require your
 rsync version to be at least 3.2.0.
 
-# OPTIONS
+## OPTIONS
 
 If the **first** arg is a `--type=SSL_TYPE` option, the script will only use
 that particular program to open an ssl connection instead of trying to find an
@@ -32,7 +32,7 @@ required for this particular option.
 All the other options are passed through to the rsync command, so consult the
 **rsync**(1) manpage for more information on how it works.
 
-# ENVIRONMENT VARIABLES
+## ENVIRONMENT VARIABLES
 
 The ssl helper scripts are affected by the following environment variables:
 
@@ -60,7 +60,7 @@ The ssl helper scripts are affected by the following environment variables:
     connection type is set to stunnel.  If unspecified, the $PATH is searched
     first for "stunnel4" and then for "stunnel".
 
-# EXAMPLES
+## EXAMPLES
 
 >     rsync-ssl -aiv example.com::mod/ dest
 
@@ -70,11 +70,11 @@ The ssl helper scripts are affected by the following environment variables:
 
 >     rsync-ssl -aiv rsync://example.com:9874/mod/ dest
 
-# SEE ALSO
+## SEE ALSO
 
 **rsync**(1), **rsyncd.conf**(5)
 
-# CAVEATS
+## CAVEATS
 
 Note that using an stunnel connection requires at least version 4 of stunnel,
 which should be the case on modern systems.  Also, it does not verify a
@@ -87,15 +87,15 @@ release the gnutls-cli command was dropping output, making it unusable.  If
 that bug has been fixed in your version, feel free to put gnutls into an
 exported RSYNC_SSL_TYPE environment variable to make its use the default.
 
-# BUGS
+## BUGS
 
 Please report bugs! See the web site at <https://rsync.samba.org/>.
 
-# VERSION
+## VERSION
 
 This man page is current for version @VERSION@ of rsync.
 
-# CREDITS
+## CREDITS
 
 rsync is distributed under the GNU General Public License.  See the file
 COPYING for details.
@@ -103,7 +103,7 @@ COPYING for details.
 A web site is available at <https://rsync.samba.org/>.  The site includes an
 FAQ-O-Matic which may cover questions unanswered by this manual page.
 
-# AUTHOR
+## AUTHOR
 
 This manpage was written by Wayne Davison.
 
diff --git a/rsync.1.md b/rsync.1.md
index 73532573..9b9b6996 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -1,8 +1,8 @@
-# NAME
+## NAME
 
 rsync - a fast, versatile, remote (and local) file-copying tool
 
-# SYNOPSIS
+## SYNOPSIS
 
 ```
 Local:
@@ -26,7 +26,7 @@ Access via rsync daemon:
 Usages with just one SRC arg and no DEST arg will list the source files instead
 of copying.
 
-# DESCRIPTION
+## DESCRIPTION
 
 Rsync is a fast and extraordinarily versatile file copying tool.  It can copy
 locally, to/from another host over any remote shell, or to/from a remote rsync
@@ -54,7 +54,7 @@ Some of the additional features of rsync are:
 - pipelining of file transfers to minimize latency costs
 - support for anonymous or authenticated rsync daemons (ideal for mirroring)
 
-# GENERAL
+## GENERAL
 
 Rsync copies files either to or from a remote host, or locally on the current
 host (it does not support copying files between two remote hosts).
@@ -79,7 +79,7 @@ Rsync refers to the local side as the client and the remote side as the server.
 Don't confuse server with an rsync daemon.  A daemon is always a server, but a
 server can be either a daemon or a remote-shell spawned process.
 
-# SETUP
+## SETUP
 
 See the file README.md for installation instructions.
 
@@ -94,7 +94,7 @@ command line option, or by setting the RSYNC_RSH environment variable.
 
 Note that rsync must be installed on both the source and destination machines.
 
-# USAGE
+## USAGE
 
 You use rsync in the same way you use rcp.  You must specify a source and a
 destination, one of which may be remote.
@@ -151,7 +151,7 @@ rsync daemon by leaving off the module name:
 
 See the following section for more details.
 
-# ADVANCED USAGE
+## ADVANCED USAGE
 
 The syntax for requesting multiple files from a remote host is done by
 specifying additional remote-host args in the same style as the first, or with
@@ -170,7 +170,7 @@ examples:
 This word-splitting only works in a modern rsync by using `--old-args` (or its
 environment variable) and making sure that `--protect-args` is not enabled.
 
-# CONNECTING TO AN RSYNC DAEMON
+## CONNECTING TO AN RSYNC DAEMON
 
 It is also possible to use rsync without a remote shell as the transport.  In
 this case you will directly connect to a remote rsync daemon, typically using
@@ -227,7 +227,7 @@ Note also that if the RSYNC_SHELL environment variable is set, that program
 will be used to run the RSYNC_CONNECT_PROG command instead of using the default
 shell of the **system()** call.
 
-# USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION
+## USING RSYNC-DAEMON FEATURES VIA A REMOTE-SHELL CONNECTION
 
 It is sometimes useful to use various features of an rsync daemon (such as
 named modules) without actually allowing any new socket connections into a
@@ -260,7 +260,7 @@ example that uses the short version of the `--rsh` option:
 The "ssh-user" will be used at the ssh level; the "rsync-user" will be used to
 log-in to the "module".
 
-# STARTING AN RSYNC DAEMON TO ACCEPT CONNECTIONS
+## STARTING AN RSYNC DAEMON TO ACCEPT CONNECTIONS
 
 In order to connect to an rsync daemon, the remote system needs to have a
 daemon already running (or it needs to have configured something like inetd to
@@ -273,7 +273,7 @@ the daemon, and it contains the full details for how to run the daemon
 If you're using one of the remote-shell transports for the transfer, there is
 no need to manually start an rsync daemon.
 
-# SORTED TRANSFER ORDER
+## SORTED TRANSFER ORDER
 
 Rsync always sorts the specified filenames into its internal transfer list.
 This handles the merging together of the contents of identically named
@@ -286,7 +286,7 @@ separate the files into different rsync calls, or consider using
 `--delay-updates` (which doesn't affect the sorted transfer order, but does
 make the final file-updating phase happen much more rapidly).
 
-# EXAMPLES
+## EXAMPLES
 
 Here are some examples of how I use rsync.
 
@@ -316,7 +316,7 @@ I mirror a directory between my "old" and "new" ftp sites with the command:
 
 This is launched from cron every few hours.
 
-# OPTION SUMMARY
+## OPTION SUMMARY
 
 Here is a short summary of the options available in rsync.  Please refer to the
 detailed description below for a complete description.
@@ -492,7 +492,7 @@ accepted:
 --help, -h               show this help (when used with --daemon)
 ```
 
-# OPTIONS
+## OPTIONS
 
 Rsync accepts both long (double-dash + word) and short (single-dash + letter)
 options.  The full list of the available options are described below.  If an
@@ -1032,37 +1032,44 @@ your home directory (remove the '=' for that).
 
 0.  `--links`, `-l`
 
-    When symlinks are encountered, recreate the symlink on the destination.
+    Add symlinks to the transferred files instead of noisily ignoring them with
+    a "non-regular file" warning for each symlink encountered.  You can
+    alternately silence the warning by specifying ``--info=nonreg0``.
 
-    By default, rsync generates a "non-regular file" warning for each symlink
-    encountered when this option is not set.  You can silence the warning by
-    specifying ``--info=nonreg0``.
+    The default handling of symlinks is to recreate each symlink's unchanged
+    value on the receiving side.
+
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
 
 0.  `--copy-links`, `-L`
 
     The sender transforms each symlink encountered in the transfer into the
     referent item, following the symlink chain to the file or directory that it
     references.  If a symlink chain is broken, an error is output and the file
-    is dropped from the transfer.  On the receiving side, any existing symlinks
-    in the destination directories are replaced with the non-symlinks that the
-    sender specifies (though any destination filenames that do not match a name
-    in the transfer can remain as symlinks if rsync is not deleting files).
-
-    In versions of rsync prior to 2.6.3, this option also had the side-effect
-    of telling the receiving side to follow symlinks, such as a symlink to a
-    directory.  A modern rsync does not do this, though you can choose to
-    specify `--keep-dirlinks` (`-K`) if you want rsync to treat a symlink to a
-    directory on the receiving side as if it were a real directory.  Remember
-    that it's the version of rsync on the receiving side that determines how it
-    reacts to existing destination symlinks when this option is in effect.
+    is dropped from the transfer.
+
+    This option supersedes any other options that affect symlinks in the
+    transfer, since there are no symlinks left in the transfer.
+
+    This option does not change the handling of existing symlinks on the
+    receiving side, unlike versions of rsync prior to 2.6.3 which had the
+    side-effect of telling the receiving side to also follow symlinks.  A
+    modern rsync won't forward this option to a remote receiver (since only the
+    sender needs to know about it), so this caveat should only affect someone
+    using an rsync client older than 2.6.7 (which is when `-L` stopped being
+    forwarded to the receiver).
+
+    See the `--keep-dirlinks` (`-K`) if you need a symlink to a directory to be
+    treated as a real directory on the receiving side.
+
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
 
 0.  `--copy-unsafe-links`
 
     This tells rsync to copy the referent of symbolic links that point outside
     the copied tree.  Absolute symlinks are also treated like ordinary files,
     and so are any symlinks in the source path itself when `--relative` is
-    used.  This option has no additional effect if `--copy-links` was also
-    specified.
+    used.
 
     Note that the cut-off point is the top of the transfer, which is the part
     of the path that rsync isn't mentioning in the verbose output.  If you copy
@@ -1073,32 +1080,68 @@ your home directory (remove the '=' for that).
     slash) to "/dest/subdir" that would not allow symlinks to any files outside
     of "subdir".
 
+    This option has no additional effect if `--copy-links` was also specified.
+    The safe symlinks are only copied if `--links` was also specified or
+    implied by `--archive` (`-a`).
+
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
+
 0.  `--safe-links`
 
-    This tells rsync to ignore any symbolic links which point outside the
-    copied tree.  All absolute symlinks are also ignored. Using this option in
-    conjunction with `--relative` may give unexpected results.
+    This tells the receiving rsync to ignore any symbolic links in the transfer
+    which point outside the copied tree.  All absolute symlinks are also
+    ignored.
 
-0.  `--munge-links`
+    Since this ignoring is happening on the receiving side, it will still be
+    effective even when the sending side has munged symlinks (when it is using
+    `--munge-links`). It also affects deletions, since the file being present
+    in the transfer prevents any matching file on the receiver from being
+    deleted when the symlink is deemed to be unsafe and is skipped.
+
+    This option must be combined with `--links` (or `--archive`) to have any
+    symlinks in the transfer to conditionally ignore. Its effect is superseded
+    by `--copy-unsafe-links`.
 
-    This option tells rsync to (1) modify all symlinks on the receiving side in
-    a way that makes them unusable but recoverable (see below), or (2) to
-    unmunge symlinks on the sending side that had been stored in a munged
-    state.  This is useful if you don't quite trust the source of the data to
-    not try to slip in a symlink to a unexpected place.
+    Using this option in conjunction with `--relative` may give unexpected
+    results.
 
-    The way rsync disables the use of symlinks is to prefix each one with the
-    string "/rsyncd-munged/".  This prevents the links from being used as long
-    as that directory does not exist.  When this option is enabled, rsync will
-    refuse to run if that path is a directory or a symlink to a directory.
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
 
-    The option only affects the client side of the transfer, so if you need it
-    to affect the server, specify it via `--remote-option`. (Note that in a
-    local transfer, the client side is the sender.)
+0.  `--munge-links`
 
-    This option has no affect on a daemon, since the daemon configures whether
-    it wants munged symlinks via its "`munge symlinks`" parameter.  See also the
-    "munge-symlinks" perl script in the support directory of the source code.
+    This option affects just one side of the transfer and tells rsync to munge
+    symlink values when it is receiving files or unmunge symlink values when it
+    is sending files.  The munged values make the symlinks unusable on disk but
+    allows the original contents of the symlinks to be recovered.
+
+    The server-side rsync often enables this option without the client's
+    knowledge, such as in an rsync daemon's configuration file or by an option
+    given to the rrsync (restricted rsync) script.  When specified on the
+    client side, specify the option normally if it is the client side that
+    has/needs the munged symlinks, or use `-M--munge-links` to give the option
+    to the server when it has/needs the munged symlinks.  Note that on a local
+    transfer, the client is the sender, so specifying the option directly
+    unmunges symlinks while specifying it as a remote option munges symlinks.
+
+    This option has no affect when sent to a daemon via `--remote-option`
+    because the daemon configures whether it wants munged symlinks via its
+    "`munge symlinks`" parameter.
+
+    The symlink value is munged/unmunged once it is in the transfer, so any
+    option that transforms symlinks into non-symlinks occurs prior to the
+    munging/unmunging **except** for `--safe-links`, which is a choice that the
+    receiver makes, so it bases its decision on the munged/unmunged value.
+    This does mean that if a receiver has munging enabled, that using
+    `--safe-links` will cause all symlinks to be ignored (since they are all
+    absolute).
+
+    The method that rsync uses to munge the symlinks is to prefix each one's
+    value with the string "/rsyncd-munged/".  This prevents the links from
+    being used as long as the directory does not exist.  When this option is
+    enabled, rsync will refuse to run if that path is a directory or a symlink
+    to a directory (though it only checks at startup).  See also the
+    "munge-symlinks" python script in the support directory of the source code
+    for a way to munge/unmunge one or more symlinks in-place.
 
 0.  `--copy-dirlinks`, `-k`
 
@@ -1125,6 +1168,8 @@ your home directory (remove the '=' for that).
     directory in the file-list which overrides the symlink found during the
     scan of "src/./".
 
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
+
 0.  `--keep-dirlinks`, `-K`
 
     This option causes the receiving side to treat a symlink to a directory as
@@ -1140,8 +1185,9 @@ your home directory (remove the '=' for that).
     "bar".
 
     One note of caution: if you use `--keep-dirlinks`, you must trust all the
-    symlinks in the copy! If it is possible for an untrusted user to create
-    their own symlink to any directory, the user could then (on a subsequent
+    symlinks in the copy or enable the `--munge-symlinks` option on the
+    receiving side!  If it is possible for an untrusted user to create their
+    own symlink to any real directory, the user could then (on a subsequent
     copy) replace the symlink with a real directory and affect the content of
     whatever directory the symlink references.  For backup copies, you are
     better off using something like a bind mount instead of a symlink to modify
@@ -1149,6 +1195,8 @@ your home directory (remove the '=' for that).
 
     See also `--copy-dirlinks` for an analogous option for the sending side.
 
+    See the [SYMBOLIC LINKS](#SYMBOLIC-LINKS) section for multi-option info.
+
 0.  `--hard-links`, `-H`
 
     This tells rsync to look for hard-linked files in the source and link
@@ -3085,7 +3133,7 @@ your home directory (remove the '=' for that).
     absolute) and (2) there are no mount points in the hierarchy (since the
     delayed updates will fail if they can't be renamed into place).
 
-    See also the "atomic-rsync" perl script in the "support" subdir for an
+    See also the "atomic-rsync" python script in the "support" subdir for an
     update algorithm that is even more atomic (it uses `--link-dest` and a
     parallel hierarchy of files).
 
@@ -3429,7 +3477,7 @@ your home directory (remove the '=' for that).
     user wants a more random checksum seed.  Setting NUM to 0 causes rsync to
     use the default of **time**() for checksum seed.
 
-# DAEMON OPTIONS
+## DAEMON OPTIONS
 
 The options allowed when starting an rsync daemon are as follows:
 
@@ -3537,7 +3585,7 @@ The options allowed when starting an rsync daemon are as follows:
     When specified after `--daemon`, print a short help page describing the
     options available for starting an rsync daemon.
 
-# FILTER RULES
+## FILTER RULES
 
 The filter rules allow for flexible selection of which files to transfer
 (include) and which files to skip (exclude).  The rules either directly specify
@@ -3594,7 +3642,7 @@ rule/pattern each.  To add multiple ones, you can repeat the options on the
 command-line, use the merge-file syntax of the `--filter` option, or the


-- 
The rsync repository.



More information about the rsync-cvs mailing list