Debian Codegraph @

old_versions/README.md

raw symbols SCIP
1 # Old rsync version archive
2
3 Static rsync binaries built from historical release tags. Two uses:
4
5 1. **Cross-version behaviour checks** — confirming whether a behaviour a user
6 reported on an old release is version-specific or option-driven.
7 2. **The version-mixing test suite** — `runtests.py --rsync-bin2=...` runs the
8 current code against one of these as the daemon / remote-shell peer; CI
9 (`.github/workflows/ubuntu-version-mix.yml`) does this for every binary
10 here against the per-version manifests in `testsuite/expect/`.
11
12 Binaries are **statically linked** so they run regardless of the host's
13 shared libraries, and named `rsync_<version>`:
14
15 | Binary | Version | Protocol | Notes |
16 |----------------|---------|----------|-----------------------------------------|
17 | `rsync_2.6.0` | 2.6.0 | 27 | 2004; needs autoconf regen (see below) |
18 | `rsync_3.0.0` | 3.0.0 | 30 | 2008 |
19 | `rsync_3.1.0` | 3.1.0 | 31 | 2013 |
20 | `rsync_3.1.3` | 3.1.3 | 31 | Ubuntu 18.04 / Debian buster era (2018) |
21 | `rsync_3.2.0` | 3.2.0 | 31 | 2020 (zstd/lz4/xxhash negotiation added)|
22 | `rsync_3.2.7` | 3.2.7 | 31 | 2022 |
23 | `rsync_3.3.0` | 3.3.0 | 31 | 2024 |
24 | `rsync_3.4.0` | 3.4.0 | 32 | 2025 |
25 | `rsync_3.4.1` | 3.4.1 | 32 | 2025 |
26
27 These are every `x.y.0` release from 2.6.0 (2004) onward plus a few point
28 releases. 2.6.0 is the practical floor: older tags need progressively more
29 porting to build on a current toolchain.
30
31 All built `--disable-openssl` and with `_FORTIFY_SOURCE` disabled (see below);
32 xxhash/zstd/lz4 are compiled in where the version supports them.
33
34 ## Adding a version
35
36 ```bash
37 ./build_static.sh 3.2.7 # uses git tag v3.2.7
38 ./build_static.sh 3.0.9 v3.0.9 # explicit tag if naming differs
39 ```
40
41 The script checks out the tag into a throwaway `git worktree`, applies the
42 minimal patches needed to compile old sources on a modern toolchain, links
43 statically, verifies the result is static and reports the requested version,
44 then installs `rsync_<version>` here and removes the worktree.
45
46 Override the source repo with `RSYNC_REPO=/path/to/rsync ./build_static.sh ...`
47 (defaults to `../rsync.4`).
48
49 ## Why the patches?
50
51 Modern GCC (>= 14, C23 default) and glibc reject things old rsync relied on.
52 `build_static.sh` handles these, each guarded so it's a no-op when not needed:
53
54 1. **K&R `lseek64()` redeclaration** in `syscall.c` clashes with glibc's real
55 prototype — removed.
56 2. **`gettimeofday()`** — glibc only has the 2-arg form; configure misdetects
57 the 1-arg form, so `HAVE_GETTIMEOFDAY_TZ` is forced on in `config.h`.
58 3. **C23 `()` == `(void)`** breaks K&R prototypes called with arguments
59 (`qsort` comparator, `pool->bomb`, etc.) — built with `-std=gnu11`.
60 4. Assorted modern `-Werror` promotions (incompatible pointer types, implicit
61 declarations) downgraded to warnings; bundled zlib/popt used to keep the
62 static link self-contained.
63
64 5. **OpenSSL (3.2+)** is disabled with `--disable-openssl`: linking
65 `libcrypto.a` statically drags in jitterentropy (`jent_*`) and zlib's
66 `uncompress` (OpenSSL's COMP module), which don't resolve here. OpenSSL only
67 provided optional MD4/MD5, which rsync implements natively, so checksum
68 behaviour is unaffected.
69
70 6. **`_FORTIFY_SOURCE` disabled** (`-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0`):
71 modern Ubuntu defaults it to `=3`, whose stricter object-size checks turn
72 latent (historically benign) over-reads in OLD rsync into hard
73 `*** buffer overflow detected ***` aborts when the binary runs as a
74 server/daemon — which made e.g. 3.1.3 and 3.2.7 unusable as peers. Disabling
75 it makes the archival binaries behave as the released versions did.
76
77 7. **Pre-3.0 tags (e.g. 2.6.0)** ship `configure.in`, not a generated
78 `configure`. The script runs `autoheader`/`autoconf` to generate it, after
79 neutralizing the `AC_CHECK_FUNCS(fn,,AC_LIBOBJ(lib/...))` fallbacks for
80 `inet_ntop`/`inet_pton`/`getaddrinfo`/`getnameinfo` — modern autoconf emits
81 broken shell for those never-taken branches (the funcs exist in glibc). It
82 also generates `proto.h` (no make rule in that era) and stubs the vendored
83 `lib/addrinfo.h` the tag dropped (modern glibc supplies `struct addrinfo`).
84 All guarded so they no-op on 3.x.
85
86 Newer versions may need fewer or different tweaks; if a build fails, the
87 script prints the first compiler errors from its log.