Skip to content

Commit 4d44bf1

Browse files
committedSep 30, 2022
A few more doc tweaks & comment tweaks.
1 parent 6af27a5 commit 4d44bf1

6 files changed

+69
-64
lines changed
 

‎NEWS.md

+27-22
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,34 @@
1818
### ENHANCEMENTS:
1919

2020
- Added negotiated daemon-auth support that allows a stronger checksum digest
21-
to be used. Added SHA512, SHA256, and SHA1 digests to MD5 & MD4. These new
22-
digests are at the highest priority in the new daemon-auth negotiation list.
21+
to be used to validate a user's login to the daemon. Added SHA512, SHA256,
22+
and SHA1 digests to MD5 & MD4. These new digests are at the highest priority
23+
in the new daemon-auth negotiation list.
2324

24-
- Added support for SHA1, SHA256, and SHA512 digests in file checksums. While
25-
this tends to be overkill, it is available if someone really needs it. These
26-
overly-long checksums are at the lowest priority in the normal checksum
27-
negotiation list.
25+
- Added support for the SHA1 digest in file checksums. While this tends to be
26+
overkill, it is available if someone really needs it. This overly-long
27+
checksum is at the lowest priority in the normal checksum negotiation list.
28+
See `--checksum-choice` (`--cc`) and the `RSYNC_CHECKSUM_LIST` environment
29+
var for how to customize this.
2830

29-
- Improved the xattr hash table to use a 64-bit key (which should ensure fewer
30-
collisions).
31+
- Improved the xattr hash table to use a 64-bit key without slowing down the
32+
key's computation. This should make extra sure that a collision doesn't
33+
happen.
3134

3235
- If the `--version` option is repeated (e.g. `-VV`) then the information is
33-
output in a (still human-readable) JSON format (client side only).
36+
output in a (still fairly readable) JSON format. Client side only.
3437

3538
- The script `support/json-rsync-version` is available to get the JSON style
3639
version output from any rsync. The script accepts either text on stdin
3740
**or** an arg that specifies an rsync executable to run with a doubled
3841
`--version` option. If the text we get isn't already in JSON format, it is
39-
converted. Newer rsync versions will provide more complete info than older
40-
versions.
42+
converted. Newer rsync versions will provide more complete json info than
43+
older rsync versions.
4144

4245
- The [`use chroot`](rsyncd.conf.5#use_chroot) daemon parameter now defaults to
43-
"unset" so that rsync can use chroot when it works and decide to proceed with
44-
a sanitized copy when chroot is not supported (e.g., for a non-root daemon).
45-
Explicitly setting it to true or false (on or off) behaves the same way as
46-
before.
46+
"unset" so that rsync can use chroot when it works and a sanitized copy when
47+
chroot is not supported (e.g., for a non-root daemon). Explicitly setting
48+
the parameter to true or false (on or off) behaves the same way as before.
4749

4850
- The `--fuzzy` option was optimized a bit to try to cut down on the amount of
4951
computations when considering a big pool of files. The simple heuristic from
@@ -54,10 +56,10 @@
5456
- The checksum code now uses openssl's EVP methods, which gets rid of various
5557
deprecation warnings and makes it easy to support more digest methods. On
5658
newer systems, the MD4 digest is marked as legacy in the openssl code, which
57-
makes openssl refuse to support it via EVP. You can just ignore this and
58-
allow the included MD4 code to be used for older rsync connections (when
59-
talking to an rsync prior to 3.0.0) or you can configure rsync to tell
60-
openssl to enable legacy algorithms (see below).
59+
makes openssl refuse to support it via EVP. You can choose to ignore this
60+
and allow the included MD4 code to be used for older rsync connections (when
61+
talking to an rsync prior to 3.0.0) or you can choose to configure rsync to
62+
tell openssl to enable legacy algorithms (see below).
6163

6264
- A simple openssl config file is supplied that can be installed for rsync to
6365
use. If you install packaging/openssl-rsync.cnf to a public spot (such as
@@ -67,15 +69,18 @@
6769
is not already set). This will enable openssl's MD4 code for rsync to use.
6870

6971
- The packager may wish to include an explicit "use chroot = true" in the top
70-
section of the /etc/rsyncd.conf file if the daemon is being installed to run
71-
as the root user (though rsync should behave the same even with the value
72-
unset, a little extra paranoia doesn't hurt).
72+
section of their supplied /etc/rsyncd.conf file if the daemon is being
73+
installed to run as the root user (though rsync should behave the same even
74+
with the value unset, a little extra paranoia doesn't hurt).
7375

7476
- I've noticed that some packagers haven't installed support/nameconvert for
7577
users to use in their chrooted rsync configs. Even if it is not installed
7678
as an executable script (to avoid a python3 dependency) it would be good to
7779
install it with the other rsync-related support scripts.
7880

81+
- It would be good to add support/json-rsync-version to the list of installed
82+
support scripts.
83+
7984
------------------------------------------------------------------------------
8085

8186
# NEWS for rsync 3.2.6 (9 Sep 2022)

‎checksum.c

+4-8
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ int cur_sum_len;
552552
static const EVP_MD *cur_sum_evp_md;
553553
#endif
554554

555+
/* Initialize a hash digest accumulator. Data is supplied via
556+
* sum_update() and the resulting binary digest is retrieved via
557+
* sum_end(). This only supports one active sum at a time. */
555558
int sum_init(struct name_num_item *nni, int seed)
556559
{
557560
char s[4];
@@ -615,14 +618,7 @@ int sum_init(struct name_num_item *nni, int seed)
615618
return cur_sum_len;
616619
}
617620

618-
/**
619-
* Feed data into an MD4 accumulator, md. The results may be
620-
* retrieved using sum_end(). md is used for different purposes at
621-
* different points during execution.
622-
*
623-
* @todo Perhaps get rid of md and just pass in the address each time.
624-
* Very slightly clearer and slower.
625-
**/
621+
/* Feed data into a hash digest accumulator. */
626622
void sum_update(const char *p, int32 len)
627623
{
628624
#ifdef USE_OPENSSL

‎clientserver.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char
831831
use_chroot = 1; /* The module is expecting a chroot inner & outer path. */
832832
else if (chroot("/") < 0) {
833833
rprintf(FLOG, "chroot test failed: %s. "
834-
"Switching 'use chroot' from unset to no.\n",
834+
"Switching 'use chroot' from unset to false.\n",
835835
strerror(errno));
836836
use_chroot = 0;
837837
} else {

‎csprotocol.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ base64 form of the digest hash of the challenge+password string. The
5353
chosen digest method is the most preferred client method that is also in
5454
the server's list. If no digest list was explicitly provided, the side
5555
expecting a list assumes the other side provided either the single name
56-
"md5" (for a negotiated protocol 30), or the single name "md4" (for an
57-
older protocol).
56+
"md5" (for a negotiated protocol 30 or 31), or the single name "md4"
57+
(for an older protocol).
5858

5959
At this point the server applies all remaining constraints before
6060
handing control to the client, including switching uid/gid, setting up
@@ -91,10 +91,12 @@ stay tuned (or write it yourself!).
9191
------------
9292
Protocol version changes
9393

94-
31 (2022-09-10, 3.2.7dev)
94+
31 (2013-09-28, 3.1.0)
9595

96-
The use of a suffixed list of digest names was added as an
97-
optional suffix to the greeting line.
96+
Initial release of protocol 31 had no changes. Rsync 3.2.7
97+
introduced the suffixed list of digest names on the greeting
98+
line. The presence of the list is allowed even if the greeting
99+
indicates an older protocol version number.
98100

99101
30 (2007-10-04, 3.0.0pre1)
100102

‎rsync.1.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,8 @@ expand it.
581581
0. `--version`, `-V`
582582

583583
Print the rsync version plus other info and exit. When repeated, the
584-
information is output is a JSON format that is still hum-readable (client
585-
side only).
584+
information is output is a JSON format that is still fairly readable
585+
(client side only).
586586

587587
The output includes a list of compiled-in capabilities, a list of
588588
optimizations, the default list of checksum algorithms, the default list of
@@ -1731,8 +1731,6 @@ expand it.
17311731
- `md5`
17321732
- `md4`
17331733
- `sha1`
1734-
- `sha256`
1735-
- `sha512`
17361734
- `none`
17371735

17381736
Run `rsync --version` to see the default checksum list compiled into your

‎rsyncd.conf.5.md

+28-24
Original file line numberDiff line numberDiff line change
@@ -203,35 +203,39 @@ the values of parameters. See the GLOBAL PARAMETERS section for more details.
203203
divider in it -- this causes an unset value to be treated as true for that
204204
module.
205205

206-
Prior to rsync 3.2.7, the default value was "true". The new default makes
207-
it easier to setup an rsync daemon as a non-root user or to run a daemon on
208-
a system where chroot fails. Explicitly setting the value to true in the
209-
rsyncd.conf file will always require the chroot to succeed.
206+
Prior to rsync 3.2.7, the default value was "true". The new "unset"
207+
default makes it easier to setup an rsync daemon as a non-root user or to
208+
run a daemon on a system where chroot fails. Explicitly setting the value
209+
to "true" in rsyncd.conf will always require the chroot to succeed.
210210

211211
It is also possible to specify a dot-dir in the module's "[path](#)" to
212212
indicate that you want to chdir to the earlier part of the path and then
213-
serve files from inside the latter part of the path (with default
214-
sanitizing and symlink munging). This can be useful if you need some
215-
library dirs inside the chroot (typically for uid & gid lookups) but don't
216-
want to put the lib dir into the top of the served path (even though they
217-
can be hidden with an [`exclude`](#) directive). However, a better choice
218-
for a modern rsync setup is to use a [`name converter`](#)" and try to
219-
avoid inner lib dirs altogether. See also the [`daemon chroot`](#)
220-
parameter, which causes rsync to chroot into its own chroot area before
221-
doing any path-related chrooting.
213+
serve files from inside the latter part of the path (with sanitizing and
214+
default symlink munging). This can be useful if you need some library dirs
215+
inside the chroot (typically for uid & gid lookups) but don't want to put
216+
the lib dir into the top of the served path (even though they can be hidden
217+
with an [`exclude`](#) directive). However, a better choice for a modern
218+
rsync setup is to use a [`name converter`](#)" and try to avoid inner lib
219+
dirs altogether. See also the [`daemon chroot`](#) parameter, which causes
220+
rsync to chroot into its own chroot area before doing any path-related
221+
chrooting.
222222

223223
If the daemon is serving the "/" dir (either directly or due to being
224-
chrooted to the module's path), rsync does not do any extra path sanitizing
225-
or (default) munging. When it has to limit access to a particular subdir
226-
(either due to chroot being disabled or having an inside-chroot path set),
227-
rsync will munge symlinks (by default) and sanitize paths. Those that
228-
dislike munged symlinks (and really, really trust their users to not break
229-
out of the subdir) can disable the symlink munging via the "[munge
230-
symlinks](#)" parameter. Sanitizing paths trims ".." path elements from
231-
args that rsync believes would escape the module hierarchy, and also
232-
substitutes leading slashes in absolute paths with the module's path (so
233-
that options such as `--backup-dir` & `--compare-dest` interpret an
234-
absolute path as rooted in the module's "[path](#)" dir).
224+
chrooted to the module's path), rsync does not do any path sanitizing or
225+
(default) munging.
226+
227+
When it has to limit access to a particular subdir (either due to chroot
228+
being disabled or having an inside-chroot path set), rsync will munge
229+
symlinks (by default) and sanitize paths. Those that dislike munged
230+
symlinks (and really, really trust their users to not break out of the
231+
subdir) can disable the symlink munging via the "[munge symlinks](#)"
232+
parameter.
233+
234+
When rsync is sanitizing paths, it trims ".." path elements from args that
235+
it believes would escape the module hierarchy. It also substitutes leading
236+
slashes in absolute paths with the module's path (so that options such as
237+
`--backup-dir` & `--compare-dest` interpret an absolute path as rooted in
238+
the module's "[path](#)" dir).
235239

236240
When a chroot is in effect *and* the "[name converter](#)" parameter is
237241
*not* set, the "[numeric ids](#)" parameter will default to being enabled

0 commit comments

Comments
 (0)
Please sign in to comment.