Compare commits

...

6782 Commits

Author SHA1 Message Date
Wayne Davison
0ac7ebceef Preparing for release of 3.2.4 2022-04-15 13:31:16 -07:00
Wayne Davison
85c56b2603 The latest news. 2022-04-11 09:50:58 -07:00
Wayne Davison
10aeb75cea Add debugging comment about read_buf_(). 2022-04-11 09:50:31 -07:00
Simon Deziel
d41bb98c09 systemd: restart daemon on-failure (#302)
man 5 systemd.service:
> Setting this to on-failure is the recommended choice for long-running services

Partial fix for https://bugzilla.samba.org/show_bug.cgi?id=13463

Signed-off-by: Simon Deziel <simon@sdeziel.info>
2022-04-11 09:08:11 -07:00
Yoichi NAKAYAMA
2fda51692b Specify log format to avoid malfunctions and unexpected errors. (#305)
Solve the following problems:
* mishandling of commit message lines similar to committer lines
* UnicodeDecodeError with commit messages that cannot be interpreted
  as utf-8
2022-04-11 08:57:19 -07:00
Michal Ruprich
1de71e8a78 Fix for CVE-2018-25032 in zlib (#306) 2022-04-11 08:50:50 -07:00
Wayne Davison
60dd42be60 Handle linking with a zlib with external read_buf. 2022-04-11 08:29:54 -07:00
Wayne Davison
d821e4cbfb Preparing for release of 3.2.4pre4 2022-03-27 14:59:57 -07:00
Wayne Davison
8aa465117f Add new & improved --copy-devices option. 2022-03-27 14:04:59 -07:00
Wayne Davison
8977815f5d Some --write-device fixes. 2022-03-27 12:52:26 -07:00
Wayne Davison
a48c20c97c Combine some alt-dest tests. 2022-03-26 10:01:12 -07:00
Wayne Davison
601f47436f Rename compare-dest test. 2022-03-26 10:01:10 -07:00
Sam Mikes
ef76d6cfa5 Extract unlink_and_reopen from copy_file (#294)
* add tests to exercise copy_file

* Extract new function unlink_and_reopen from copy_file

The argument `ofd` to copy_file is always set to -1 unless
`open_tmpfile()` is called at generator.c:909

This change
 * removes assignment to a function argument
 * renames argument `ofd` to `tmpfilefd` in line with existing uses
 * extracts a new function `unlink_and_reopen` which is static to util1.c
 * rewrites header comments for copy_file
2022-03-26 09:14:10 -07:00
Wayne Davison
96ed4b47b9 Some word fixes. 2022-03-26 08:58:51 -07:00
Wayne Davison
13c4019e94 Also ignore a root-level rrsync file. 2022-03-13 10:45:09 -07:00
Wayne Davison
b7b387b1f7 Add FALLTHROUGH comment. 2022-03-13 09:31:44 -07:00
Wayne Davison
7569edfaef Use ac_includes_default in largefile support test. 2022-03-09 18:38:03 -08:00
Wayne Davison
55b2a06812 Test newer FreeBSD. 2022-03-03 17:26:47 -08:00
Wayne Davison
b81a509556 Make asm use more selectable
- Make the SIMD ASM code off by default. Use configure --enable-simd-asm
  to enable.
- Allow MD5 ASM code to be requested even when OpenSSL is handling MD4
  checksums. Use configure --enable-md5-asm to enable.
2022-03-03 17:00:57 -08:00
Wayne Davison
26f4dbe12c Change usage (--version) output to note when ASM isn't really being used. 2022-02-21 16:41:50 -08:00
Sam Mikes
b3f1970f18 Fix wording in RSYNC_PORT section (#293)
Fix wording from 'does is not read' -> 'is not read'
2022-02-21 14:00:45 -08:00
Wayne Davison
c51da9174f Build Cygwin on windows-2022 with newer python. [buildall] 2022-02-09 14:00:13 -08:00
Wayne Davison
81f71f6f29 Add a CAUTION message to --debug=FILTER for trailing whitespace. 2022-01-27 08:53:41 -08:00
Wayne Davison
48e7005554 Add a couple more --rsync-path opts to the test. [buildall] 2022-01-20 10:51:13 -08:00
Wayne Davison
2b3e68814b Specify the rsync that lsh.sh should run. [buildall] 2022-01-20 09:02:02 -08:00
Wayne Davison
cc83294316 Preparing for release of 3.2.4pre3 2022-01-18 23:47:45 -08:00
Wayne Davison
08c8375acb Tweak rrsync rules in the Makefile. 2022-01-18 23:13:22 -08:00
Wayne Davison
824a057935 Add some arg-escaping tests. 2022-01-18 22:47:05 -08:00
Wayne Davison
d91ddb97d1 Don't backslash-escape args for a local transfer. 2022-01-18 22:47:05 -08:00
Wayne Davison
5bb637ca04 Add missing ">". 2022-01-18 22:47:03 -08:00
Wayne Davison
142aba00d5 Silence some symlink mode-change failures. 2022-01-17 22:23:31 -08:00
Wayne Davison
8687e44d10 Fix a broken link & make a tweak. 2022-01-17 20:44:16 -08:00
Wayne Davison
0bd8e85185 Facilitate the next release. 2022-01-17 19:43:43 -08:00
Wayne Davison
00a5ab2364 Tweak some rrsync rules for cleanup & release. 2022-01-17 18:52:49 -08:00
Wayne Davison
f44e76b65c Handle html link targets in a better way. 2022-01-17 18:11:45 -08:00
Wayne Davison
1174d97072 Fix --old-args interaction with a daemon
Ensure that a remote rsync daemon will not split a filename arg unless
the user asked for `--old-args`.
2022-01-17 18:11:03 -08:00
Wayne Davison
d9eaffe564 Complain about --old-args with --protect-args. 2022-01-17 18:09:36 -08:00
Wayne Davison
6197385d1f More man & NEWS enhancements, including linking to env vars. 2022-01-17 18:09:34 -08:00
Wayne Davison
d07272d631 More man page and NEWS improvements.
- Add link targets for all option choices, not just the first one.
- Tweak cross-link arg format.
- Add more links, including some in the latest NEWS.
- Split out a few numbered lists.
2022-01-16 10:47:36 -08:00
Wayne Davison
e2a011d9d0 Fix some typos mentioned in the fossies report. 2022-01-16 10:33:22 -08:00
Wayne Davison
76dc7d0a76 It's OK to capitalize rsync at the start of a sentence. 2022-01-15 21:44:26 -08:00
Wayne Davison
7e94e52144 Some NEWS.html improvements.
- Improve NEWS heading's link targets using version info.
- Optimize regex compilation.
- Make sure every link target is unique.
- Allow link targets to start with a number.
2022-01-15 21:07:34 -08:00
Wayne Davison
5ef7e3c9c5 Remove <a name=...> tags. 2022-01-15 20:55:54 -08:00
Wayne Davison
d2cc1149b3 Get md-convert to output the release html files in the right dir. 2022-01-15 19:12:03 -08:00
Wayne Davison
c3b553a93f Preparing for release of 3.2.4pre2 2022-01-15 17:21:01 -08:00
Wayne Davison
eb0b41587c Use standard "git diff" for full diff highlighting support. 2022-01-15 17:20:11 -08:00
Wayne Davison
3c0bb7ff51 Even more man page improvements. 2022-01-15 17:13:31 -08:00
Wayne Davison
995ce7198b Man page improvments, including html cross-links. 2022-01-15 16:31:54 -08:00
Wayne Davison
38ffa522f6 A few more man page format tweaks. 2022-01-14 14:27:31 -08:00
Wayne Davison
8898aecb21 Make it easier to get section links. 2022-01-14 13:55:22 -08:00
Wayne Davison
f08505e92b Add more link targets to html man pages. 2022-01-13 23:44:30 -08:00
Wayne Davison
c1e8809a8f Tweak a caveat. 2022-01-13 23:31:43 -08:00
Wayne Davison
6130c4fa3c Display ??:??:?? when a time estimate gets too big. 2022-01-13 08:22:25 -08:00
Wayne Davison
8c4ceb3b86 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.
2022-01-12 20:04:32 -08:00
Wayne Davison
30a5909544 Some symlink improvements to the man page. 2022-01-12 16:43:40 -08:00
Wayne Davison
e841944b47 Change manpage headings in html to use h2 tags with an id target. 2022-01-12 16:43:22 -08:00
Wayne Davison
635d8c0632 A repeated --old-args does more escape disabling. 2022-01-09 18:20:23 -08:00
Wayne Davison
6b8db0f644 Add an arg-protection idiom using backslash-escapes
The new default is to protect args and options from unintended shell
interpretation using backslash escapes.  See the new `--old-args` option
for a way to get the old-style splitting.  This idiom was chosen over
making `--protect-args` enabled by default because it is more backward
compatible (e.g. it works with rrsync). Fixes #272.
2022-01-09 17:47:24 -08:00
Wayne Davison
3b2804c815 Tweak a comment. 2022-01-09 14:03:31 -08:00
Wayne Davison
ff1792edf1 Improve --copy-links description. 2022-01-09 12:38:36 -08:00
Wayne Davison
b985123d2e Allow someone to specify scratchbase=FOO for runtests.sh. 2022-01-09 11:40:41 -08:00
Wayne Davison
c983279020 Improve rrsync usage and some more NEWS tweaks. 2022-01-03 00:47:19 -08:00
Wayne Davison
ee9199b542 More NEWS improvements. 2022-01-03 00:18:59 -08:00
Wayne Davison
f1a6998df2 Only send the --no-W kluge to a receiver. 2022-01-02 23:51:35 -08:00
Wayne Davison
3e44bbd313 Preparing for release of 3.2.4pre1 2022-01-02 15:13:19 -08:00
Wayne Davison
4adfdaaf12 Tweak stderr handling for older BackupPC versions
This makes the default for a protocol-28 server process be --stderr=client
instead of --stderr=errors.  See rsync's github issue #95.
2022-01-02 14:48:04 -08:00
Wayne Davison
4a7ba3cfaf A couple man page improvements. 2022-01-02 14:43:30 -08:00
Rodrigo Osorio
ffbca80ca2 Time-limit options are not being checked enough (#179)
The `--stop-at`, `--stop-after`, and `--time-limit`` options should have their
limit checked when receiving and sending data, not just when receiving.
Fixes #177.
2022-01-02 14:37:27 -08:00
Wayne Davison
c11467af36 Some compression improvements.
The compression level of the first file in the transfer no longer sets
the level for all files that follow it.  Document that per-file level
switching has no current effect (except for a global "dont compress = *"
rule in the daemon).
2021-12-31 12:21:13 -08:00
Wayne Davison
13cfe6406f Add error-code ignoring options to atomic-rsync. 2021-12-30 12:29:14 -08:00
Wayne Davison
8e77ece0ee Tweak the rrsync man page. 2021-12-30 12:29:09 -08:00
Marco Nenciarini
ffec7fe109 Fix rrsync directory normalization (#268)
Fix an off-by-one in the `args.dir_slash_len` variable that leads to base every absolute path on `/`
2021-12-30 08:59:17 -08:00
Wayne Davison
e07f8fb863 Add a default single-access lock. 2021-12-27 17:57:53 -08:00
Wayne Davison
8cf9dbb742 Change args to maybe-make-man. 2021-12-27 17:40:31 -08:00
Wayne Davison
3008e7c226 Include "rrsync" in "all" target when --with-rrsync was used. 2021-12-27 15:52:11 -08:00
Wayne Davison
a2b630c0bb Unify md parsing scripts & improve non-man html conversions. 2021-12-27 14:24:05 -08:00
Wayne Davison
5b1baa7a2e Rename md2man. 2021-12-27 13:42:19 -08:00
Wayne Davison
7f8cf771b7 Add more backticks. 2021-12-27 13:11:23 -08:00
Wayne Davison
b00e99c529 Ignore the built rrsync man-page files. 2021-12-27 12:10:31 -08:00
Wayne Davison
a76e32f949 Test --with-rrsync configure option & put rrsync into the artifacts. 2021-12-26 14:58:16 -08:00
Wayne Davison
512acd125e Use mallinfo2, when available, and use %zd for size_t values on C99.
An exhanced version of pull request #265.
2021-12-26 14:25:53 -08:00
Wayne Davison
72adf49ba8 rrsync improvements
- Convert rrsync to python.
- Enhance security of arg & option checking.
- Reject `-L` (`--copy-links`) by default.
- Add `-munge` and `-no-del` options.
- Tweak the logfile line format.
- Created an rrsync man page.
- Use `configure --with-rrsync` if you want `make install` to install
  rrsync and its man page.
- Give lsh more rrsync testing support.
2021-12-26 12:29:00 -08:00
Wayne Davison
73ceea6ad2 Convert atomic-rsync to python. 2021-12-20 17:36:33 -08:00
Wayne Davison
39c3ae0ea3 Convert munge-symlinks to python. 2021-12-20 16:41:16 -08:00
Wayne Davison
ed19ea05fe Make rrsync default to munged symlinks. 2021-12-20 15:16:30 -08:00
Wayne Davison
dc1b9febf1 Add options to assist in localhost rrsync testing. 2021-12-20 15:08:20 -08:00
Wayne Davison
d9015da151 Add --munge-links rsync option; convert to python. 2021-12-20 13:51:50 -08:00
Wayne Davison
1f0e62f139 Improve a couple support scripts:
- rsync-no-vanished now avoids joining stdout & stderr, avoids affecting
  a non-client run, and gets the rsync status code correctly.
- rsync-slash-strip now avoids affecting a non-client run.
2021-11-13 10:39:09 -08:00
Andrew Aladjev
7d830ff52f improved cross compilation detection (#252) 2021-11-07 11:45:49 -08:00
Issam Maghni
8f383e8987 shell: test -a|o is not POSIX (#250) 2021-11-07 10:23:01 -08:00
Wayne Davison
ca538965d8 Add closing backticks that Itzoke pointed out. 2021-11-07 10:11:12 -08:00
Wayne Davison
e4669b81ae Add the --info=NONREG setting. 2021-11-03 09:35:50 -07:00
Wayne Davison
1b9308b727 More NEWS changes. 2021-10-30 15:58:01 -07:00
Wayne Davison
80c64dc3b3 Fix the ability to read the user's numeric locale. 2021-10-29 20:06:06 -07:00
Wayne Davison
be3d6c0fbb Update the NEWS. 2021-10-19 21:10:59 -07:00
Wayne Davison
7956070f2b Make --chown|--usermap|--groupmap imply -o|-g (as appropriate). 2021-10-19 21:10:12 -07:00
Wayne Davison
d0f34b5a76 Allow a "%scope" suffix on the client's ipv6 addr.
Hopefully fixes bug #239.
2021-10-17 13:58:57 -07:00
Achim Leitner
84498104bf Linux: Handle protected_regular in inplace writes (#241)
The Linux fs.protected_regular sysctl setting could cause rsync to fail to write a file in-place with the O_CREAT flag set, so the code now tries an open without O_CREAT when it might help to avoid an EACCES error.  A testsuite script is included (and slightly improved by Wayne to ensure that it outputs a SKIP when fs.protected_regular is turned off).
2021-10-17 13:00:24 -07:00
Wayne Davison
378a0a634f Add more skipped verifications. [buildall] 2021-10-17 12:45:45 -07:00
Wayne Davison
ac08fa74f3 Tweak output about skipped tests. 2021-10-17 12:07:03 -07:00
Wayne Davison
d5d4ae51ee Change RSYNX_MAX_SKIPPED to RSYNC_EXPECT_SKIPPED. 2021-10-17 11:34:07 -07:00
Wayne Davison
0f87eafa2f A couple minor tweaks. 2021-10-13 10:39:44 -07:00
Wayne Davison
3af00277ee We need stat memcpy. 2021-10-10 14:01:59 -07:00
Wayne Davison
b774dbc1c0 Improve --omit-dir-times & --omit-link-times
The code now better handles skipping time setting on dirs and/or links
when --atimes and/or --crtimes is specified without --times.
2021-10-10 13:39:09 -07:00
Wayne Davison
296352ecb0 Tweak atime/crtime code a bit more. 2021-10-10 12:43:11 -07:00
Wayne Davison
11a9b62322 Avoid spurious warning about "code" var not being initialized. 2021-10-10 10:05:26 -07:00
Wayne Davison
452ef78517 Unify on "path" vs "fname" arg naming. 2021-10-10 09:53:35 -07:00
Wayne Davison
0d1b48893a Change do_lchmod() back to a swtich with some better ENOTSUP & ENOSYS logic. 2021-10-10 09:32:43 -07:00
Wayne Davison
ec8a05f653 Some packaging improvements. 2021-10-10 09:28:24 -07:00
Wayne Davison
78b5bc6629 Enable --atimes on macOS. 2021-10-02 15:23:30 -07:00
Wayne Davison
f41cdc75a1 Check ro in set_create_time() for Cygwin too. 2021-10-02 11:39:41 -07:00
Wayne Davison
c8e7c4b352 Avoid an issue where the size of st_dev != dev_t. 2021-10-01 14:21:26 -07:00
Wayne Davison
bff084c10a Always run mkgitver prior to a build
Some hosts were not running `mkgitver` when they should, so tweak the
script to only update the timestamp when the file's data changes and
then always run the script when performing a build.
2021-10-01 14:17:53 -07:00
Wayne Davison
16c8b05f11 Add more NEWS updates. 2021-10-01 13:40:07 -07:00
Wayne Davison
15dd2058fd Change do_chmod to always try lchmod() first (when possible). 2021-10-01 13:28:57 -07:00
Wayne Davison
c27180c044 Add a couple more options to rrsync. 2021-10-01 13:24:51 -07:00
Wayne Davison
050fdd4126 Allow the script to be run from inside the packaging dir. 2021-10-01 13:23:30 -07:00
Jindřich Makovička
ae1f002999 Reduce memory usage (#235)
In 2004, an allocation optimization has been added to the file
list handling code, that preallocates 32k of file_struct pointers
in a file_list. This optimization predates the incremental
recursion feature, for which it is not appropriate anymore. When
copying a tree containing a large number of small directories,
using the incremental recursion, rsync allocates many short
file_lists. Suddenly, the unused file_struct pointers can easily
take 90-95% of the memory allocated by rsync.
2021-10-01 12:04:59 -07:00
Wayne Davison
3911c23866 Tweak SIMD & ASM option defaults. 2021-09-27 11:09:43 -07:00
Wayne Davison
3814dbb0f4 Make cygwin's curl grab the gist file. [buildall] 2021-09-27 10:34:22 -07:00
Wayne Davison
82f023d7e3 Add --fsync option (promoted from patches). 2021-09-27 10:30:00 -07:00
Wayne Davison
ec57c57baf Help avoid a --sparse --inplace bug in older rsyncs. 2021-09-27 10:16:15 -07:00
Wayne Davison
354fa581c1 Fix typo. 2021-09-26 19:27:46 -07:00
Wayne Davison
d881814a35 Don't allow a broken samba host to cause gensend to fail. 2021-09-26 19:11:24 -07:00
Wayne Davison
ad048d78ac Allow $host_cpu to be amd64 in addition to x86_64. 2021-09-26 19:11:20 -07:00
Wayne Davison
109dbc0b75 Rename cmdormsg -> cmd-or-msg. 2021-09-26 18:55:46 -07:00
Wayne Davison
745ecf2825 Fix a couple variable typos. 2021-09-26 18:50:32 -07:00
Shark64
265785b7b9 x86-64 AVX2 assemby implemenation of get_checksum1() (#174) 2021-09-26 18:16:55 -07:00
Wayne Davison
97f4d48a07 configure improvements
- Make SIMD & ASM only default to enabled on linux for now (due to
  FreeBSD & MacOS issues).
- Improve the enable/disable help messages so that they don't look
  wrong when the opposite --enable-X/--disable-X arg is specified.
2021-09-26 18:11:06 -07:00
Wayne Davison
3cc7f0ba43 Tweak a comment. 2021-09-26 17:23:33 -07:00
a1346054
dde4695136 Minor cleanup (#214)
- use `grep -E` and `grep -F` (`egrep` and `fgrep` are non-standard)
- use same hashbang style for all test scripts
- use explicit comparisons in test scripts
- remove redundant ; from test scripts
- make test script not executable, just like all the other scripts
- unify codestyle across all test scripts
- make openssl license exception clearer by having it at the top
- use modern links in COPYING. The text now matches:
  https://www.gnu.org/licenses/gpl-3.0.txt
- fix typo
2021-09-26 16:57:55 -07:00
Fabian H
3337930292 add ssl/tls key option (#216)
Improves rsync-ssl configurability.
2021-09-26 16:44:00 -07:00
zgpmax
44cc148907 Fix spelling of nanosecond (#220)
Hyphenating the word just makes it harder to find when nanosecond support was added.
2021-09-26 16:42:02 -07:00
TomasKorbar
b2e16facd4 Eventually add write permission when setting extended attributes (#212)
* Eventually add write permission when setting extended attributes

When we need to set extended atributes of file which does not
allow write then temporarily add write permission and after
attributes are set, remove it again.

Resolves #208

Co-authored-by: Wayne Davison <wayne@opencoder.net>
2021-09-26 16:34:15 -07:00
Wayne Davison
4fd662fea9 Remove duplicate include. 2021-09-26 16:28:35 -07:00
Wayne Davison
12c058698b Add gist update logic to gensend target. 2021-09-26 14:57:22 -07:00
Wayne Davison
33095916ec Make use of a git gist instead of the samba website. 2021-09-26 12:09:17 -07:00
Wayne Davison
5818cf8596 Add missing INET6 check. 2021-09-26 11:25:18 -07:00
Jonathan Davies
1fa0bd1e87 configure.ac: Test IPv6 compatibility instead of relying on library probes (#206)
Legacy configure behaviour was to detect IPv6 support through known IPv6
capable version of common standard libraries. Now: it runs a POSIX test
to determine if IPv6 is usable (in case it has not been disabled).

Patch originally from Pierre-Olivier Mercier <nemunaire@nemunai.re>.

Signed-off-by: Jonathan Davies <jpds@protonmail.com>
2021-09-26 11:25:06 -07:00
Fabian H
592c6bc3e5 add missing - in certopt (#210)
otherwise openssl will give an error and not accept is as argument
2021-08-16 15:52:39 -07:00
Natanael Copa
efc81c93a9 Add test and fix regression for --delay-updates (#192) (#204)
Fixes regression introduced with commit 3a7bf54ad5 (A resumed
partial-dir file is transferred in-place.)
2021-07-28 09:10:55 -07:00
Wayne Davison
35d4f6737a Update the options in rrsync. 2021-07-09 11:58:27 -07:00
Wayne Davison
291a042b3e Support --crtimes on Cygwin. 2021-07-08 18:59:26 -07:00
Wayne Davison
9dad3721a9 Make whole-line comments clearer. 2021-07-04 12:42:51 -07:00
Wayne Davison
dbb1c2d10c Set whole_file = 0 when whole_file < 0. Fixes issue 114. 2021-07-04 12:15:16 -07:00
Wayne Davison
e8e34ed6fb Need to also check stdout_format_has_i in some INFO-NAME checks. 2021-06-27 11:34:57 -07:00
Wayne Davison
c529782a8d Fix compiling without ftruncate. 2021-06-27 09:45:41 -07:00
juleslagarde
2dfd48492e fix man page typo
Fix a copy/paste error that should be referring to deletions.
2021-06-16 22:39:45 -07:00
Wayne Davison
a6bdf313f2 Unset DISPLAY in environment.
Without a DISPLAY var, ssh won't try to forward X11 when making an
ssh connection.  This patch also makes use of setenv() and unsetenv()
if they are available.
2021-05-01 09:14:51 -07:00
Bart S
915685e01b Updated GLIBC check in configure.ac (#175)
The current GLIBC check does not consider we may see glibc 3.0 in the future.
2021-05-01 08:23:25 -07:00
Wayne Davison
05540220a9 Fix plural of --group option. 2021-04-03 21:09:14 -07:00
Wayne Davison
75158e1086 Fix git-set-file-times's handling of staged changed files. 2021-03-15 09:35:39 -07:00
Wayne Davison
676537cf29 Switch to using image_family for Cirrus CI. 2021-03-02 19:16:52 -08:00
Wayne Davison
d857fd42ac Install bash on FreeBSD CI. 2021-03-02 19:09:23 -08:00
Wayne Davison
5856b71eb7 Update FreeBSD CI to 12.2. 2021-03-02 19:02:08 -08:00
Wayne Davison
57adb2973a See if explicitly installing m4 gets FreeBSD CI a newer gm4 version. 2021-03-02 14:13:54 -08:00
Wayne Davison
ead44adcd3 Allow the generator's msg iobuf to get bigger too. 2021-02-25 12:28:18 -08:00
Wayne Davison
d3085f7add Rename util.c to util1.c
Fixes an issue where the Makefile's glob of *.c could sort util.c &
util2.c in an order that depends on the current collation setting.
2021-02-25 09:14:33 -08:00
Wayne Davison
1da64c37e8 A few Cygwin build tweaks. [buildall] 2021-02-10 08:07:03 -08:00
Wayne Davison
ef36b097bf Stop checking for gmake in build scripts
Since a non-cygwin gmake trips up the github cygwin action, let's just
require that the user put a good "make" early on their path (a simple
`ln -s `which gmake` ~/bin/make` with the right $PATH works fine).
2021-02-04 20:51:04 -08:00
Wayne Davison
ec3833c96e Add optional netgroup.h include for NetBSD hosts. 2021-02-01 16:31:28 -08:00
Wayne Davison
25dfc2c41d Some pip-releated tweaking. 2021-02-01 09:00:06 -08:00
Wayne Davison
d5b7889d40 Add a link to the man page to the README. 2021-02-01 08:47:44 -08:00
Wayne Davison
74561d70b5 Check for netinet/ip.h after including netinet/in.h. 2021-01-31 11:11:07 -08:00
Wayne Davison
83f7372369 A couple "make" tweaks. 2021-01-31 11:10:38 -08:00
Wayne Davison
8c3de35b0b Put 0 in parens to silence an Xcode warning. 2021-01-31 09:28:34 -08:00
Wayne Davison
ec1d5d564c Add --with-nobody-user=FOO configure option. 2021-01-15 07:38:49 -08:00
Wayne Davison
26befd9c6c Cygwin python3 is now 3.8 w/o commonmark lib. [buildall] 2021-01-01 10:02:49 -08:00
James Cook
a28c4558c5 Fix spelling error in man page. (#124)
trasnferred -> transferred
2020-12-10 09:43:04 -08:00
Wayne Davison
ed6a0dc7c2 Fix a typo. 2020-12-09 22:35:16 -08:00
Wayne Davison
9dd62525f3 Work around glibc's lchmod() issue a better way. 2020-11-29 09:40:03 -08:00
Wayne Davison
ada588a7a8 Include stdlib.h for exit() and consult HAVE_* macros more. 2020-11-29 09:13:09 -08:00
Wayne Davison
286e164ed6 Tweak cmd_txt routines in the packaging scripts. 2020-11-01 11:27:08 -08:00
Wayne Davison
85b8dc8aba Force HAVE_LCHMOD off for Linux (for now). 2020-10-30 16:37:52 -07:00
Wayne Davison
0748800118 Use the right powershell env syntax. [buildall] 2020-10-07 14:02:28 -07:00
edo
b7fab6f285 Allow cross-compilation with SIMD (x86_84) (#104)
Replace runtime SIMD check with a compile-only test in case of
cross-compilation.

You can still use '--enable-simd=no' to build x86_64 code without
SIMD instructions.
2020-10-06 22:33:57 -07:00
Wayne Davison
9fc7deab0d Update CI builds to new path-setting idiom. 2020-10-06 22:28:17 -07:00
Wayne Davison
b115bc8a5d Silence a few more warnings. 2020-09-29 16:05:29 -07:00
Wayne Davison
cd018c7a4c Use a better -Wno-pedantic heuristic. 2020-09-29 15:30:20 -07:00
Wayne Davison
9fce0eb5ab Avoid some pedantic errors & old warnings. 2020-09-29 14:51:45 -07:00
Wayne Davison
33e94849b1 Handle early gcc versions that don't understand -Wno-pedantic. 2020-09-29 14:27:59 -07:00
Wayne Davison
8f1511184a Make gcc die on init overflow of an array.
- Use -pedantic-errors with gcc to make an array-init fatal.
- Fix all the extra warnings that gcc outputs due to this option.
- Also add -Wno-pedantic to gcc if we're using the internal popt
  code (since it has lots of pedantic issues).
2020-09-29 13:18:28 -07:00
Wayne Davison
acca9d43d3 Expand the max name_num_item list size. 2020-09-29 12:57:32 -07:00
Wayne Davison
58f464f4da Change --info=skip2 messages & add info on attr changes. 2020-09-23 09:33:29 -07:00
Wayne Davison
7eb59a9152 Change from $build_cpu to $host_cpu as edo1 suggested. 2020-09-22 17:19:48 -07:00
Wayne Davison
740ed11aa8 Make the extra info on the "exists" messages optional. 2020-09-22 16:45:07 -07:00
Wayne Davison
d2a97a7ab4 Various file comparison improvements
- Rename unchanged_file() to quick_check_ok().
- Enhance quick_check_ok() to work with non-regular files.
- Add a get_file_type() function to the generator.
- Use the new functions in the generator code to make the logic simpler.
- Fix a bug where the `--alt-dest` functions were not checking if a
  special file fully matched the non-permission mode bits before
  deciding if we have found an alt-dest match.
- Enhance the `--info=skip --ignore-existing` output to include extra
  info on if the existing file differs in type or passes the standard
  quick-check logic.
- Add `--info=skip2` that authorizes rsync to perform a slow checksum
  "quick check" when ignoring existing files. This provides the uptodate
  and differs info even if we need to checksum a file to get it.
2020-09-22 12:48:02 -07:00
Wayne Davison
15bc7ded39 More NEWS updates. 2020-09-21 19:17:59 -07:00
Wayne Davison
f0810068a6 A couple whitespace tweaks. 2020-09-21 18:42:21 -07:00
Shark64
7aa2f36317 optimize avx2 code (#102)
Optimize avx2 code using only intrinsic functions supported by older gcc versions.
2020-09-21 15:11:27 -07:00
Wayne Davison
9cd85b8496 Skip an append if sender's file gets shorter.
Fixes bug #90.  Similar to a pull request by Tomas Korbar.
2020-09-21 14:57:45 -07:00
Wayne Davison
f8dcd7d452 Improve the docs for --archive.
A slightly tweaked version of a patch from Richard Michael.
2020-09-21 14:07:48 -07:00
Wayne Davison
69530b406e Avoid output variance in protocol 29. 2020-09-21 13:45:42 -07:00
Wayne Davison
122b0fdc4f Check status of tests that pipe rsync's output & simplify output diffing. 2020-09-21 13:32:41 -07:00
Wayne Davison
b990d97d35 Put CAN_HARDLINK_SYMLINK info into --version output. 2020-09-21 13:17:15 -07:00
Wayne Davison
fd6839b746 Avoid spurious "is newer" messages with --update. 2020-09-21 11:07:42 -07:00
Wayne Davison
a79d9b22b1 Update the NEWS. 2020-09-08 22:31:18 -07:00
Wayne Davison
2613c9d98a Handle a --mkpath failure
Fixes bug #96 where --mkpath makes rsync complain when a dest path
exists but the path contains an alt-dest name for the single file.
2020-09-08 10:58:47 -07:00
Wayne Davison
27aff880a9 Use new xxhash lib in cygwin build. [buildall] 2020-09-07 19:42:08 -07:00
Wayne Davison
7b53e67d64 Try using the Windows version of curl. [buildall] 2020-09-07 15:11:32 -07:00
Wayne Davison
da956469a1 Another cygwin build attempt. [buildall] 2020-09-07 14:46:27 -07:00
Wayne Davison
9c59632d8b Improve a sentence about --stderr=all. 2020-09-07 14:42:35 -07:00
Wayne Davison
d1f458d383 Try cygwin build again. [buildall] 2020-09-07 14:23:39 -07:00
Wayne Davison
a35a900ac0 Add git-version.h to "gen" target. 2020-09-06 23:36:08 -07:00
Wayne Davison
f4c3969b63 Leave git-version.h out of GENFILES so it doesn't go in a release tar. 2020-09-06 23:27:28 -07:00
Wayne Davison
ee75e51f2f Allow git-version.h to be provided for the build
For a non-git build or for a git build w/o adequate git history, we now
allow the git-version.h file to be provided before the build.  If the
file does not exist, we either create an empty file or put a define of
RSYNC_GITVER in it based on the output of git describe.  The github
builds now snag the git-version.h file that was generated for the last
commit so that they all get the same version string, even with a shallow
checkout.
2020-09-06 23:09:11 -07:00
Wayne Davison
9f9240b661 Set CXX_OK=no when cross compiling. 2020-09-03 10:07:36 -07:00
Wayne Davison
48885309c7 Create SECURITY.md 2020-09-02 14:49:20 -07:00
Wayne Davison
203b3d0143 Setup for 3.2.4dev. 2020-08-27 19:36:57 -07:00
Wayne Davison
25526eb3fe Simplify the compat logic for local_server
Change the logic in compat.c to construct the client_info string value
for a local copy so that the various checks of the string don't need to
make an exception for local_server.
2020-08-27 19:23:13 -07:00
Matt McCutchen
c3f7414c45 rsync-ssl: Verify the hostname in the certificate when using openssl. 2020-08-26 14:07:02 -07:00
Wayne Davison
4c4fce5107 Add some comments about protocol versions. 2020-08-07 16:25:12 -07:00
Wayne Davison
6816b31378 Simplify where version.h is included. 2020-08-06 21:10:46 -07:00
Wayne Davison
e94bad1c15 Preparing for release of 3.2.3 2020-08-06 20:57:26 -07:00
Wayne Davison
617d726a3d Tweak a comment. 2020-08-05 21:32:44 -07:00
Wayne Davison
020eda887f Change fetch depth. 2020-08-03 14:47:38 -07:00
Wayne Davison
b5f8021a12 Don't use --always to ensure a tag is in gitver. 2020-08-03 14:27:49 -07:00
Wayne Davison
7b6947576a Avoid a build fail when git isn't installed. 2020-08-03 14:20:08 -07:00
Wayne Davison
9375a8c4c2 Make my_alloc(NULL) use malloc instead of calloc. 2020-08-03 14:01:18 -07:00
Wayne Davison
7f5c4084c7 Use touch for proto.h-tstamp since one awk wasn't updating mtime. 2020-08-03 13:33:46 -07:00
Wayne Davison
6c89f00d1b Move SUPPORT_ATIMES to rsync.h. 2020-08-03 13:27:00 -07:00
Wayne Davison
dee0993286 Create usage.c for smaller awk-dep rebuilds. 2020-08-03 12:23:18 -07:00
Wayne Davison
47351c2b16 Use RSYNC_GITVER in more output 2020-08-03 10:46:31 -07:00
Wayne Davison
16b7670614 A couple more mkgitver tweaks
- Support git worktree checkouts (has non-dir .git)
- Use --always for someone who may be missing a tag.
2020-08-03 10:23:43 -07:00
Wayne Davison
72b2a81f90 Use --abbrev=8 instead of --tags. 2020-08-01 00:43:37 -07:00
Wayne Davison
d73c26d2b7 Put git version in a file for between-release versioning. 2020-08-01 00:15:06 -07:00
Wayne Davison
e83bbeb673 Don't make .PHONY the first target in a Makefile. 2020-07-30 18:58:34 -07:00
Wayne Davison
b6aa9c5cfe Make configure less annoying
- Improve configure's notifications around the new features.
- Improve the info about man page generation and fetching.
2020-07-30 18:33:58 -07:00
Wayne Davison
dfe3b77cb5 Some Makefile improvements.
- Improve distclean.
- Remove proto.h from GENFILES (we don't need to distribute it).
- Improve finddead target.
2020-07-29 11:51:55 -07:00
Wayne Davison
cbe3b2bfe5 Tweak a comment. 2020-07-29 11:51:52 -07:00
Wayne Davison
b1ae7fc941 INSTALL changes, including some Fedora packages. 2020-07-29 11:22:23 -07:00
Wayne Davison
8695bcc2b1 Preparing for release of 3.2.3pre1 2020-07-27 17:56:25 -07:00
Wayne Davison
4ae6f708b1 Need 3.2.3 line in table & tweak to release script. 2020-07-27 17:54:48 -07:00
Wayne Davison
14c4656fb8 A couple more NEWS updates. 2020-07-27 17:31:51 -07:00
Wayne Davison
13cec31f7f Set LANG to C to help with some remote build hosts. 2020-07-27 16:48:48 -07:00
Wayne Davison
5db7e4b1ee Use linkat() if available
Some OSes have a more capable linkat() function that can hard-link
syslinks, so use linkat() when it is available.
2020-07-27 16:36:55 -07:00
Wayne Davison
54693fa992 Add a few more skip-compress suffixes. 2020-07-27 15:56:48 -07:00
Wayne Davison
3f83bcb4af Make the --append* options have more warnings. 2020-07-27 15:21:50 -07:00
Wayne Davison
e1e546d67e Don't allow a completely empty source arg. 2020-07-27 14:49:51 -07:00
Wayne Davison
3714084f48 Mention an implied option. 2020-07-27 13:49:51 -07:00
Wayne Davison
eb2c3a5e18 Replace a couple calloc() calls with new_array0(). 2020-07-26 23:30:50 -07:00
Wayne Davison
f6967eca58 Complain about a missing/non-dir --temp-dir. 2020-07-26 02:01:30 -07:00
Wayne Davison
8455bf66c2 Don't include config.h in proto.h rule. 2020-07-26 01:40:55 -07:00
Wayne Davison
00e59e01e3 Mention awk/gawk/nawk dependency. 2020-07-26 01:40:43 -07:00
Wayne Davison
91eaffe13f Mention --protect-args in --chown info. 2020-07-26 01:02:07 -07:00
Wayne Davison
2066024981 Fix issue where rdev major could get out of sync
If the receiving side read a hard-linked device, it needs to set the
value of rdev_major to the value it snags from the hard-linked data
because the sender set their rdev_major value for that file entry.
2020-07-26 00:11:28 -07:00
Wayne Davison
d274b2096f Have release script use patch-update --make (not --shell) 2020-07-25 10:52:49 -07:00
Wayne Davison
0327a2526b Fix a grammar error. 2020-07-25 10:40:46 -07:00
Wayne Davison
f43412f1d5 More spelling fixes. 2020-07-25 10:34:26 -07:00
Wayne Davison
b9010ec617 Fix some spelling errors. 2020-07-25 10:21:50 -07:00
Wayne Davison
21ecc833ea Change new stderr options to --stderr=MODE. 2020-07-25 10:03:32 -07:00
Wayne Davison
f9bb8f76ee Change daemon variable & simplify some option code
- Rename daemon_over_rsh -> daemon_connection since it is also used to
  indicate if a non-rsh daemon connection is active.
- Move the daemon-over-rsh exception out of server_options() to the one
  caller that needs that behavior.
- Don't allow noop_io_until_death() to be short-circuited when talking
  to a daemon over a socket, because it can't send errors via stderr.
2020-07-25 09:36:42 -07:00
Wayne Davison
a5a9f268fe Tweak NEWS & src_file(). 2020-07-24 23:30:32 -07:00
Wayne Davison
0a255771f4 Add --errors2stderr & --msgs2protocol options. 2020-07-24 22:48:37 -07:00
Wayne Davison
e07d79ad50 Handle the first run of configure; prefer gmake. 2020-07-24 17:37:01 -07:00
Wayne Davison
2f74eb7584 Change smart-rebuild to smart-make. 2020-07-24 17:25:09 -07:00
Wayne Davison
39741c7d50 Fix the setting of $make. 2020-07-24 16:49:55 -07:00
Wayne Davison
3f016888fd Add helper script for a smart rebuild. 2020-07-24 14:19:19 -07:00
Wayne Davison
e5a012c959 Link to the git blob for source files. 2020-07-24 13:20:11 -07:00
Wayne Davison
c3cf174e5e More changes to NEWS, README, INSTALL, & configure.ac 2020-07-24 12:38:25 -07:00
Wayne Davison
a0a7c9f2e3 Enable xattrs on Cygwin.
- Tweak configure.ac to have Cygwin use linux xattrs.
- Change CI setup to install attr packages on Cygwin.

[buildall]
2020-07-24 11:38:14 -07:00
Wayne Davison
a8f61ba937 Add Cygwin package info into INSTALL.md. 2020-07-24 11:37:50 -07:00
Wayne Davison
842d6edfdc Fix devices-fake test if rsync can't link specials
- Add info about hardlinked specials to --version output.
- Use "no hardlink-special" info to ensure that the devices-fake
  test will not fail.
2020-07-24 11:33:21 -07:00
Wayne Davison
92a8855ff3 Install python3 for cygwin [buildall] 2020-07-24 10:10:26 -07:00
Wayne Davison
def96fd7c4 Install python36 for cygwin [buildall] 2020-07-24 09:57:41 -07:00
Wayne Davison
f624a73bbc Change the --mkpath message. 2020-07-24 09:46:53 -07:00
Wayne Davison
93a373f6ba Some INSTALL improvements. 2020-07-24 09:42:49 -07:00
Wayne Davison
01742c07e6 Add --mkpath option. Fixes bugzilla bug 4621. 2020-07-23 20:54:38 -07:00
Wayne Davison
e00662f263 Add packages to INSTALL.md; put INSTALL.md on ftp site 2020-07-23 17:29:13 -07:00
Wayne Davison
491ddb08a4 Simplify md_parser assignment. 2020-07-23 17:28:34 -07:00
Wayne Davison
918cb39fed Fix multi-line code blocks. 2020-07-23 16:22:12 -07:00
Wayne Davison
1369fe43e1 Tweak ubuntu configure args. 2020-07-23 12:32:41 -07:00
Wayne Davison
150f3416ac Setup commonmark on Cygwin. 2020-07-23 12:20:40 -07:00
Wayne Davison
d8941be8cb Simplify the msgs2stderr default logic. 2020-07-23 12:15:50 -07:00
Wayne Davison
592059c8fd Improve error output for local & remote-shell xfers 2020-07-23 11:23:47 -07:00
Wayne Davison
37f4a23f60 Drop a superfluous "+". 2020-07-22 21:42:24 -07:00
Wayne Davison
27be94c889 A few more build improvements
Includes Ben's RSYNC_MAX_SKIPPED=3 suggestion for FreeBSD and a fix for
the artifact file list for Cygwin.
2020-07-22 21:01:01 -07:00
Wayne Davison
974f49e22a Add --crtimes option. 2020-07-22 12:12:18 -07:00
Wayne Davison
9f7506ac1b Improve --itemize-changes doc. 2020-07-22 11:30:00 -07:00
Wayne Davison
8779d6c8bb Switch to RSYNC_MAX_SKIPPED test setting. 2020-07-22 11:00:26 -07:00
Wayne Davison
96be713fd2 Update NEWS. 2020-07-21 12:37:56 -07:00
Wayne Davison
13d8fc9542 Avoid some extraneous parent-dir warnings
Don't complain about an absent parent dir if the current file is marked
as missing and there is a marked-as-missing entry for the parent dir.
2020-07-21 11:54:54 -07:00
Wayne Davison
f74473b151 Don't create a path for a file marked as missing. 2020-07-21 11:54:48 -07:00
Wayne Davison
5eda68f11b Tweak include syntax. 2020-07-20 18:45:36 -07:00
Wayne Davison
f635207347 Save the build into an artifact. 2020-07-20 14:44:35 -07:00
Wayne Davison
64f7e893f3 Ignore *.exe files (for Cygwin builds). 2020-07-20 14:43:06 -07:00
Wayne Davison
31556ec7a8 Use just $(...) instead of a mix of that and ${...}. 2020-07-20 14:42:13 -07:00
Wayne Davison
9ad3f4385f Make the daily build happen a few hours later. 2020-07-18 23:17:25 -07:00
Wayne Davison
e9899dbdb4 Add strict (no-skipping) checks and use them. 2020-07-17 11:20:04 -07:00
Wayne Davison
18cffa8aa9 A couple minor changes. 2020-07-17 10:56:22 -07:00
Wayne Davison
7e07a32504 Add the name converter daemon parameter.
This is based on the long-standing patch but with the protocol changed
to just use newlines as delimiters instead of null chars (since names
should not contain a newline AND it makes it easier to write a helper
script).  Lots of other small improvements and a better default value
for "numeric ids" when using "use chroot" with "name converter".
2020-07-17 10:30:59 -07:00
Wayne Davison
be11a496bb Run a daily build. 2020-07-16 22:04:40 -07:00
Wayne Davison
c6f5f0b505 Let's try cygwin again. (#69)
Setup an optional cygwin build that is currently triggered when a [buildall] is in the commit message (the build is currently quite slow).
2020-07-15 14:30:22 -07:00
Wayne Davison
f553da1730 GitHub artifact test didn't work. 2020-07-15 13:53:40 -07:00
Wayne Davison
40753bcbf7 Tweak the save path. 2020-07-15 13:42:36 -07:00
Wayne Davison
33df361d52 Avoid normal build on cygwin-save change. 2020-07-15 13:20:40 -07:00
Wayne Davison
f4db970718 Try to get cygwin-save to run. 2020-07-15 13:16:36 -07:00
Wayne Davison
ab3928898f Try to save cygwin install in an artifact. 2020-07-15 12:31:38 -07:00
Ben RUBSON
13f274fd02 Force git line endings (#68) 2020-07-15 10:20:52 -07:00
Wayne Davison
b51fe50e7f Tweak the workflows filename. 2020-07-14 21:47:50 -07:00
Wayne Davison
1829a2ee0d Disable cygwin for now. 2020-07-14 21:47:11 -07:00
Wayne Davison
65370a0f56 Try a couple different way to fix the build. 2020-07-14 21:32:41 -07:00
Wayne Davison
23213099e9 Try Cygwin build in actions. 2020-07-14 21:18:52 -07:00
Wayne Davison
25e08110d5 Let's try a Cygwin build on Cirrus. 2020-07-14 20:41:44 -07:00
Wayne Davison
95f683039d Mention the auto-build-save setup. 2020-07-14 20:25:02 -07:00
Ben RUBSON
129d7195ff Enable FreeBSD CI ssl (#66) 2020-07-14 13:22:55 -07:00
Wayne Davison
044339d6b4 Reduce the installed pkg items since they are so slow. 2020-07-13 16:26:58 -07:00
Wayne Davison
4c4fc7462a A few more NEWS & man tweaks. 2020-07-13 16:14:27 -07:00
Wayne Davison
22cb57ee20 Try using cmarkgfm. 2020-07-13 15:44:43 -07:00
Wayne Davison
4c0be4da13 Avoid a failed test on Cygwin. 2020-07-13 15:33:07 -07:00
Wayne Davison
4549855126 Search for cmark. 2020-07-13 14:09:24 -07:00
Wayne Davison
284c28c773 Add new code to recv_group_name() too. 2020-07-13 13:43:17 -07:00
Wayne Davison
d2406ae372 Give up on commonmark. 2020-07-13 13:42:28 -07:00
Wayne Davison
1e9c34972a Avoid a crash if id-0 doesn't exist. 2020-07-13 13:18:38 -07:00
Wayne Davison
116bd19324 One more commonmark try. 2020-07-13 13:12:39 -07:00
Wayne Davison
883de22c29 Avoid a test failure if id didn't work. 2020-07-13 12:59:22 -07:00
Wayne Davison
18f500a7a4 Try another way to get commonmark working. 2020-07-13 12:59:07 -07:00
Wayne Davison
d14b0ca4db Install commonmark on FreeBSD. 2020-07-13 12:18:13 -07:00
Wayne Davison
4156e7d464 Tweak lsh's Usage message & opening comment. 2020-07-13 12:01:00 -07:00
Wayne Davison
9e48da65c1 Search for commonmark pkg. 2020-07-13 12:00:56 -07:00
Wayne Davison
2cdf9416ee Tweak brew run. 2020-07-13 10:41:26 -07:00
Wayne Davison
cd0c83e485 Setup a macOS CI. 2020-07-13 10:38:17 -07:00
Wayne Davison
0e814e956c A couple more NEWS items. 2020-07-12 23:45:55 -07:00
Wayne Davison
f47e5a7732 Mention file & line on OOM and overflow errors.
Also simplify output of src file paths in errors & warnings when
built in a alternate build dir.
2020-07-12 23:25:21 -07:00
Wayne Davison
91fff802b9 Check for overflow the right way. 2020-07-12 22:45:01 -07:00
Wayne Davison
3c8ac20d63 Fix a typo. 2020-07-12 20:51:21 -07:00
Wayne Davison
38a521defd More NEWS tweaks. 2020-07-12 20:49:01 -07:00
Wayne Davison
2f13049600 Add "@netgroup" names to host matching. 2020-07-12 19:16:57 -07:00
Wayne Davison
af531cf787 Add the --stop-after & --stop-at options. 2020-07-12 18:32:41 -07:00
Wayne Davison
d495e343c0 A few word tweaks. 2020-07-12 12:38:12 -07:00
Ben RUBSON
de7e4d00ab Improve FreeBSD tests (#61)
Improve FreeBSD tests & use a ZFS mount for the CI's testtmp.
2020-07-12 12:36:02 -07:00
Wayne Davison
374cc1be74 Get my yaml continuation line right. 2020-07-11 16:22:48 -07:00
Wayne Davison
8b25488fe9 More CI tweaks
- Add to ubuntu build: make install & rsync-ssl test run
- Don't fail a build if samba.org daemon list has an issue.
2020-07-11 16:08:22 -07:00
Wayne Davison
4f5742baa0 Make sure FreeBSD has bash installed. 2020-07-11 15:51:05 -07:00
Wayne Davison
2b416de4ca More FreeBSD script separation. 2020-07-11 15:37:51 -07:00
Wayne Davison
1f41b7dca1 Add a little more FreeBSD testing. 2020-07-11 15:32:51 -07:00
Wayne Davison
486e7852db Add FreeBSD test & re-enable linux build. 2020-07-11 15:03:31 -07:00
Wayne Davison
a68a92793c Just disable md2man on FreeBSD for now. 2020-07-11 12:28:05 -07:00
Wayne Davison
a84e8aced7 Add 2 more FreeBSD pkg installs. 2020-07-11 12:22:05 -07:00
Wayne Davison
3bc2d9aeaa Add some FreeBSD pkg installs and pause on linux. 2020-07-11 12:11:13 -07:00
benrubson
6214c26bd3 Add FreeBSD CI 2020-07-11 11:54:33 -07:00
Wayne Davison
da7a350667 Some number & string improvements
- Use strdup(do_big_num(...)) to replace num_to_byte_string(...).
- Allow a ',' for a decimal point in a SIZE option in some locales.
- Get rid of old (now unused) strdup() compatibility function.
- Try harder to include the newline in a single error message write.
2020-07-11 11:39:36 -07:00
Wayne Davison
66ca4fc97b Allow --block-size's size to have a suffix.
Change the block_size global to be an int32.
2020-07-10 13:00:42 -07:00
Wayne Davison
7d63f8b249 Add missing "M" in SIZE suffixes; mention bytes are the default. 2020-07-10 09:59:17 -07:00
Wayne Davison
bb1365dd77 Fix see_token zstd case. 2020-07-10 09:47:16 -07:00
Wayne Davison
bcc273d460 Clean more built .h files. 2020-07-09 15:18:11 -07:00
Wayne Davison
a6da3c67f8 Must read the nsec val even w/o CAN_SET_NSEC. 2020-07-08 14:17:01 -07:00
Wayne Davison
ab110fc8fb Warning fixes & impossible-failure improvements
- Silence a couple warnings for less-common builds.
- Use a better impossible-failure idiom than assert(0).
2020-07-08 12:26:19 -07:00
Wayne Davison
7265d96116 Avoid non-updating proto.h on Alpine. 2020-07-07 23:50:55 -07:00
Wayne Davison
560b63b051 Avoid a test failure on Alpine. 2020-07-07 23:05:41 -07:00
Wayne Davison
0eb82a7c90 Fix xattr issue with MIGHT_NEED_PRE.
Fixes bugzilla 13113.
2020-07-07 20:07:31 -07:00
Wayne Davison
f92a5182fc Tweak the NEWS. 2020-07-07 19:50:13 -07:00
Wayne Davison
fb6fabc116 Fix an xattr free of the wrong object.
In uncache_tmp_xattrs() the code used to find the value to unlink,
update the single-linked list, and then free the wrong pointer.
This fixes bug #50.
2020-07-07 14:25:58 -07:00
Wayne Davison
c3269275a8 Don't use UNUSED() when an arg is used sometimes. 2020-07-07 13:12:51 -07:00
Wayne Davison
7e47855d47 Update the NEWS. 2020-07-07 12:38:20 -07:00
Wayne Davison
d2d6ad481a Allow --max-alloc=0 for unlimited. 2020-07-07 11:56:23 -07:00
Wayne Davison
5dcb49c7dd Allow --bwlimit=0 again. 2020-07-07 11:43:33 -07:00
Wayne Davison
19d8550cf4 One more TANDEM include. 2020-07-06 09:41:31 -07:00
Wayne Davison
7610f76aea Remove another file_struct kluge. 2020-07-06 09:31:22 -07:00
Wayne Davison
59cb358fda More TANDEM changes
- Handle a non-0 root uid.
- Handle alternate major/minor/MAKEDEV funcs.
- Other misc compatibility tweaks.
2020-07-06 00:05:46 -07:00
Wayne Davison
bb16db1747 Send the uid/gid 0 name since not all systems use 0 for root. 2020-07-05 22:51:12 -07:00
Wayne Davison
d6f0342a34 Change name map funcs to return a const char*. 2020-07-05 22:17:09 -07:00
Wayne Davison
6f6e5b51cc Some TANDEM ACL support. 2020-07-05 20:09:16 -07:00
Wayne Davison
28de25a664 Some whitespace & paren cleanup. 2020-07-05 20:09:13 -07:00
Wayne Davison
052b34dceb A bit more configure tweaking. 2020-07-05 19:16:32 -07:00
Wayne Davison
748b5c5d53 Some configure tweaks for TANDEM. 2020-07-05 19:08:44 -07:00
Wayne Davison
e1e4ffe057 Some C99 flexible array changes
- Use C99 flexible arrays when possible, and fall back on the existing
  fname[1] kluges on older compilers.
- Avoid static initialization of a flexible array, which is not really
  in the C standard.
2020-07-05 17:25:53 -07:00
Wayne Davison
1b53b2ff4b Tweak a comment. 2020-07-05 14:42:36 -07:00
Wayne Davison
da45cecfc8 Tweak a couple var names. 2020-07-05 14:22:09 -07:00
Wayne Davison
87b5d233e9 Setup for 3.2.3dev. 2020-07-05 09:26:40 -07:00
Wayne Davison
194cee671d Preparing for release of 3.2.2 2020-07-04 23:12:59 -07:00
Wayne Davison
b7c5520add Handle tweaked NEWS headings & protocol change. 2020-07-04 23:11:46 -07:00
Wayne Davison
2bee307592 Get rid of some superfluous lz4 code. 2020-07-04 16:13:00 -07:00
Wayne Davison
85e62c330d Tweak indentation. 2020-07-04 16:10:37 -07:00
Wayne Davison
0add026a5d Initialize values string in a more consistent spot. 2020-07-04 14:21:15 -07:00
Wayne Davison
f4184849c4 Use module_id more consistently after it is set. 2020-07-04 10:28:39 -07:00
Wayne Davison
565cde84a7 Don't turn off the user's open-noatime unless the module is forcing the value. 2020-07-04 10:28:38 -07:00
Paul Slootman
f0e670b4c6 Add "open noatime" module option to rsyncd.conf 2020-07-04 09:30:35 -07:00
Wayne Davison
ef8951779d Fix issue in --compress-level doc. 2020-07-03 11:58:36 -07:00
Wayne Davison
e285f8f9d2 Some NEWS and man page tweaks. 2020-07-02 22:33:40 -07:00
Wayne Davison
cb383673f6 Tweak a var name. 2020-07-02 09:34:08 -07:00
Wayne Davison
0768d620a5 Another table tweak. 2020-07-01 14:20:14 -07:00
Wayne Davison
d640d78f91 Change how protocol changes are mentioned; fix table in html. 2020-07-01 14:14:24 -07:00
Wayne Davison
544b3d8b3b A few more systemd tweaks. 2020-07-01 12:10:14 -07:00
Wayne Davison
ce12142c45 Don't set systemd ProtectHome=on by default. 2020-07-01 10:41:13 -07:00
Wayne Davison
c83a81ca38 Move name exceptions into the txt file. 2020-07-01 09:05:21 -07:00
Wayne Davison
d88db22ae8 Add support for the remaining parser types. 2020-07-01 08:15:12 -07:00
Wayne Davison
a1cc50ba96 Preparing for release of 3.2.2pre3 2020-06-30 23:17:50 -07:00
Wayne Davison
feb2fff894 Put the optimizations into their own list. 2020-06-30 19:31:59 -07:00
Wayne Davison
7d30490ef4 Simplify the daemon parameter definitions
The code now derives all the struct defines, default value assignments,
parser-param defines, and lp_foo() accessor functions from a single list
of daemon parameters.
2020-06-30 19:30:28 -07:00
Wayne Davison
317beebef8 Avoid crash of transfer logging w/default log format. 2020-06-30 12:16:52 -07:00
Wayne Davison
7a413c9722 Avoid strdup redefinition warning. 2020-06-30 08:27:20 -07:00
Wayne Davison
5be7363297 Avoid bloating the src-dir scan. 2020-06-29 21:45:56 -07:00
Wayne Davison
646784f0e5 Move the new target after "all". 2020-06-29 20:04:54 -07:00
Wayne Davison
18ed3f0279 More patch-update improvements; configure.ac tweak; Makefile tweaks. 2020-06-29 19:53:05 -07:00
Wayne Davison
00dd50a00c Preparing for release of 3.2.2pre2 2020-06-28 19:54:38 -07:00
Wayne Davison
7039d14616 Improve the per-branch build dir support
The release script & the patch management script now require the use of
an auto-build-save dir that makes it much easier to keep the generated
files from melding together, and remembers the configure setup for each
patch branch.
2020-06-28 19:42:25 -07:00
Wayne Davison
ec3c9f2f5a Improve alternate build-dir support
We now put the configure.sh, config.h.in, and aclocal.m4 files in the
alternate build dir along with the other generated files.  This requires
that we create symlinks for configure.ac & m4 in the build dir, which is
handled on the first run of configure or prepare-source.  I also changed
the patch-branch handling away from the .gen-stash dir to an automatic
build/$PATCH subdir idiom that will keep each branch's configuration
separated.  These automatic build dirs are only used when there is a
.git dir, a build/master dir, and no top-dir Makefile.  You'll also
want to have package/make early on your path for optimal ease of use.
2020-06-28 15:12:10 -07:00
Wayne Davison
3b4f5fb891 Move the version string out of configure.ac. 2020-06-28 15:02:19 -07:00
Wayne Davison
76064b1bf2 Fix rebuilding configure.sh in an alternate build dir 2020-06-28 12:55:43 -07:00
Wayne Davison
8df766917e A bit more man page & NEWS tweaking. 2020-06-28 09:21:29 -07:00
Wayne Davison
299430a6c1 Lack of "saw" values now reported as "INVALID"; tweak a comment. 2020-06-27 23:14:35 -07:00
Wayne Davison
dcbe005a6a Preparing for release of 3.2.2pre1 2020-06-27 21:22:49 -07:00
Wayne Davison
af57b55bdb Some misc cleanup
Remove some extraneous vars, update some years, add an  rrsync opt, &
ensure some less options are set right when running release-rsync.
2020-06-27 21:19:52 -07:00
Wayne Davison
967e6426b9 Improve the NSTR differentiation idiom. 2020-06-27 20:43:38 -07:00
Wayne Davison
61971acbe1 Some more doc & NEWS improvements. 2020-06-27 20:43:34 -07:00
Wayne Davison
5bd0b6cf71 Change the CI name 2020-06-27 18:40:21 -07:00
Wayne Davison
0eec25f75b Some patch-update & vim ft improvements
- Stash off some gen files when switching patch branches.
- Set the filetype in "env -S" files that vim can't handle.
2020-06-27 17:59:04 -07:00
Wayne Davison
3a6f06003c Improve the output when a negotiation fails. 2020-06-27 10:51:29 -07:00
Wayne Davison
f805d1a7f7 More NEWS and man page changes. 2020-06-27 10:39:12 -07:00
Wayne Davison
ab29ee9c44 Negotation env lists can specify "client & server" 2020-06-26 17:56:57 -07:00
Wayne Davison
d07c2992d1 A few more simple changes & fixes. 2020-06-26 13:19:07 -07:00
Wayne Davison
b1a8b09c21 Some man page changes. 2020-06-26 11:27:27 -07:00
Wayne Davison
fe2ef556d9 A few more tweaks. 2020-06-25 22:30:02 -07:00
Wayne Davison
11eb67eec9 Some memory allocation improvements
- All the memory-allocation macros now auto-check for failure and exit
   with a failure message that incudes the caller's file and lineno
   info.  This includes strdup().

 - Added the `--max-alloc=SIZE` option to be able to override the memory
   allocator's sanity-check limit.  It defaults to 1G (as before).
   Fixes bugzilla bug 12769.
2020-06-25 20:54:21 -07:00
Christian Hesse
39a083b16b Add missing semicolon in man page
All nginx configuration directives end in semicolon.
2020-06-24 17:54:47 -07:00
Wayne Davison
202b7b18af Tweak alloc args to size_t w/proper realloc order. 2020-06-24 17:52:36 -07:00
Wayne Davison
20934382e3 Use normal C comment style. 2020-06-23 21:45:32 -07:00
Wayne Davison
1bdf68b905 Prepare for future release of XXH3 & XXH128. 2020-06-23 21:01:25 -07:00
Wayne Davison
89827e49bc Another NEWS update. 2020-06-23 19:32:44 -07:00
Wayne Davison
f157ff3b3a Avoid negotiating a "none" choice by default
The client does not pass "none" as a negotiation choice unless it's from
the user's environment list.  The server still passes the "none" value
to the client unless its environment var excludes it.
2020-06-23 19:20:01 -07:00
Wayne Davison
d15cfef935 Setup for 3.2.2dev. 2020-06-23 19:02:59 -07:00
Wayne Davison
28f9c960d5 The server side can enforce its negotiation limits 2020-06-23 18:53:23 -07:00
Wayne Davison
323c42d51e Improve how the env restricts negotiated strings
- The env on the server side now affects the negotiated strings
  that are sent to the client.
- A too-old remote rsync gets a default negotiated string value
  so that an env restriction now handles old clients the same way
  as new ones.
2020-06-23 17:33:16 -07:00
Wayne Davison
d1fdf9ff8d Avoid -U if --atimes is disabled. 2020-06-23 15:53:47 -07:00
Wayne Davison
e93f40d8b4 Apple needs a leading underscore. 2020-06-23 15:47:27 -07:00
Hiroshi Takekawa
4df1b1d4fe Makefile.in: Use srcdir for installing rsync-ssl
When building out of source tree, we can't find rsync-ssl in the current
directory and installation fails.  Fix it by using the srcdir variable for the
path to rsync-ssl.

Signed-off-by: Hiroshi Takekawa <sian.ht@gmail.com>
2020-06-23 09:02:33 -07:00
Wayne Davison
1af58f6b77 Improve the info about compression. 2020-06-22 20:37:52 -07:00
Wayne Davison
a8fc8fc2d2 Preparing for release of 3.2.1 2020-06-22 19:31:16 -07:00
Wayne Davison
b8b7f1f3d0 Fix a typo. 2020-06-22 19:30:07 -07:00
Wayne Davison
622a116917 A few more man page tweaks. 2020-06-22 19:21:32 -07:00
Wayne Davison
b51b0b3236 Get the NEWS heading idiom right. 2020-06-22 14:46:14 -07:00
Wayne Davison
8cb1c99563 A few more https changes. 2020-06-22 14:21:15 -07:00
Wayne Davison
597a751466 Update links to https. 2020-06-22 14:16:21 -07:00
Wayne Davison
5a9e4ae5e7 Improve the options info a bit more. 2020-06-22 14:12:27 -07:00
Wayne Davison
3094552311 Add --zl=N opt & improve its docs. 2020-06-22 13:41:42 -07:00
Samuel Henrique
e4c9ff5873 Make --backup be set when --backup-dir is used 2020-06-22 13:05:17 -07:00
Samuel Henrique
9b13bcf185 Add Documentation field to systemd unit 2020-06-22 13:01:02 -07:00
Wayne Davison
8f6d6bcb08 Tweak valid_ipaddr() check. 2020-06-22 11:17:56 -07:00
Wayne Davison
300fd3055a Even more NEWS changes. 2020-06-22 09:57:29 -07:00
Wayne Davison
f6df3708c2 A few more NEWS changes; change release script. 2020-06-22 09:09:51 -07:00
Wayne Davison
785cb938ec Even more NEWS improvements. 2020-06-21 23:30:00 -07:00
Wayne Davison
246d117df0 A bit more NEWS tweaking. 2020-06-21 23:07:16 -07:00
Wayne Davison
3f776f582b More talk of buggy clang++. 2020-06-21 22:53:33 -07:00
Wayne Davison
d8d2d71663 Get the g++ version to see if it is really clang. 2020-06-21 22:34:32 -07:00
Wayne Davison
6a9adabfbb Mention the early-input on stdin. 2020-06-21 20:25:51 -07:00
Wayne Davison
2564f25114 Put the date in the heading of a pre release too. 2020-06-21 19:46:28 -07:00
Wayne Davison
7fb08531e0 Preparing for release of 3.2.1pre1 2020-06-21 19:24:26 -07:00
Wayne Davison
9dba0bb7fb Improve the simd note. 2020-06-21 18:52:28 -07:00
Wayne Davison
87bca719c3 Merge OLDNEWS.md into NEWS.md 2020-06-21 18:42:53 -07:00
Wayne Davison
f3439944ea The proto files don't need perl, so change fetch rule. 2020-06-21 16:46:50 -07:00
Wayne Davison
a7c1690d62 One more >= tweak. 2020-06-21 15:30:34 -07:00
Wayne Davison
662fedd74b Get the early-input reading code right. 2020-06-21 15:23:13 -07:00
Wayne Davison
128139c66a Leave 3.2.0 news in the NEWS file for 3.2.1. 2020-06-21 15:20:43 -07:00
Wayne Davison
2b439c1fc8 Disable atimes on macOS. 2020-06-21 15:16:56 -07:00
Wayne Davison
e16b22751a Add --early-input=FILE option. 2020-06-21 14:32:00 -07:00
Wayne Davison
7587e20cf4 Output a helpful msg about configure only if the command fails. 2020-06-21 12:55:24 -07:00
Wayne Davison
2e1b46db39 Close STDIN for early exec script. 2020-06-21 11:17:09 -07:00
Wayne Davison
f4e6fe54c9 More NEWS changes. 2020-06-21 09:18:52 -07:00
Wayne Davison
f86ceb5539 Give more_testing() a default target. 2020-06-21 09:06:59 -07:00
Wayne Davison
dfa34b4792 Some more docs/news changes.
- Mention the -VV behavior.
- Mention how the protect-args default is presented in -V list.
2020-06-21 08:58:45 -07:00
Wayne Davison
e9e9fd0cca Use an ssse3 target instead of an inline declaration. 2020-06-21 08:28:49 -07:00
Wayne Davison
7e95ba8787 Add -fno-slp-vectorize to clang++. 2020-06-21 08:05:19 -07:00
Wayne Davison
66fd34ed84 Mention atimes & protected-args in capabilities. 2020-06-20 23:28:19 -07:00
Wayne Davison
f8c6f9f4f3 Tweak the NEWS. 2020-06-20 23:15:22 -07:00
Wayne Davison
e6cfebb578 We only need one capability marked with a "*". 2020-06-20 22:09:08 -07:00
Wayne Davison
5d2379d93f Mention "asm" instead of "ASM". 2020-06-20 21:59:51 -07:00
Wayne Davison
6884ccbd2f Mention openssl-crypto in -VV list. 2020-06-20 21:44:46 -07:00
Wayne Davison
bad97961dc Elide -g from CXXFLAGS before the c++ test. 2020-06-20 21:26:21 -07:00
Wayne Davison
b0ab07cdac Some README and man page tweaks. 2020-06-20 20:31:52 -07:00
Wayne Davison
68c4583693 Change repo to be 3.2.1dev. 2020-06-20 20:17:13 -07:00
Wayne Davison
6b237b0fe9 Require -VV to see SIMD & ASM in version output 2020-06-20 19:57:11 -07:00
Wayne Davison
b37a136314 Get rid of -g option in CXXFLAGS (at least for now). 2020-06-20 19:23:54 -07:00
Wayne Davison
c9c8c64506 Remove leftover case match. 2020-06-20 19:00:57 -07:00
Wayne Davison
c5d502dc5f When fetching gen files, make sure aclocal.m4 is older than configure files. 2020-06-20 18:46:16 -07:00
Wayne Davison
1629b803cb More asm improvements
- Only use the asm code if we're on x86_64.
- More changes to decouple asm from simd.
- Check if the -Wa,--noexecstack option works.
- Support --disable-asm configure option.
2020-06-20 18:40:47 -07:00
Wayne Davison
29c7a4558a Include more SIMD test code to weed out older compilers. 2020-06-20 17:48:56 -07:00
Wayne Davison
b7dc2ca25c Decouple the MD5 asm code from the simd enabling. 2020-06-20 17:01:25 -07:00
Wayne Davison
f525f2c818 Remove asm type & size. 2020-06-20 16:54:24 -07:00
Wayne Davison
1b5819efbd Use AC_RUN_IFELSE() to make sure we can run the cpp test program. 2020-06-20 14:47:55 -07:00
Wayne Davison
a56a0bc7d6 Mention how to turn off simd near the cpp compile. 2020-06-20 11:53:22 -07:00
Wayne Davison
bd7bd5ff0c Simplify some escaping. 2020-06-20 11:35:56 -07:00
Wayne Davison
f9aece899f Change SIMD test to use a compile check. 2020-06-20 11:13:06 -07:00
Wayne Davison
63508f1518 Handle hard-linking the top-level $VER-NEWS.html file on a final release. 2020-06-20 09:57:35 -07:00
Wayne Davison
9ac22062af The nightly dir is gone now. 2020-06-20 09:43:25 -07:00
Wayne Davison
73faaab26d Pass --noexecstack to assembler. 2020-06-20 09:23:56 -07:00
Wayne Davison
9467c1f9b9 Fix conditional directives in the asm file
- Switch .s -> .S to enable the preprocessor.
- Move some defines from mdigest.h to md-defines.h.
- Tweak the asm file to use md-defines.h.
- Add a couple missing .h dependencies in the Makefile.
2020-06-20 09:06:18 -07:00
Wayne Davison
04653dabc8 Exclude the asm code when it's not being used. 2020-06-20 08:05:53 -07:00
Wayne Davison
19617f7b4a Fix compiling in a separate dir. 2020-06-20 08:05:53 -07:00
Caleb Xu
b218de2702 lib/md5-asm-x86_64.s: fix build with Apple Clang
The Mach-O x86-64 model doesn't seem to support ".type" and
".size" directives in assembly. Add ifdefs that should allow for
the file to build without issues in Apple Clang.
2020-06-19 23:38:15 -07:00
Wayne Davison
d4764934c3 A slightly modified g++/clang++ check. 2020-06-19 23:29:31 -07:00
Wayne Davison
c225330aaf Preparing for release of 3.2.0 2020-06-19 14:11:01 -07:00
Wayne Davison
3c56896d21 Simplify a variable. 2020-06-19 11:07:02 -07:00
Wayne Davison
deb8353d2c Yes, we know we're discarding a return value. 2020-06-19 10:56:32 -07:00
Wayne Davison
73053f26bc Simple change to recv_token(). 2020-06-19 09:55:48 -07:00
Holger Hoffstätte
0c13e1b3f8 Prevent unnecessary xattr warning by reordering header inclusion. (#22)
xattr headers have been provided by glibc (at least on Linux/glibc)
for many years now. Reorder the inclusion of xattr headers to
attempt compatibility/legacy after the common case.
This prevents the warning without changing compatibility to
non-glibc systems.

* Add dependency on lib/sysxattrs.h header in Makefile

Co-authored-by: Wayne Davison <wayne@opencoder.net>
2020-06-19 08:22:54 -07:00
Wayne Davison
9da38f2f99 A few minor man page tweaks. 2020-06-19 00:26:43 -07:00
Wayne Davison
a93ffb1ae9 More non-breaking space/dash improvements
- In html, use css more for non-breakability.
- In nroff, mark more dashes as non-breaking in code->bold sections,
  and get rid of backslashed dashes in preformatted blocks.
2020-06-18 23:55:51 -07:00
Wayne Davison
e08f600378 Use -&#8288; instead of &#8209;
Using a non-breaking zero-width char after a dash makes the browser
avoiding breaking on that dash and also makes it match a dash in a
search.  This is better than a non-breaking dash char, which does not
match a dash in a search.
2020-06-18 22:58:11 -07:00
Wayne Davison
e406845542 Comment must be indented to avoid ending the list item. 2020-06-18 21:57:34 -07:00
Wayne Davison
a93eb4cf38 Handle a missing c++ too. 2020-06-18 17:02:46 -07:00
Wayne Davison
7fd24bef0f Make SIMD enabled by default again (for x86_64) 2020-06-18 16:28:28 -07:00
Wayne Davison
1a9a184145 Check extra rounding using an int64. 2020-06-18 15:45:39 -07:00
Wayne Davison
4965ccf283 We need to use nawk or gawk on Solaris, not their weird awk. 2020-06-18 14:53:55 -07:00
Wayne Davison
c6f89cbf9c Complain if we can't enable simd on non-x86_64. 2020-06-18 14:27:00 -07:00
Wayne Davison
2921779c1f Fix clang check. 2020-06-18 13:46:01 -07:00
Wayne Davison
cbed522ef4 Get rid of useless -e with sed. 2020-06-18 13:31:50 -07:00
Chainfire
4f539ccf21 x86-64 SIMD build fixes (#20)
* x86-64 SIMD build fixes

configure.ac was modified to detect g++ >=5 and clang++ >=7. Additionally
some script malfunctions on FreeBSD were corrected.

The get_checksum1() code has been modified to fix clang and g++ 10
compilation.

This version of the code and configure.ac has been tested on:

Ubuntu 16 - gcc 7.3.0, clang 6.0.0
Debian 10 - gcc 5.4.0, 6.4.0, 7.2.0, 8.4.0, 9.2.1, 10.0.1, clang 5.0.2,
6.0.1, 7.0.1, 8.0.0, 9.0.0, 10.0.0
ArchLinux 20200605 - gcc 10.1.0, clang 10.0.0
FreeBSD 12.1 - gcc 9.3.0, clang 8.0.1

It is unknown if it will work on gcc 5.0-5.3, but the script currently
allows it.
2020-06-18 13:20:44 -07:00
Wayne Davison
b5e539fc5a Use documentation to extract 2 more .h lists
- Change default_cvsignore char[] into a define.
- Make the DEFAULT_DONT_COMPRESS and DEFAULT_CVSIGNORE defines get set
  based on their info in rsync.1.md.
- Add a few more don't-compress suffixes from Simon Matter.
2020-06-18 11:20:57 -07:00
Wayne Davison
88c18ef648 Make the g++ check more lenient. 2020-06-18 09:31:47 -07:00
Wayne Davison
7dc9431f60 A few minor man page improvements. 2020-06-17 11:25:38 -07:00
Wayne Davison
07a3e1f939 Enhance compatibility with older python3 versions. 2020-06-17 10:52:02 -07:00
Wayne Davison
93223719c9 A couple more NEWS tweaks. 2020-06-17 10:30:32 -07:00
Wayne Davison
0b2d5fe494 Preparing for release of 3.2.0pre3 2020-06-17 10:12:09 -07:00
Wayne Davison
d3c7cfad22 Be a little more explicit with override info. 2020-06-17 09:31:48 -07:00
Christian Hesse
9ec777faf8 add a systemd socket unit for rsync 2020-06-17 09:19:12 -07:00
Christian Hesse
69f445fd09 update rsync systemd unit, add more security features 2020-06-17 09:19:12 -07:00
Wayne Davison
643b9d0183 Change SIMD back to disabled unless requested. 2020-06-16 23:00:01 -07:00
Wayne Davison
2c681b874e Some fixes after compiling on cygwin. 2020-06-16 22:58:24 -07:00
Wayne Davison
e44e79cedb Update config.guess & config.sub. 2020-06-16 21:24:23 -07:00
Wayne Davison
beaf19c3e7 Have --disable-md2man affect the Makefile. 2020-06-16 19:05:05 -07:00
Wayne Davison
0b2a394cbc Fix /usr/bin/env with script args. 2020-06-16 18:32:16 -07:00
Wayne Davison
27e88dec04 Use /usr/bin/env for increased portability. 2020-06-16 18:27:48 -07:00
Wayne Davison
929f136b3b A few more NEWS tweaks. 2020-06-16 15:48:23 -07:00
benrubson
6a22f4fee1 enh(configure) Promote OpenSSL crypto lib support 2020-06-16 15:05:36 -07:00
Wayne Davison
d90990d6ac A few more trivial tweaks. 2020-06-16 14:42:41 -07:00
Wayne Davison
111225a996 Fix md2man --test on a fresh checkout. 2020-06-16 14:03:16 -07:00
Wayne Davison
7dfcbf7df6 Add g++ failure info; add mention of SSL rsyncd examples. 2020-06-16 12:10:56 -07:00
Wayne Davison
38ecf188d9 Only complain about lack of g++ on linux for now. 2020-06-16 11:35:54 -07:00
Wayne Davison
29be5eddde Add configure check for md2man functioning; split long error lines. 2020-06-16 11:13:45 -07:00
Wayne Davison
54b1ddc45d Change configure to make new features more likely to get included in a build. 2020-06-16 09:59:00 -07:00
Wayne Davison
8cd9aa326c Fix bug in CXXFLAGS tweak. 2020-06-16 09:14:28 -07:00
Wayne Davison
cd50745e1c Remove the new $< use from the Makefile. 2020-06-16 08:46:44 -07:00
Wayne Davison
ae94e3db4b Tweak my email. 2020-06-16 07:55:42 -07:00
Wayne Davison
6efaa74dd3 More spelling fixes from Fossies
https://fossies.org/linux/test/rsync-master.tar.gz/codespell.html
2020-06-16 07:46:28 -07:00
Wayne Davison
5496eda5d1 Turn help-from-md into an awk script. 2020-06-15 18:32:00 -07:00
Wayne Davison
353dec1102 Avoid -e option to sed for BSD. 2020-06-15 15:08:42 -07:00
Wayne Davison
d80da9e674 A few small tweaks. 2020-06-15 15:04:08 -07:00
Wayne Davison
6f0c56304f Preparing for release of 3.2.0pre2 2020-06-15 11:53:19 -07:00
Wayne Davison
2452ad3663 Fixed setting of rsync_lastver var. 2020-06-15 11:52:54 -07:00
Wayne Davison
1fa38546a0 Document how to setup rsyncd behind a TLS proxy. 2020-06-15 11:36:24 -07:00
Wayne Davison
249e28c75a Rename "haproxy header" to "proxy protocol". 2020-06-15 11:33:23 -07:00
Wayne Davison
6273153c5f Add preliminary gnutls support. 2020-06-15 11:19:36 -07:00
Wayne Davison
628dcceb8d Choose openssl before stunnel. 2020-06-15 10:41:08 -07:00
Wayne Davison
00ec415a69 Tweak the stunnel4 Verify config; tweak the rsync-ssl docs/usage. 2020-06-15 09:36:13 -07:00
Wayne Davison
ec8035cef9 A minor NEWS tweak. 2020-06-15 09:21:26 -07:00
Wayne Davison
775f64f4b8 Add a warning header to the generated help-*.h files. 2020-06-14 18:49:38 -07:00
Wayne Davison
660274bfb7 A few more md -> html improvements 2020-06-14 18:28:30 -07:00
Wayne Davison
59cf9ff797 More NEWS improvements. 2020-06-14 18:00:18 -07:00
Wayne Davison
ff272503b0 Output who_am_i() info in all rsyserr() messages. 2020-06-14 15:54:42 -07:00
Wayne Davison
43a939e3f2 Improve some md files. 2020-06-14 15:29:45 -07:00
Wayne Davison
b65b6db304 Add handling of non-breaking space & double-dash. 2020-06-14 15:29:45 -07:00
Wayne Davison
7b1f8f57c3 Update rrsync & its opt-culling script. 2020-06-13 22:11:37 -07:00
Wayne Davison
c32012d199 Need to indent a code block in the README. 2020-06-13 21:31:26 -07:00
Wayne Davison
9ba6ce1b67 More release improvements. 2020-06-13 21:21:26 -07:00
Wayne Davison
ca9e247762 Mention renamed .md files. 2020-06-13 20:42:33 -07:00
Wayne Davison
f27a630e46 Don't use c++ comments. 2020-06-13 20:12:15 -07:00
Wayne Davison
243a9d9be0 A few more release script fixes. 2020-06-13 20:11:06 -07:00
Wayne Davison
c528f8d5c8 Preparing for release of 3.2.0pre1 2020-06-13 19:16:26 -07:00
Wayne Davison
1d1c0f14e1 Make -4 & -6 also able to affect an ssh remote shell. 2020-06-13 19:15:02 -07:00
Wayne Davison
e63ff70eae Some indentation fixes. 2020-06-13 19:15:02 -07:00
Wayne Davison
8a70f1420b Some fixes for the release script & other helpers. 2020-06-13 19:15:00 -07:00
Wayne Davison
cdf58a7aba Change alt_dest_name() to alt_dest_opt(). 2020-06-13 12:04:13 -07:00
Wayne Davison
1d6c9676f9 Change 3 alt-dest vars to just one + some defines. 2020-06-13 11:47:08 -07:00
Wayne Davison
3d29fa99ec Tweak a couple var names. 2020-06-13 11:47:04 -07:00
Wayne Davison
d167935874 Change a function name. 2020-06-13 03:03:33 -07:00
Wayne Davison
d326961290 Fix overzealous setting of mtime & tweak time comparisons
- Stop setting the mtime on a file we didn't transfer (or didn't verify
  the checksum) when the time diff is within the modify window.
- Stop computing a time difference (-1|0|1) when all we care about is
  time equality.
2020-06-13 02:41:30 -07:00
Wayne Davison
7dec4029ee Convert a couple files to UTF-8; more Copyright years. 2020-06-13 02:41:04 -07:00
Wayne Davison
ab0189c813 Make use of poptDupArgv(). 2020-06-12 23:28:27 -07:00
Wayne Davison
bb484a799e The unalias argv array needs room for a trailing NULL. 2020-06-12 23:19:14 -07:00
Wayne Davison
ad9f1571ce Add hashtable to delete_in_dir() to fix -x deletions 2020-06-12 17:42:56 -07:00
Wayne Davison
f800557824 Tweak the hashtable routines to be a little clearer and easier. 2020-06-12 17:42:41 -07:00
Wayne Davison
13f81f4aa7 Tweak a usage message. 2020-06-12 10:20:33 -07:00
Wayne Davison
d3ae752c53 Fix running prepare-source from a separate build dir. 2020-06-12 09:29:42 -07:00
Wayne Davison
e3437244b5 Improve how the help lines are harvested from the md file. 2020-06-12 08:50:51 -07:00
Wayne Davison
1efeb59166 Enable SIMD by default (if g++ is around). 2020-06-12 08:29:36 -07:00
Wayne Davison
d4fc18f375 Use the refused-option code to disable options that aren't compiled into the source. 2020-06-11 22:53:29 -07:00
Wayne Davison
58680edb12 Improve checkcsum/compress info that may differ between packaged versions. 2020-06-11 22:03:10 -07:00
Wayne Davison
34141954c7 Add packaging notes to NEWS. 2020-06-11 20:35:18 -07:00
Wayne Davison
cba00be622 Translate man page's option list into .h files for options.h to use. 2020-06-11 20:34:23 -07:00
Wayne Davison
de78dd685b Simplify the install of rsync-ssl by unifying 2 scripts. 2020-06-11 20:26:56 -07:00
Wayne Davison
88abb50229 Promote newer compressors to the start of the list. 2020-06-11 20:26:56 -07:00
Wayne Davison
6d6b8595df Remove generated doc files via make clean. 2020-06-11 20:26:45 -07:00
Wayne Davison
66bd4774a8 Allow maintainer to build with /usr/local prefix but document /usr. 2020-06-11 19:15:08 -07:00
Wayne Davison
c117fa4bf9 Create a get_device_size() helper function. 2020-06-11 16:09:36 -07:00
Wayne Davison
b040825b86 Improve the haproxy header docs. 2020-06-11 15:23:35 -07:00
Wayne Davison
3c793ef153 Use /dev/shm instead of requiring /dev/shm/tmp. 2020-06-11 14:33:25 -07:00
Wayne Davison
cff0764b7f Add haproxy header parameter to rsync daemon 2020-06-11 14:22:25 -07:00
Wayne Davison
a3377921eb Add early exec daemon parameter.
Inspired by Ciprian Dorin Craciun's `bootstrap exec` patch.
2020-06-10 21:38:37 -07:00
Wayne Davison
a61ffbafe5 Make sure the tmpdir2 dir is writable. 2020-06-10 13:59:02 -07:00
Wayne Davison
190b474610 Mention how to run a single test. 2020-06-10 13:59:02 -07:00
Wayne Davison
85e90b0f80 Update copyright year in runtests.sh too. 2020-06-10 13:59:02 -07:00
Wayne Davison
516ca6a442 Add support for /run/shm/tmp dir so the CI action doesn't skip a test. 2020-06-10 13:17:41 -07:00
Wayne Davison
fe993ca94d Have the CI actions run make check29 & check30. 2020-06-10 12:02:40 -07:00
Wayne Davison
f8683063fb Fix a couple batchfile issues. 2020-06-10 11:23:14 -07:00
Wayne Davison
7c83eb6e63 Improve gensend rule & list of PHONY targets. 2020-06-10 09:44:23 -07:00
Wayne Davison
58e8ecf48f Improvements for release process; a gensend hook. 2020-06-10 09:31:01 -07:00
Wayne Davison
c5e44330a5 Fix double-gen of manpages. 2020-06-10 00:39:30 -07:00
Wayne Davison
ae82762c31 Fix the output with -D; a few minor tweaks. 2020-06-10 00:26:29 -07:00
Wayne Davison
2ac7401b44 Mention the github rsync home. 2020-06-09 18:08:29 -07:00
Wayne Davison
44af79223e The samba rsync server now requires ssl. 2020-06-09 17:28:07 -07:00
Wayne Davison
03fc62ad2f More man processing improvements
- Support the commonmark library in addition to cmarkgfm.
- Remove github-flavor from the markup.
- A few more html style improvements.
2020-06-09 17:02:41 -07:00
Wayne Davison
68c865c9e6 A few more man page script improvements. 2020-06-09 09:17:37 -07:00
Wayne Davison
6dc94e39a7 Output the files at the end; fix a missing double-quote. 2020-06-09 00:58:07 -07:00
Wayne Davison
8146b04ffb Fix the html title. 2020-06-08 22:52:58 -07:00
Wayne Davison
5b19cf7875 A couple man page tweaks. 2020-06-08 22:48:14 -07:00
Wayne Davison
53fae55652 Change man page src format from yodl to markdown.
This removes the yodl dependency, which is sometimes hard to track down.
Instead, this uses a python3 script that leverages the cmarkgfm library
to turn the source file into html.  Then, the script parses the html in
order to turn the tag stream into a nroff stream using a simple state
machine. While it's doing that it also implements one added format rule
that turns an ordinal list that starts at 0 into a description list
(since markdown doesn't have an easy description list idiom).
2020-06-08 21:03:42 -07:00
Wayne Davison
bd66a92e7c Tweak the new heading 2020-06-07 19:46:22 -07:00
Sebastian Andrzej Siewior
165ef61de3 Add OpenSSL license exception also to COPYING
Add the OpenSSL license exception also to the COPYING file which
contains the license related information.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2020-06-07 19:46:22 -07:00
Wayne Davison
7dbbde8c5e Use ZSTD_CLEVEL_DEFAULT define. 2020-06-07 19:30:24 -07:00
Wayne Davison
888f4f9503 Put the rsync-ssl-rsh helper script into a lib dir. 2020-06-07 19:25:18 -07:00
Wayne Davison
2c6f0581ac A couple minor fixes. 2020-06-04 22:54:38 -07:00
Wayne Davison
916faecb83 Only sender can output non-final stats on error
The receiving side's stats are split between 2 processes until the very end.
2020-06-04 21:40:43 -07:00
Wayne Davison
5d7b71b7a7 Make use of O_NOFOLLOW if it is defined. 2020-06-04 19:47:59 -07:00
Wayne Davison
0dde65a26b Mention more NEWS items. 2020-06-04 19:08:04 -07:00
Wayne Davison
b177311aee Use a lock to not fail on a left-over pid file. 2020-06-04 19:08:03 -07:00
Wayne Davison
778f0dff9b Use more switch statements. 2020-06-04 16:17:12 -07:00
Wayne Davison
342579aa6f Make -V the short opt for --version. 2020-06-04 15:52:38 -07:00
Wayne Davison
01b9bbb0f9 Avoid a deadlock due to huge amounts of verbose messages.
Allow the receiver to increase their iobuf.msg xbuf if it fills up. This
ensures that the receiver will never block trying to output a message,
and thus it will always drain the data from the sender and keep the
whole thing from clogging up.
2020-06-04 14:20:51 -07:00
Wayne Davison
852a0b29c3 Tweak --copy-as docs a bit more. 2020-06-04 13:07:50 -07:00
Wayne Davison
55290c8584 Add hostname "lh" as a --no-cd localhost. 2020-06-04 12:58:02 -07:00
Wayne Davison
e633091d23 Fix change_dir() leaving appended slash in curr_dir on failure. 2020-06-04 12:35:24 -07:00
Wayne Davison
4c9fdb9f74 Handle --skip-compress right for new compressors
Some compressors can't completely turn off, so minimize the level
when a file is being "skipped".
2020-06-02 18:06:09 -07:00
Wayne Davison
e0d30a22d7 Mention that rsync --version outputs checksum & compress lists. 2020-06-02 17:21:51 -07:00
Wayne Davison
42ec4e3090 Update ccpp.yml
Switch to ubuntu-20.04 and add a couple dev libs.
2020-06-02 17:20:22 -07:00
Wayne Davison
3735002751 Some improvements to the release mechanism
- Some manpage changes to make them more consistent and to add a section
  that the release script expects in rsync-ssl.
- Fixed some issues in release-rsync pertaining to various file changes,
  such as the .md file changes.
- Change the gpg handling to stop prompting for a passphrase since gpg
  now makes use of gpg-agent (and the old gpg script is apparently not
  passing through fd 2 that git needs to get status).
2020-06-02 16:54:07 -07:00
Wayne Davison
d47a80c05e Move the CSUM defines. 2020-06-01 18:49:15 -07:00
Wayne Davison
9dd9952138 A few style tweaks. 2020-06-01 18:38:06 -07:00
Jorrit Jongma
71c4ae2336 Move OpenSSL-related MD4/5 defines and imports to lib/mdigest.h
Works just as well, prevents having to repeat them across files
2020-06-01 17:57:38 -07:00
Wayne Davison
c0268d9217 Some improvements for --msgs2stderr and --daemon.
- Set am_daemon to -1 (from 1) when the daemon is run via rsh.
- Only disable --msgs2stderr for a normal (socket) daemon.
- Forward a -q to the server if --msgs2stderr was also specified.
- Added --no-msgs2stderr option to allow it to be overridden.
2020-05-31 16:02:46 -07:00
Wayne Davison
da448cdc99 Mention the latest NEWS items. 2020-05-30 05:54:09 -07:00
Wayne Davison
d619a87aa5 Avoid noop_io_until_death() if --msgs2stderr was specified. 2020-05-30 05:53:59 -07:00
benrubson
a931301bef Search for double-fuzzy files only when needed 2020-05-29 23:13:15 -07:00
Wayne Davison
265b0bc9bb Silence a strncpy() warning. 2020-05-29 17:35:56 -07:00
Wayne Davison
13f249a826 Silence some g++ warnings. 2020-05-29 17:24:15 -07:00
Wayne Davison
c66e08acb3 Give configure's snprintf() test a guaranteed short string at the start. 2020-05-29 17:24:05 -07:00
Wayne Davison
f5446552f3 Silence gcc7.1 warnings about snprintf(). 2020-05-29 14:18:08 -07:00
Wayne Davison
364d302bca Fix regex issue due to python 3.8 bug. 2020-05-28 20:48:24 -07:00
Wayne Davison
60e71c1b8b A few minor xxhash changes. 2020-05-28 20:40:23 -07:00
Wayne Davison
342921eb97 Merge pull request #5 from benrubson/daemonstats
Have daemon log data sent/received even when exiting with an error.
2020-05-28 13:42:47 -07:00
Wayne Davison
df0ed76a76 Add stub for canonical_checksum(). 2020-05-28 12:46:46 -07:00
Wayne Davison
d7521f5428 The xxh* checksums don't need to be reversed on output. 2020-05-28 12:33:36 -07:00
Wayne Davison
c7f10de442 Switch to using LZ4_compress_default(). 2020-05-28 11:40:52 -07:00
Wayne Davison
f60bd811e9 Use MSG_FLUSH in a couple more spots. 2020-05-28 00:41:39 -07:00
Wayne Davison
cd0637a953 Merge pull request #2 from benrubson/flush
Help final error messages get to the sender. Is particularly helpful when talking with an older rsync client. Adds a new flush type of MSG_FLUSH.
2020-05-27 23:35:25 -07:00
Wayne Davison
8809f65b13 A couple minor tweaks. 2020-05-26 22:36:56 -07:00
benrubson
c906619620 Log data sent/received even if error 2020-05-26 19:53:25 +02:00
Wayne Davison
5710d2fe2e Simplify the capabilities array. 2020-05-26 08:05:24 -07:00
benrubson
32fe5fbc11 Correctly send last error to sender 2020-05-26 16:24:30 +02:00
Wayne Davison
bcb0a24a8f Convert NEWS & OLDNEWS into .md files. 2020-05-26 02:24:33 -07:00
Wayne Davison
96ed96dabd Fix the parsing of the --version capabilities. 2020-05-25 23:42:51 -07:00
Wayne Davison
8ad2ca9ae2 Install yodl for the CI builds. 2020-05-25 23:42:51 -07:00
Wayne Davison
23a37ecac4 Get indent right. 2020-05-25 23:33:11 -07:00
Wayne Davison
47bae3abf6 Improve output of capabilities in --version list.
It now wraps better as the "no " prefixes change, and it makes it easier
to maintain patches that add items into the capabilities list.
2020-05-25 23:24:46 -07:00
Wayne Davison
dff9dd56a0 Remove xxhash from capabilities list.
It's now listed in the "Checksum list:" output.
2020-05-25 21:31:40 -07:00
Wayne Davison
7182508a75 Fix a couple deb names. 2020-05-25 21:21:58 -07:00
Wayne Davison
cb0fe9e195 Improve CI setup. 2020-05-25 21:17:51 -07:00
Wayne Davison
87f2984df0 Improve how negotiated info affects batch files. 2020-05-25 19:19:59 -07:00
Wayne Davison
24ce3e9d54 Tweak the --zz option to --zc (aka --compress-choice). 2020-05-25 16:57:47 -07:00
Wayne Davison
98cddfaf7a Rename a couple files to .md 2020-05-25 15:05:06 -07:00
Wayne Davison
d1fcb8ce9d Add some extra indent. 2020-05-25 14:59:51 -07:00
Wayne Davison
b4ace35304 Create ccpp.yml 2020-05-25 14:43:25 -07:00
Wayne Davison
888ce058d8 Two sparse fixes from Yuxuan Shui.
- Make "len" parameter of do_punch_hole an OFF_T.
- Clear sparse_past_write in sparse_end(), otherwise when write_sparse()
  is called for the next file, do_punch_hole() will be called with a pos
  that's not actually the current position in file, causing it to fail.
2020-05-25 14:01:52 -07:00
Wayne Davison
c394e86184 Include lz4 compression support.
Based on a patch that was emailed to me without a valid return address.
2020-05-25 13:45:56 -07:00
Wayne Davison
4aaadc2f29 Include zstd compression support.
Based on a patch by Sebastian A. Siewior. Fixes bug #14338.
2020-05-25 13:44:48 -07:00
Wayne Davison
abef92c037 Fix handling of a compressor that has no off_level. 2020-05-25 13:02:56 -07:00
Wayne Davison
87019d7721 Output the default checksum & compress lists in the --version output. 2020-05-25 13:02:12 -07:00
Wayne Davison
fc265c5a92 A couple minor configure.ac tweaks. 2020-05-25 11:50:44 -07:00
Wayne Davison
d999efe6e5 Make compression-level handling generic. 2020-05-25 11:18:51 -07:00
Wayne Davison
97e8c55ee8 Some minor tweaks & tidying up. 2020-05-24 22:50:51 -07:00
Wayne Davison
739fa96737 Change odd-ball map_ptr() to use remainder like the others. 2020-05-24 20:38:48 -07:00
Jorrit Jongma
d474f2986e Improve performance of file_checksum()
Previously files were hashed in blocks of CSUM_CHUNK (64) bytes. This
causes significant overhead. The CSUM_CHUNK define cannot be changed as
md5.c depends on it, but there is no obvious reason to use it in
file_checksum(). By using CHUNK_SIZE (32 kB) instead, in some test
cases throughput more than doubles.
2020-05-24 20:33:33 -07:00
Wayne Davison
a863c62cd1 More NEWS updates. 2020-05-24 20:19:15 -07:00
Wayne Davison
5ac353d845 Prefer zlibx compression consistently instead of having 2 possible default preference orders. 2020-05-24 19:52:08 -07:00
Wayne Davison
faecd066a6 Don't auto-foward debug options to the server side anymore. 2020-05-24 19:37:15 -07:00
Wayne Davison
6efc43cc0a Fix -z choice with older rsyncs. 2020-05-24 19:16:05 -07:00
Wayne Davison
4496e0e8e7 A few more compression tweaks. 2020-05-24 18:43:03 -07:00
Wayne Davison
64d5ea39c0 More compress changes
- Add the zlibx (external-code compatible) compression name.
- Re-enable zlib support with the external library so it can be
  tried as a fallback if zlibx isn't available.
- Add --compress-choice=STR (aka -zz=STR) option.
- Make --cc=STR an alias for --checksum-choice=STR.
- Hook up the new compression negotiation logic.
2020-05-24 17:24:42 -07:00
Wayne Davison
4af8403aa2 Fix negotiation of none & improve NSTR debug msgs. 2020-05-24 13:49:06 -07:00
Wayne Davison
2f84a6bd73 Add support for negotiated checksum names. 2020-05-24 13:22:19 -07:00
Wayne Davison
eda15d52a8 Make xxh64 the "main_name" for the current xxhash. 2020-05-24 02:10:05 -07:00
Wayne Davison
741d5f10c6 Fix some warnings. 2020-05-24 02:04:14 -07:00
Wayne Davison
4f92fd8ddd Some more checksum improvements
- Add/improve --debug=CSUM2 messages.
- Add an "xxh64" alias for "xxhash" name because we should be
  getting a few more xxhash variations in the future.
- Tweak the matching code to handle entries that have multiple
  names.
- Tweak some of the vars/defines.
2020-05-24 01:00:53 -07:00
Wayne Davison
7f2359a5cc Improve some early debug-message newlines.
Avoid a newline issue during the output of --DEBUG=CSUM info from
both the server and the client -- we need to output the full message
with its newline as much as possible.
2020-05-23 21:51:28 -07:00
Wayne Davison
6e942e5898 Avoid re-evaluating the args of SIVAL* w/CAREFUL_ALIGNMENT. 2020-05-23 21:43:53 -07:00
Wayne Davison
1c9bb168bb Unify the checksum context memory, since we only use one at a time. 2020-05-23 18:52:03 -07:00
Wayne Davison
799de21af6 Fixed the use of openssl MD4 for transfer checksums. 2020-05-23 16:22:36 -07:00
Wayne Davison
1cb1edeb68 Optional openssl support for MD4 pre-transfer checksums (but, sadly, not transfer checksums). 2020-05-23 12:30:58 -07:00
Wayne Davison
15c1162b24 Add optional use of the openssl crypto lib for MD5. 2020-05-23 10:06:59 -07:00
Wayne Davison
a7175ee029 Mention a few more news items. 2020-05-22 23:26:25 -07:00
Wayne Davison
68516f91be Add "input" handling for cmd_txt_*() pkglib.py. 2020-05-22 22:49:02 -07:00
Jorrit Jongma
531ffa8104 Optimized assembler version of md5_process() for x86-64
Originally created by Marc Bevand and placed in the public domain.
Enable/disabled via the same --enable-simd configure switch as
the rolling checksum optimizations.
2020-05-22 22:37:21 -07:00
Wayne Davison
d7212df0f1 A little more safety in negotiate_checksum(). 2020-05-22 19:29:05 -07:00
Wayne Davison
a28bc3ebf6 Promoting xxhash support. 2020-05-22 17:59:12 -07:00
Wayne Davison
55bb4dab7a Some checksum improvements
- Improve csum negotation logic.
- Define the csum names in a single structure.
- Add --debug=CSUM.
2020-05-22 17:59:12 -07:00
Jorrit Jongma
5fa4209ca0 AVX2 optimized version of get_checksum1() for x86-64
Additionally restructures build switches and defines from SSE2 to SIMD,
to allow potential reuse should patches become available with SIMD
instructions for other processor architectures.

(Some minor tweaks of Jorrit's patch to avoid requiring GNU make and to
avoid C++ comments in .c files.)
2020-05-22 11:31:31 -07:00
Wayne Davison
4f6c8c6652 Checksum negotiation & more bits for compat_flags
- Add checksum negotiation to the protocol so that we can easily add new
  checksum algorithms and each will be used when both sides support it.
- Increase the size of the compat_flags value in the protocol from a
  byte to an int.
2020-05-22 09:52:14 -07:00
Wayne Davison
a7303a3d3d Fix a bug in the writing of the batch.sh file
Fix the code that writes the options and the default destination path
into the batch.sh file to be able to handle options being specified
after source/dest args.
2020-05-22 08:27:07 -07:00
Jorrit Jongma
70c6b408dc SSE2/SSSE3 optimized version of get_checksum1() for x86-64
Requires compilation using GCC C++ front end, build scripts have been
modified accordingly. C++ is only used when the optimization is enabled
(g++ as compiler, x86-64 build target, --enable-sse2 is passed to
configure).

(Wayne made a few tweaks, including making it disabled by default.)
2020-05-21 14:41:55 -07:00
Wayne Davison
be7af36c51 Tweak the accept/refuse strings a bit. 2020-05-18 00:06:06 -07:00
Wayne Davison
3b36bde953 Add back a lost "*" and document the refusing of log-file* opts. 2020-05-17 23:28:35 -07:00
Wayne Davison
c3986d4c5a More manpage improvements for "refuse options". 2020-05-17 22:19:25 -07:00
Wayne Davison
b3a1a0ca9d Add the ability to negate matches for the daemon's "refuse options". 2020-05-17 21:29:11 -07:00
Wayne Davison
e448d31d63 Need to flush early errors before we exit. 2020-05-17 21:20:15 -07:00
Wayne Davison
37de48979e Some pkglib improvements. 2020-05-17 20:32:43 -07:00
Wayne Davison
08f955e17b A couple more manpage fixes. 2020-05-13 00:20:03 -07:00
Wayne Davison
3435ae9bd0 A bit more manpage tweaking. 2020-05-13 00:11:57 -07:00
Wayne Davison
7a9295778c Change r'\1%s\2' to r'\g<1>%s\2'. 2020-05-06 17:23:34 -07:00
Wayne Davison
f7746d0000 A couple extra function checks for future features. 2020-04-29 22:14:49 -07:00
Wayne Davison
96a6ea0f26 Convert another packaging script to python3. 2020-04-29 21:25:17 -07:00
Wayne Davison
6242786158 A few superficial tweaks. 2020-04-29 19:41:56 -07:00
Wayne Davison
b430ceec7a Use a varint to send the file-list flags
If both sides support the "V" compatibility flag, we send the file-list
flags as a varint instead of a 1-or-2 byte value.  This upgrades the
number of reserved flag bits from 1 to 17 with very few extra bytes in
typical file-list data.
2020-04-29 18:22:52 -07:00
Wayne Davison
3a7bf54ad5 A resumed partial-dir file is transferred in-place.
Fixed bug #13071.
2020-04-29 17:02:14 -07:00
Wayne Davison
c1cb307b4b Fix a couple issues with the atime file-list value. 2020-04-26 18:42:37 -07:00
Wayne Davison
af6118d98b Allow a missing parent dir when --delete-missing-args was specified. 2020-04-26 18:10:40 -07:00
Wayne Davison
ea3337a210 Add extensions to the default no-compress list.
Fixes bug #13749.
2020-04-26 17:07:58 -07:00
Wayne Davison
035a13f7e4 Add a few new opts to rrsync. 2020-04-26 14:54:45 -07:00
Wayne Davison
f14adfd75e Some var cleanup; move test-util vars into t_stub.c. 2020-04-26 14:54:43 -07:00
Wayne Davison
d218be3482 Update a few more copyright years. 2020-04-25 23:34:16 -07:00
Wayne Davison
f4c077e85e Change pending version to 3.2.0 (currently 3.2.0dev). 2020-04-25 23:30:42 -07:00
Wayne Davison
1c7785ab1e Change do_setattrlist_times() to use an stp arg. 2020-04-25 21:39:11 -07:00
Wayne Davison
87257f869c Change --set-notime to --open-noatime. 2020-04-23 14:32:26 -07:00
Wayne Davison
b936741032 Added --atimes and --set-noatime options. 2020-04-23 13:24:15 -07:00
Wayne Davison
2b2a3c87b6 Mention more changes in the NEWS. 2020-04-23 13:18:07 -07:00
Wayne Davison
6e962ac51e Eliminate .in for rsync-ssl. 2020-04-22 14:53:06 -07:00
Wayne Davison
991ab811cb Turn nightly-rsync into a python script. 2020-04-22 12:43:25 -07:00
Wayne Davison
3249824264 Some more rsync-ssl improvements:
- Make the rsync-ssl default behavior more user friendly.
- Install rsync-ssl & rsync-ssl-rsh in the regular install rules.
- Add a manpage for rsync-ssl (which is also installed).
- Get rid of the rsync-ssl-client package in our spec file.
2020-04-22 12:40:14 -07:00
Wayne Davison
1c465dc33a Change the name of the rsh-ssl-rsync script. 2020-04-22 10:52:01 -07:00
Wayne Davison
2a87d78f69 Change the rsync-ssl helper script
The new rsh-ssl-rsync helper script (replacing stunnel-rsync) supports
openssl in addition to stunnel.  The RSYNC_SSL_TYPE environment variable
can be set to specify which type of connection to use, and the first arg
to rsync-ssl can be --type=stunnel or --type=openssl to override the env
var or the default of "stunnel".  The helper script now looks for
stunnel4 or stunnel on the PATH at runtime instead of having configure
look for it at compile time.
2020-04-19 14:00:33 -07:00
Wayne Davison
3ba4db7030 Two more spelling fixes and some year updates. 2020-04-16 09:31:02 -07:00
Wayne Davison
d29702134a Spelling fixes from a Fossies run done by Jens. 2020-04-15 17:42:23 -07:00
Wayne Davison
1c82a1e1e5 A few file-data improvements. 2020-04-12 15:51:20 -07:00
Wayne Davison
2d0c7adba9 Change some packaging tools into python3 and make a few improvements. 2020-04-12 00:13:35 -07:00
Wayne Davison
0b4b31a960 Add a (pending) release line for 3.1.4. 2020-04-11 17:59:22 -07:00
Wayne Davison
8a21e5a8c6 Use the --quiet option. 2020-04-09 18:42:31 -07:00
Wayne Davison
fa9c8d04d4 Put the year-tweak script into packaging dir. 2020-04-09 15:17:09 -07:00
Wayne Davison
c5fabfb068 Set Copyright years and make them easier to update
I replaced git-set-file-times with an improved version that I wrote
recently (in python3). A new script uses it to figure out the
last-modified year for each *.[ch] file and updates its copyright.
It also puts the latest year into the latest-year.h file for the
output of --version.
2020-04-09 15:11:37 -07:00
Wayne Davison
e2aee6c4af Switch RSYNC_PORT to -1 in check_for_hostspec(). 2020-04-07 19:21:37 -07:00
Wayne Davison
2598ca668b Fix the default skip-compress list.
The default value of the skip-compress list actually comes from the
daemon's default lp_dont_compress() value, but a while back the vars
stopped getting default values in a non-daemon run. I added a call to
reset_daemon_vars() so that the "Vars" values get set from "Defaults".
2020-04-07 18:15:09 -07:00
Wayne Davison
cd7ad50bc8 Tweak the grep to look for sys/sysmacros.h. 2020-04-07 15:32:06 -07:00
Wayne Davison
5e4a1441cb Avoid the include warnings for major(). 2020-04-07 15:16:19 -07:00
Wayne Davison
9dea2ae87c Make use of the new RSYNC_PORT env var. 2020-04-07 13:36:01 -07:00
Ethan Sommer via rsync
795268bb7c Replace mkproto.pl with mkproto.awk
This replaces the build dependency on perl with one on awk which is
already used throughout the build system and is much more ubiquitous
than perl.
2020-04-07 13:08:05 -07:00
Wayne Davison
70cbc66b7f Set RSYNC_PORT in the env for a daemon-over-rsh connection.
Fixes bug #14163.
2020-04-05 19:34:27 -07:00
Wayne Davison
b63276e70f A quick fix for some perl patch-helper scripts. 2020-04-05 17:18:32 -07:00
Wayne Davison
b0c03e2be9 Another tweak for a change in git status. 2020-04-05 17:12:29 -07:00
Wayne Davison
8475e0e492 Tweak some indentation. 2020-04-05 17:03:15 -07:00
Wayne Davison
7f06cc7ed0 Don't throw an error if a potential fuzzy dir isn't a dir
Add a flag for calling get_dirlist() and for send_directory() that
indicates that the dirname is allowed to not be a directory.  Based
on a patch by Ben Rubson.  Fixes bug #13445.
2020-04-05 16:41:15 -07:00
Wayne Davison
10d40508e6 Use "exit 1" in atomic-rsync for error exit.
Fixes bug #15469.
2020-04-05 16:23:07 -07:00
Wayne Davison
daf8f7a669 Some configure improvements for strict C99 compilers (based on a patch by Florian Weimer). 2020-04-05 16:19:54 -07:00
Wayne Davison
15fa9ab06d Add progress output via SIGINFO and SIGVTALRM
On BSD-ish systems you can type Ctrl+T to see the current file and
the progress output (in --info=progress2 format).  On hosts w/o
SIGINFO, use something like "killall -VTALRM rsync" or a more
targetted "kill -VTALRM PID ..." call (as needed).
2020-04-05 15:07:31 -07:00
Wayne Davison
7e70e4842b No need to forward --write-devices to a remote sender. 2020-04-05 12:01:48 -07:00
Wayne Davison
9e9d33a2db Added the --write-devices option.
This is a fleshed out version of the old one in the patches repo with
documentation & proper handling of the implied --inplace option for a
daemon's option-rufusing considerations. I ommitted the -w short option
as I would hate for someone to turn this on accidentally.
2020-04-05 11:56:28 -07:00
Wayne Davison
b32aa4797d Make exit_cleanup() use _exit() if called from a signal handler.
Fixes bug #13982.
2020-04-05 10:26:40 -07:00
Wayne Davison
826ddc5403 Enhance the validation of --block-size for older protocols.
Fixes bug #13974.
2020-04-05 10:05:25 -07:00
Wayne Davison
3bd4e1e8cd Make the --copy-links caveat a little clearer. 2020-04-05 09:43:59 -07:00
Wayne Davison
51e23e0ab7 Use nanosleep if it is available.
Fixes bug #14328.
2020-04-05 09:22:00 -07:00
Wayne Davison
08650cb14c Add a --copy-as=USER[:GROUP] option
This can be used by a root-run rsync to try to make reading or writing
files safer in a situation where you can't run the whole rsync command
as a non-root user.
2020-03-29 13:18:20 -07:00
Wayne Davison
24c28cd715 Match the latest git "clean" text. 2019-03-19 09:35:59 -07:00
Wayne Davison
c0c6a97c35 Try to fix the iconv crash in bug 11338.
Applying Michal Ruprich's suggested patch for the rwrite() function that
should hopefully help with a bug that I couldn't reproduce.
2019-03-16 11:51:49 -07:00
Wayne Davison
d47d379216 Fix bug in try_dests_reg that Florian Zumbiehl pointed out.
If the alternate-destination code was scanning multiple alt dirs and it
found the right size/mtime/checksum info but not the right xattrs, it
would keep scanning the other dirs for a better xattr match, but it
would omit the unchanged-file check that needs to happen first.
2019-03-16 11:12:53 -07:00
Wayne Davison
eb1b138ec2 Clarify the cut-off point for --copy-safe-links. 2019-03-16 10:55:50 -07:00
Wayne Davison
13f596433b Some doc tweaks suggested by Clément Pit-Claudel. 2019-03-16 10:10:14 -07:00
Wayne Davison
3fe4469bfa Fix zlib CVE-2016-9843. 2019-03-16 09:56:11 -07:00
Wayne Davison
8eb50bce43 Fix zlib CVE-2016-9842. 2019-03-16 09:56:11 -07:00
Wayne Davison
fc10fafa25 Fix zlib CVE-2016-9841. 2019-03-16 09:56:11 -07:00
Wayne Davison
efcbec3df5 Fix zlib CVE-2016-9840. 2019-03-16 09:56:11 -07:00
Wayne Davison
3e2e4b5a33 Tweak the copyright year. 2019-03-16 09:15:49 -07:00
Wayne Davison
79332c0d66 Fix --remove-source-files sanity check w/--copy-links the right way.
Fixes bug #10494.
2019-03-16 09:09:09 -07:00
Wayne Davison
bdfc296faf Handle a run from down inside the checkout tree. 2019-03-15 12:20:55 -07:00
Wayne Davison
2ad1c4e800 Improve write-only --sender check & handle 2 new options. 2019-01-15 11:18:36 -08:00
Wayne Davison
0da7ba57b5 Update option culling to handle latest changes. 2019-01-15 11:16:50 -08:00
Wayne Davison
b3d12c5a3d Use a separate pass-by-value pointer for clarity. 2019-01-15 10:46:29 -08:00
Wayne Davison
bc7402aa3a Avoid warning about leaked mem (didn't affect rsync's pool use). 2019-01-15 10:46:29 -08:00
Wayne Davison
f233dffbd6 Avoid leaving a file open on error return. 2019-01-15 10:38:00 -08:00
Wayne Davison
c2da3809f7 Fix --prealloc to keep file-size 0 when possible. 2019-01-15 08:59:35 -08:00
Wayne Davison
48346c878f Reject --log-file when read-only. 2019-01-09 13:35:21 -08:00
Wayne Davison
a0274c08b5 Improve check for ".." and guard against dash args. 2019-01-09 13:35:21 -08:00
Wayne Davison
f627e27749 Save each expanded daemon-config string on first use to
avoid a new alloc on every use (one that was not freed).
2019-01-09 13:35:21 -08:00
Wayne Davison
0b6cae6792 No need to strdup each new section since we stopped using free(). 2019-01-08 20:30:58 -08:00
Wayne Davison
e5610f1877 Avoid a yodl macro warning. 2019-01-08 16:39:48 -08:00
Wayne Davison
c376170644 Make sure that some memory zeroing always happens. 2019-01-08 14:46:41 -08:00
Wayne Davison
48163179eb Avoid a yodl macro warning. 2019-01-08 13:38:19 -08:00
Wayne Davison
b4c1b27e03 Fix 2 spelling errors pointed out by bug 13734. 2019-01-08 13:34:32 -08:00
Wayne Davison
c90b87e021 Avoid a failed test if dirs report 1 hlink (e.g. WSL weirdness). 2019-01-04 21:43:50 -08:00
Wayne Davison
ad17b21889 Silence fall-through warnings. 2019-01-04 15:06:30 -08:00
Wayne Davison
a366868535 Avoid a potential out-of-bounds read in daemon mode if argc is 0. 2018-12-15 16:59:18 -08:00
Wayne Davison
f55d35c5a0 Try to be clearer that --append-verify isn't a general-purpose-copy option. 2018-11-20 14:17:32 -08:00
Wayne Davison
6af8e11450 Don't force cygwin to solaris ACLs anymore. 2018-11-20 14:11:42 -08:00
Wayne Davison
1a288c06d9 Document how a leading comma changes the gid parsing. 2018-11-20 13:44:09 -08:00
Wayne Davison
4aeb093206 Fix itemizing of wrong dir name on some --iconv transfers.
Fixes bug #13492.
2018-11-20 13:21:32 -08:00
Wayne Davison
1eb7a7061a Need to mark xattr rules in get_rule_prefix().
This fixes the bug of xattr filters getting sent as a normal filter rule
(since the 'x' was dropped in the prefix).
2018-06-14 15:22:53 -07:00
Wayne Davison
eec6ab7615 Avoid a compiler error/warning about shifting a negative value.
Fixes bug #13268.
2018-03-25 19:11:41 -07:00
Wayne Davison
5df9847f06 Allow some pre-/post-xfer exec shell restrictions.
Support both RSYNC_SHELL & RSYNC_NO_XFER_EXEC environment variables.
2018-03-25 11:02:50 -07:00
Wayne Davison
fb7a162f53 Prepare the repository for more development. 2018-03-25 10:04:29 -07:00
Wayne Davison
d73762eea3 Preparing for release of 3.1.3 2018-01-28 15:24:27 -08:00
Wayne Davison
d58405a353 Mention nanoseconds change. 2018-01-15 11:25:04 -08:00
Wayne Davison
0f8e9e2d86 Don't force nanoseconds if a file wasn't transferred or checksummed. 2018-01-15 10:58:31 -08:00
Wayne Davison
c4a3f55be3 Preparing for release of 3.1.3pre1 2018-01-14 21:34:42 -08:00
Wayne Davison
473108ae6e Tweak copyright date. 2018-01-14 19:55:07 -08:00
Wayne Davison
e401959b89 Mention more changes. 2018-01-14 19:51:25 -08:00
Jeriko One
7706303828 Ignore --protect-args when already sent by client
In parse_arguments when --protect-args is encountered the function exits
early. The caller is expected to check protect_args, and recall
parse_arguments setting protect_args to 2. This patch prevents the
client from resetting protect_args during the second pass of
parse_arguments. This prevents parse_arguments returning early the
second time before it's able to sanitize the arguments it received.
2018-01-09 17:51:30 -08:00
Wayne Davison
f5e8a17e09 Fix issue with earlier path-check (fixes "make check")
and make a BOOL more explicit.
2017-12-03 16:27:11 -08:00
Jeriko One
5509597dec Check daemon filter against fnamecmp in recv_files(). 2017-12-03 16:13:06 -08:00
Jeriko One
70aeb5fddd Sanitize xname in read_ndx_and_attrs. 2017-12-03 16:13:05 -08:00
Jeriko One
3e06d40029 Check fname in recv_files sooner. 2017-12-03 16:12:28 -08:00
Wayne Davison
416e719bea More archaic-checksum improvements. This makes the len vars clearer
and ensures that only the flist code gets the 2-byte digest len.
2017-11-07 14:01:13 -08:00
Wayne Davison
9f5dc9309d Use the right sum len. 2017-11-07 13:32:10 -08:00
Wayne Davison
b984e9dbd4 Replace startdit|enddit with description for newer yodl.
Fixes bug 13115.
2017-11-05 12:29:14 -08:00
Wayne Davison
c60d9fcab1 Add missing closing paren that Paul Slootman pointed out. 2017-11-05 11:56:52 -08:00
Wayne Davison
47a63d90e7 Enforce trailing \0 when receiving xattr name values.
Fixes bug 13112.
2017-11-05 11:46:09 -08:00
Wayne Davison
bc112b0e7f Use full MD4 len for archaic protocol auth. 2017-10-30 13:34:18 -07:00
Wayne Davison
8a82feeb7c Don't overflow an allocated dest buf when input path is empty.
Fixes bug 13105.
2017-10-29 15:53:28 -07:00
Wayne Davison
0350f95e7b Add an extra argc validation in do_server_sender().
Fixes bug 13104.
2017-10-29 15:52:56 -07:00
Wayne Davison
9a480deec4 Only allow a modern checksum method for passwords. 2017-10-24 20:44:37 -07:00
Wayne Davison
c252546cee Don't forget to tweak sum_update(). 2017-10-24 20:44:20 -07:00
Wayne Davison
7b8a4ecd6f Handle archaic checksums properly. 2017-10-24 15:42:43 -07:00
Wayne Davison
17b849c97a Set our_uid & our_gid values when changed by the daemon.
Fixes bug 10719.
2017-10-09 17:13:00 -07:00
Wayne Davison
276a9836bd Mention --link-dest limit. 2017-10-08 09:30:18 -07:00
Wayne Davison
c140b2e749 Mention refusing delete for write-only. 2017-10-08 09:18:10 -07:00
Wayne Davison
b547302943 Mention -O is forced, not just implied. 2017-10-08 08:52:33 -07:00
Wayne Davison
136c6c7734 Fix double-fuzzy + link-dest issue.
Fixes bug 11866.
2017-10-08 08:39:37 -07:00
Wayne Davison
3fb1634f21 Fix possible buffer overrun for some large name_len values.
Fixes bug 12568.
2017-10-07 17:54:05 -07:00
Wayne Davison
881addc9e1 Add "daemon chroot|uid|gid" parameters.
This allows the daemon to run chrooted as any uid+gid you like
(prior to the transfer possibly changing the chroot and/or the
uid+gid further). Based on the patch in #12817.
2017-09-04 14:20:16 -07:00
Wayne Davison
b7799aaefe Add nanosecond mtime support for Mac OS X.
Slightly tweaked the patch contributed by Heikki Lindholm.
2017-08-31 08:22:14 -07:00
Wayne Davison
ce854cf021 Add "syslog tag" to rsync daemon config. 2017-04-29 13:49:14 -07:00
Wayne Davison
9e7b8ab7cf Don't allow --daemon or --server alias via popt.
Fixes bug 12576.
2017-02-20 11:09:16 -08:00
Wayne Davison
87bc224011 Add a way to specify xattr name filtering. 2017-01-22 16:01:45 -08:00
Wayne Davison
a4e8b552d6 Join some lines. 2017-01-22 15:55:54 -08:00
Wayne Davison
62652202c4 Get rid of some superfluous double-quotes in error messages. 2017-01-22 15:42:36 -08:00
Wayne Davison
001adf5096 Fix extern of preallocated_len w/o SUPPORT_PREALLOCATION. 2016-10-31 09:06:50 -07:00
Wayne Davison
ff66fd4bb6 More fixes for --progress quirks.
This patch avoids inconsistent evaluation of options in the
show_filelist_p() function by turning it into a var.  We
also avoid setting "output_needs_newline" if --quiet was
specified.
2016-10-29 15:26:10 -07:00
Wayne Davison
e02b89d0d3 We need a LF after filelist-progress with a CR.
Fixes bug 12367.
2016-10-29 14:33:44 -07:00
Wayne Davison
d1a1fec134 Use S_BLKSIZE when multiplying st_blocks. 2016-10-15 11:33:07 -07:00
Wayne Davison
f3873b3d88 Support --sparse combined with --preallocate or --inplace.
The new code tries to punch holes in the destination file using newer
Linux fallocate features. It also supports a --whole-file + --sparse +
--inplace copy on any filesystem by truncating the destination file.
2016-10-10 11:53:03 -07:00
Stefan Metzmacher
6e3b2102bc xattrs: maintain a hashtable in order to speed up find_matching_xattr()
As a testcase I've used one directory on gpfs with 1000000 files,
each with an xattr called 'name$i' having a value of 'value$i'.
So we also have 1000000 unique xattrs. The source and dest directories
are already in sync before. So the rsync command is basically a noop,
just verifying that everything is already in sync.

The results before this patchset are:

  [gpfs]# time rsync -a -P -X -q source-xattr/ dest-with-xattr/

  real    8m46.191s
  user    6m29.016s
  sys     0m24.883s

  [gpfs]# time rsync -a -P -q source-xattr/ dest-without-xattr/

  real    1m58.462s
  user    0m0.957s
  sys     0m11.801s

With the patchset I got:

  [gpfs]# time /gpfs/rsync.install/bin/rsync -a -P -X -q source-xattr/ dest-with-xattr/

  real    2m4.150s
  user    0m1.917s
  sys     0m17.077s

  [gpfs]# time /gpfs/rsync.install/bin/rsync -a -P -q source-xattr/ dest-without-xattr/
  real    1m59.534s
  user    0m0.924s
  sys     0m11.599s

It means the time in userspace dropped from 6m29.016s down to 0m1.917s!
Without -X we get ~ 0m0.9s with or without the patch.

Part of a patchset for bug 5324.
2016-08-14 14:37:49 -07:00
Stefan Metzmacher
cc29b94d0f hashtable: add hashlittle() from lookup3.c, by Bob Jenkins
Part of a patchset for bug 5324.
2016-08-14 14:20:19 -07:00
Stefan Metzmacher
6eb71beaff xattrs: introduce a rsync_xa_list struct as layer between two nested item_lists
We have the global 'item_list rsync_xal_l', this maintains an array
of rsync_xa_list structure, one per file.

Each rsync_xa_list structure maintains an array of rsync_xa structure,
while each represent a single xattr with name and value.

Part of a patchset for bug 5324.
2016-08-14 14:20:16 -07:00
Stefan Metzmacher
39d7e3ec25 xattrs: let rsync_xal_store() return ndx.
Part of a patchset for bug 5324.
2016-08-14 13:54:34 -07:00
Stefan Metzmacher
ac97bc14f6 xattrs: add const to empty_xattr
Part of a patchset for bug 5324.
2016-08-14 13:54:34 -07:00
Greg Whiteley
31e93c3228 Makefile: rounding.h generation requires proto.h via rsync.h
Bug 12029 - Makefile missing dep gives parallel race for rounding.h

Signed-off-by: Greg Whiteley <greg.whiteley@gmail.com>
2016-07-20 08:34:26 -07:00
Wayne Davison
a720d81d0a Fix "could not find xattr #1" errors.
The abbreviated-xattr code can get requests that are not in the same
order as the xattr list, so we need to support wrap-around scanning
of the available xattrs. Fixes bug 6590.
2016-06-26 12:06:09 -07:00
Wayne Davison
359758d611 Fix path check when prior_dir_file is NULL. 2016-06-04 11:53:33 -07:00
Wayne Davison
1f83b51d71 Improve the top-level section on include/exclude traversal.
This is my edit of some suggestions by Karl O. Pinc.
2016-05-07 15:55:26 -07:00
Wayne Davison
a5a7d3a297 Add --checksum-choice option to choose the checksum algorithms. 2016-05-01 17:06:54 -07:00
Wayne Davison
4fc78878e0 Tweak indentation only. 2016-05-01 16:29:34 -07:00
Wayne Davison
b973bffa94 If a backup fails (e.g. full disk) rsync should fail.
Fixes bug 11668.
2016-04-17 16:31:57 -07:00
Wayne Davison
d1c80404fe Output "UNKNOWN" if starttime or endtime is -1.
Fixes bug 11382.
2016-04-17 16:11:04 -07:00
Wayne Davison
9a12959ab6 Support only splitting users/groups on commas.
Fixes bug 11817.
2016-04-17 15:56:11 -07:00
Wayne Davison
070c810e2d Tweak non-fatal output when man pages cannot be created. 2016-04-17 11:43:46 -07:00
Wayne Davison
71ec4609eb Fix use of obsolete compile macro.
Fixes bug 11813.
2016-04-17 11:20:38 -07:00
Wayne Davison
0f7db203fb Only output about new backup dirs when requested.
Fixes bug 11812.
2016-04-17 11:06:58 -07:00
Wayne Davison
4e25abc9a9 Fix/improve the sort functions.
Fixes bug 11704.
2016-01-31 14:40:51 -08:00
Wayne Davison
839dbff2aa Add support for comparing nanoseconds on the receiver.
This patch adds the ability to specify --modify-window=-1 (aka -@-1) to
ask rsync to compare files with the full nanosecond timestamps.  The
default is still -@0 for the moment, which ignores nanoseconds in time
comparisons.  Changing the default to -1 would cause a copy from ext4 to
ext3 to constantly compare as different, or a copy there and back again
to do a full copy as it zeroed all the nanosecond times.  Such a change
might be too much of a functional difference for things like backup
solutions to handle without a warning period.  The current plan is to
support nanosecond comparisons for those that want them, and possibly
change the default window value from 0 to -1 at some point in the
future.
2016-01-24 11:16:10 -08:00
Wayne Davison
f6f5ea4173 Prepare the repository for more development. 2016-01-24 11:12:32 -08:00
Wayne Davison
9a37d9cb1e Fix a tweak that should have been untweaked. 2015-12-24 13:09:47 -08:00
Wayne Davison
16b49716d5 Preparing for release of 3.1.2 2015-12-21 12:00:49 -08:00
Wayne Davison
58faa1e8b9 Improve the "use chroot" & "numeric ids" info a bit more. 2015-12-21 11:56:33 -08:00
Wayne Davison
9250e9ac23 Improve the comment a bit more. 2015-12-21 10:54:02 -08:00
Wayne Davison
3623d94fe7 Fix rule for out-of-tree builds.
Fixes bug 11635.
2015-12-18 16:09:58 -08:00
Wayne Davison
cbc42b9c16 Don't allow an empty flag name to --info & --debug. 2015-12-18 14:46:28 -08:00
Wayne Davison
6ff5824c25 Document expand_item_list's args & make sure incr==0 works OK. 2015-12-18 14:41:22 -08:00
Wayne Davison
32de6b7cb4 Fix return of stat info from try_dests_reg().
The try_dests_reg() function could sometimes tweak the stat struct's
info when it should have been left unchanged.  This fixes bug 11545
(where an ACL check of a file that was mistakenly thought to be a
directory failed).
2015-12-05 11:10:24 -08:00
Wayne Davison
bb853b3205 Add -wo option for write-only rrsync mode. 2015-09-13 16:23:54 -07:00
Wayne Davison
cce44865c1 Fixed logging of %b & %c when using --log-file.
The %b and %c escapes were outputting cumulative values when logged via
--log-file only (the bug didn't affect daemon transfer logging or the
output of the client's --out-format info).  Also unified the %b & %c
switch case to make it easier to maintain.  Fixes bug 11496.
2015-09-07 10:07:17 -07:00
Wayne Davison
1983198097 Add support for netbsd in xattrs case.
Closes bug-suggestion 11484.
2015-09-02 12:20:52 -07:00
Wayne Davison
2a7355fb56 Change daemon's gid list to use an "item_list". 2015-08-24 11:54:00 -07:00
Wayne Davison
3da1dc4d18 Add configure option to set max daemon gid list.
Fixes bug 11456.
2015-08-24 10:09:57 -07:00
Wayne Davison
abfb41e63e Avoid creating even the top-level backup dir until needed.
Fixes bug 11423.
2015-08-23 21:58:18 -07:00
Wayne Davison
9d1cd2437c Improve make_path() error return for non-dir element. 2015-08-23 21:55:16 -07:00
Wayne Davison
f8d2ecd223 Preparing for release of 3.1.2pre1 2015-08-08 12:47:35 -07:00
Wayne Davison
453914e35b Update the copyright year. 2015-08-08 12:47:03 -07:00
Wayne Davison
3f26e38f86 Mention latest fixes. 2015-08-08 12:42:13 -07:00
Wayne Davison
81d1ca0683 Don't create so many empty backup dirs.
Fixes bug 10724.
2015-08-08 12:19:42 -07:00
Wayne Davison
289ccbd02f Allow samba.org hostname to be overridden. 2015-08-02 11:15:17 -07:00
Wayne Davison
85d3877be9 Improve mergedir filter handling internals.
Fixes bug 10995.
2015-07-13 10:56:13 -07:00
Wayne Davison
e203245d76 Make sure chk subdir can't diverge in time from its src subdir. 2015-07-12 14:00:45 -07:00
Wayne Davison
dfbcc4f7ec Avoid --remove-sent-file issue for non-regular files. 2015-07-12 13:26:01 -07:00
Wayne Davison
0bcb8b639a Mention local-only effect of --msgs2stderr. 2015-07-12 13:10:05 -07:00
Wayne Davison
77f750f167 Mention how we handle a module named "global". 2015-07-12 10:38:32 -07:00
Wayne Davison
23afe20780 Brant Gurganus's autoconf updates.
This improves some obsolete autoconf macros and increases the minimum
autoconf version from 2.60 to 2.69.  Fixes bug 11369.
2015-07-07 10:37:12 -07:00
Wayne Davison
e12a6c087c Add parent-dir validation for --no-inc-recurse too. 2015-07-04 16:25:23 -07:00
Wayne Davison
6feb7d37df Change "fail" to "test_fail".
Fixes bug 11322.
2015-06-10 15:20:01 -07:00
Wayne Davison
81ff413bb0 Make the checksum_seed a bit harder to predict. 2015-05-11 14:32:45 -07:00
Wayne Davison
eac858085e Add compat flag to allow proper seed checksum order.
Fixes the equivalent of librsync's CVE-2014-8242 issue.
2015-05-11 12:36:20 -07:00
Wayne Davison
2ac35b4507 Pass -I option to aclocal. 2015-05-01 15:17:41 -07:00
Tiziano Müller
3bc319766d Use AS_IF instead of plain if/then/fi 2015-05-01 14:26:21 -07:00
Tiziano Müller
a689fb1f5f Ignore .deps directories. 2015-05-01 14:26:21 -07:00
Tiziano Müller
b560a96b2c Check for perl and assign it to a var since it is needed for generating the protocol header. 2015-05-01 14:26:21 -07:00
Tiziano Müller
51e3c3da85 Remove dead targets from build system 2015-05-01 14:26:21 -07:00
Wayne Davison
461086bbe7 Handle configure's new version style. 2015-05-01 14:26:21 -07:00
Tiziano Müller
00694610a6 Specify package name and version in call to AC_INIT 2015-05-01 14:26:21 -07:00
Tiziano Müller
8e3a6db842 Properly quote arguments for AC_LIBOBJ. 2015-05-01 14:26:21 -07:00
Wayne Davison
8354cad53e Must define LIBOBJDIR in the Makefile. 2015-05-01 14:26:05 -07:00
Tiziano Müller
317a0e8ca5 Use AC_CONFIG_LIBOBJ_DIR and AC_REPLACE_FUNCS to adhere to autoconf standards 2015-04-26 17:54:08 -07:00
Tiziano Müller
066ad8c719 Modularize m4 macros
Split acinclude.m4 into one file per function in m4/
2015-04-26 17:54:06 -07:00
Tiziano Müller
ec4f644d2f Properly quote m4 macro 2015-04-26 16:50:41 -07:00
Wayne Davison
4bf342c60f Update generated-files logic. 2015-04-26 16:50:41 -07:00
Tiziano Müller
a2f733c664 Rename aclocal.m4 to acinclude.m4 and add make target
It is common practice to split up m4 files for easier maintenance and
generate the required aclocal.m4 using `aclocal` instead.
2015-04-26 16:50:16 -07:00
Stefan Behrens
3ea74eb388 rsync: fix of-by-one in check of snprintf() result.
Fixes bug 11229.
2015-04-22 10:31:04 -07:00
Wayne Davison
962f8b9004 Complain if an inc-recursive path is not right for its dir.
This ensures that a malicious sender can't use a just-sent
symlink as a trasnfer path.
2014-12-31 13:48:42 -08:00
Wayne Davison
ae189e18de Mention that --append can be dangerous. 2014-12-31 13:10:46 -08:00
Wayne Davison
5b34561cf7 Call set_modtime even if only NSEC is different. 2014-12-31 13:10:37 -08:00
Wayne Davison
5546dab329 Use usleep() for msleep() if it is available. 2014-11-27 12:02:56 -08:00
Wayne Davison
6128f56694 Add a missing closing paren. 2014-10-10 14:15:11 -07:00
Wayne Davison
743f5a30d5 Prepare the repository for more development. 2014-09-06 11:00:52 -07:00
Wayne Davison
a955e93316 Mention DRY RUN in --debug=exit output. 2014-09-06 10:47:13 -07:00
Wayne Davison
aca7dd3bff Adding the long options that BackupPC likes to use. 2014-09-04 13:44:50 -07:00
Wayne Davison
bc55aa04df Set GIT_MERGE_AUTOEDIT=no in the environment. 2014-07-31 15:59:32 -07:00
Wayne Davison
f438d5abe0 Match latest git's repo branch message. 2014-07-31 14:52:30 -07:00
Wayne Davison
6fe798392b Match latest git's repo status messages. 2014-07-31 14:47:09 -07:00
Wayne Davison
6ceb9ea012 Remove superfluous ${INSTALL_STRIP} uses. 2014-07-31 14:39:09 -07:00
Wayne Davison
6900d35cce Fix a typo. 2014-07-31 14:38:16 -07:00
Wayne Davison
7cb0de6326 Preparing for release of 3.1.1 2014-06-22 09:50:03 -07:00
Wayne Davison
61e74afc42 Add a clarification about shell wildcard expansion. 2014-06-22 09:41:17 -07:00
Wayne Davison
0466e46b9f Make sure the link() destination file doesn't exist. 2014-06-22 09:04:24 -07:00
Wayne Davison
aa4c6db043 Make sure cmp_time() doesn't mess up due to a time_t overflow.
Fixes bug 10643.
2014-06-15 17:53:34 -07:00
Wayne Davison
edb0d9c792 Updated NEWS & tweaked a comment. 2014-06-14 09:55:37 -07:00
Wayne Davison
6ffd8f2169 Put zlib and popt -I options early in the CFLAGS. 2014-06-14 09:48:56 -07:00
Wayne Davison
ba43e88527 Fix hard-link bugs when receiver isn't capable.
If the receiving side cannot hard-link symlinks and/or special files
(including devices) then we now properly handle incoming hard-linked
items (creating separate identical items).
2014-06-13 16:05:08 -07:00
Wayne Davison
ff08acd4f2 Added a flag to disable xattr hlink optimization.
I added a compatibility flag for protocol 31 that will let both sides
know if they should be using the xattr optimization that attempted to
avoid sending xattr info for hardlinked files.  Since this optimization
was causing some issues, this compatibility flag will ensure that both
sides know if they should be trying to use the optimization or not.
2014-06-08 10:42:14 -07:00
Wayne Davison
03bb593f81 I missed this tweak in the undo of a prior xattr optimization. 2014-06-08 10:21:27 -07:00
Wayne Davison
4c8eb5f951 Preparing for release of 3.1.1pre2 2014-05-26 15:42:03 -07:00
Wayne Davison
f491d17352 Mention all the latest changes in the NEWS. 2014-05-26 14:08:31 -07:00
Wayne Davison
288e64a79f Avoid an xattr-finding glitch on the receiver.
Fixes bug 9594.
2014-05-26 14:08:31 -07:00
Wayne Davison
0872dff60c Add new-compress option to rrsync. 2014-05-26 12:13:01 -07:00
Wayne Davison
3ce7a65c11 Make --omit-dir-times avoid early-create directories. 2014-05-25 16:43:14 -07:00
Wayne Davison
de8ec0b309 Exit with a partial-transfer error for a sender-remove failure. 2014-05-25 16:00:13 -07:00
Wayne Davison
677c6e14cc Check for attr lib. 2014-05-05 09:25:13 -07:00
Wayne Davison
7665ba5b36 Fix usermap/groupmap parsing of MIN-MAX IDs. 2014-04-30 12:34:15 -07:00
Wayne Davison
adc600cbe2 Check F_IS_ACTIVE() in a few more spots.
The code needs to ignore flist entries that were marked inactive (by
either duplicate removal or empty-dir pruning) in a few more spots.
2014-04-20 14:41:54 -07:00
Wayne Davison
43d6d0c5ba Change args to file_checksum() to prepare for future changes. 2014-04-19 16:26:35 -07:00
Wayne Davison
22a3ac0b55 Add new-style compression that skips matching data.
Adding new-style compression that only compresses the literal data that
is sent over the wire and not also matching file data that was not sent.
This new-style compression is compatible with external zlib instances,
and will eventually become the default (once enough time has passed that
all servers support the --new-compress and --old-compress options).

NOTE: if you build rsync with an external zlib (i.e. if you specified
configure --with-included-zlib=no) you will ONLY get support for the
--new-compress option!  A client will treat -z as uncompressed (with a
warning) and a server will exit with an error (unless -zz was used).
2014-04-19 12:18:19 -07:00
Wayne Davison
1524c2e5c7 Expand the backslash description a bit more in excludes. 2014-04-19 10:16:00 -07:00
Wayne Davison
0dedfbce2c Avoid infinite wait reading secrets file. 2014-04-13 13:51:36 -07:00
Wayne Davison
4cad402ea8 Receiver now rejects invalid filenames in filelist.
If the receiver gets a filename with a leading slash (w/o --relative)
and/or a filename with an embedded ".." dir in the path, it dies with
an error (rather than continuing). Those invalid paths should never
happen in reality, so just reject someone trying to pull a fast one.
2014-04-13 10:36:59 -07:00
Wayne Davison
306d112730 Mention how "max verbosity" affects info & debug opts. 2014-03-07 23:47:40 -08:00
Wayne Davison
371242e4e8 Have receiver strip bogus leading slashes on filenames.
If the receiver is running without --relative, it shouldn't be receiving
any filenames with a leading slash.  To ensure that the sender doesn't
try to pull a fast one on us, we now make flist_sort_and_clean() strip a
leading slash even if --relative isn't specified.
2014-03-02 16:47:01 -08:00
Wayne Davison
e1bfdf67f3 Avoid the use of an extra leading dot when using --temp-dir. 2014-02-26 14:00:10 -08:00
Wayne Davison
3fe686b577 Explicitly mention that dirs aren't affected by --update. 2014-02-24 11:30:07 -08:00
Wayne Davison
783611707b Include a systemd file that some distros might want. 2014-02-24 10:19:14 -08:00
Wayne Davison
cd909fde87 Fix --info=progress2 info as a file is transferred.
Applying Anish Shankar's patch to fix speed and stats of files as they
are transferred.  Fixes bug 10450.
2014-02-24 10:07:18 -08:00
Wayne Davison
4dfe7c9f3e Improve the *.spec file a bit. 2014-01-27 09:57:28 -08:00
Wayne Davison
7fb4c08c24 Use the patch's list of generated files for each patch. 2014-01-27 09:18:03 -08:00
Wayne Davison
8946cfc6f8 Preparing for release of 3.1.1pre1 2014-01-26 09:32:43 -08:00
Wayne Davison
dfa5b49110 Bump the year to 2014. 2014-01-26 09:29:15 -08:00
Wayne Davison
1bf6203616 More NEWS improvements. 2014-01-26 09:21:47 -08:00
Wayne Davison
a3f852bd78 Fix "unchanged" protocol designation. 2014-01-19 19:44:30 -08:00
Wayne Davison
72e7fb5b92 Mention the latest NEWS items. 2014-01-19 15:24:07 -08:00
Wayne Davison
740551d657 Undo the hard-link xattr optimization in 78286a03.
I'm backing out the xattr optimization that was put in to try
to make xattr data sending more optimal on hard-linked files.
The code was causing hard-to-reproduce bugs, and it's better to
get things done fully & correctly over fully optimally.
2014-01-19 14:59:43 -08:00
Wayne Davison
a106ed78d5 Fix the leaving of a temp file w/o partial-file saving.
Fixed bug 10350.
2014-01-19 14:35:05 -08:00
Wayne Davison
bba31ddf12 Avoid ACL and/or xattr lookups on IS_MISSING_FILE() entries.
Fixes bug 10381.
2014-01-19 12:24:01 -08:00
Wayne Davison
31825a94b3 Add IS_MISSING_FILE(statbuf) macro. 2014-01-19 12:23:39 -08:00
Wayne Davison
5dcef7c6dd Adding IVAL64() and SIVAL64(). 2014-01-19 12:02:38 -08:00
Wayne Davison
72e0c45078 Handle more x86 hosts w/o resorting to CAREFUL_ALIGNMENT. 2014-01-19 11:48:14 -08:00
Wayne Davison
0593471e99 We really depend on autoconf 2.60 these days. 2014-01-02 10:56:03 -08:00
Wayne Davison
1b29458ea4 Adding rsync-no-vanished script for bug 10356. 2014-01-01 10:35:08 -08:00
Wayne Davison
d3414a7d23 Warn about lack of yodl2man at end of configure run. 2014-01-01 10:03:45 -08:00
Wayne Davison
9e2e7a1b2d Restoring use of socketpair on cygwin.
Use of socketpair is much faster on cygwin, and some folks report fewer
hangs using the modern socketpair implementation vs pipes.
2013-12-25 14:20:53 -08:00
Wayne Davison
d34eaa8183 Use 0 (not NULL) for a non-pointer arg. 2013-12-25 14:19:30 -08:00
Wayne Davison
b4ea93c676 Try to fix bug 7865 for some acl() EINVAL results. 2013-12-25 10:18:41 -08:00
Wayne Davison
6df5d81ce2 Fix a few issues with make_path().
The make_path() utility function was not returning the right status
when --dry-run was used, so I added some stat() checking that only
happens for -n.  I also noticed that the function was not handling
the case where the whole path needed to be created, so I fixed that.
Fixes bug 10209.
2013-12-23 10:30:28 -08:00
Wayne Davison
0e3152febd Change owner+group before setting xattrs to avoid xattr loss.
Fixes bug 10163.
2013-12-23 09:49:17 -08:00
Wayne Davison
e9398b1dc5 Fix a typo that Stefan Beller pointed out. 2013-12-14 16:25:18 -08:00
Wayne Davison
83792c1cbf A delete_item() error should use FERROR_XFER.
Fixes bug 10024.
2013-12-01 15:58:17 -08:00
Wayne Davison
32540aa091 Tweak log_delete() to send MSG_DELETED more.
If the client is the sender and it is wanting to log deletes, the
current generator code neglects to send MSG_DELETED to the client side
unless some delete verbosity is enabled.  With this new version on the
generator side, the logfile will now mention deletes, even if the
sending (client) side is an older rsync.  Fixes bug 10182.
2013-11-28 11:13:05 -08:00
Wayne Davison
836e0c5df4 Create and use write_bigbuf() function for extra-large buffer sizes. 2013-11-25 13:12:35 -08:00
Wayne Davison
2cd87086f0 Use chunked xattr reading in OS X sys_lgetxattr(). 2013-11-25 13:12:09 -08:00
Wayne Davison
eaa4e2d1ee Fix itemize bug with --link-dest, -X, and -n.
When running with --*-dest & -X, some alt-dest-found files would not
use the right name when looking up old attrs in itemize(), causing a
weird error for a --dry-run copy.  Fixes bug 10238.
2013-11-25 09:18:18 -08:00
Wayne Davison
e461cefbab Avoid useless keepalive msgs that would kill an older rsync.
This fix avoids the sending of keep-alive messages from the receiver
to the sender when we are still sending the file list (at which time
an older rsync would die if it received such a keep-alive message).
The messages aren't actually needed, since we haven't forked yet, and
the single flow of data keeps the procs alive.
2013-11-10 16:15:39 -08:00
Wayne Davison
18217a94c4 Fix timeout checking in safe_read(). 2013-11-09 10:49:59 -08:00
Wayne Davison
090ef59b29 Change safe_read() to select() before reading. 2013-11-09 10:32:44 -08:00
Wayne Davison
708db6f772 Git rid of uneeded extern. 2013-10-27 11:26:29 -07:00
Wayne Davison
63f9197611 Return an error if a buffer overflows in do_mknod(). 2013-10-27 10:12:53 -07:00
Wayne Davison
f643330eb1 Restore sending of "-ef" marker to the server. 2013-10-27 09:49:16 -07:00
Wayne Davison
bc0d094d2a Don't use comma_num() in FLOG output. 2013-10-27 09:48:57 -07:00
Wayne Davison
64dff88db9 Don't forget about --debug and --info for rrsync. 2013-10-04 14:10:44 -07:00
Wayne Davison
637ebad048 A few more new options that rsync 3.1.0 can pass. 2013-10-04 13:59:04 -07:00
Wayne Davison
487bf9290c Prepare repository for more development. 2013-10-03 10:45:49 -07:00
Wayne Davison
bc58313bf7 Preparing for release of 3.1.0 2013-09-28 13:55:54 -07:00
Wayne Davison
de78297b61 Remove unused var. 2013-09-28 13:53:23 -07:00
Wayne Davison
9c7d755dfe Flush write buffer on an aborted in-place transfer. 2013-09-28 10:40:27 -07:00
Wayne Davison
60cc5d4b78 Mention latest news. 2013-09-16 09:23:35 -07:00
Wayne Davison
1220c93a99 Fix the visit-all-patches path. 2013-09-16 09:16:30 -07:00
Wayne Davison
7d7538d43c Fix error in write_sparse() on incomplete write.
Fix a problem where sparse_seek could get left non-zero when we
did not finish writing all the data that would take us to that
sparse gap.  Issue pointed out by David Taylor.
2013-09-16 09:02:46 -07:00
Wayne Davison
de94193353 Remove bypassed checksums in --inplace to improve speed.
When checking a checksum that refers to a part of an --inplace file that
has been overwritten w/o getting SUMFLG_SAME_OFFSET set, we remove the
checksum from the list.  This will speed up files that have a lot of
identical checksum blocks (e.g. sequences of zeros) that we can't use
due to them not getting marked as being the same.  Patch provided by
Michael Chapman.
2013-08-03 09:59:38 -07:00
Wayne Davison
05fce6582a Preparing for release of 3.1.0pre1 2013-07-28 10:36:43 -07:00
Wayne Davison
62327b1281 We need a trailing dot when using --server --daemon. 2013-07-12 15:28:54 -07:00
Wayne Davison
99c9520ea7 Look for REMOTE_HOST before SSH_* environment options. 2013-07-12 15:24:58 -07:00
Wayne Davison
01959d6387 Set DESTDIR for make install. 2013-06-23 15:47:09 -07:00
Wayne Davison
807f3a44ba Mention latest changes. 2013-06-16 16:59:24 -07:00
Wayne Davison
2791e0b542 Be a little clearer about full-line comments. 2013-06-16 16:43:14 -07:00
Wayne Davison
d6a7ed99c1 Get GPL name right. 2013-06-16 16:36:27 -07:00
Wayne Davison
4066d61a9d Mention right option when using --delete-delay. 2013-06-16 16:33:32 -07:00
Wayne Davison
70d4a945f7 Support rsync daemon over SSL via stunnel.
Added the client rsync-ssl script and various client/daemon support
files needed for talking to an rsync daemon over SSL on port 874 (no
tls support).  This uses an elegant stunnel setup that was detailed
by dozzie (see the resources page) now that stunnel4 has improved
command-spawning support.  Also incorporates some tweaks by devzero
(e.g. the nice no-tmpfile-config client-side code) and a few by me
(including logging of the actual remote IP that came in to the
stunnel process).  This probably still needs a little work.
2013-06-15 16:40:10 -07:00
Wayne Davison
0488a14b99 Fix "make check". 2013-06-11 18:06:53 -07:00
Wayne Davison
a213d1cd6e Move some code from util.c to util2.c and add sum_as_hex(). 2013-06-11 13:36:44 -07:00
Wayne Davison
fc2d6fabe7 Set number_separator the first time it gets used. 2013-06-11 13:28:45 -07:00
Wayne Davison
a508e88fcf More NEWS changes. 2013-06-09 22:28:24 -07:00
Wayne Davison
f0da824237 Upgrading zlib to 1.2.8. 2013-06-09 22:27:33 -07:00
Wayne Davison
b74250037c Rename lsh.pl -> lsh. 2013-06-09 19:40:56 -07:00
Wayne Davison
f93094fa9f Rename lsh -> lsh.sh. 2013-06-09 19:40:56 -07:00
Wayne Davison
baf382d62e Updating NEWS with the latest changes. 2013-06-09 16:02:19 -07:00
Wayne Davison
12505e02b1 Allow --password-file=- for a stdin-supplied password. 2013-06-09 12:11:53 -07:00
Wayne Davison
d6df07392e Fix module-name splitting with --protect-args.
Fixes bug 8838.
2013-06-02 15:54:48 -07:00
Wayne Davison
d9ca1e4990 Tweak --checksum-seed docs. 2013-06-02 13:14:27 -07:00
Wayne Davison
0ab8e166f4 Avoid preallocation on inplace file that is already long enough. 2013-06-02 12:37:48 -07:00
Wayne Davison
1e9ee19a71 Look for got_kill_signal in a couple more spots. 2013-05-28 12:59:47 -07:00
Wayne Davison
9bf065860f Improve logic of code vs exit_code (etc.) in cleanup. 2013-05-26 16:23:37 -07:00
Wayne Davison
5b46454364 Forward a MSG_ERROR_EXIT value to generator too.
Fixes bug 9882.
2013-05-26 16:23:37 -07:00
Wayne Davison
d4070db631 Avoid I/O via signal-handler thread.
The cleanup code will try to flush the output buffer in some
circumstances, which is not valid if we're handling an async signal
(since it might have interrupted some partial I/O in the main thread).
These signals now set a flag and try to let the main I/O handler take
care of the exit strategy.  Fixes a protocol error that could happen
when trying to exit after a kill signal.
2013-05-26 16:22:56 -07:00
Wayne Davison
cb784f18ec Improve iconvbufs() to do more buffer size checks.
- If iconv() returns EINVAL or EILSEQ and the error is being ignored, make
  sure that there is room in the output buffer to store the erroneous char.
- When accepting an erroneous char, be sure to break if there are no more
  input characters (without calling iconv() with a zero input length).
2013-05-19 23:56:34 +00:00
Wayne Davison
2dc2070992 Fix msleep() if time goes backwards. Fixes bug 9789. 2013-05-19 22:55:08 +00:00
Wayne Davison
4442f8037b Fixed unused variable warnings in free_stat_x. 2013-05-19 22:01:29 +00:00
Wayne Davison
333e3a9ff0 Add an implementation of getpass for systems that lack one. 2013-05-19 22:01:29 +00:00
Wayne Davison
94073d20e4 Use S_IXUSR instead of the now-obsolete S_IEXEC. 2013-05-19 22:01:29 +00:00
Wayne Davison
750ec9bcdc Updated to the version dated 2013-04-24. 2013-05-19 22:01:07 +00:00
Wayne Davison
7fdba7aaf8 Updated to the version dated 2013-05-16. 2013-05-19 22:00:44 +00:00
Wayne Davison
eec26089b1 Improve description of --max-delete. 2013-01-20 11:30:08 -08:00
Wayne Davison
76340ea44c Fix weird error in test programs on SunOS. 2013-01-19 12:07:38 -08:00
Wayne Davison
7e1a9c4d79 Update copyright year. 2013-01-19 11:05:53 -08:00
Wayne Davison
16a9883649 Update OLDNEWS with 3.0.9 info. 2013-01-19 11:05:15 -08:00
Wayne Davison
bd7d36cc6c Free ACL/xattr info in try_dests_reg() loop. 2013-01-19 10:25:18 -08:00
Wayne Davison
d42e7181d5 Add free_stat_x() inline function. 2013-01-19 10:25:18 -08:00
Wayne Davison
c03bb3d181 Further improve non-empty-destination --link-dest behavior:
- Avoid relinking a file that is already linked correctly.
- Avoid trashing the stat buffer of an existing file in try_dests_reg().
2013-01-19 10:24:46 -08:00
Wayne Davison
cee326436c Remove -3 return from try_dests_reg() again -- let it do a local copy
when the dest file is unlinked and the hard link fails.
2013-01-19 09:08:39 -08:00
Wayne Davison
0ae92567ed Align fileio's map_ptr() reads. Fixes bug 8177. 2013-01-18 15:30:08 -08:00
Wayne Davison
42f759ad9a Reformat a few things for wider lines. 2013-01-18 15:20:43 -08:00
Wayne Davison
e1ded58983 Improve handling of existing files for alt-dest opts.
Fixes bug #5644.
2013-01-18 11:57:49 -08:00
Wayne Davison
0bacaccee6 Perl version of lsh that can change user w/o sudo. 2012-10-07 16:33:30 -07:00
Wayne Davison
d46f8314b6 Fix bogus "vanished file" with "./" prefixes.
Fixes bug 9212.
2012-10-07 10:47:58 -07:00
Wayne Davison
7cefbf106f Fix indentation that used expanded tabs. 2012-10-03 15:20:43 -07:00
Wayne Davison
f143b55ef1 Avoid an unused variable warning if no setvbuf. 2012-09-23 12:03:19 -07:00
Wayne Davison
ee51a745c1 Make read_args() return the full request.
When a daemon is sent multiple request args, they are now joined into a
single return value (separated by spaces) so that the RSYNC_REQUEST
environment variable is accurate for any "pre-xfer exec".  The values
in RSYNC_ARG# vars are no longer truncated at the "." arg, so that all
the request values are also listed (separately) in RSYNC_ARG#.
2012-09-23 11:15:36 -07:00
Wayne Davison
0d34fbdf5a Make daemon listener exit w/code 0 on SIGTERM. 2012-06-16 10:31:14 -07:00
Wayne Davison
d51a3adb4f Set the modtime to 0 on a partial file.
Fixes debian bug 624826.
2012-05-05 08:01:09 -07:00
Wayne Davison
b55115ec6f Fix --only-write-batch hang with --hard-links.
Fixes bug 8565.
2012-01-28 12:04:26 -08:00
Wayne Davison
f5e2b8f803 Add a slash-stripping version of rsync in support dir. 2012-01-28 10:42:01 -08:00
Wayne Davison
41c5ba641f flist->in_progress is only needed w/inc_recurese. 2012-01-28 10:42:01 -08:00
Wayne Davison
0dfd2a64ec Make stderr line-buffered w/--msgs2stderr. 2012-01-28 10:42:01 -08:00
Wayne Davison
6686b93a7a Add new --outbuf=N|L|B option. 2012-01-28 10:41:58 -08:00
Wayne Davison
9510fa9ab8 Allow --max-size=0 and --min-size=0.
Fixes bug 7965.
2011-12-24 12:35:37 -08:00
Wayne Davison
d74512eb05 Complain if the --block-size=N value is too large.
Fixes bug 8036.
2011-12-24 12:35:37 -08:00
Wayne Davison
1a2704512a Improve the handling of verbose/debug messages
The sender no longer allows a filelist to be sent in the middle of
parsing an incoming message, so that the directory sending doesn't block
all further input reading.  The generator no longer allows recursive
reading of info/error messages when it is waiting for the message buffer
to flush.  This avoids a stack overflow when lots of messages are coming
from the receiver and the sender is not reading things quickly enough.
The I/O code now avoids sending debug messages that could mess up the
I/O buffer it was in the middle of tweaking.  This fixes an infinite
loop in reduce_iobuf_size() with high levels of debug enabled.  Several
I/O-related messages were changed to output only when --msgs2stderr is
enabled.
2011-12-21 12:14:49 -08:00
Wayne Davison
a3b62ff4cf Avoid double-free of xattr/acl data in real_sx.
Fixes bug 8665.
2011-12-16 09:07:19 -08:00
Wayne Davison
60ef397057 Mention that %a and %h are daemon-only escapes. 2011-11-24 07:55:11 -08:00
Wayne Davison
89e049ad7f Another asprintf() return-value-check tweak. 2011-11-23 13:14:35 -08:00
Wayne Davison
036094d30e Committing missed manpage tweak. 2011-11-23 12:36:50 -08:00
Wayne Davison
48b51d0004 make repeated --fuzzy option look into alt-dest dirs. 2011-11-23 12:29:25 -08:00
Wayne Davison
7da17144fd Add compatibility with an unmodified zlib. 2011-11-21 09:22:14 -08:00
Wayne Davison
cbdff74b44 Fix --compress data-duplication bug. 2011-11-21 09:17:17 -08:00
Wayne Davison
37a729768b Fix version expansion. 2011-11-21 09:10:49 -08:00
Wayne Davison
8dd6ea1f1e Fix --delete-missing-args when --relative is active. 2011-10-22 10:24:54 -07:00
Wayne Davison
7c8f180900 Test asprintf() failure with < 0, not <= 0. 2011-10-08 09:16:43 -07:00
Wayne Davison
3527677043 Let's cast getpid() to an int instead of a long for snprintf(). 2011-10-08 09:15:36 -07:00
Wayne Davison
fd91c3b666 Fix two unused-variable compiler warnings. 2011-09-22 23:37:07 -07:00
Wayne Davison
15df927ae2 Fix xattr memory leak. Fixes bug 8475. 2011-09-22 09:13:31 -07:00
Ben Walton
8adceeb2b3 Testsuite/dir-sgid: use symbolic mode to set sgid bit
The chmod on Solaris (9 and 10) cannot set the sgid bit on a directory
using absolute mode, so use symbolic mode.  Avoids a skipped test.
2011-09-22 08:28:07 -07:00
Wayne Davison
0c7fdf705e Add solaris xattr support to the tests.
Change the xattr case statements to use $HOST_OS.
(Slightly tweaked version of a Ben Walton patch.)
2011-09-20 13:24:42 -07:00
Wayne Davison
439d5d8929 Better fakeroot support helps Solaris. 2011-09-20 13:17:42 -07:00
Wayne Davison
de219101ed Change stat order for better ELOOP determination. 2011-09-20 13:02:12 -07:00
Wayne Davison
79853c30c0 Be sure to use STRUCT_STAT. 2011-09-20 12:54:06 -07:00
Wayne Davison
953feeadd2 Make do_readlink() support fake-super w/o O_NOFOLLOW. 2011-09-19 09:29:00 -07:00
Wayne Davison
3417881d5c Make --delete-excluded work better with --filter=merge. 2011-09-15 07:52:38 -07:00
Wayne Davison
397fb1acd2 When modifying PATH, export it (for Solaris). 2011-09-15 07:32:07 -07:00
Wayne Davison
db0443cf90 Added "SORTED TRANSFER ORDER" manpage section. 2011-09-13 16:04:21 -07:00
Wayne Davison
d5bff8ffe2 Cleanup some manpage & --help info. 2011-09-13 15:30:40 -07:00
Wayne Davison
a7d7f52ae0 Use "|| true" in our xattr test runs. 2011-09-13 08:07:31 -07:00
Wayne Davison
847ddaf071 Make sure other early exit calls can't hang in noop_io_until_death(). 2011-09-12 17:56:23 -07:00
Wayne Davison
c4c5dc68b9 Improve the usage for --help. 2011-09-11 22:46:57 -07:00
Ben Walton
c4170cbaac Better configure support for Solaris xattrs
If we have the attropen() function, allow OS conditional enabling of
extended attribute support.  This removes the need to pass
--enable-extended-attributes to force the feature activation on Solaris.
2011-09-11 18:48:52 -07:00
Wayne Davison
de407c03d2 Fix a potential hang on an empty file list.
Fixes bug 8423.
2011-09-11 11:08:14 -07:00
Wayne Davison
c1005fb256 Document --msgs2stderr. 2011-09-11 11:01:04 -07:00
Wayne Davison
70c4bfb770 Error out if --password-file specifed and it fails.
Fixes bug 8440.
2011-09-06 21:22:22 -07:00
Wayne Davison
a470b675af Dirs need +rx as well as +w for non-super xfers.
Fixes bug 8242.
2011-09-03 12:41:22 -07:00
Wayne Davison
5561c14978 Move implied_dot_dir=1, just to be safe. 2011-08-27 14:58:20 -07:00
Wayne Davison
865efe9456 Fix sending of "." attributes for implied-dot-dir. 2011-08-27 12:05:07 -07:00
Wayne Davison
18749579b5 Fix bwlimit multiplication overflow. Fixes bug 8375. 2011-08-27 12:05:07 -07:00
Wayne Davison
a05758fde6 Some option-parsing clarifiation in the intro. 2011-08-27 12:04:45 -07:00
Wayne Davison
fb0d4403f0 Fix misplaced parens on getnameinfo() call. 2011-08-06 11:21:40 -07:00
Wayne Davison
3fd0357f9f Ignore socketpair() on cygwin. Fixes bug 8356. 2011-08-06 11:19:00 -07:00
Wayne Davison
64fa23add9 Tweak includes to fix non-defined NULL on some systems. 2011-07-31 23:31:24 -07:00
Wayne Davison
0a77adee0b Fix Minix build errors. Fixes bug 8313. 2011-07-22 11:17:57 -07:00
Wayne Davison
0a04a80d9f Replace another inet_ntop() call with getnameinfo(). 2011-07-16 16:16:04 -07:00
Wayne Davison
7ae666d2a7 Add more connect debug info, as Carlos suggested. 2011-07-12 16:02:31 -07:00
Wayne Davison
fbf4c261f4 Move freeaddrinfo() call after failure-reporting loop. 2011-07-11 18:15:51 -07:00
Wayne Davison
425747c2f3 Fix a comment. 2011-07-04 16:32:06 -07:00
Wayne Davison
03cd1ae4fa Handle FES_NO_SEND properly on a hard-linked file.
Fixes bug 8246.
2011-07-04 16:13:45 -07:00
Wayne Davison
01580c794a Fix #ifdef in unchanged_attrs(). Fixes bug 8268. 2011-06-26 09:52:47 -07:00
Wayne Davison
a59a7b2423 Fix reading side of fake-symlink bug 7109. 2011-06-18 13:42:30 -07:00
Wayne Davison
5bfe006882 Make daemon-exclude errors more error-like.
Fixes bug 7765.
2011-06-18 12:44:26 -07:00
Wayne Davison
852585b1fc Check if sender file changed before allowing a remove.
Fixes bug 7691.
2011-06-18 12:29:21 -07:00
Wayne Davison
e2c1e482e0 Set NO_SYMLINK_USER_XATTRS on linux. Fixes bug 7109. 2011-06-18 10:12:47 -07:00
Wayne Davison
4591bb2f66 Only skip deletions on IOERR_GENERAL. Fixes bug 7809. 2011-06-04 13:04:46 -07:00
Wayne Davison
810dc9fc2a Don't force \(em in the manpages. Fixes bug 7941. 2011-06-04 12:53:10 -07:00
Wayne Davison
d80f7d6cc3 Add a colon if a non-empty pre-xfer exec message follows. 2011-06-04 12:12:49 -07:00
Wayne Davison
e3bc529de9 Handle EINTR when reading the pre-xfer exec message. 2011-06-04 12:08:18 -07:00
Wayne Davison
820f7a7b57 Send error messages from pre-xfer exec script to the user. 2011-06-04 10:46:22 -07:00
Wayne Davison
a131954b7b Linux needs symlink xattrs. Fixes bug 8201. 2011-06-04 09:47:24 -07:00
Wayne Davison
f187ce36cc We need VA_COPY() defined more. Fix dangling #endif. 2011-05-30 12:48:04 -07:00
Wayne Davison
2fff0a4f28 Merge latest samba version to get va_end() fixes, etc. 2011-05-30 10:24:57 -07:00
Wayne Davison
cb0db58fb3 Fix unwritable directory issue due to misordered chmod call. 2011-05-30 08:24:27 -07:00
Wayne Davison
582aead623 Expand NO_ENTRY items from fake-super ACLs in get_rsync_acl(). 2011-05-25 08:59:47 -07:00
Wayne Davison
d518e02243 Use a union for idlist's name/max_id value. Fixes bug 8137. 2011-05-16 18:24:34 -07:00
Wayne Davison
b9cc2d4c86 Explicitly mention spaces in the "path" setting. 2011-05-16 11:34:15 -07:00
Wayne Davison
ac30d22ae5 Check for linux/falloc.h header file. 2011-05-16 08:26:40 -07:00
Wayne Davison
8bcd6a4aff Abort if the cd fails. 2011-05-07 13:01:21 -07:00
Wayne Davison
58663df432 Turn empty remote args into dot dirs. 2011-05-07 12:42:16 -07:00
Wayne Davison
da7acc5e42 Make --files-from allow a missing trailing arg w/--server. 2011-05-07 12:16:50 -07:00
Wayne Davison
54d13604fa Mention the number of child args. 2011-05-07 12:11:56 -07:00
Wayne Davison
3ed84dbc98 Don't die if man-copy fails. 2011-04-28 18:50:21 -07:00
Wayne Davison
0308092914 Handle non-srcdir man copying when yodl isn't installed. 2011-04-28 16:41:03 -07:00
Wayne Davison
a13d3b3d77 Avoid adding a slash to path '/'. 2011-04-22 16:06:15 -07:00
Wayne Davison
813d5a25e3 Fix a potential crash when trying to find a better block match. 2011-04-22 16:06:06 -07:00
Wayne Davison
591c224584 Improve lsh's handling of -l user option w/cd. 2011-04-09 08:51:26 -07:00
Wayne Davison
b223d96bf0 Add some temp-name dot heuristics for OS X's sake.
- Drop one leading '.' from the filename (before adding our own).
 - Drop one trailing '.' from a (possibly truncated) name prior to
   the .XXXXXX suffix being added.
 - Allow the temp-name to collapse to just the .XXXXXX suffix
   if the path is long enough to require that.

Note that we don't try to remove multiple dots from a filename
that actually has multiple consecutive dots, since we might as
well learn early if the final name is going to fail or not.
2011-04-05 13:35:13 -07:00
Wayne Davison
28b519c93b Applying the preallocate patch. 2011-04-04 21:57:57 -07:00
Wayne Davison
8686d3abba Move var declaration for older C compilers. 2011-04-03 18:02:45 -07:00
Wayne Davison
73b9b90a0b Adding release info for 3.0.8 to the trunk. 2011-03-26 14:50:52 -07:00
Wayne Davison
98ec67d786 Verify the module list output of the daemon-via-ssh check. 2011-03-26 11:07:27 -07:00
Wayne Davison
0de5157564 Tweak dir xattrs after the writability fudging. 2011-03-26 10:19:04 -07:00
Wayne Davison
78286a03d1 Avoid re-setting (and sending) xattrs on a hard-linked file w/the same xattrs.
Improved the xattrs testing to include hard-linking.
2011-03-26 10:09:20 -07:00
Wayne Davison
d699d815d6 Enhance the -liconv check for OS X. Fixes bug 8018. 2011-03-20 19:33:28 -07:00
Wayne Davison
e5e6d3c410 Get the branch set right before listing names and handling --delete. 2011-03-19 16:34:37 -07:00
Wayne Davison
016ce71568 Make it possible to create a new patch file while on a patch branch. 2011-03-19 16:29:47 -07:00
Wayne Davison
2792a83d58 Don't send user/group names for ACLs with --numeric-ids.
Fixes bug 8020.
2011-03-18 14:59:03 -07:00
Wayne Davison
0b67d5e396 Fix xattrs test on OS X. 2011-03-13 20:48:18 -07:00
Wayne Davison
d52aeae4e9 Improve the &merge/&include example explanation. 2011-03-11 17:39:33 -08:00
Wayne Davison
f7c3a25052 Change rsyncd.conf &merge directive to match *.inc.
This allows the same rsyncd.d directory to be used for a set
of merge files (*.inc) and a set of include files (*.conf).
2011-03-11 16:13:33 -08:00
Wayne Davison
6da6b02bb7 Suggest a better solution for a make without wildcard support. 2011-02-26 08:12:28 -08:00
Wayne Davison
da9b72b36c Clarify what extraneous hard link are. 2011-02-23 07:19:52 -08:00
Wayne Davison
75a1a04847 Get rid of obsolete tempfs warning. 2011-02-22 15:37:26 -08:00
Wayne Davison
eee2c77a93 Some uid/gid fixes for (id_t)-1 and other large ID values.
The code now avoids any special internal meaning for uid/gid -1, which
allows it to be mapped to a better value (use 4294967295 instead of -1
as the ID to map).  Replaced atol() with something than can return a
value > 0x7FFFFFFF and that will error-out if the value overflows.  If
chown() is called with a uid or gid of -1, complain that the ID is not
settable and signal a transfer error.  Fixes bug 6936.
2011-02-22 10:27:35 -08:00
Wayne Davison
7766e67321 Allow a failure of EINVAL to mean no ACLs are available.
(If our POSIX types aren't valid, we can't handle the ACLs.)
2011-02-22 08:52:48 -08:00
Wayne Davison
4403b1332f Fix --force with --one-file-system w/o --delete. 2011-02-22 08:26:13 -08:00
Wayne Davison
c82711b34e Fix issue with devices-fake test. 2011-02-22 08:25:11 -08:00
Wayne Davison
b2e446d0cb Fix devices test on OS w/o hard-linked devices. 2011-02-22 07:39:10 -08:00
Wayne Davison
3bd9f51917 Improve some hard-link caveats in the manpage. 2011-02-20 23:30:53 -08:00
Wayne Davison
86e90c58f4 Add .hg dir exclude to default_cvsignore list.
Fixes bug 7957.
2011-02-17 22:09:08 -08:00
Wayne Davison
e1fe1d55c4 Updated a comment to match a 3.0.x change. 2011-01-29 22:24:49 -08:00
Matt McCutchen
57edc4808f Avoid changing file_extra_cnt during deletion.
The I/O code can receive incremental file-list chunks during deletion,
and their OPT_EXTRA fields would get corrupted when file_extra_cnt is
incremented.

Instead of temporarily enabling uid_ndx to find out whether the user
owns a file, have make_file() set a flag for that purpose.

Applied with a few minor tweaks by Wayne.  Fixes bug 7936.
2011-01-29 22:05:16 -08:00
Wayne Davison
69be312b5e Some minor variable and flag cleanup. 2011-01-29 22:01:37 -08:00
Wayne Davison
4b4bcbe674 Optimize finding the sum that matches our --inplace position. 2011-01-16 17:35:50 -08:00
Wayne Davison
3f26945cb1 Include backup in map_ptr() to avoid backing up when reading. 2011-01-15 11:16:49 -08:00
Wayne Davison
580cffdec9 Sender realigns chunks with generator during an --inplace copy
when sending a sequence of zeros.
2011-01-14 21:32:15 -08:00
Wayne Davison
58a1c1a218 Make sure an alternate --inplace sum has the right length
and add missing break in --inplace same-offset loop.
2011-01-14 15:37:48 -08:00
Wayne Davison
53e6507e14 Fix a bug in the trailing-slash handling. 2011-01-13 23:00:30 -08:00
Wayne Davison
3feece5938 Improve the discussion of the absolute-filter alternative. 2011-01-13 17:16:32 -08:00
Wayne Davison
4ab6125214 Have build farm always use included popt. 2011-01-04 08:00:31 -08:00
Wayne Davison
49eb0c4a35 Mention that sorting the --files-from input is helpful. 2011-01-03 19:49:05 -08:00
Wayne Davison
050e5334d8 Added "listen backlog" daemon config paramater. 2011-01-03 19:42:27 -08:00
Wayne Davison
bf4170ade8 Daemon supports forward-DNS lookups for simple hostnames
in hosts deny/allow config settings.
2011-01-03 19:04:06 -08:00
Wayne Davison
6500e0769a Avoid reading ACL/xattr info on filetypes not being copied.
Make OS X avoid xattr access on device/special files.
Fixes bug 5458.
2011-01-03 11:20:04 -08:00
Wayne Davison
aa3faf5f8c Separate the dirs from the files in xattrs.text. 2011-01-01 21:23:19 -08:00
Wayne Davison
8030518dd0 Clarify incremental recursion's effect on --hard-link. 2011-01-01 18:21:40 -08:00
Wayne Davison
e630fd1186 Some --inplace manpage enhancements. 2011-01-01 18:16:49 -08:00
Wayne Davison
d3f5c628d7 Avoid directory permission issues with --fake-super.
Fixes bug 7070.
2011-01-01 18:09:57 -08:00
Wayne Davison
8b6ebde1f3 Be clear on which part(s) of testsuite's checkit() failed. 2011-01-01 18:09:16 -08:00
Wayne Davison
1c99b1d956 Report all socket connection errors if we fail.
Fixes bug 6588.
2011-01-01 14:00:40 -08:00
Wayne Davison
575933e9d0 Itemize xattrs of a missing dir from an alt-dest dir.
Fixes bug 6576.
2011-01-01 13:10:28 -08:00
Wayne Davison
14013906ca Use full_fname() for system error messages. 2011-01-01 13:09:58 -08:00
Wayne Davison
d1b3118c16 Tweak the year. 2011-01-01 11:52:03 -08:00
Wayne Davison
8f30d21584 Protect a remote filename that starts with a dash. 2010-12-23 22:09:45 -08:00
Wayne Davison
3f770ab0a5 Set NO_SYMLINK_XATTRS on linux the easy way.
Fixes bug 7109.
2010-12-19 08:54:11 -08:00
Wayne Davison
743348e848 Fix issues with unchanged_attrs() for symlinks. 2010-12-18 08:48:07 -08:00
Wayne Davison
14ebc5b618 Fix crash when --backup-dir is excessively long. 2010-12-16 22:15:04 -08:00
Wayne Davison
aef2b8ce41 Enhance --chmod to allow octal values. 2010-12-16 21:53:07 -08:00
Wayne Davison
9f5c16e51d Avoid splitting a multi-byte character when trimming a name.
Fixes bug 7816.
2010-11-26 09:35:43 -08:00
Wayne Davison
8484ddd3d1 A couple comment tweaks. 2010-11-20 09:30:35 -08:00
Wayne Davison
51b2ff03b3 Optimize --inplace chunck search to avoid a non-aligned search. 2010-11-12 09:07:58 -08:00
Wayne Davison
96e051c86a Use ftruncate() at the end of a --sparse file.
Fixes bug 7337.
2010-11-06 10:13:16 -07:00
Wayne Davison
55f767c5ca Mention seek effect of an unmoved --inplace chunk. 2010-11-06 08:14:21 -07:00
Wayne Davison
5ebe9a46d7 Add @group auth and overrides to "auth user" daemon config. 2010-10-12 10:34:38 -07:00
Wayne Davison
d64bda1c1e Some quoting fixes/improvements. 2010-09-06 08:41:46 -07:00
Wayne Davison
c6679e04f8 If we create an off_t type, define SIZEOF_OFF_T. 2010-09-06 08:26:41 -07:00
Wayne Davison
9cb20c605f Fix rsync_xal_set reference in an error. 2010-09-06 08:09:46 -07:00
Wayne Davison
ba342e22e7 Undo unintended mode-reference tweak. 2010-08-28 18:02:22 -07:00
Wayne Davison
29358819ca Fix description of how to force new prototype generation. 2010-08-27 07:44:17 -07:00
Wayne Davison
2a189350f2 Move time setting to syscall.c and add syscall fallback.
See bug 5506 and bug 7621.
2010-08-26 15:31:07 -07:00
Wayne Davison
020df16def Make case_N.h more generic. 2010-08-26 11:13:02 -07:00
Wayne Davison
2624e005e2 Add --omit-link-times and use CAN_SET_SYMLINK_TIMES less. 2010-08-26 11:12:58 -07:00
Wayne Davison
c9bf436e5b Mention need of wildcard support in make.
See bug 7625.
2010-08-26 08:50:34 -07:00
Wayne Davison
8b48c68285 Remove duplication for -x option. 2010-08-26 07:58:22 -07:00
Wayne Davison
aff4850053 Add some new dont-compress suffixes.
As suggested in bug 6839.
2010-08-21 14:41:53 -07:00
Wayne Davison
b32fd63459 Avoid a crash with --append-verify when discarding the received data.
Fixes bug 6293.
2010-08-21 14:25:48 -07:00
Wayne Davison
3b22184d4c Avoid a non-writable-by-the-user file when copying xattrs.
Fixes part of the problem in bug 5147.
2010-08-21 14:14:31 -07:00
Wayne Davison
929002a2d5 Avoid infinite loop if the file's length is negative.
Fixes bug 4664.
2010-08-21 13:48:01 -07:00
Wayne Davison
a64840a29d Don't mention bug fixes that are queued up for 3.0.8. 2010-07-03 08:57:28 -07:00
Wayne Davison
0f6b683c8e Refer to the right lsetxattr() caller in a error message. 2010-07-03 08:14:02 -07:00
Wayne Davison
18070203c2 Replace another assert with a descriptive error. 2010-06-26 16:06:09 -07:00
Wayne Davison
b3e41255a6 I like braces when multiple lines are indented. 2010-06-26 11:43:09 -07:00
Wayne Davison
9dbb94a7e6 Older protocols should send 1-incremented dev numbers. 2010-06-26 11:42:55 -07:00
Wayne Davison
1c9eafdda0 Mention more changes. 2010-06-26 10:59:30 -07:00
Wayne Davison
cf0f454b8a More manpage improvements. 2010-06-26 10:52:04 -07:00
Wayne Davison
d8c55a6e04 Mention more output changes. 2010-06-26 10:01:24 -07:00
Wayne Davison
b320b7d6e5 Manpage improvements for --stats, --human-readable, and --list-only. 2010-06-26 10:01:13 -07:00
Wayne Davison
54504b8e4f Output list-only sizes using any human-readable setting. 2010-06-26 10:00:29 -07:00
Wayne Davison
de32838ea2 Fix accessors F_LENGTH() and F_MOD_NSEC(). 2010-06-26 08:54:57 -07:00
Wayne Davison
ce571e64b6 Close the socket fds in the "post-xfer exec" process. 2010-06-19 10:50:28 -07:00
Wayne Davison
9541770faf Get rid of some trailing whitespace. 2010-06-19 10:49:09 -07:00
Wayne Davison
3be1d9beb2 Fix compression-ignoring of upper-case suffixes.
Fixes bug 7512.
2010-06-19 09:47:00 -07:00
Wayne Davison
292a5c2b72 Fix a couple socketpair_tcp() issues (see bug 7514). 2010-06-19 09:39:55 -07:00
Wayne Davison
e60c8b59fe Fix daemon-filter crash issue (bug 7489). 2010-06-04 23:09:20 -07:00
Wayne Davison
130cdd0d90 Avoid a double-increment of a file's st_dev value
while supporting older rsyncs that send dev == 0.
2010-05-29 10:57:09 -07:00
Wayne Davison
db22e586da Make sure our idev_find() hashtable use is right. 2010-05-29 09:21:30 -07:00
Wayne Davison
60c25caa64 Make sure we never try to store a 0 key and tweak key64 init. 2010-05-29 09:20:26 -07:00
Wayne Davison
c3541d30b6 Turn an assert into two more descriptive errors. 2010-05-29 08:52:59 -07:00
Wayne Davison
86be7a0e64 Mention --debug=hlink's level limits. 2010-05-29 08:52:26 -07:00
Wayne Davison
47573508f4 Update rrsync with the latest options. 2010-05-26 11:24:00 -07:00
Wayne Davison
d1fe65fc5e Make an empty-string dest-dir the same as "." again. 2010-05-02 17:05:07 -07:00
Wayne Davison
9fbec6e44c May as well use do_mkdir() directly these days. 2010-04-30 12:58:17 -07:00
Wayne Davison
25082d1ef6 Reject passing an arg to an option that doesn't take one (bug 6915).
Based on a patch by Matt, but further tweaked to deal with -q=foo.

Ultimately this should be upstreamed, but for now lets get this
functionality into rsync.
2010-04-24 10:00:38 -07:00
Matt McCutchen
5deb19e4ea Man page description of --xattrs should not assume a push. 2010-04-24 09:58:09 -07:00
Matt McCutchen
0b8a9bd69d Minor restructuring/clarification to get_backup_name.
(Tweaked by Wayne to follow his preferred style.)
2010-04-24 09:56:34 -07:00
Matt McCutchen
7a3ce973c3 In "ignoring unsafe symlink" messages, show only the file-list path.
Rsync was showing the full destination path, which was confusing because
nothing is created at that path and was especially bogus in combination
with the source name of a solo file.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506830
2010-04-24 09:51:54 -07:00
Matt McCutchen
be8234cd59 Point out that the file_struct in log_delete is zero-initialized
because it is static.

It took me long enough to realize this that I think it is worth
documenting.
2010-04-24 09:51:05 -07:00
Matt McCutchen
d0f2bbb83e Rename configure.in to configure.ac, the current autoconf standard. 2010-04-24 09:34:43 -07:00
Matt McCutchen
ef7441669b Fix erroneous "--fake-user" in the rsyncd.conf(5) man page. 2010-04-24 09:30:04 -07:00
Matt McCutchen
9a54a640f7 Don't set the umask to 0 any more: it's ugly and pointless. 2010-04-24 09:28:58 -07:00
Matt McCutchen
58a79f4b44 Amplify the man page description of --hard-links (see bug 3693), and
improve that of --inplace while I'm at it.
2010-04-24 08:11:54 -07:00
Matt McCutchen
ae03e0e008 Document the "copy-some-dirlinks" trick in the man page.
Originally explained at:

http://lists.samba.org/archive/rsync/2006-February/014838.html
2010-04-24 08:07:56 -07:00
Wayne Davison
554dc122f2 Removing now-redundant path-size check from send_if_directory(). 2010-03-31 14:57:01 -07:00
Wayne Davison
8c934eba05 Fix a typo that Andrea Gelmini pointed out. 2010-03-27 12:06:45 -07:00
Wayne Davison
41ae04e09c Get rid of trailing whitespace. 2010-03-27 12:05:01 -07:00
Wayne Davison
9a7532e516 Fix directory-length overflow bug (7057). 2010-03-26 16:58:39 -07:00
Wayne Davison
9b594a530f Handle files that spring up while doing backup path checking. 2010-03-09 11:58:07 -08:00
Wayne Davison
5d8dcd1edb Write out the right compat_flags value into the batch file. 2010-02-17 14:55:34 -08:00
Wayne Davison
afccb3d326 If a module has no path setting, return an error. 2010-02-06 13:40:12 -08:00
Wayne Davison
0d78a27893 Mention what -XX (repeated --xattrs) does. 2010-02-06 13:32:47 -08:00
Wayne Davison
05c36015f7 More --timeout improvements, especially for the receiving side:
- The receiver now sends keep-alive messages to the generator
  when it is actively doing work and hasn't sent anything
  recently.  This ensures that the generator won't timeout
  if the receiver is working hard.
- The perform_io() code has improved keep-alive participation.
- Allow the sender to send some keep-alive messages, which
  ensures that if it is in a lull, it can probe the socket.
2010-01-02 10:58:39 -08:00
Wayne Davison
e34f43495c Don't try to send MSG_ERROR_EXIT after a timeout. 2010-01-02 09:14:19 -08:00
Wayne Davison
4256264991 Always use lchmod() if it is available. 2009-12-31 14:10:38 -08:00
Wayne Davison
fa5a06ad0c Mention 2010 in the main copyright. 2009-12-31 13:43:10 -08:00
Wayne Davison
794f2cbab3 Adding release info for 3.0.7 to the trunk. 2009-12-31 13:41:23 -08:00
Wayne Davison
12e59929e2 Allow any gcc to make use of __builtin_alloca for alloca. 2009-12-30 20:04:20 -08:00
Wayne Davison
fc4bb1230e Configure check for -Wno-unused-parameter now tries to link too. 2009-12-30 19:59:49 -08:00
Wayne Davison
a01e3b490e Change naming of local patch-related branches and unify
the git-status checking into a library.
2009-12-30 13:57:39 -08:00
Wayne Davison
2b2a473831 Add understanding of RSYNC_PROTECT_ARGS environment var. 2009-12-30 12:29:47 -08:00
Wayne Davison
4c4a296209 Allow "./configure --with-protect-args" to make -s the default. 2009-12-29 12:08:41 -08:00
Wayne Davison
e89a0fc094 Handle check-in and tagging of patches dir. 2009-12-26 14:29:51 -08:00
Wayne Davison
164faae84f Improve handling of MSG_IO_ERROR message. 2009-12-23 14:14:54 -08:00
Wayne Davison
de6ab501b6 Pass the 'f' compatibility flag to the server (via -e)
so that 3.0.7 knows we support the safer flist-xfer method.
2009-12-21 14:37:47 -08:00
Wayne Davison
4286ea6036 Don't die if inflate() returns Z_BUF_ERROR in see_deflate_token(). 2009-12-21 10:15:13 -08:00
Wayne Davison
626b5ae839 Don't set last_io_out in check_timeout. 2009-12-19 13:42:35 -08:00
Wayne Davison
92d021488e Improve --timeout method to take into account all I/O that is going on.
The receiving side also switches timeout handling from the receiver to
the generator, which obviates the need for the sender to send any
keep-alive messages at all (for protocol 31 and beyond).  Given this
setup, all keep-alive messages are now sent as empty MSG_DATA messages,
with MSG_NOOP messages only being understood and (when necessary) acted
upon to forward a keep-alive event to an older receiver.  This is both
safer and more compatible with older versions.
2009-12-19 11:00:36 -08:00
Wayne Davison
82b2a31a46 Added an am_receiver variable. 2009-12-19 10:14:49 -08:00
Wayne Davison
eeea1bbd72 Improved some I/O comments. 2009-12-17 09:00:52 -08:00
Wayne Davison
aa3999d66c Fix the val reading for MSG_ERROR_EXIT. Use 0-length MSG_DATA when
MSG_NOOP is not available (is both safer and supports older rsyncs).
2009-12-16 12:38:54 -08:00
Wayne Davison
6e9ad2bb03 Allow per-test timeout overrides. Give hardlinks more time. 2009-12-15 08:44:46 -08:00
Wayne Davison
c5130bc123 Improve the timeout messages. 2009-12-15 08:32:18 -08:00
Wayne Davison
f8e1fa6272 Free a strdup() in do_cmd() that checker was complaining about. 2009-12-13 19:28:01 -08:00
Wayne Davison
8e7f3107a4 Avoid -u option to id since solaris doesn't support it. 2009-12-13 18:15:09 -08:00
Wayne Davison
c2dd3ec32c Avoid a compiler warnings about a signed/unsigned mismatch. 2009-12-13 17:52:05 -08:00
Wayne Davison
e9ad7bb1f8 Increase the testrun timeout for slow compilefarm systems. 2009-12-13 17:49:09 -08:00
Wayne Davison
b9107ee61e Fix a compiler warning about a %d mismatch. 2009-12-13 17:47:35 -08:00
Wayne Davison
45426a7604 Run each testsuite test with a timeout. 2009-12-13 14:14:38 -08:00
Wayne Davison
dc2a0923a2 Avoid another checker warning. 2009-12-13 13:21:30 -08:00
Wayne Davison
ac32cdd7d4 Prevent the reading of another message before the end of the current one. 2009-12-12 21:54:52 -08:00
Wayne Davison
6d952fdbe7 Change a variable name in read_a_msg(). 2009-12-12 21:40:02 -08:00
Wayne Davison
870cf55287 This should fix another checker warning. 2009-12-12 15:58:53 -08:00
Wayne Davison
7d0fe4da70 Fix checker compile warning. 2009-12-12 15:51:03 -08:00
Wayne Davison
763880ba81 Turn iobuf.in into a circular input buffer. 2009-12-12 15:16:46 -08:00
Wayne Davison
2885270b52 Fix a hang that can happen when the sender is sending an extra file-list
and no one is reading (i.e. do advantageous reading in perform_io()).
2009-12-12 09:46:02 -08:00
Wayne Davison
0c2e8f9364 Don't send MSG_ERROR_EXIT messages at the end of the transfer.
Added some debug output for MSG_ERROR_EXIT messages.
2009-12-12 08:54:36 -08:00
Wayne Davison
24079e988f Don't (wrongly) retouch dir permissions with --fake-super.
(Patch from Matt.)
2009-11-28 21:46:42 -08:00
Wayne Davison
8a68cad1f7 Add IPv6 detection on cygwin. 2009-11-26 15:17:49 -08:00
Wayne Davison
d03c0b1ed3 Fix a comment. 2009-11-23 22:45:29 -08:00
Wayne Davison
907e6a32a0 Change the handling of circular buffers to not waste 4 bytes
all the time (we only waste from 1-3 bytes some of the time).
2009-11-23 08:16:18 -08:00
Wayne Davison
e4c598c830 Make some RERR_* choices better, and another noop_io_until_death() tweak. 2009-11-16 12:35:17 -08:00
Wayne Davison
ae598f3847 Don't complain about a socket EOF unless it affects a read.
Make sure a write error drains any messages in the input buffer.
2009-11-15 12:54:55 -08:00
Wayne Davison
d85d029b92 Tweak the noop_io_until_death() timeout and comment it. 2009-11-14 23:05:52 -08:00
Wayne Davison
d620b907e4 Improved a couple comments and added some "else" optimizations. 2009-11-14 10:01:13 -08:00
Wayne Davison
5692657757 No need to check MIN_FILECNT_LOOKAHEAD w/extra_flist_sending_enabled. 2009-11-14 09:58:25 -08:00
Wayne Davison
c493b6b81d Make the two "wrap-bytes" sections simpler and more similar. 2009-11-14 09:56:42 -08:00
Wayne Davison
4e2a7e59e5 Prefer send_msg_int() over send_msg() for better debug output. 2009-11-14 09:52:40 -08:00
Wayne Davison
b82d8c9d1a Tweaked sizing checks in perform_io(). 2009-11-14 09:51:26 -08:00
Wayne Davison
75ea845904 Fixed the buffer-has-space check in write_buf(). 2009-11-14 09:43:02 -08:00
Wayne Davison
ce795fcd75 Make --bwlimit take the same size suffixes as the --max-size option
(while keeping it backward compatible). Improve --bwlimit docs.
2009-11-12 23:55:21 -08:00
Wayne Davison
aa381148a3 Fix the daemon test when running it as root. 2009-11-12 22:05:45 -08:00
Wayne Davison
cece2e3f5e Make use of seteuid() determined by configure. 2009-11-08 20:17:02 -08:00
Wayne Davison
f397616e00 Change an RERR_* to RERR_FILEIO. 2009-11-08 11:51:02 -08:00
Wayne Davison
4351c039ad Mention who got the unknown logcode. 2009-11-08 11:50:43 -08:00
Wayne Davison
304d7b5817 More improvements for abnormal exits. 2009-11-08 11:45:55 -08:00
Wayne Davison
9270e88d76 Save first filename and linenum in case exit_cleanup() recurses. 2009-11-08 00:12:33 -08:00
Wayne Davison
2907af472d Try to silence some warnings from "checker". 2009-11-07 09:46:20 -08:00
Wayne Davison
8346c62a95 Mention the error improvements. 2009-11-07 09:46:01 -08:00
Wayne Davison
4655dcf218 Give noop_io_until_death() a time limit. 2009-11-07 09:45:43 -08:00
Wayne Davison
f9185203ee Added notifications about error-exit values:
- The receiver notifies the generator if it is exiting with an error,
  and then, if it is a server, waits around for the generator to die.
  This ensures that the client side has time to read the error.
- The generator or sender will notifiy the other side of the transfer of
  an error-exit value if protocol 31 is in effect.  This will get rid of
  some "connection unexpectedly closed" errors that are really expected
  events due to a fatal exit on the other side.
2009-11-07 01:22:11 -08:00
Wayne Davison
84c11e85a4 Fix MSG_IO_TIMEOUT when the daemon is the receiver. 2009-11-01 13:57:17 -08:00
Wayne Davison
6be8a8b14d A daemon treats --msgs2stderr as "output only to the log, not the user". 2009-11-01 13:43:29 -08:00
Wayne Davison
ef9d3a152b Make sure rwrite() can handle any logcode value in --msgs2stderr mode. 2009-11-01 13:26:15 -08:00
Wayne Davison
fe16d9a67d Fix a hang when dealing with really large numbers of files
in an incremental recursion scan.
2009-10-29 17:35:54 -07:00
Wayne Davison
23a0d1e200 Get rid of some unneeded externs. 2009-10-27 12:38:30 -07:00
Wayne Davison
a0f1ed55cd Change the daemon-timeout conveyance into a protocol-31 message. 2009-10-27 12:38:04 -07:00
Wayne Davison
4dde3347fb Fix %b and %c so that they count per-transfer bytes again. 2009-10-25 22:27:01 -07:00
Wayne Davison
44a97a34b1 Enhance log_format_has() to understand the "'" modifier. 2009-10-25 21:24:48 -07:00
Wayne Davison
281a141ea7 Updated NEWS with some of the recent changes. 2009-10-25 13:51:09 -07:00
Wayne Davison
8e6b4ddbe8 A few more --files-from fixes, and an enhanced testsuite for it. 2009-10-24 12:39:58 -07:00
Wayne Davison
9ccc8f8bbb Add a check30 target. 2009-10-24 12:37:26 -07:00
Wayne Davison
2170667802 Make use of $suitedir. 2009-10-24 11:42:29 -07:00
Wayne Davison
705132bcee Fixed some backward-compatibility issues with --files-from. 2009-10-24 11:12:37 -07:00
Wayne Davison
0dd2310cac Moved some --iconv text that was supposed to be in --files-from. 2009-10-24 00:23:21 -07:00
Wayne Davison
cbc63a09e8 Fixed a couple iconv loops to properly handle incomplete chars
that span two reads.
2009-10-24 00:19:40 -07:00
Wayne Davison
a0a88e0ef3 Move free_xbuf() into ifuncs.h. 2009-10-23 22:55:06 -07:00
Wayne Davison
d8a7290f86 Give iconvbufs() an ICB_INIT flag. 2009-10-23 22:51:29 -07:00
Wayne Davison
3b8f819222 A protocol 31 daemon will inform the client about its timeout setting
so that the client will be able to cooperate with keep-alive.
2009-10-20 15:07:51 -07:00
Wayne Davison
8b3e6fb985 Make sure daemon's io_timeout is used as a maximum value. 2009-10-20 15:05:15 -07:00
Wayne Davison
d720569422 Moved a few group-related functions with some minor tweaks; 2009-10-20 07:54:21 -07:00
Wayne Davison
0a56ef128c Silence some rprintf() size_t warnings. 2009-10-19 08:06:21 -07:00
Wayne Davison
0a9fbe17de Allow %VAR% environment references in daemon-config parameter values. 2009-10-17 16:30:23 -07:00
Wayne Davison
d23cc156aa Call seteuid() when calling setuid(). 2009-10-17 15:03:11 -07:00
Wayne Davison
6f098b0f8c Fix some man page problems Scott Kostyshak pointed out. 2009-10-17 11:06:49 -07:00
Wayne Davison
1ec57e4ddc Fix check for an empty output buffer and limit to flist_eof. 2009-10-17 11:06:20 -07:00
Wayne Davison
20caffd2b3 A major overhaul of I/O routines, creating perform_io().
Files-from data is now sent as multiplexed I/O so that it can mingle
with any messages (such as debug output).  Requires protocol 31.

Protocol 31 no longer disables output verbosity in a couple instances
that used to cause protocol issues.

Got rid of MSG_* messages that have implied raw data that follows after
them.  We instead send a negative index value as a part of the raw data
stream, which is guaranteed to be output together with the following
data.  This only affects the (in-progress) protocol 31 and the (self-
contained) communication stream from the receiver to the generator.

Added --debug=IO and improved --debug=FLIST.  Some --debug=IO output
requires --msgs2stderr to be used to see it (i.e. sending a message
about sending a message would send another message, ad infinitum).
2009-10-17 00:03:32 -07:00
Wayne Davison
df6350a8b8 Avoid type-punned compiler warnings for the byteorder.h macros
by using inline functions for the 4-char <-> uint32 conversions.
2009-10-13 21:10:57 -07:00
Wayne Davison
7a7810aa2f Avoid calling send_extra_file_list() when we shouldn't. 2009-10-13 10:45:23 -07:00
Wayne Davison
41000dffc1 Avoid stopping multiplexed out over the message fd.
Use simpler multiplexed-out stopping method.
Make sure we can't false-match a socket fd.
2009-10-12 09:10:50 -07:00
Wayne Davison
d8587b4690 Change the msg pipe to use a real multiplexed IO mode
for the data that goes from the receiver to the generator.
2009-10-02 14:18:51 -07:00
Wayne Davison
e8bb37f567 Better mask handling, including some changes to help solaris. 2009-09-12 09:40:31 -07:00
Wayne Davison
ee1c00fea8 Pass "new_mode" to set_acl() and change its return values. 2009-09-12 09:27:07 -07:00
Wayne Davison
1b502f3ec2 Put file descriptor arg at the start of the arg list for consistency. 2009-09-12 09:13:38 -07:00
Wayne Davison
44d7d045c7 Improve the "--delete does not work without -r or -d" message. 2009-09-07 14:22:59 -07:00
Wayne Davison
1a2e41af94 Add support for transferring & setting nsec time values. 2009-09-07 14:11:58 -07:00
Wayne Davison
accc091fe9 Always use lutimes() if it is available. 2009-09-07 13:45:33 -07:00
Wayne Davison
4b660bae92 Add a few new "dont compress" suffixes and improve the docs. 2009-09-05 10:29:29 -07:00
Wayne Davison
2f1fb732d4 Improve error handling and get rid of a lingering fprintf(). 2009-09-05 10:25:42 -07:00
Wayne Davison
59924aa8cf Fix daemon's conveyance of io_error value from sender. 2009-09-05 09:40:53 -07:00
Wayne Davison
b15fa9bd7b Avoid an dry-run error trying to stat a prior hard-link
file that hasn't really been created.
2009-09-05 08:18:35 -07:00
Wayne Davison
2c1aa2efac Need to use O_RDONLY in solaris sys_lremovexattr(). 2009-09-03 15:25:55 -07:00
Wayne Davison
6e310d38fc Have --fake-super turn a symlink into a file when
NO_SYMLINK_XATTRS is defined.
2009-09-02 09:06:29 -07:00
Wayne Davison
3b83a22057 Define and use "our_gid" variable. 2009-09-02 08:56:34 -07:00
Wayne Davison
8e15bd87dd Better compiling if SUPPORT_LINKS is not defined. 2009-09-02 08:53:40 -07:00
Wayne Davison
4a440e4be8 Rebuild proto.h if config.h changes. 2009-09-02 08:52:41 -07:00
Wayne Davison
486ecd3d9c Fix attropen() flags for writing an xattr on solaris. 2009-09-02 07:37:55 -07:00
Wayne Davison
17cc4c383b Fix read_xattr() for solaris. 2009-09-01 12:11:32 -07:00
Wayne Davison
c55fb5e1d6 Create non-transferred files in a more atomic manner:
If a symlink, device, special-file, or hard-linked file is replacing
an existing non-directory, the new file is created using a temporary
filename and then renamed into place.  Also changed the handling of
a cluster of hard-linked symlinks/devices/special-files to always
ensure the first item in the cluster is correct, since it doesn't
really save any significant work to try to find an existing correct
item later in the cluster to link with.
2009-08-29 16:18:57 -07:00
Wayne Davison
8a21be11f0 Fix the chmod-temp-dir test if /var/tmp doesn't exist.
Fixes bug 6569.
2009-08-22 09:34:01 -07:00
Wayne Davison
ce827c3e50 Have the sender use dead time to pad out the file list. 2009-08-22 08:15:26 -07:00
Wayne Davison
2523d0cc14 Allow Solaris sys_llistxattr() to return the list length when size == 0. 2009-08-15 06:43:06 -07:00
Wayne Davison
18bd04018d Fix some variable references. 2009-08-15 06:27:19 -07:00
Wayne Davison
4c3e9c09eb Fix a bogus free in uncache_tmp_xattrs(). 2009-08-14 07:05:48 -07:00
Wayne Davison
05a652d0b7 Some improvements to the solaris xattr routines.
Inspired by the patch to bug 6633.
2009-08-13 08:02:53 -07:00
Wayne Davison
845ed84d70 Fix a warning about a %d not getting an int (on some platforms). 2009-08-10 09:24:53 -07:00
Wayne Davison
049f8cbc8a Initial version of xattr routines for Solaris. 2009-08-08 13:27:58 -07:00
Wayne Davison
0d5ebab1d6 Add conditional support for excluding types of files from xattr ops. 2009-08-08 13:21:26 -07:00
Wayne Davison
dab0fb7cf0 Get section reference right. Fixes bug #6573. 2009-08-01 11:29:55 -07:00
Wayne Davison
62342430bf Added solaris IPv6 checking to configure. Fixes #6438.
Patch from Tim Spriggs.
2009-06-05 13:02:55 -07:00
Wayne Davison
63070274f2 Mention that --whole-file is not the default for a local transfer when
writing a batch file.
2009-06-01 09:09:09 -07:00
Wayne Davison
06886d36cf Adding a new script that creates a local patch/* branch
for each file given on the command-line.
2009-05-23 13:40:34 -07:00
Wayne Davison
9ba4d44fa8 Improved the usage output. 2009-05-23 13:40:23 -07:00
Wayne Davison
350242c5c1 Determine the master's commit hash and note it in each patch
that is based on the master in the new "based-on:" line.
2009-05-23 13:12:01 -07:00
Wayne Davison
181c9faf92 Mention some recent changes. 2009-05-23 11:45:17 -07:00
Matt McCutchen
c8fa85b23b Refactorings to the filter code, most notably:
- Improve function name: parse_rule -> parse_filter_str (to make the
  similarity with parse_filter_file clearer, and better indicate that
  it can parse multiple rules when FILTRULE_WORD_SPLIT is specified).

- In preparation for rule prefixes containing information beyond the
  rflags, change the code to pass around a full "template" filter_rule
  instead of just rflags.  Callers of parse_filter_{str,file} that want
  to specify only rflags can use rule_template(rflags) .

- Remove the MODIFIERS_* strings and instead hand-code the condition
  under which each modifier is valid.  This should make it easier to
  see that the conditions are correct.

- Tighten up default modifiers on merge rules:
  - Disallow "!" because it isn't useful.
  - If the merge rule specifies a side via "s" or "r", the rules in the
    file cannot also specify a side via "s", "r", "hide", etc.

[Patch was changed by Wayne a bit prior to application.]
2009-05-23 11:20:40 -07:00
Wayne Davison
a61ec6b168 Improved a couple variable names. 2009-05-23 10:41:16 -07:00
Wayne Davison
7b6c5c7794 Use typedefs for the filter structures. 2009-05-23 09:07:43 -07:00
Wayne Davison
b32d425451 Change filter MATCHFLGs to FILTRULEs. 2009-05-23 09:07:35 -07:00
Wayne Davison
134f97c9cc Support an older AIX system that doesn't have ENOTSUP. 2009-05-14 11:23:38 -07:00
Wayne Davison
87755c6cea Switch from inet_aton() to inet_pton() (since we supply a compatibility
function for the latter, it will always exist).
2009-05-14 11:22:37 -07:00
Wayne Davison
8f73c8a498 Adding release info for 3.0.6 to the trunk. 2009-05-08 11:13:37 -07:00
Wayne Davison
0cdb547f5c Fix typo pointed out by Chris Pepper. 2009-05-07 08:02:17 -07:00
Wayne Davison
56017d3150 Enhance name_to_{u,g}id() to optionally parse numbers and rename
to {user,group}_to_*().  Based on a patch by Matt McCutchen.
2009-05-07 07:34:42 -07:00
Matt McCutchen
d960af72b2 Move the description of include/exclude modifiers to a better place
in the man page.
2009-05-05 07:46:54 -07:00
Wayne Davison
fd2b6046cb Clarify which options are transfer rules, and what that means. 2009-04-27 07:26:23 -07:00
Wayne Davison
a8e6e14869 Change sending/receiving/storing of the rdev value for special files.
Since the value is not needed, protocol 31 no longer sends it, while
older protocols are optimized so the sender just sends a valid rdev
value as efficiently as possible.  The receiver no longer caches an
rdev value for special files, and the generator will always pass a 0
rdev value to do_mknod() for special files. Fixes bug #6280.
2009-04-26 07:43:32 -07:00
Wayne Davison
307555eba3 Use upper-case HLINK in a --debug setting to avoid a really weird bug
in the strncasecmp() of OpenSUSE 10.2 (x86_64).
2009-04-13 21:07:12 -07:00
Wayne Davison
261808dac1 Switch to upper-case in the {debug,info}_verbosity arrays. 2009-04-13 07:37:49 -07:00
Wayne Davison
5250c3bc20 Changed the commands used to "make gen" without any stoppage. 2009-04-12 15:44:52 -07:00
Wayne Davison
9eaba7266c Don't allow --remove-s*-files with --read-batch. 2009-04-12 12:57:31 -07:00
Wayne Davison
d510e82fc6 Fixed the use of --xattrs with --only-write-batch. 2009-04-12 12:51:20 -07:00
Wayne Davison
4e9c7fae8f The suffix must be non-empty if the backup-dir is the same as the dest
dir.
2009-04-11 17:31:13 -07:00
Wayne Davison
3696674bc6 More backup improvements:
- Changed get_backup_name() to verify the backup path, and make any
  missing directories.  This avoids accidental use of a symlink as a dir
  in a backup path, and gets rid of any other non-dirs that are in the
  way.  It also avoids the need for various operations to retry after
  calling make_bak_dir(), simplifying several pices of code.
- Changed create_directory_path() to make_path(), giving it flags that
  lets the caller decide if it should skip a leading slash or drop the
  trailing filename.
- Mention when we create the backup directory, so the user is not caught
  unaware when rsync uses a directory they didn't expect.
- Got rid of some dir-moving backup code that is not used.
- Added a little more backup-debug output.
2009-04-11 11:51:07 -07:00
Wayne Davison
5e2d51ee06 Fix "just in case" unlink. Prefer renaming of normal files
if hard-linking fails.
2009-04-11 06:37:49 -07:00
Wayne Davison
d735fe2014 Improved link_or_rename() to handle prefer_rename better. 2009-04-10 23:33:08 -07:00
Wayne Davison
7e6c8ad653 Don't try to backup a file being removed from the backup area. 2009-04-10 23:14:06 -07:00
Wayne Davison
407ea78a62 Allow a "make reconfigure" to continue, even if the Makefile changes. 2009-04-10 16:24:12 -07:00
Wayne Davison
cb197514d9 Fixed an ACL/xattr corruption issue where the --backup option could cause
rsync to associate the wrong ACL/xattr information with received files.
2009-04-10 16:22:44 -07:00
Wayne Davison
a055dbdd88 Allow $RSYNC_TEST_TMP to indicate a good tmp dir for our tests. 2009-04-10 08:19:16 -07:00
Wayne Davison
5eb8bd4962 Don't try to simplify an ACL that has a mask w/o any named values. 2009-04-09 22:49:24 -07:00
Wayne Davison
e129500c85 Some improvements to the rsync.yo manpage:
- Mention the switch from MD4 to MD5.
- Mention the default for the --log-file-format option.
2009-04-07 07:39:34 -07:00
Wayne Davison
7fc2ca2551 Make sure that config.h.in is up-to-date before allowing the
Makefile-updating rule to run ./config.status.
2009-04-04 07:52:26 -07:00
Wayne Davison
83c32ca572 Fixed --dry-run with --read-batch:
- Avoid sending MSG_NO_SEND to the generator.
- Check if the file is wanted before discarding the batched data.
2009-04-04 07:25:25 -07:00
Wayne Davison
1a85a969a7 Fixed improper deletion of mount-point hierarchies.
Fixes bug #6240.
2009-03-31 20:15:44 -07:00
Wayne Davison
7f2591eaea Fixed a word ending that Jesse Weinstein and revamp some of the text
to make it clearer.
2009-03-31 14:34:31 -07:00
Wayne Davison
eecc969e9b Make symlink iconv work for a local copy.
Fixes issue mention in bug #5615.
2009-03-29 13:24:15 -07:00
Matt McCutchen
f8605c5b89 Give a meaningful error message when we fail to write to a batch file. 2009-03-13 09:45:35 -07:00
Wayne Davison
42d8ec616d My version of Matt's improvements related to missing source args:
- Implement --ignore-missing-args.
- In the absence of --*-missing-args, a missing source arg is an
  FERROR_XFER, but doesn't need to be an IOERR_GENERAL.
- Revise the man page.
2009-03-13 09:37:31 -07:00
Wayne Davison
7781241889 Make missing args governed by protect filters, not hide. 2009-03-13 08:49:53 -07:00
Wayne Davison
b5473dd4a9 Made --list-only output missing args as a "*missing" line. 2009-03-06 22:42:13 -08:00
Wayne Davison
4e0fa131fe Don't let --chmod tweak a 0 mode value (which marks a missing arg). 2009-03-06 22:41:23 -08:00
Wayne Davison
17a1676976 Simplify an "if" in ssh-basic.test. Fixes bug #6169; 2009-03-06 07:07:43 -08:00
Wayne Davison
b4d30300b9 Improved the unsafe_symlink() code to not get fooled by extra '/' chars
in the symlink's path.  Added test cases.  This fixes bug #6151.
2009-03-03 08:46:57 -08:00
Wayne Davison
e6f3a33c5e Make the backup code call unsafe_symlink() correctly. 2009-03-03 08:42:56 -08:00
Wayne Davison
ce66f41791 Added the --delete-missing-args option to delete specified
files on the receiver that don't exist on the sender.
2009-02-28 09:25:26 -08:00
Wayne Davison
8d10cbfcb1 Made --progress use ir-chk instead of to-chk when the incremental
recursion scan is still active.  Mention the output change more
prominently in the NEWS file.  Updated the --progress output in
the manpage, with mention of the new "ir-chk" string's meaning.
2009-02-28 08:07:01 -08:00
Wayne Davison
e8d6fe6261 Properly indent some lines. 2009-02-19 23:09:20 -08:00
Wayne Davison
7f367bb1b4 Added a way for supplementary groups to be specified in the rsyncd.conf
file.  Also made explicitly-set uid/gid values no longer ignored by a
daemon that was not run by a super-user.
2009-02-19 23:08:48 -08:00
Wayne Davison
df7ec1cf42 Adding a way for log-format numbers to become more human readable. 2009-02-18 07:26:48 -08:00
Wayne Davison
6437b817c0 Mention that only the first line of a password-file is used. 2009-02-16 10:31:58 -08:00
Wayne Davison
d39d60a129 Handle a link_stat() failure with errno ENOENT as a vanished file. 2009-02-14 08:35:57 -08:00
Wayne Davison
49c2407141 Added --disable-iconv-open option for configure to turn off all use
of the iconv_open() function.  Implies --disable-iconv (which turns
off the --iconv option).  Fixes bug #6107.
2009-02-14 07:50:09 -08:00
Wayne Davison
44ae54114a Moved the --disable-debug check sooner in configure.in so that it
happens prior to checking for the compiler.  Switched no-debug code
to setting ac_cv_prog_cc_g=no.  Fixes bug #6106.
2009-02-14 07:48:40 -08:00
Wayne Davison
43eb865f9a Made copy_section() and string_set() simpler, getting rid of a
"FIXME" comment that we don't need to fix.
2009-02-06 07:27:18 -08:00
Wayne Davison
789213909d Combine Globals and Locals into a Vars struct that parallels Defaults,
shortening some code.  Improve comments and make other minor cleanups.
Based on a patch that Matt McCutchen posted to the mailing list.
2009-02-05 07:35:33 -08:00
Wayne Davison
46cd1ef6bc Ensure that the sender turns off any msg_fd_in use earlier.
This avoids a problem where an extra message from the sender
could give the generator time to start sending data that will
not be understood by the sender's use of read_msg_fd().
2009-02-04 18:23:59 -08:00
Wayne Davison
6e80613717 Do not try to send a symlink with a 0-length value.
This avoids a transfer error in the receiver.
2009-02-04 18:13:09 -08:00
Wayne Davison
dc6fb11b41 We only need to send --stats to a remote receiver now. 2009-01-30 08:45:54 -08:00
Wayne Davison
4d13a2fe55 A few more improvements to the hostspec-parsing code. 2009-01-28 23:17:46 -08:00
Wayne Davison
58cf354711 Fixed the parsing of IPv6 literal addresses with a username
prefixed.  Fixes bug #6067.
2009-01-28 15:59:06 -08:00
Wayne Davison
7a498f5b6c Check the right flist_num in gen_wants_ndx(). 2009-01-18 23:02:36 -08:00
Wayne Davison
243e9a366d Added a "Defaults" structure with both globals and locals in it.
Initialize both the Globals and Locals back to their default values
when reading the config.  This fixes a bug where locals set in the
global section were not getting reset to their default value if the
config item was removed from the file.
2009-01-18 22:42:41 -08:00
Wayne Davison
b53c202e45 A couple minor function-call tweaks. 2009-01-18 22:40:17 -08:00
Wayne Davison
aef68d7892 Renamed some typedefs:
- global -> global_vars
- section -> local_vars
- global_and_section -> all_vars
2009-01-18 22:39:57 -08:00
Wayne Davison
077e543b7d Renamed sDefault to Locals. 2009-01-18 22:39:20 -08:00
Wayne Davison
9784f01cbc Use a varint when sending the error_code. 2009-01-17 14:52:13 -08:00
Wayne Davison
bc40a30503 Fixed the delete statistics with --delete-delay and --delete-after. 2009-01-17 14:46:42 -08:00
Wayne Davison
4079d6a684 Fixed a hang in the inc_recurse batch-reading code. 2009-01-17 13:59:08 -08:00
Wayne Davison
df694f72ed Change some args from "char *" to "const char *" in order to get rid of
a compiler warning that was just introduced.  Also avoids changing the
host string to lower-case in access.c (by using iwildmatch()).
2009-01-15 00:23:07 -08:00
Matt McCutchen
11ef77b76a Added the "reverse lookup" daemon-config parameter. 2009-01-15 00:22:36 -08:00
Wayne Davison
abd32c9585 Send the --stats option for proper del-stats operation. 2009-01-14 07:38:37 -08:00
Wayne Davison
01e293f1b5 Use "use warnings" rather than -w on the #! line. 2009-01-13 14:52:03 -08:00
Wayne Davison
8051aa5a34 Adding recent release info from the 3.0.x branch. 2009-01-13 13:53:01 -08:00
Matt McCutchen
46d68be3da Fixed recv_add_uid() to properly differentiate users and groups. 2009-01-13 11:21:06 -08:00
Matt McCutchen
bb499bd7a0 Handle simultaneous arrival of multiple connections. 2009-01-13 09:42:54 -08:00
Wayne Davison
416cef36e9 Tweaked the --delete-* option summaries. 2009-01-08 17:01:38 -08:00
Wayne Davison
1fb6a4018d Avoid a server-side problem with -e is at the start of the short options.
(Bug #6020)
2009-01-07 16:39:22 -08:00
Wayne Davison
fc4a695cdd Tweaked s### and m## to avoid vim highlighting issues. 2009-01-07 16:38:06 -08:00
Wayne Davison
83238ed0bb Fixed bug #6011: use of target in configure. 2009-01-03 20:50:54 -08:00
Wayne Davison
21cddef2b4 Improved the backup code:
- Backups do not interfere with an atomic update (when possible).
- Backing up a file will remove a directory that is in the way
  and visa versa.
- Unify the backup-dir and non-backup-dir code in backup.c.
- Improved the backup tests a little bit.
2009-01-03 12:02:47 -08:00
Wayne Davison
b3bf9b9df9 Update the copyright year. 2009-01-03 10:57:14 -08:00
Wayne Davison
974e18191c Make delete_item() public, moving it into delete.c. 2009-01-03 10:52:50 -08:00
Wayne Davison
09ca0d15d3 Added init_stat_x() to avoid duplication of acl/xattr init code. 2009-01-03 08:53:59 -08:00
Wayne Davison
c43c66125e Allow opendir() in send_directory() to fail with ENOENT. 2008-12-27 11:09:53 -08:00
Wayne Davison
8b7a752024 Mention the mapfrom/mapto scripts and how they work. 2008-11-15 18:32:21 -08:00
Wayne Davison
2df20057e3 Adding the --usermap/--groupmap/--chown options. 2008-11-15 18:13:00 -08:00
Wayne Davison
9556f156a9 Make it clearer which configure files changed. 2008-11-15 15:31:38 -08:00
Wayne Davison
aade88bfc2 An ftruncate() failure should result in FERROR_XFER. 2008-11-15 14:50:40 -08:00
Wayne Davison
3795dafd97 Change clean_fname() to keep "//" at the start for cygwin. 2008-11-15 14:18:36 -08:00
Wayne Davison
e4ed195bb7 Change some size_t vars to ints. 2008-11-11 18:06:11 -08:00
Wayne Davison
faf980ffb5 Make sparse_seek an OFF_T (pointed out by Pedro Valasco). 2008-11-11 18:05:27 -08:00
Wayne Davison
b3ad9649bc A "make reconfigure" doesn't stop if configure changes. 2008-11-11 15:55:14 -08:00
Matt McCutchen
d4d56eed8a Add flist_find_ignore_dirness() and change delete_in_dir() to use it.
This fixes an issue with -K noticed by eric casteleijn, avoids some
inconsistent itemizing when a file/dir is replaced by a dir/file,
and removes a now-obsolete chunk of code from make_file().
2008-11-10 07:05:21 -08:00
Wayne Davison
3ce3cabe34 Fixed the use of a dot-dir path (foo/./bar) inside of a files-from file. 2008-11-09 21:37:04 -08:00
Wayne Davison
9411292489 Fixed a bunch of "warn_unused_result" compiler warnings. 2008-11-09 18:56:21 -08:00
Wayne Davison
b4de848d75 Avoid a potential hang when --remove-*-files is active. 2008-11-09 17:59:11 -08:00
Matt McCutchen
89cb47212e The protect filter automatically added with --backup is not perishable
(see f41152d393), so remove the inaccurate
"p" from the man page.  Noticed by Jacob Balazer:

http://lists.samba.org/archive/rsync/2008-November/022022.html
2008-11-02 20:52:27 -08:00
Wayne Davison
1049378d9c Mention rsync's definition of client and server. 2008-10-25 09:43:50 -07:00
Wayne Davison
9ddc2b64da Fixed our supplied getnameinfo()'s ability to do a reverse lookup,
as reported in bug 5851.
2008-10-25 09:21:13 -07:00
Wayne Davison
b3347e2a03 Adding hashtable debugging output (--debug=hash). 2008-10-15 07:51:45 -07:00
Wayne Davison
d8e8ef323a Fixed a glitch when using -s with a remote-shell daemon. 2008-10-11 11:11:10 -07:00
Wayne Davison
ea0f037930 Don't lookup address "0.0.0.0" when we're a remote-shell daemon.
Gets rid of a DNS delay waiting for a lookup failure.
2008-10-11 11:00:51 -07:00
Wayne Davison
08b7c3ed83 Fixed send_protected_args() to send "." in place of an empty arg. 2008-10-11 10:27:16 -07:00
Wayne Davison
76181461f5 Added a fully atomic update if the user has setup a symlink
to a *-1 or *-2 directory.  A few other minor improvements.
2008-10-11 09:30:26 -07:00
Wayne Davison
2c11e80e2e Fix the error message on one of the rename operations. 2008-09-29 21:54:49 -07:00
Wayne Davison
e366e5303f Enhanced the --stats output:
- Mention how many files were created (protocol >= 29).
- Mention how many files were deleted (new in protocol 31).
- Follow the file-count, created-count, and deleted-count
  with a break-out list of each count by type.
2008-09-26 22:14:01 -07:00
Wayne Davison
0a23e33630 Properly ignore source args on a --read-batch command. 2008-09-26 20:45:49 -07:00
Wayne Davison
8ab02ccd52 More batch-mode fixes to handle redos properly (and without hanging). 2008-09-26 20:32:04 -07:00
Wayne Davison
e0c572c5c6 Moved the flist_ndx_{push,pop}() routines from io.c into util.c. 2008-09-26 19:45:08 -07:00
Wayne Davison
315c2152d0 Initialize xattr data in a couple spots in the hlink code, which avoids
a crash when the xattr pointer's memory happens to start out non-zero.
Also fixed the itemizing of an alt-dest file's xattrs when hard-linking.
2008-09-24 08:00:50 -07:00
Wayne Davison
6d301fa3de Don't send a bogus "-" option to an older server if there were
no short options specified.
2008-09-23 19:35:36 -07:00
Wayne Davison
af2dea6033 Fixed skipping of unneeded updates in a batch file when
incremental recursion is active.  Added test.
2008-09-23 19:31:14 -07:00
Wayne Davison
7fdb3bdab9 Remove bogus "non-empty" qualifier in '*' discussion. 2008-09-14 19:58:15 -07:00
Wayne Davison
794d033981 A couple instant-rsyncd improvements:
- Prompt the user for the parameters when missing.
- Allow the creation of a module without a user+password.
2008-09-11 08:50:14 -07:00
Matt McCutchen
45574a73c1 Add instant-rsyncd to support/ . 2008-09-11 08:05:06 -07:00
Wayne Davison
26e21efc5a Convey the cleaned-up module-path to the user in all cases.
Fixed a just-introduced problem with a relative module-path.
2008-09-11 07:35:40 -07:00
Wayne Davison
433c6753a8 Fix the %P logfile escape inside a chroot. 2008-09-10 16:45:06 -07:00
Wayne Davison
46b1361b41 Adding 3.0.4 release line to OLDNEWS. 2008-09-06 09:50:49 -07:00
Wayne Davison
9e7acc86c3 Adding human_readable var. 2008-09-03 16:10:45 -07:00
Wayne Davison
56c7ed9983 Changed some "rsync" commands into proper "$RSYNC" commands. 2008-09-03 12:15:36 -07:00
Wayne Davison
5dd14f0c33 Split up the ifuncs.h file into 3 .h files. 2008-09-01 19:11:36 -07:00
Wayne Davison
2a147e9fcb Don't define an array with no size. 2008-09-01 19:01:48 -07:00
Wayne Davison
7634fc8eb6 A little tidying up to follow my preferred style. 2008-09-01 17:08:26 -07:00
Matt McCutchen
daa8d92094 Several fixes for merge file handling:
- Free a mergelist's parent_dirscanned filters the last time it is
  popped or as soon as the filters are discarded due to the "n"
  modifier.  Aside from not leaking memory, this is needed to clean up
  any mergelists defined during the parent_dirscan to avoid crashing by
  trying to restore nonexistent state for them in pop_local_filters.
- Make push_local_filters save the current mergelist_cnt, and make
  pop_local_filters assert that it has the correct number of mergelists
  before restoring their state.
- Assert that mergelists get deactivated in strict LIFO order to catch
  any glitches as soon as they happen.  Free linked lists of filters in
  reverse order to make that the case.
- Add a bunch of mergelist-related debug output (--debug=filter2).
2008-09-01 17:01:19 -07:00
Wayne Davison
adc2476fa2 Output numbers in 3-digit groups by default (e.g. 1,234,567).
Also improved the human-readable output functions, including
adding the ability to output negative numbers.
2008-09-01 13:27:11 -07:00
Wayne Davison
34c3ca8f35 Verify that SUBPROTOCOL_VERSION is set correctly when making a
nightly tar file release.  Fixed the opening comments.
2008-08-31 11:55:09 -07:00
Wayne Davison
4f282b0b92 Added extra file-changing logic to ensure that the various files that
mention the protocol number have the right value, that the check-in date
for a protocol-change release is specified, and that a pre-release with
a protocol change doesn't have SUBPROTOCOL_VERSION set to 0.  Prompt for
releasing a branch if -b option was not used and we're on a branch.
2008-08-31 10:13:38 -07:00
Wayne Davison
8b3e60523a Improved the fix that ensures that the generator gets notified about an
I/O error for the incremental directory that generated the error.  The
PROTOCOL_VERSION was bumped to 31 to implement this.
2008-08-31 09:43:39 -07:00
Wayne Davison
1d891835e7 Improved rwrite() to handle a stderr exception without playing games
with the msgs2stderr value.
2008-08-24 14:07:10 -07:00
Wayne Davison
0b78944600 Some minor improvements to the flushing code to try to make it
even more solid.
2008-08-24 13:40:36 -07:00
Wayne Davison
79daa59618 Make the !flist_eof assumption explicit before the check_for_io_err
code calls wait_for_receiver().
2008-08-24 12:54:49 -07:00
Wayne Davison
72de4140d5 Added /support/savetransfer to .gitignore. 2008-08-17 09:28:50 -07:00
Wayne Davison
94a4a125bc An improved RERR_PARTIAL message. 2008-08-17 09:23:28 -07:00
Wayne Davison
e982d59146 Changed flist_for_ndx() to optionally die with an error
if the index isn't found.
2008-08-14 07:40:56 -07:00
Wayne Davison
c78e4ea905 Made an error of readlink_stat() use the right function name. 2008-08-10 07:32:54 -07:00
Wayne Davison
0b7bce2c7b Make sure that the hlink node->data allocation doesn't fail. 2008-08-08 07:48:41 -07:00
Wayne Davison
87678cefd1 Tweaked the symlink iconv buffer size and fixed a comment. 2008-08-02 13:45:50 -07:00
Wayne Davison
7c7462cd30 When using --iconv, if a server-side receiver can't convert a filename,
it now outputs the name back to the client without mangling the charset.
2008-08-02 10:26:17 -07:00
Wayne Davison
e34ad4e925 Refer to the symlink's contents as "symlink data", not "symlink name". 2008-08-02 10:20:51 -07:00
Wayne Davison
f303b749f2 Added logic to the receiving side to ensure that the --delete-during
code will not delete in a directory prior to receiving an I/O error
for that directory (or not receiving it, as the case may be).
2008-08-02 09:14:36 -07:00
Wayne Davison
91fd15b8b6 Skip new symlink conversion step if the remote rsync is not
new enough to do symlink content conversions.
2008-08-02 07:06:15 -07:00
Wayne Davison
6e5b682273 The --iconv option now converts the content of a symlink too. 2008-08-01 19:21:02 -07:00
Wayne Davison
902ee53ea4 Fixed a problem with checking for the '.' dir in the first file
list that is transferred.  This fixes a glitch where a failed
--iconv conversion on the receiving side could prevent deletions
from happening in the root-dir of the transfer.
2008-08-01 19:03:59 -07:00
Wayne Davison
c9f540f37d Changed the iconv-related message that was being output as the
lone --info=misc2 message into a --debug=iconv message so that
all iconv info will be output when requesting iconv debugging.
2008-08-01 18:15:28 -07:00
Wayne Davison
0479eb7601 Fixed a couple minor problems in util.c:
- Make sure that handle_partial_dir() never returns a truncated fname.
- Make robust_rename() return that it failed to do a cross-device
  copy if the partial-dir could not be created.
2008-08-01 18:04:24 -07:00
Wayne Davison
459abd75f5 Properly handle a failure to create a partial directory, which is
especially important for --delay-updates, particularly when
--remove-source-files was also specified.
2008-08-01 18:03:57 -07:00
Wayne Davison
342bfb5e23 Output an FERROR* for a general io_error, and an FWARNING for other
io_error flags.
2008-07-31 07:59:45 -07:00
Wayne Davison
1fe0d14263 Mention a missing sender-side hash improvment that went out in 3.0.0. 2008-07-30 08:33:05 -07:00
Wayne Davison
c8b823f9d8 Make hard-linking work when a device has an st_dev of 0. 2008-07-29 18:06:26 -07:00
Wayne Davison
45c37e737f Mention some mount options that can interfere with --link-dest. 2008-07-28 18:25:18 -07:00
Wayne Davison
41adbcec9f Added a client --munge-links option that works like the daemon
"munge symlinks" parameter.
2008-07-28 16:35:03 -07:00
Wayne Davison
582831a447 - Don't require a daemon config &directive to use an equal sign.
- Improved some daemon-config error messages.
2008-07-27 16:25:11 -07:00
Wayne Davison
312b68417f Made include_config() more efficient, and fixed a memory leak. 2008-07-27 15:14:20 -07:00
Wayne Davison
2206abf884 Added a command-line override for daemon config parameters:
--dparam=PARAMETER=VALUE (-M PARAMETER=VALUE).
2008-07-27 12:13:35 -07:00
Wayne Davison
fcd613d6c7 - Got rid of unused pstring/P_GSTRING/P_SEP/P_SEPARATOR code.
- Made pointer-adding code a little better.
2008-07-27 12:06:26 -07:00
Wayne Davison
8a3ddcfc81 Added &include and &merge config-file directives that allow the
daemon's config file incorporate the contents of other files.
2008-07-26 20:03:45 -07:00
Wayne Davison
c9604e2115 Changed the module array to use an item_list structure. 2008-07-26 19:57:02 -07:00
Wayne Davison
b583594ac7 Change the references to "service" to be either "section" or "module". 2008-07-26 19:11:32 -07:00
Wayne Davison
36828daef1 Reorder the static functions to avoid the need for forward declarations. 2008-07-26 17:47:02 -07:00
Wayne Davison
8880d8ec5e Since the loadparm.c file is changing, I'm reformatting it to use the
rsync style.
2008-07-26 17:42:09 -07:00
Wayne Davison
56fc9f70d3 Enhanced the release scripts to be able to handle a branch release. 2008-07-23 23:40:06 -07:00
Wayne Davison
aacd188034 Fixed a potential alignment issue in the IRIX ACL code when allocating
the initial struct acl object.  Also, cast mallocs to avoid warnings.
2008-07-22 08:31:17 -07:00
Wayne Davison
bb640d3221 Explicitly cast a -1 that is being assigned to a size_t. 2008-07-21 23:22:40 -07:00
Wayne Davison
0566dc54b1 Use PTR_ADD for the new instances of void-pointer arithmetic. 2008-07-21 23:12:02 -07:00
Wayne Davison
aad635f766 Explicitly cast an int64 to an int32. 2008-07-21 23:11:23 -07:00
Wayne Davison
a72f37bb67 Got rid of a variable that was set but not used. 2008-07-21 23:11:04 -07:00
Wayne Davison
93465f51bc Improved var-checker and tweaked all the issues it found. 2008-07-21 00:10:22 -07:00
Wayne Davison
26a7af26aa Renamed extern-squish -> var-checker. 2008-07-21 00:09:16 -07:00
Wayne Davison
b791d6802b Include the array-size in array externs so that IBM's code-checker
can do more checking for us.
2008-07-20 22:41:29 -07:00
Wayne Davison
741597c2df Turn off extra debugging now that the problem is fixed. 2008-07-20 22:28:19 -07:00
Wayne Davison
37077bd339 Improved the handling of --msgs2stderr a little more. 2008-07-20 22:27:23 -07:00
Wayne Davison
ced4fd8993 Fixed a bug in match_hard_links() where an empty directory would try
to allocate 0 bytes of memory (which can fail on some OSes).
2008-07-20 20:34:06 -07:00
Wayne Davison
eabc85ef5e Added a debug-helping option, --msgs2stderr, than should help all
messages to be seen in a situation where rsync is dying (as long
as stderr is a viable output method for the remote rsync).
2008-07-20 20:08:08 -07:00
Wayne Davison
5a18b34de3 Changed the chksum debug flag to deltasum. 2008-07-20 20:02:09 -07:00
Wayne Davison
56ac812359 A few more HLINK debug messages. 2008-07-20 13:54:53 -07:00
Wayne Davison
e42fc158c9 Output even more debug messages. 2008-07-20 13:06:54 -07:00
Wayne Davison
886df221c1 Added a '%C' (MD5 checksum) flag for the output/logfile formatting. 2008-07-19 22:50:28 -07:00
Wayne Davison
fb01d1fb07 Changed the POOL_QALIGN flag to POOL_NO_QALIGN, reversing the setting
(making pools aligned by default).  Added the missing code to make the
documented behavior of pool_free() with a NULL addr work.  Updated the
pool_alloc.3 manpage.
2008-07-19 09:20:56 -07:00
Wayne Davison
51ce67d599 Improved the alignment code and changed POOL_APPEND to POOL_PREPEND. 2008-07-18 20:57:52 -07:00
Wayne Davison
a02348b5df We now pass the POOL_QALIGN flag to pool_create(). Also optimized
the verbose-message check at the start of recv_file_list().
2008-07-18 20:46:58 -07:00
Wayne Davison
28a5b78c6f Improved the hard-link logging. 2008-07-18 17:35:22 -07:00
Wayne Davison
7bbd60101e Turn on flist5 debugging. 2008-07-18 17:34:59 -07:00
Wayne Davison
d239efa3ff Some minor tweaking for the info+debug option parsing. 2008-07-18 08:17:05 -07:00
Wayne Davison
269a8fb604 Make the hands.test use a higher hlink debug level. 2008-07-18 08:12:06 -07:00
Wayne Davison
b1617a0825 Add --debug=hlink to hands.test. 2008-07-18 07:19:21 -07:00
Wayne Davison
806f530bcb Don't interrupt the make for a generated file didn't really change. 2008-07-17 20:02:56 -07:00
Wayne Davison
7f0db4fd8e Use big_num() in a few more places. 2008-07-17 17:01:10 -07:00
Wayne Davison
3a8fad7805 Moving big_num() into lib/compat.c so tls.c can use it. 2008-07-17 16:59:59 -07:00
Wayne Davison
0c096e29aa Added some HLINK debugging output and enabled it for hardlink tests. 2008-07-17 07:43:11 -07:00
Wayne Davison
6d56efa6ea Changed human_num() to big_num() with an extra arg so that it can
be used in place of all %.0f output idioms.
2008-07-17 07:37:31 -07:00
Wayne Davison
97dde6b620 A couple xattr fixes for --fake-super. 2008-07-14 23:48:33 -07:00
Wayne Davison
75d9697869 A few more minor improvements in the --info/--debug code. 2008-07-14 23:36:21 -07:00
Wayne Davison
f35798a57e Added a "test_fail" function to 00-hello.test. 2008-07-14 22:47:03 -07:00
Wayne Davison
b8993a1ee9 Made the info_verbosity array 1 element larger. 2008-07-14 07:40:10 -07:00
Wayne Davison
951e826b75 Added the --info=FLAGS an --debug=FLAGS options, which allows
fine-grained output control (in addition to the coarse -v).
2008-07-13 20:51:08 -07:00
Wayne Davison
d8d1389348 Fixed the timeout/flush loop-check logic to work properly with
incremental recursion.
2008-07-13 17:29:47 -07:00
Wayne Davison
2970362338 If the user specifies --protocol=29, rsync will avoid sending an -e
option to the server (which is only useful for protocols 30 and above
anyway).  This gives the user an easy way to talk to a restricted
server that has overly restrictive option-checking.
2008-07-11 09:48:33 -07:00
Wayne Davison
7a2eca415b Added the --remote-option=OPT (-M OPT) option. 2008-07-05 08:31:16 -07:00
Wayne Davison
854411909b Got rid of some trailing whitespace. 2008-07-05 01:41:19 -07:00
Wayne Davison
bb4e4d889f The --progress output now leaves the cursor at the end of the line
(instead of the start) in order to be extra sure that an error won't
overwrite it.  We also ensure that the progress option can't be enabled
on the server side.
2008-07-05 00:31:46 -07:00
Wayne Davison
93f3fbf73e Prepare repository for more development. 2008-07-04 23:45:57 -07:00
Wayne Davison
d252e47d09 Improved the docs for various delete options. 2008-07-04 13:14:16 -07:00
Wayne Davison
db8f3f7350 Preparing for release of 3.0.3 2008-06-29 20:15:37 -07:00
Wayne Davison
85fd80ce10 Mention the addition of the deny-rsync script, and tweak some comments. 2008-06-28 10:12:57 -07:00
Wayne Davison
a24d64bfaa Fixed a problem with a file descriptor being left open in the
generator when handling an empty file.
2008-06-26 08:14:11 -07:00
Wayne Davison
33cc92a63a Some deny-rsync fixes:
- Fixed messages longer than 63 chars.
- Don't require the presence of a "bc" program.
- Append a newline to the message to make the script easier to call.
- Make extra sure the message outputs without escape interpretation.
- Stick around long enough for a client to reliably get the message.
2008-06-23 23:10:12 -07:00
Matt McCutchen
5e7f63f0bf The deny-rsync script from bug 3945. 2008-06-23 23:04:21 -07:00
Wayne Davison
8bd77e7098 Fixed the sending of large files with older rsync versions by
handling the old block-size limit for protocols < 29.
2008-06-23 09:17:55 -07:00
Wayne Davison
13074c982b Preparing for release of 3.0.3pre3 2008-06-22 19:03:46 -07:00
Matt McCutchen
2171b9395b The sender now sets IOERR_GENERAL in more skipped-file instances. 2008-06-22 19:00:51 -07:00
Wayne Davison
20bb1eb7ae Mention more fixes in the NEWS. 2008-06-22 18:45:07 -07:00
Wayne Davison
7ee7bcd4e9 Improved the build rules for rsync.1 and rsyncd.conf.5 when building
in a separate build directory from the source.
2008-06-22 18:26:15 -07:00
Wayne Davison
844810d609 Avoid problems with timestamp rounding that cp -p and touch -r may do. 2008-06-17 15:59:47 -07:00
Wayne Davison
67347196b1 Fix the problem with setting xattrs on a directory that has an
identical match found in a --link-dest/--copy-dest hierarchy.
2008-06-12 23:08:43 -07:00
Wayne Davison
e424e26128 Cast the datum_len value to a long for rprintf(). 2008-06-12 06:59:51 -07:00
Wayne Davison
ca7d17e41d Handle a solo_file of a directory for --delete-during. 2008-06-09 07:42:03 -07:00
Wayne Davison
6283e9ef43 A couple more xattr improvements:
- Made the XSTATE_* defines avoid using 0.
- Call !XATTR_ABBREV() in recv_xattr_request().
- Improved the "internal abbrev" error message.
- Fixed the potential for a directory time glitch in xattrs.diff.
2008-06-08 21:14:46 -07:00
Wayne Davison
7462c6ac39 Fixed an "Internal abbrev error" when dealing with an xattr value
that is unchanged on an early file, and changed on a later file.
Added 2 new test cases to ensure this stays fixed.
2008-06-08 20:40:11 -07:00
Wayne Davison
f31850966f Improved the progress_is_active code to not overwrite the progress
output in more circumstances.
2008-06-04 09:01:02 -07:00
Wayne Davison
4ecf3e0671 Improved handling of a system that doesn't have a 64-bit offset type. 2008-06-04 08:15:51 -07:00
Wayne Davison
60a986f504 Improved the proto.h target so that a build in a different dir from the
srcdir will ensure that the builddir has a copy of the proto.h file when
the Makefile found it to be out of date.  This prevents the repeated
building of all the targets when the srcdir's proto.h file is accurate,
but older than the newest .c file.
2008-06-04 07:13:22 -07:00
Wayne Davison
0e9c3564c6 Improved the daemon testing, including adding a test to ensure that
daemon excludes can't exclude a dot dir.
2008-05-31 14:52:24 -07:00
Wayne Davison
164cb66add Fixed the destination path check so that it cannot exclude a
dot dir.
2008-05-31 14:51:38 -07:00
Wayne Davison
0d9eba0312 Have send_file_list() check is_excluded() (but only on non-dot-dirs)
and then call send_file_name() with NO_FILTERS.  This gets rid of
the need for a FLAG_DOTDIR_NAME flag (used only by make_file()).
2008-05-31 14:41:20 -07:00
Wayne Davison
d1f66d8d79 If an arg is excluded, don't include its implied dirs. 2008-05-31 11:29:24 -07:00
Wayne Davison
cc911409d6 Make sure the generator doesn't try to send a negative checksum count to
the sender (which would cause it to die with a cryptic error).  Instead,
warn the user when the file's size is too large for checksum processing.
2008-05-31 10:13:28 -07:00
Wayne Davison
a64f19e24b Fixed the backing up of a device or socket. 2008-05-22 16:44:01 -07:00
Wayne Davison
4337eeb754 A cuple more fixes for --xattrs combined with --backup, this time to
handle when --link-dest is also used.
2008-05-22 07:32:11 -07:00
Wayne Davison
928da42359 Fixed the "src" symlink in each testtmp subdir. 2008-05-18 07:00:48 -07:00
Wayne Davison
e717fa4d37 Fix some path problems when the build dir is not the
source dir.
2008-05-17 15:07:24 -07:00
Wayne Davison
cc56eb2acc Preparing for release of 3.0.3pre2 2008-05-17 10:02:19 -07:00
Wayne Davison
88e05f8489 Fixed an "else" in the device-making part of keep_backup(). 2008-05-17 09:57:08 -07:00
Wayne Davison
9ec8583ef5 Mention the latest fixes in the NEWS. 2008-05-17 09:45:13 -07:00
Wayne Davison
e9489cd6cb Fixed several issues with preserving xattrs when using --backup. 2008-05-17 09:35:46 -07:00
Wayne Davison
f1ca7c4429 Preserve the right errno value when trying adjunct functions during
robust backup, copy, and renaming activities.
2008-05-17 08:25:22 -07:00
Wayne Davison
adc4ebdd76 Improved the docs for --inplace and made the mentions of
rsync's delta-transfer algorithm more consistent.
2008-05-09 23:49:41 -07:00
Wayne Davison
9a30c0cc3c Preparing for release of 3.0.3pre1 2008-05-07 22:12:57 -07:00
Wayne Davison
47f43c023b The test of HAVE_LUTIMES accidentally omitted the 'L'. 2008-05-07 22:11:17 -07:00
Wayne Davison
5b385336b9 Added options to tls.c to allow us to ask for mtime and ownership info
on symlinks.  The testsuite will now pass these options to tls if rsync
is configured to affect such attributes on symlinks.
2008-05-06 10:39:19 -07:00
Wayne Davison
c3a2d95cfa Adding missing entry for 3.0.3 protocol-history list. 2008-05-01 16:14:39 -07:00
Wayne Davison
6b19df680a Mention all the latest changes in the NEWS. 2008-04-28 21:29:30 -07:00
Wayne Davison
fdf74bede0 - Changed prev_name into a buffer so that there is no chance that its
contents can be overwritten by other calls to f_name().
- Changed an hlink assert into a check that provides more debug info.
2008-04-28 21:17:36 -07:00
Wayne Davison
876ad10ccc Fixed a crash if a non-incremental-recursion transfer has a
skipped file in a set of hard-links.
2008-04-27 18:45:13 -07:00
Wayne Davison
34a2b39165 Reorder the filenames to touch to try to avoid a weird error on Solaris
5.8.  Also, use lsh in one of the runs in order to try a hard-link run
that uses a (pretend) remote shell.
2008-04-18 19:55:08 -07:00
Wayne Davison
276cc45571 Added a --no-cd option to support/lsh so that the script can be used by
the testsuite.  Improved the home-directory-changing code and added an
error message when "localhost" is not the hostname specified.  Use the
updated script in the testsuite instead of creating a pretend-ssh script
in a couple spots.
2008-04-18 19:41:57 -07:00
Wayne Davison
311676ed21 Fixed a problem with how the daemon filters deal with
a destination directory with a trailing slash.
2008-04-16 09:32:22 -07:00
Wayne Davison
4616867b0d Don't allow '.' dir to be excluded by the daemon's filter rules. 2008-04-16 09:30:28 -07:00
Wayne Davison
8a5ae84efd A few $last_touch tweaks. 2008-04-16 09:11:15 -07:00
Wayne Davison
59d2cd5a7f When running in --progress mode with a progress message active, the
client now outputs a newline prior to an error message, which avoids
overwriting the active file's last progress line.
2008-04-15 08:50:14 -07:00
Wayne Davison
1c3e6e8b26 Moved the setting of the socket options before the connect(). 2008-04-15 08:34:17 -07:00
Wayne Davison
f2681d42ff Fixed the %M escape, which was munging the wrong spaces. 2008-04-15 08:32:41 -07:00
Wayne Davison
774d1c367b Use overflow_exit() for overflows, not out_of_memory(). 2008-04-15 08:27:38 -07:00
Wayne Davison
1b8e0e876b Consistently call the daemon parameters "parameters", not "options",
which allows us to distinguish them from rsync's command-line options.
2008-04-15 08:26:00 -07:00
Wayne Davison
1502f4f58f Updated the README and the NEWS file. 2008-04-15 08:12:56 -07:00
Wayne Davison
6db1db5488 Fix a file-globbing bug in the daemon when chroot is on. 2008-04-11 22:32:38 -07:00
Wayne Davison
09ad90537d If the daemon test is run as root, use a --config option. 2008-04-11 21:57:17 -07:00
Wayne Davison
da9aefa6b4 Prepare repository for more development. 2008-04-11 21:55:43 -07:00
Wayne Davison
8ba802f3b4 Preparing for release of 3.0.2 2008-04-08 08:16:05 -07:00
Wayne Davison
e53f49d1af Call patch-update in its new location. 2008-04-08 08:15:39 -07:00
Wayne Davison
0917f581bc Roll over the NEWS files for the next release. 2008-04-08 08:03:20 -07:00
Wayne Davison
1fe2a3533f Fixed a potential overflow issue with realloc() that Sebastian Krahmer
pointed out.
2008-04-08 08:01:43 -07:00
Wayne Davison
237e9a178f Have the spec file put more useful stuff into the doc dir. 2008-04-05 22:46:48 -07:00
Wayne Davison
0668bfe077 Moving some files from support into packaging. 2008-04-05 22:45:12 -07:00
Wayne Davison
214af6ad83 Comment out the Source1 tar file by default in the spec file. 2008-04-04 00:27:14 -07:00
Wayne Davison
2551c47eb7 Fixed the code that removes old file versions for a final release. 2008-04-04 00:05:44 -07:00
Wayne Davison
83d22fd7f9 Bump the repository version to 3.0.2dev. 2008-04-04 00:04:58 -07:00
Wayne Davison
325c243210 Preparing for release of 3.0.1 2008-04-03 22:37:01 -07:00
Wayne Davison
4e90cfbfed A few more spec-file tweaks. 2008-04-01 20:00:08 -07:00
Wayne Davison
6fd2c27f38 Define a "srcdir" in the spec file and use it in the URLs for the
source files so that they use the unchanging src or src-preview
subdirectory location for the file.
2008-04-01 12:55:27 -07:00
Wayne Davison
19173d224a Tweaked rsync.spec to use "rsync" in place of "%{name}" in a few
places (which allows for easier creation of adjunct RPMs).
2008-03-31 14:10:07 -07:00
Wayne Davison
5b83829669 A simple change to change_pathname() to ensure that the error output
mentions the right path when dir == NULL.
2008-03-31 07:46:47 -07:00
Wayne Davison
8cd3c6dccf Preparing for release of 3.0.1pre3 2008-03-30 23:29:43 -07:00
Wayne Davison
29a89172f7 Improved the chdir() code:
- Renamed push_dir() to change_dir() and revised it a little so that it
  can chdir() to a relative path without an intervening chdir() back to
  the staring path.
- Renamed push_pathname() to change_pathname() and revised it to take
  different args and to only call path_is_daemon_excluded() on a new
  path (not a revisit of a file's already-checked path).
- Fixed change_pathname() to set the right pathname value when a chdir()
  call fails.
- Set orig_dir once outside of the change_pathname() function.
- Got rid of pop_dir().
2008-03-30 15:44:46 -07:00
Wayne Davison
2089375179 Some argc-based actions in parse_arguments() shouldn't happen on
the server side.
2008-03-30 08:05:50 -07:00
Wayne Davison
f8949e7647 Fixed a path-exclusion glitch when checking more than one arg. 2008-03-30 08:05:42 -07:00
Wayne Davison
84ecaa0eca Improved the code that protects a '.' dir from exclusion.
This fixed a glitch in the daemon-exclusion code that allowed
an exclude rule such as ".*" or "*/" to affect a '.' dir.
2008-03-29 23:06:18 -07:00
Wayne Davison
3f2d8d683a Extended a test to ensure that hard-linked distant files continues
to work in incremental-recursion mode.
2008-03-28 10:40:17 -07:00
Wayne Davison
fd2598022c Allow the file-list sending code to set XMIT_SAME_UID/XMIT_SAME_GID
when owner/group info isn't being preserved.  This helps to ensure
that the lower 8 bits of the xflags aren't 0, and is what older
rsync versions did.
2008-03-28 10:40:10 -07:00
Wayne Davison
b05c58cce6 Dump an extraneous empty line. 2008-03-28 10:30:11 -07:00
Wayne Davison
05805cd6b7 Preparing for release of 3.0.1pre2 2008-03-26 17:12:07 -07:00
Wayne Davison
a165be754b Mention two more NEWS items. 2008-03-26 17:04:29 -07:00
Wayne Davison
af3172c148 Ensure that a per-dir merge file is also loaded from implied directories
in the sender (was working in incremental mode).
2008-03-26 16:49:12 -07:00
Wayne Davison
487cb52615 Fixed the discovery of a prior finished hard-link when the entry
is old enough that it is no longer in the flist data.
2008-03-26 16:12:39 -07:00
Wayne Davison
9793bbb364 Improved a length check in parse_merge_name(). 2008-03-26 14:01:52 -07:00
Wayne Davison
f6f74b93ef Ensure that a per-dir merge file is also loaded from implied directories
in the generator (for protocol 30, at least).
2008-03-26 14:01:26 -07:00
Wayne Davison
7568ff448a Fixed the way rsync handles iconv-conversion problems in the file-list:
- If the sender cannot convert a name, the discarding of the entry now
  occurs soon enough to avoid affecting the sender's list (which was
  causing the file-list on the receiving side to be out of sync).
- If the receiver cannot convert a name, its transformation of the name
  into an empty name (which indicates that the entry should be skipped)
  is no longer thwarted by the clean_fname() call (which was changing
  the name into a ".").
2008-03-25 10:46:06 -07:00
Wayne Davison
56158b7e04 Preparing for release of 3.0.1pre1 2008-03-24 21:15:51 -07:00
Wayne Davison
798a9e4e74 Some more improvements for the packaging/release-rsync script:
- Check early if the version tag already exists, so it aborts right
  away if the release script can't do its work.
- Update the files in the "patches" dir while merging the master branch
  into the patch branches (done before creating the release patches for
  the rsync-patches tar file).
- Allow the user to ask to visit each patch when updating them.
- Pause after initial patch updating so that any extra patch changes
  can be done before the creating of the tar files.
- Ask for the GPG signing passphrase once for all signing commands.
2008-03-24 21:15:30 -07:00
Wayne Davison
c202b4fa96 Some improvements for support/patch-update:
- Added a --shell option which starts a sub-shell on each patch branch.
- Don't allow the user to exit a sub-shell if the branch is not clean.
- If the sub-shell exited with a non-zero exit status, prompt to see if
  the user wanted to abort rather than assuming that.
- Wait to start the new patch-file output until after the shell runs.
- Always return to the starting branch on exit.
2008-03-24 20:30:09 -07:00
Wayne Davison
1df02d13d3 Don't send daemon-config filter-action messages back to the user. 2008-03-24 10:14:59 -07:00
Wayne Davison
73cb6738b3 Improved --dirs/--no-dirs/--list-only option handling:
- Moved setting of list_only and xfer_dirs from main.c to options.c.
- Fixed the ability of the user to force --no-dirs.
- Added the --old-dirs/--old-d option to make it easier to interact
  in list-only mode with an older rsync.
- Suggest the use of --old-d instead of "-r --exclude='/*/*'".
2008-03-24 09:54:04 -07:00
Wayne Davison
ba8672dfab Added a couple more NEWS items. 2008-03-23 10:06:53 -07:00
Wayne Davison
a5e0bf3579 Properly handle a new patch-branch that is only available locally. 2008-03-23 09:53:15 -07:00
Wayne Davison
99ba99c74c Changed the way version numbering of pre-releases will be done in
the RPM spec file so that they order prior to the final release.
2008-03-23 00:10:12 -07:00
Wayne Davison
469ff84e29 More NEWS updates and improvements. 2008-03-22 22:33:04 -07:00
Wayne Davison
b5daf5300f Made the filename arg-parsing code skip args that have excluded path
components, returning the same errors that would occur if the path
elements didn't actually exist.  The glob_match() code was also
changed to no longer truncate an arg with an excluded path element
(it just omits excluded items from glob matching).
2008-03-22 15:33:18 -07:00
Wayne Davison
f5aeb6ff9b Added XFLG_DIR2WILD3 flag that the daemon uses to transform any
config-file dir/ exclude rule into a dir/*** rule.
2008-03-22 14:02:34 -07:00
Wayne Davison
4c74d44dab A couple fixes in add_rule() for XFLG_ABS_IF_SLASH:
- Remove the trailing slash earlier, so that it doesn't
  affect the XFLG_ABS_IF_SLASH check.
- Count the slashes earlier so that the XFLG_ABS_IF_SLASH
  can use it instead of using a strchr() all that could
  scan past the end of the input.
2008-03-22 12:30:43 -07:00
Wayne Davison
4a86fbcda0 Change ex_len to pre_len in add_rule(). 2008-03-22 12:21:41 -07:00
Wayne Davison
bc267e0f57 Improved ENSURE_MEMSPACE() macro and use it in more places in glob code. 2008-03-22 08:13:04 -07:00
Wayne Davison
fc05137846 Mention the most recent changes in the NEWS. 2008-03-21 17:50:01 -07:00
Wayne Davison
c085ece623 Some RPM spec file improvements:
- Added installation of new /etc/xinetd.d/rsync config file.
- Added commented-out lines to demonstrate how to use rsync-patches.
2008-03-21 17:11:20 -07:00
Wayne Davison
91f625cee0 Make glob_expand() return an indicator if the glob had no matches. 2008-03-21 15:00:28 -07:00
Wayne Davison
27b067f87b Changed d_name() to be a static inline function. 2008-03-21 07:26:25 -07:00
Wayne Davison
987a546756 A couple improvements to the new arg-globbing code:
- Put all the state variables into a single struct.
- Reuse the buffer memory for each glob_expand() call until a final
  call with a NULL pointer tells us to free it.
2008-03-21 07:22:34 -07:00
Wayne Davison
4d30f17671 Changed the arg-globbing routine to use a custom arg-globbing algorithm
that does not include any daemon-excluded items in the matches.  It is
also not subverted by the presence of one or more dot-dir elements in
an arg.
2008-03-20 23:30:09 -07:00
Wayne Davison
d48810ba5b Some improvements to the file-name cleaning code:
- Removed the CFN_KEEP_LEADING_DOT_DIR flag for clean_fname().
- Explicitly add an implied dot-dir to the transfer rather than keeping
  a leading a "./" prefix as a part of a relative pathname.
- Added the CFN_KEEP_DOT_DIRS flag for clean_fname().
- Added the SP_KEEP_DOT_DIRS flag for sanitize_path().
- Call clean_fname() a couple more times.
2008-03-20 22:39:29 -07:00
Wayne Davison
819bfe4599 Changed the name of the server_filter_list to be
daemon_filter_list, for improved clarity.
2008-03-20 10:42:43 -07:00
Wayne Davison
d2f6e19262 Fixed a bug in the truncating of daemon-excluded paths. 2008-03-20 10:35:53 -07:00
Wayne Davison
e889e0c43b A couple more support/rrsync tweaks:
- Die if the --server option is not first on the command-line.
- Don't allow the --daemon option by default.
2008-03-19 16:44:11 -07:00
Wayne Davison
6e0bf4d840 Some more minor changes for the skip/missing/dry_run code. 2008-03-19 08:59:44 -07:00
Matt McCutchen
83a8ca7b14 Unsnarl missing_below/dry_run logic.
The generator can skip a directory's contents altogether due to
--ignore-non-existing, a daemon exclude, or a mkdir failure.  On a
--dry-run, the generator can also note the missingness of a directory
while still scanning its contents.  These two scenarios were conflated
using a single set of missing_below/missing_dir variables in combination
with transient increments in dry_run; this caused at least three bugs.

Now recv_generator has separate variables for the two scenarios, called
skip_dir and dry_missing_dir, respectively.  For simplicity, we take the
F_DEPTH instead of having separate *_below variables.  We mark both
kinds of missing dirs with FLAG_MISSING_DIR.  (dry_run > 1) iff the
*root* of the destination does not exist; it is no longer incremented
for missing subdirs.  I added tests for the three fixed bugs in
missing.test.
2008-03-19 07:45:58 -07:00
Matt McCutchen
100200d0d2 Fix a poorly placed sentence in rsyncd.conf.yo. 2008-03-18 15:28:36 -04:00
Wayne Davison
f28bf7f401 My modified version of Matt's improvements to the sections on
the various filter parameters.
2008-03-18 11:41:00 -07:00
Wayne Davison
e0fd68f5ce Improved arg-path checking so that wildcards can't be used to
avoid a daemon-exclude.
2008-03-18 10:57:54 -07:00
Wayne Davison
cc12c488aa Use the missing_below code to make the daemon-exclusions
work better.
2008-03-18 10:10:13 -07:00
Wayne Davison
99c3e591b2 Reject a daemon-excluded destination. 2008-03-18 09:44:42 -07:00
Wayne Davison
1aefb7ef73 Output a non-existent-file error for server-excluded files instead of
silently ignoring them.
2008-03-18 09:16:24 -07:00
Matt McCutchen
d7b6774d82 More typo fixes. 2008-03-17 15:32:07 -04:00
Wayne Davison
d4c5cb2b01 A couple more changes for dealing with "checker" warnings. 2008-03-17 10:50:11 -07:00
Matt McCutchen
df476bfcff Fix typo in rsyncd.conf man page. 2008-03-17 11:30:08 -04:00
Wayne Davison
aa0e6b9977 Attempting to silence some more "checker" warnings. 2008-03-17 07:35:19 -07:00
Wayne Davison
1ba6468f1b Mention all the latest changes in the NEWS file. 2008-03-16 22:43:35 -07:00
Wayne Davison
f490102454 If we're not compiling one or more major options (ACLs, xattrs, & iconv),
try to turn off unused-parameter compiler warnings.
2008-03-16 21:51:07 -07:00
Wayne Davison
18f3cb6957 Changed stat() call to do_stat(). 2008-03-16 21:44:33 -07:00
Wayne Davison
7abcfd85b7 Moved declaration of "int i" outside the ifdef in send_protected_args(). 2008-03-16 20:39:16 -07:00
Wayne Davison
6de417d9d4 If the system's popt.h file is not found, use our provided popt code. 2008-03-16 20:35:18 -07:00
Wayne Davison
ffe8feb265 Added "const" to a couple more char * args. 2008-03-16 19:50:35 -07:00
Wayne Davison
c9b62cf375 Fixed hard-linking when some of the files can get skipped. This adds
the FLAG_SKIP_HLINK flag, which gets set on any hard-linked file that
the user wants to skip (e.g. via --ignore-existing, --append, etc.).
The code in hlink.c now deals with the skipped files instead of
triggering an assert() error.
2008-03-16 19:47:35 -07:00
Wayne Davison
7bc595785e Made the FLAG_MOUNT_DIR bit only honored on a directory. 2008-03-16 17:52:31 -07:00
Wayne Davison
022dec7aba Moved the --append check so that files that don't need to be transferred
still get their non-content attributes updated, and combining --append
with --hard-links will not prevent the discovery of unchanged files.
2008-03-16 17:50:28 -07:00
Wayne Davison
ddaef70ced Make the --ignore-existing option not overwrite a regular file with
a dir/symlink/device/special-file, just like it already refuses to
overwrite a non-regular file with a regular file.
2008-03-16 17:17:38 -07:00
Wayne Davison
2357a51e09 A daemon no longer tries to refuse the iconv option when it is not enabled. 2008-03-16 12:11:19 -07:00
Wayne Davison
24ded29ff6 Fixed a hang when using --remove-source-files in dry-run mode. 2008-03-16 06:56:26 -07:00
Wayne Davison
ddff23a7f9 Added missing $(CPPFLAGS) from the building of rounding.h. 2008-03-15 14:09:20 -07:00
Wayne Davison
53936ef935 Fixed the use of --protect-args (-s) with a daemon. 2008-03-15 11:56:18 -07:00
Wayne Davison
7f9bf6b710 Generate a helpful message when we get an option-error from a daemon
while requesting a file-listing and we suspect that the remote rsync
is complaining about the -d option.
2008-03-15 11:24:38 -07:00
Wayne Davison
cfdb27b0c1 Another optimization of "bp" adding when creating a file_struct. 2008-03-15 07:27:33 -07:00
Wayne Davison
fc3ca11040 Got rid of some useless uses of the -t option. 2008-03-15 07:26:46 -07:00
Wayne Davison
d6c9c3319b - Fixed a crash bug when backing up files with ACLs enabled and we
create a directory in the backup-path area.
- Fixed a bug where make_file() was setting F_PATHNAME() on the
  receiving side.
- A non-pool (temp-memory) file structure now stores the size of
  its extra_cnt value in the F_DEPTH() int so that unmake_file()
  can always be sure of how to free() the memory.
- The ACL-preserving code no longer allocates 4 more bytes per
  file entry than it needs.
- Got rid of a useless adding of the symlink length to "bp".
2008-03-15 00:44:53 -07:00
Wayne Davison
8afaef4219 Have configure check to see if /usr/include/popt/popt.h is around
(rather than /usr/include/popt.h), and use the included popt lib
if it is (to avoid a potential conflict due to our use of -I.).
2008-03-14 22:55:59 -07:00
Wayne Davison
11faa893ca (Matt) More itemize clarifications. 2008-03-13 17:45:13 -07:00
Wayne Davison
600b56b316 Clarify that the change/checksum itemize flag can be missing
when talking to older rsync versions.
2008-03-12 16:51:13 -07:00
Wayne Davison
ee39281d14 Fixed the 'T' itemized output for a symlink the right way this time. 2008-03-11 17:35:49 -07:00
Wayne Davison
0607c30700 - One more fix for the 'T' itemized output for a symlink when we're
the client on the receiving side of a protocol-29 connection.
2008-03-11 07:26:37 -07:00
Wayne Davison
492ad04277 (Matt) Add missing --no-y option. 2008-03-10 21:40:04 -07:00
Wayne Davison
1ed9018e69 Fixed some itemized logging failures:
- If a symlink/device/special-file changes its value without any
  attribute changes, the itemized event no longer gets dropped.
- We put a 'c' into the checksum/change field now to indicate when
  a symlink/device/special-file changes its value without changing
  its type.  This lets us properly interpret the --copy-links output
  to know which items are getting copied without changes and which
  are getting created with new content.
- Fixed the 'T' itemized output for a symlink when rsync tries to
  set the right time but fails due to lack of OS/disk support.
2008-03-10 21:39:01 -07:00
Wayne Davison
ff0e15804f Fixed the itemizing of perms with -E. 2008-03-09 19:50:51 -07:00
Wayne Davison
894e6299c1 Some popt improvements:
- Fixed a bug in short-opt parsing when an abutting arg has an '='.
- Allow a short-opt to be separated from its arg by an '='.
- Avoid an IBM-checker warning about an impossible case in a switch
  and a warning about a potential NULL-pointer dereference.
- Fixed a memory leak.
2008-03-08 11:02:40 -08:00
Wayne Davison
c080190365 Fixed the latest xattrs tests on OS X. 2008-03-07 17:13:38 -08:00
Wayne Davison
26f0e56587 Restore a long-attribute test that was temporarily disabled. 2008-03-07 16:45:26 -08:00
Wayne Davison
b4e6aac985 Fixed a syntax problem for non-HAVE_LINUX_ATTRS systems. 2008-03-07 16:41:09 -08:00
Wayne Davison
7c21776e54 Handle the very latest spot for the nightly dir. 2008-03-07 16:25:05 -08:00
Wayne Davison
d724dd186e Fixed the interaction of --fake-super with --link-dest & --xattrs.
Fixed the munging of non-user namespace xattrs w/--fake-super.
Fixed the sorting of received xattrs when name-munging occurs.
Added xattr tests to verify that these things stay fixed.
2008-03-07 16:23:21 -08:00
Wayne Davison
cbbd8e2e8b The --fake-super option conflicts with -XX (which copies internal
rsync xattrs literally).
2008-03-07 15:23:39 -08:00
Wayne Davison
af6241f7ad Simplify the description of what we're doing. 2008-03-06 09:40:46 -08:00
Wayne Davison
852e763b89 Added even more no-OPTION overrides. 2008-03-06 09:38:48 -08:00
Wayne Davison
0f71592015 Made the description of ignored symlink errors more accurate. 2008-03-06 09:37:26 -08:00
Wayne Davison
e63d3a29e2 Updated nightly-rsync and release-rsync to handle the new
ftp directory layout.
2008-03-05 00:22:55 -08:00
Wayne Davison
38cef641a5 Updated rrsync to deal with the latest 3.0.0's use of the -e option.
Added a couple more long options that might get passed.
2008-03-04 22:51:56 -08:00
Wayne Davison
6226396c4a Don't call utimes() on a dir that doesn't need its mtime changed. 2008-03-04 22:48:01 -08:00
Wayne Davison
89b47d43de - Made the itemize test check for CAN_HARDLINK_SYMLINK define instead
of running its own test using ln.
- Made the merge test call checkit with absolute paths so that some
  folk's cd command won't foul things up with extra output.
2008-03-04 21:46:27 -08:00
Wayne Davison
d1c06c2180 Fixing a problem with a NULL config_file pointer when accessing
a single-use daemon without no --config option specified.  Added
a test to ensure that this doesn't break in the future.
2008-03-03 18:33:11 -08:00
Wayne Davison
800a4485f3 Improved the error-checking when tweaking the files for a new release. 2008-03-03 12:33:15 -08:00
Wayne Davison
fede378577 Updated copyright year in --version output and improved the release
script to look for year changes in options.c and to get the version
defaults totally right in the prompts.
2008-03-03 11:19:48 -08:00
Wayne Davison
3bc207b9dd Fixed a thinko and a typo in the --append option. 2008-03-03 07:16:38 -08:00
Wayne Davison
ebac031925 Show the last compile error if we failed to create rounding.h. 2008-03-01 21:00:41 -08:00
Wayne Davison
3cbe640d3c Tweak the files to start work on the next release.
The work-in-progress version is 3.0.1dev.
2008-03-01 20:35:18 -08:00
Wayne Davison
4cb6197b21 Preparing for release of 3.0.0 2008-03-01 12:12:04 -08:00
Wayne Davison
d3d07a5e86 Include 2008 in the copyright years. 2008-03-01 12:01:41 -08:00
Wayne Davison
62ca38262f Fixed the lastversion default when changing from a pre-release
to a final release.  Ensure that newly-created "extra files"
get included in the diff.
2008-03-01 12:00:13 -08:00
Wayne Davison
d62fb8894f Mention a couple more items of note. 2008-03-01 09:48:55 -08:00
Wayne Davison
fc29efc38d Use variables to hold the constant itemized strings so
that future changes are easier to make.
2008-02-27 17:57:29 -08:00
Wayne Davison
c4c9bb944b Temporarily set uid_ndx in the delete code if the transfer is not
preserving ownership, but we want to know what the UIDs are on the
files we're deleting.  Changed the DEL_OWNED_BY_US flag to be
DEL_NO_UID_WRITE, which is only set when a file is owned by us and
we can't write to it.  Fixed a glitch in the error handling of the
--delete-delay code where it might try to enable delete-after in
incremental-transfer mode.  Made a simple (well tested) optimization
in the --delete-delay code and a few other readability changes.
2008-02-27 16:25:29 -08:00
Wayne Davison
236adddc18 Use preserve_[ug]id values for send/recv checking, which will
allow the delete code to temporarily set [ug]id_ndx during
delete processing, as needed.  Got rid of a couple duplicate
tests.
2008-02-27 16:15:14 -08:00
Wayne Davison
5b3aa8028b Added missing init_iconv() call when initiating a daemon transfer. 2008-02-27 07:19:13 -08:00
Wayne Davison
16e24c2043 Don't force the user to start from the master branch when any
clean starting branch will do.  Return to the starting branch.
2008-02-24 13:19:51 -08:00
Wayne Davison
7869953bbf Fixed the description of the 'x' in the itemized output. 2008-02-23 20:55:39 -08:00
Wayne Davison
d07edfc895 Added a default to the new switch in str_acl_type(). 2008-02-23 08:14:56 -08:00
Wayne Davison
85b057cccf Check the return code from mbr_uid_to_uuid()/mbr_gid_to_uuid() so
that the user sees the right error if they failed.
2008-02-23 07:44:55 -08:00
Wayne Davison
a2c473bb59 Tweaked the ACL type-names returned by str_acl_type()
so that error messages are a little clearer.
2008-02-23 07:33:32 -08:00
Wayne Davison
f587061a5b Cast ai->ai_addrlen to int for an rprintf() call using %d. 2008-02-22 15:15:32 -08:00
Wayne Davison
d9e92804a5 The code expects id_t and mode_t to be unsigned, so the code now defines
each one to be unsigned int (instead of int) when the type is missing.
2008-02-21 20:51:54 -08:00
Wayne Davison
46e858a631 Improved several things in the NEWS files, including some typos
that Matt fixed.
2008-02-20 10:32:35 -08:00
Wayne Davison
e0fe5231c2 Output info on what's being signed to make it clearer
what is happening.  Improved the final admonition.
2008-02-19 19:18:20 -08:00
Wayne Davison
698bc16e87 Preparing for release of 3.0.0pre10 2008-02-19 18:28:00 -08:00
Wayne Davison
7b4f48650c Make a few more char pointers const. 2008-02-19 16:35:22 -08:00
Wayne Davison
a43ff267e9 Tweaked a comparison that "checker" was complaining about. 2008-02-19 11:52:00 -08:00
Wayne Davison
717d04669a Fixed the hard-link check again, adding a comment as to
why it is coded the way it is.
2008-02-18 17:16:08 -08:00
Wayne Davison
15dbffc215 Fixed a compilation problem when iconv support is disabled. 2008-02-18 16:48:20 -08:00
Wayne Davison
0099e42332 Only set FLAG_TIME_FAILED if receiver_symlink_times is set. 2008-02-18 16:48:04 -08:00
Wayne Davison
1ed56a05c2 Extended the protocol-30 info-passing code at startup, and use it to
tell the client if the server can set the times on a symlink (both
the server->client byte and the client->server use of -e).  Make use
of this info to allow the proper output of the 't' flag when rsync
can set the time on a symlink (and we're talking protocol >= 30).
Added output of "[no] symtimes" info in the --version message.
Fixed the itemize.test so that it works when rsync believes that it
can set the time of a symlink, but it can't really do it.
2008-02-18 15:57:59 -08:00
Wayne Davison
28fb6365d0 Added --no-one-file-system and --no-x options. 2008-02-18 12:42:04 -08:00
Wayne Davison
8365126b8d Some permssion fixes:
- Changed itemized output to only report 'p' with -p or -E.
 - Fixed a duplicate output of a link-dest file with -vv but no -i.
 - Improved unchanged_attrs() to handle -E.
2008-02-18 10:20:50 -08:00
Wayne Davison
d770837ec0 Fixed a typo reported in a Debian bug report. 2008-02-18 09:59:44 -08:00
Wayne Davison
59658acfec Mention the leading '*'-char rule for itemized output. 2008-02-18 08:25:15 -08:00
Wayne Davison
46f800e8c7 Decided to pad the "*deleting" message to make the names line up. 2008-02-17 23:46:26 -08:00
Wayne Davison
1c65a93d03 The daemon no longer logs a recv entry for a file that is not
actually being updated due to the --only-write-batch option.
2008-02-17 23:44:52 -08:00
Wayne Davison
cae7885e2f Don't output a duplicate warning when the daemon-config excludes a
directory or when a directory is ignored via --ignore-non-existing.
Use a new var, is_dir, to simplify the dir code in recv_generator().
2008-02-17 22:34:08 -08:00
Wayne Davison
eaa28e654f Use the name "ChangeLog" for the ftp copy of the repository history. 2008-02-16 14:45:22 -08:00
Wayne Davison
beef86d0dd A few minor changes, including better push_dir()/pop_dir() verbosity. 2008-02-15 22:19:43 -08:00
Wayne Davison
2fe1feea75 Added a way to specify where the chroot should occur in the module's
path, which allows a daemon admin to have chroot protection and still
have files that are outside the transfer area (such as libraries).
2008-02-15 19:01:35 -08:00
Wayne Davison
0b52f94da7 Some daemon security improvements, including the new parameters
"charset" and "numeric ids".
2008-02-15 17:39:21 -08:00
Wayne Davison
f96bac8468 (Matt) Dropped a superfluous word from a sentence. 2008-02-12 17:30:02 -08:00
Wayne Davison
8444a7c00d (Matt) Needed to remove a few more files for distclean target. 2008-02-12 17:29:09 -08:00
Wayne Davison
c9d3bc3fca A few more NEWS tweaks. 2008-02-10 21:21:24 -08:00
Wayne Davison
8340aa9670 Mention a couple more items. 2008-02-10 21:02:05 -08:00
Wayne Davison
3e2c0024d5 Made reconfigure target check if configure.sh was up-to-date. 2008-02-10 20:39:31 -08:00
Wayne Davison
205393a2b5 Preparing for release of 3.0.0pre9 2008-02-10 20:16:25 -08:00
Wayne Davison
5f0f2e0894 Some improvements for --hard-links and --filter options. 2008-02-10 20:10:13 -08:00
Wayne Davison
a5bb0902b4 One more fix in set_modtime() when we get ENOSYS on a symlink. 2008-02-10 15:39:21 -08:00
Wayne Davison
d348d5fd5f Add a trailing slash to a modname arg that has no path information.
This ensures that the user gets a "skipping" message if they didn't
specify -r or -d.  (A trailing-slash was already being added to a
lone modname for --list-only transfers.)
2008-02-09 22:07:03 -08:00
Wayne Davison
21897ecbed Improved the "symlink has no referent" logic to work with all the
--copy*links options.
2008-02-09 21:41:50 -08:00
Wayne Davison
01103e1870 Make do_recv() reset copy_unsafe_links too (just like it does for
copy_links and copy_dirlinks).
2008-02-09 21:33:13 -08:00
Wayne Davison
2d8f9b1df0 Ignore exit-code 23 when we expect a daemon-excluded file to be excluded. 2008-02-09 21:30:49 -08:00
Wayne Davison
68f1e7e594 (Matt) Made a daemon-refused file an FERROR_XFER with a better message. 2008-02-07 11:24:38 -08:00
Wayne Davison
87629cf2f6 Re-indent some code in set_file_attrs() to make the flow clearer. 2008-02-07 07:24:58 -08:00
Wayne Davison
e7f642cffe Using rebase for the patches has become a failing-hunk
pain in the neck, so I'm switching to using merge.
2008-02-06 16:39:53 -08:00
Wayne Davison
3e8fe565ed A daemon needs to call setup_iconv() after parsing the options
it receives.
2008-02-06 16:13:37 -08:00
Wayne Davison
e96c7777d7 Fixed return code from hard_link_one() when not verbose. 2008-02-06 16:06:33 -08:00
Wayne Davison
71daa07fb1 Make get_xattr_names() even safer at fetching the list of attr names. 2008-02-06 07:52:00 -08:00
Wayne Davison
287bb276d5 Only check F_OWNER() if uid_ndx is non-zero. 2008-02-04 21:17:27 -08:00
Wayne Davison
ddc8110dea Fixed local_child() so that the client side really does handle
the log-file writing.
2008-02-04 12:52:41 -08:00
Wayne Davison
c0f4228d66 Don't try to use recv_xattr_request() with --dry-run. Fixes an
internal abbrev error on the sending side.
2008-02-04 12:34:02 -08:00
Wayne Davison
d6e6333a02 Store the key64 flag from hashtable_create() in the hashtable structure
so that hashtable_find() knows which hashtable is which on a 64-bit
architecture.
2008-02-04 07:29:22 -08:00
Wayne Davison
970ce063ee Fixed finding of parent's description when @ARGV doesn't mention it. 2008-02-04 00:12:01 -08:00
Wayne Davison
dd1f0da818 Improved the usage message. 2008-02-03 23:40:20 -08:00
Wayne Davison
38a4bd432a Fixed a couple DEL_OWNED_BY_US glitches. 2008-02-03 16:40:28 -08:00
Wayne Davison
3eabe6aa41 Dump delete_item()'s "replace" var to reduce recursive stack use. 2008-02-03 15:13:36 -08:00
Wayne Davison
f2b7b64d86 Fixed the diffing of generated files when creating a patch that has
a parent that is not the master branch.
2008-02-02 17:00:25 -08:00
Wayne Davison
b2057d38a9 Some extra password-clarification verbage from Matt. 2008-01-29 17:19:22 -08:00
Wayne Davison
964244b90d Fixed several glitches with failed updates and batch files:
- Correctly identify when a missing batch update is for a resend.
- Made a missing batch update an xfer error.
- Made a failed redo an xfer error.
- Identify a failed transfer file consistently when it is a solo file.
- Have --read-batch say "may try again" instead of "will try again".
2008-01-27 14:40:50 -08:00
Wayne Davison
a7c1fa0049 Moved the batch option checking until after the protocol-version
in the batch file is known.  Also simplified the do_compress
checking, which had some erroneous def_compress_level code.
2008-01-26 11:58:17 -08:00
Wayne Davison
42a28d9d3a Improved a comment. 2008-01-26 09:13:19 -08:00
Wayne Davison
19284e2ef8 When removing a file/dir that is owned by us but does not have
owner-write permission, set it before the removal.
2008-01-26 08:47:02 -08:00
Wayne Davison
2268defe66 Fix some typos and such. 2008-01-25 16:57:54 -08:00
Wayne Davison
643b018cfb Mention iconv --list. 2008-01-25 16:57:26 -08:00
Wayne Davison
e35ad79b1b Make do_chmod() report an error with -E. 2008-01-25 16:57:02 -08:00
Wayne Davison
da01d2e843 Improved option handling for protocol 30 batch files. 2008-01-19 11:21:07 -08:00
Wayne Davison
641dc0c51e Output (BATCH ONLY) rather than (DRY RUN) for --only-write-batch. 2008-01-19 11:20:42 -08:00
Wayne Davison
69e2b4ee3a Fixed the combination of --dry-run and --only-write-batch. 2008-01-19 11:20:17 -08:00
Wayne Davison
75a01a0734 Don't apply filter rules to implied directories. 2008-01-19 10:09:22 -08:00
Wayne Davison
b769ad6a3e Another xattr "internal abbrev" fix for an xattr object that is
shared by multiple files:  handle the case where one file has an
abbreviated item set correctly, but a following item does not.
Also extended testsuite/xattrs.test to verify that this works.
2008-01-12 22:16:37 -08:00
Wayne Davison
6e59b97770 Preparing for release of 3.0.0pre8 2008-01-12 10:53:10 -08:00
Wayne Davison
4da9fcd41d - Make sure the Makefile is up-to-date before running "make gen".
- The release-rsync script now creates the generated patches in a
  separate dir from the normal patches.
2008-01-12 10:52:46 -08:00
Wayne Davison
68ddbaf645 Fixed a bug with truncated xattr data requests when the receiver
needs to discard some of the items from the sender's list.
2008-01-12 09:14:56 -08:00
Wayne Davison
555a081fe2 If "make gensend" fails, abort the script. 2008-01-11 13:20:14 -08:00
Wayne Davison
513d3fd806 Improved check_for_finished_files() to be really, really sure
that we've processed all the items on the hard-linked and redo
queues before we return.
2008-01-11 13:13:15 -08:00
Wayne Davison
34aa616d41 Fixed a length problem parsing an arg of "./". 2008-01-09 11:51:44 -08:00
Wayne Davison
ec8637f367 Don't allow a slash to be specified in a module name.
Document the module-name limitations in rsyncd.conf.yo.
2008-01-09 11:41:23 -08:00
Wayne Davison
62a6b8df72 Made read_arg_from_pipe() handle EINTR. 2008-01-02 17:20:44 -08:00
Wayne Davison
dd6f31f70f Rebuild the Makefile when it is not up-to-date. 2008-01-01 10:43:55 -08:00
Wayne Davison
a5fd4b6e6e Renamed mkrounding.c to rounding.c. 2008-01-01 10:34:27 -08:00
Wayne Davison
eca151d457 Changed the creation of rounding.h to use a set of compile-time checks
similar to how configure determines the size of variables.
2008-01-01 10:27:19 -08:00
Wayne Davison
f859d3ded6 If we're cross-compiling, tell the user to run mkrounding on the
target machine to build the rounding.h file.
2008-01-01 08:59:26 -08:00
Wayne Davison
5288be3af7 Some minor tweaks:
- Improved some comments in hlink.c.
- Changed "the" to "a" in rsyncd.conf.yo.
- Improved the PATCH.name filtering loop in patch-update.
2007-12-31 20:40:51 -08:00
Wayne Davison
83235dbc54 Fixed a case where the receiver indicates a successful update when the
transfer succeeded, but the final rename failed.
2007-12-31 10:31:43 -08:00
Wayne Davison
c78cb8f349 Made some user-/group-name pointers "const". 2007-12-29 22:52:42 -08:00
Wayne Davison
7210dbfd2a Some minor tweaking to name_to_uid() and name_to_gid(). 2007-12-29 22:52:04 -08:00
Wayne Davison
b6800a0b32 Added check for libiconv_open when iconv_open isn't found. 2007-12-29 09:53:37 -08:00
Wayne Davison
14eaa7a53b Added reconfigure target to re-run configure. 2007-12-29 09:44:58 -08:00
Wayne Davison
bc065415b0 Fixed Source URL and changed from ftp to http. 2007-12-19 09:36:05 -08:00
Wayne Davison
9203c8d274 Improved prepare-source to make it more flexible. The script now
lets the user choose which actions to perform and their order.
2007-12-17 23:32:47 -08:00
Wayne Davison
9468cf796d Fixed a FALL THROUGH comment. 2007-12-16 17:51:36 -08:00
Wayne Davison
77d4c400c2 Only ignore ENOSYS error from lutimes(). 2007-12-16 17:18:01 -08:00
Wayne Davison
e3915dac76 Added the 'h' option to the tar command that creates the patches
tar file just in case the patches directory is a symlink.
2007-12-16 15:41:59 -08:00
Wayne Davison
78246d1a09 Preparing for release of 3.0.0pre7 2007-12-16 15:09:43 -08:00
Wayne Davison
4bb319c6a6 Fixed extracting files from old tar file. 2007-12-16 15:09:21 -08:00
Wayne Davison
293b11b8a5 Mention 2 more changes in the NEWS. 2007-12-16 15:04:12 -08:00
Wayne Davison
8f42da0b50 Added a "fetchall" option. 2007-12-16 15:02:42 -08:00
Wayne Davison
a10186910d Fixed the check_filter() calls that might be checking an absolute path
in "use chroot = no" mode against a daemon's exclude restriction.
2007-12-16 14:16:37 -08:00
Wayne Davison
eb7715c1eb Moved the dir_count increment into an even better spot and make sure that
send_file_name() returned a non-NULL pointer before doing any DOT_NAME
processing in inc_recurse mode.
2007-12-16 14:14:35 -08:00
Wayne Davison
a7188cbf48 Fixed a potential memory leak in make_file(). 2007-12-15 11:57:34 -08:00
Wayne Davison
f7a2ac075f Refer to delta-transfer algorithm rather than rsync algorithm. 2007-12-15 08:35:45 -08:00
Wayne Davison
ce27f36d92 Check on the alternate destination dirs and report any problems. 2007-12-15 08:19:56 -08:00
Wayne Davison
af5ed0f257 Make push_dir() output where we are when verbosity is high. 2007-12-15 07:39:33 -08:00
Wayne Davison
e6d05dcfca Move incrementing of dir_count so that it can't get incremented
for a directory that isn't going to be included in the transfer.
2007-12-13 07:00:38 -08:00
Wayne Davison
65b4e4b2a9 Updated indexing for accurate progress and improved raw ndx values.
The sending side now has a sorted file-list in iconv mode so that it
can output progress in sorted order.  Simplified the over-the-wire
index values to ensure both sides will always agree on the values.
Optimized the allocation of the dir_flist->sorted array on the
receiving side with --iconv and incremental recursion.
2007-12-08 11:39:47 -08:00
Wayne Davison
37adeae73e A few more additions of $(srcdir) to Makefile.in. 2007-11-30 19:08:54 -08:00
Wayne Davison
091b3459f6 Fixed a build problem for those building in a different dir from
the srcdir.  Also got rid of "cd" code in configure stub.
2007-11-30 19:02:50 -08:00
Wayne Davison
85cdbb6be3 Reorganize the build-farm "prepare-source" magic a little.
This makes it easier for a user to request a copy of the
configure scripts via rsync ("./prepare-source fetch").
2007-11-30 18:01:18 -08:00
Wayne Davison
fcb1068f72 Improved header-file dependency rules even more. 2007-11-30 07:42:47 -08:00
Wayne Davison
07ad305e8a Make sure that the test programs get rebuilt when a header
file changes.
2007-11-29 23:44:40 -08:00
Wayne Davison
bcfb738c93 One build-farm system needs to fetch the proto.h* files too. 2007-11-29 23:21:51 -08:00
Wayne Davison
b58f5e17ed Simplified the time_t overflow check and moved an extra_len rounding
check into the right spot in recv_file_entry().
2007-11-29 22:52:20 -08:00
Wayne Davison
87de82f2d0 Make sure that the inc_recurse value is always set to
either 0 or 1.
2007-11-29 22:46:43 -08:00
Wayne Davison
87531e6302 Get rid of some compiler warnings in the AIX sysacls code. 2007-11-29 17:12:54 -08:00
Wayne Davison
eb67a6909b Don't try to process hard-link data in list-only mode. 2007-11-29 10:27:16 -08:00
Wayne Davison
9217ce30e3 Revised release-rsync and nightly-rsync code to create a tar files
with the right timestamps.
2007-11-29 09:29:45 -08:00
Wayne Davison
d52607ecd6 Preparing for release of 3.0.0pre6 2007-11-28 01:00:37 -08:00
Wayne Davison
13e4914826 Fixed a problem with extracting the previous release's
generated files (used to create the release diff).
2007-11-28 01:00:02 -08:00
Wayne Davison
932fcfc1aa Mentioned the latest changes in the NEWS. 2007-11-28 00:40:34 -08:00
Wayne Davison
a2c770dc21 Switching over to a dynamic hash method for really large files.
This code has been reported to be better for large files than the
file-chunking code that was included in pre3.
2007-11-28 00:39:02 -08:00
Wayne Davison
ba22c9e219 Adding --contimeout=SECONDS option. 2007-11-28 00:28:26 -08:00
Wayne Davison
6a2456c501 Don't use git-FOO command to call git sub-commands. 2007-11-27 16:06:01 -08:00
Wayne Davison
ef3f14e6a7 When the new "munge symlinks" option is off, a non-chroot
daemon should sanitize its symlinks, as it used to do.
2007-11-27 13:11:49 -08:00
Wayne Davison
9585b27678 Add a new daemon security option: "munge symlinks". 2007-11-27 07:34:59 -08:00
Wayne Davison
5c77266d95 Use a non-printing command for proto.h's build-rule. 2007-11-25 15:12:06 -08:00
Wayne Davison
3db06222af Give proto.h a build rule so that make re-checks its timestamp. 2007-11-25 15:03:19 -08:00
Wayne Davison
aa6865d761 Return to the master branch at the end. 2007-11-25 14:46:33 -08:00
Wayne Davison
67b9b26ff3 Modified the discovery of the generated files & use "make gen". 2007-11-25 14:36:30 -08:00
Wayne Davison
b82ad9507f Re-run autoconf and autoheader, as needed. 2007-11-25 14:08:19 -08:00
Wayne Davison
4d7c8e6b76 We now call set_stat_xattr() before set_xattr(). 2007-11-25 13:49:41 -08:00
Wayne Davison
a685271de3 Various xattr fixes:
- Fake-super mode no longer strips the RSYNC_PREFIX from a "%name" item.
- Make various places skip the fake-super xattr when --fake-super is enabled.
- If we fail to re-read the xattr value of an xattr we are trying to un-
  abbreviate, send a zero for its length (avoiding a protocol problem).
2007-11-25 13:48:54 -08:00
Wayne Davison
613c2d4431 Improved proto.h-tstamp handling, including cleanup. 2007-11-24 11:50:41 -08:00
Wayne Davison
225787a4a4 Made the (re-)building of the proto.h file automatic in the
main Makefile rules, and the (re-)building of the man pages
automatic if yodl2man is present.
2007-11-24 10:54:35 -08:00
Wayne Davison
e107b6b122 Fixed a problem with --fake-super not getting the fully tweaked new_mode
value.  Also fixed the removal of rsync-internal xattr values on the
destination files when we aren't copying rsync-internal xattr values.
2007-11-24 10:50:45 -08:00
Wayne Davison
5223b786ca A daemon needs to set dry_run with --only-write-batch. 2007-11-22 11:19:34 -08:00
Wayne Davison
3f0211b63a New logging categories added to allow differentiation between
transfer errors, normal errors, and warnings.  New messages are
translated into old FERROR/FINFO categories for older protocols.
2007-11-22 10:05:36 -08:00
Wayne Davison
a6c6f8e650 Use FLOG instead of FERROR for config errors. 2007-11-22 09:51:21 -08:00
Wayne Davison
ee6e80c753 Fix two iconv problems that Lennart Lövstrand pointed out in bug 5075. 2007-11-22 07:57:03 -08:00
Wayne Davison
ce72de30ce Don't try to delete when list_only is set. 2007-11-21 07:09:26 -08:00
Wayne Davison
29bca53f9b Got rid of the unused symlink parameter to sanitize_path(). 2007-11-20 17:37:53 -08:00
Wayne Davison
dc2815c1fb Make sure that a failure to build configure.sh or config.h.in
doesn't leave a file lying around that could deceive us on the
next run.
2007-11-20 17:22:47 -08:00
Wayne Davison
3005a12bce Only allow the build farm to rsync the latest generated
configure files when building them fails.
2007-11-20 08:40:15 -08:00
Wayne Davison
fd913297fa Made some code that handles hard-linking of symlinks be
omitted if symlinks can't be hard-linked.
2007-11-18 17:54:35 -08:00
Wayne Davison
90c98cdc39 Adding a support script that can be used to make the checked-out
file-times of an initial clone nicer.
2007-11-17 10:29:13 -08:00
Wayne Davison
b258ebf8ac Improved F_RDEV_P() define to use DEV_EXTRA_CNT count. 2007-11-17 10:26:46 -08:00
Wayne Davison
97f0421523 Make sure we process a parent patch before a dependent patch. 2007-11-16 08:02:26 -08:00
Wayne Davison
ee8a733d6f A couple minor improvments to the tar-creation code. 2007-11-15 14:05:09 -08:00
Wayne Davison
20c7d7fd69 Updated to work with git instead of cvs. 2007-11-15 07:48:13 -08:00
Wayne Davison
49ebb358ab Handle new PATCH-$name files, improved $last_touch code,
fixed handling of dependent patches.
2007-11-12 15:10:52 -08:00
Wayne Davison
1f41d42a91 Getting rid of all .cvsignore files. 2007-11-12 13:32:10 -08:00
Wayne Davison
813d2d101a Mention the change for protocol 30. 2007-11-12 07:12:48 -08:00
Wayne Davison
86eb9f9595 Exit if something goes wrong with commit or tag. 2007-11-12 06:44:16 -08:00
Wayne Davison
18fa91296b Make sure that time has progressed when we need change branches
in order to run prepare-source.
2007-11-12 06:30:24 -08:00
Wayne Davison
8d3211447d If we start a sub-shell to let the user fix a rebase, output a
message and change the prompt.
2007-11-12 00:13:52 -08:00
Wayne Davison
805d8ac43d Updated to work with latest git repository and to package
the patches directory in a separate tar file.
2007-11-11 23:58:01 -08:00
Wayne Davison
d26c7dfdb0 This script transforms one or more patch/* branches into
one or more patches/*.diff files.
2007-11-11 23:15:40 -08:00
Wayne Davison
1e21cde315 Ignore a couple more items. 2007-11-11 22:52:25 -08:00
Wayne Davison
c5d77e9659 Including my extern-squishing script, which just found an
extraneous extern in exclude.c.
2007-11-11 22:51:50 -08:00
Wayne Davison
2909586ede This helper script exists to create the generated files that are needed
for a build.  It pretends to be a configure script so that the build
steps are still the normal sequence of ./configure, make, make install
(which is particularly helpful with the samba build farm).  Once the
generated files are ready, the configure.sh script is called to do the
real configure work.
2007-11-09 21:37:01 -08:00
Wayne Davison
c5435b56bf Switched prototype generation from awk to perl. 2007-11-09 22:57:14 +00:00
Wayne Davison
2c386ff971 Ignore generated files and dirs. 2007-11-09 19:55:00 +00:00
Wayne Davison
7f3b529367 Tweaked gensend to upload man pages too. 2007-11-09 19:31:20 +00:00
Wayne Davison
6228239894 Include the arg name for the lp_*() funtions. 2007-11-09 19:28:27 +00:00
Wayne Davison
4da09a65f8 Simplified script even more for HP-UX. 2007-11-09 19:14:51 +00:00
Wayne Davison
ab96610986 Use older open() style for compatibility with older perl versions. 2007-11-09 18:15:52 +00:00
Wayne Davison
c8dccf8fb4 Improved the manpage install rules. 2007-11-09 18:12:40 +00:00
Wayne Davison
bdc12f41de Don't fail the install if the man pages aren't there. 2007-11-09 18:04:50 +00:00
Wayne Davison
2042c63251 Clean generated files for distclean. 2007-11-09 17:56:00 +00:00
Wayne Davison
6ec47d3d01 Added gensend target. 2007-11-09 17:50:10 +00:00
Wayne Davison
0c270e48af Let's try using perl for building proto.h. 2007-11-09 17:40:56 +00:00
Wayne Davison
8aeac05d98 Improved configure bootstrap to try to build generated files
before fetching them.
2007-11-09 16:56:46 +00:00
Wayne Davison
564dc9941e This is an attempt to remove generated files from the rsync repository
while still supporting the samba build farm.  Let's see if it works.
2007-11-09 16:22:20 +00:00
Wayne Davison
732b391720 Preparing for release of 3.0.0pre5 2007-11-09 04:49:18 +00:00
Wayne Davison
879b6ad05c When performing a --dry-run, output a "(DRY RUN)" reminder on the
last line of the verbose summary text.
2007-11-09 04:48:10 +00:00
Wayne Davison
f153c9c943 Mention latest changes. 2007-11-09 04:32:58 +00:00
Wayne Davison
1b411143e5 Got rid of a compiler warning. 2007-11-08 20:30:17 +00:00
Wayne Davison
9456434688 Some fixes for SCO in new getaddrinfo() code. 2007-11-08 14:54:58 +00:00
Wayne Davison
268da8167a Use uint32, not uint32_t. 2007-11-08 01:31:58 +00:00
Wayne Davison
2213961e8f Add back a define of "struct sockaddr_storage" for systems that
don't have it.
2007-11-08 01:10:34 +00:00
Wayne Davison
d100e733db Improve the man page and --help descriptions of --dry-run. In
particular, make it clear that --dry-run turns off action without
turning on verbosity, and has some incomplete/inaccurate stats.
2007-11-08 00:06:48 +00:00
Wayne Davison
15e4d40184 Tweaked an extern. 2007-11-06 15:32:55 +00:00
Wayne Davison
f7a76b9c45 Some changes to allow an unsorted file list even if the iconv option
was disabled via configure.
2007-11-06 15:25:02 +00:00
Wayne Davison
84e1a34eaa Fixed some typos that Matt pointed out. 2007-11-05 18:33:09 +00:00
Wayne Davison
41979f2518 Make sure that get_xattr_data() never tries to malloc 0 bytes. 2007-11-05 18:15:04 +00:00
Wayne Davison
4b1553e2d4 If the xattr data is bogus in get_rsync_acl(), free the buffer. 2007-11-05 18:15:01 +00:00
Wayne Davison
e516b69ef6 Fixed get_xattr_acl() -- it needed to zero *len_p. 2007-11-05 15:02:30 +00:00
Wayne Davison
7df593f21f Got rid of a redundant mtime check. 2007-11-05 15:02:27 +00:00
Wayne Davison
cac80887a6 Conditional symlink-checking code in unchanged_attrs() should be
checking HAVE_LUTIMES.
2007-11-04 06:43:01 +00:00
Wayne Davison
45a143cd51 Have unchanged_attrs() check the mtime on items where we can
affect the time, even if unchanged_file() might have already
checked it.
2007-11-03 21:14:16 +00:00
Wayne Davison
0379c8eca1 Make sure that the user has write permissions when opening a temp file. 2007-11-03 19:27:49 +00:00
Wayne Davison
c9b16cdaba Stop password errors from getting reported as transfer errors. 2007-11-03 18:14:36 +00:00
Wayne Davison
77943e69aa - Renamed updating_basis -> updating_basis_or_equiv.
- Set updating_basis_or_equiv if we're inplace-updating a
  file using the backup file as the basis.
2007-11-03 16:57:17 +00:00
Wayne Davison
d620219dc4 A better way to count our queued workload. 2007-11-03 16:30:30 +00:00
Wayne Davison
c0685c05f8 Fixed hang when --hard-links was processing a large directory
hierarchy with no files.
2007-11-03 15:27:14 +00:00
Wayne Davison
b7386d23d4 Avoid verbose output during the forwarding of flist data (for now,
at least).
2007-11-03 07:20:09 +00:00
Wayne Davison
17a4977bef In mplex_write(), make extra sure something unexpected doesn't get
put between the split output of a long buffer.
2007-11-03 07:20:05 +00:00
Wayne Davison
4f9b139ab9 The HAVE_UTIMBUF define changed to HAVE_STRUCT_UTIMBUF. 2007-11-02 20:53:04 +00:00
Wayne Davison
9f802c7294 A new version of the getaddrinfo code from the samba source. 2007-11-02 20:52:57 +00:00
Wayne Davison
6e1fa33f67 Make use of the HAVE_NETDB_H define. 2007-11-02 20:52:52 +00:00
Wayne Davison
4021aa455b Changes to handle new getaddrinfo code. 2007-11-02 20:52:46 +00:00
Wayne Davison
6ec0f6977d Added AC_HAVE_TYPE(). 2007-11-02 20:52:33 +00:00
Wayne Davison
8c702798f6 One more SUBPROTOCOL_VERSION increase for iconv change. 2007-10-31 15:01:26 +00:00
Wayne Davison
2ad3c71777 - In --iconv mode, we can't lower the ndx_end value because dirs
aren't sorted to the end.
- Made output_flist() output from "files" instead of "sorted".
2007-10-31 14:02:51 +00:00
Wayne Davison
05bd302ab6 Increment the SUBPROTOCOL_VERSION. 2007-10-31 05:48:56 +00:00
Wayne Davison
2b4d51f2e9 Set ndx_start to 1 only for an inc-recursive transfer. 2007-10-31 05:48:25 +00:00
Wayne Davison
ee279980cc - Handle a dot-dir-containing flist using its parent_ndx value. 2007-10-31 04:43:36 +00:00
Wayne Davison
4e42173508 - Fixed a problem with merging dot dirs with non-dot-dir args
in inc-recursive mode.
- Clean up a relative name to remove interior dot dirs and extra
  slashes.
- Fixed the error output about /../ in a -R path after a /./ cut-off.
- Changed the starting ndx value to 1 so that a dot-dir flist can
  use 0 to refer to its parent (".") directory.
2007-10-31 04:43:32 +00:00
Wayne Davison
b58bfb2f20 Call clean_fname() with new flag arg. 2007-10-31 04:43:29 +00:00
Wayne Davison
6bb82fe0a8 Changed clean_fname() to take a flag int instead of a BOOL. Added
a few extra cleaning options (all off by default).
2007-10-31 04:43:25 +00:00
Wayne Davison
c73f2a3831 - Define the new CFN_* flags for clean_fname().
- Changed struct relnamecache's "is_dot_dir" member to "name_type".
2007-10-31 04:43:22 +00:00
Wayne Davison
b1eca24226 Avoid a crash if we read an index value without a valid first_flist. 2007-10-31 04:43:19 +00:00
Wayne Davison
58b7b3d668 Suggest -Z as a good popt alias letter instead of -s. 2007-10-31 00:51:48 +00:00
Wayne Davison
ce055e863d Mention that --keep-dirlinks can be dangerous if there are
untrusted symlinks in the transfer.
2007-10-30 15:00:40 +00:00
Wayne Davison
53ec55a88e Fixed --one-file-system handling when dealing with multiple
user-specified mount points in inc-recursive mode.
2007-10-30 02:24:03 +00:00
Wayne Davison
2cce75453c My version of Matt's cleanup patch from bug 5051. This makes
--copy-dest use a temp file when not in in-place mode, and has
various improvments for the code.  I have also "#if 0"ed the code
in the receiver that makes missing directories to see if we can
figure out if it is needed (and if so, what for).
2007-10-29 20:43:34 +00:00
Wayne Davison
93204ccae2 Made some more char pointers const. 2007-10-28 21:42:41 +00:00
Wayne Davison
57d617192b Don't call copy_file() for a dry-run. (Thanks, Matt!) 2007-10-28 20:03:00 +00:00
Wayne Davison
ea118be593 Fixed setting of updating_basis value. 2007-10-28 06:51:50 +00:00
Wayne Davison
6a85ee9623 Preparing for release of 3.0.0pre4 2007-10-27 05:09:06 +00:00
Wayne Davison
5851ac2dfe Fixed a problem with build_hash_table() getting called too
often when overwriting a shorter file.
2007-10-27 04:41:18 +00:00
Wayne Davison
e844a4a8a8 When listing a bare module name w/o -r, make sure we list the
contents of the module's root directory.
2007-10-27 02:19:49 +00:00
Wayne Davison
1d8638ce86 Preparing for release of 3.0.0pre3 2007-10-27 00:00:21 +00:00
Wayne Davison
4c17cdcb64 Chunk a really large file to avoid sender-side hash-table
overload.
2007-10-26 22:11:19 +00:00
Wayne Davison
c291d05759 Fixed problem with anchored filter and an absolute
source path with --relative.
2007-10-26 16:53:02 +00:00
Wayne Davison
9520ce4b65 Mention .git/ exclude. 2007-10-25 02:05:43 +00:00
Wayne Davison
0485b451ea Added .git/ to "CVS" excludes. 2007-10-25 02:05:05 +00:00
Wayne Davison
4efa11680a We need to provide iconvbufs() anytime ICONV_CONST is defined. 2007-10-25 01:40:17 +00:00
Wayne Davison
2f39f112c1 A few more improvements. 2007-10-21 22:30:49 +00:00
Wayne Davison
0438c59fd0 Improved a description. 2007-10-21 21:53:20 +00:00
Wayne Davison
1aa343e89c Make last fix even better. 2007-10-21 21:52:25 +00:00
Wayne Davison
5ed353a881 Avoid dropping a hard-linked itemized output with -ii. 2007-10-21 16:50:31 +00:00
Wayne Davison
c126e66ebd Got rid of a couple compiler warnings when SUPPORT_HARD_LINKS is not
defined.
2007-10-20 06:19:01 +00:00
Wayne Davison
97bcf138be Improved a couple entries. 2007-10-18 19:47:41 +00:00
Wayne Davison
37ce167996 We can't decrement the in_progress value for a hard-linked file until
the generator gets a chance to finish the hard links.
2007-10-18 14:04:42 +00:00
Wayne Davison
88a7426843 Typedef any missing types. 2007-10-17 14:15:22 +00:00
Wayne Davison
a1f7c8e250 Add checking for id_t, and changed some of the type checking to use
the newer, recommended method.  (Couldn't switch uid_t and gid_t.)
2007-10-17 14:15:18 +00:00
Wayne Davison
52d9a554d1 Changed a word in an error message. 2007-10-16 22:42:10 +00:00
Wayne Davison
aabb50d4e3 Tweaked set_allow_inc_recurse() a bit more. 2007-10-16 18:33:47 +00:00
Wayne Davison
03646b4910 The start of some updated "thanks". 2007-10-16 16:19:40 +00:00
Wayne Davison
11b02d927f Adding Wesley Terpstra's lchmod()-equivalent that uses setattrlist(). 2007-10-16 16:00:41 +00:00
Wayne Davison
5cefa088e2 We now report symlink mode changes if HAVE_SETATTRLIST is defined. 2007-10-16 16:00:34 +00:00
Wayne Davison
2e4e03f196 Added checks for setattrlist and sys/attr.h. 2007-10-16 16:00:31 +00:00
Wayne Davison
ea4e8cf8a1 Call set_allow_inc_recurse() for situations that don't call server_options(). 2007-10-16 15:10:17 +00:00
Wayne Davison
95def6d957 - Send an 'i' in the -e arg to the server if we can support inc_recurse.
- Got rid of some unneeded blocking_io value twiddling.
- Send --use-qsort to the server if it was specified.
2007-10-16 15:10:12 +00:00
Wayne Davison
9970bed4d9 - Moved the arg-checking relating into set_allow_inc_recurse() and
call it when the server is in setup_protocol().  The function sets
  allow_inc_recurse to 0 if some options won't allow us to support
  an incremental-recursive transfer.
- The server now checks for an 'i' in the -e option from the client
  and zeros out allow_inc_recurse if not found.
- The server reports its inc_recurse determination back to the client.
- The client sets inc_recurse based on the value it gets from the server.
2007-10-16 15:10:09 +00:00
Wayne Davison
494d049ce1 Incremented the SUBPROTOCOL_VERSION. 2007-10-16 15:10:05 +00:00
Wayne Davison
6a385e3b7e We don't need to send --no-i-r anymore. 2007-10-16 04:08:25 +00:00
Wayne Davison
71456d301f Write out the inc_recurse flag into a protocol-30 batch file. 2007-10-16 04:08:21 +00:00
Wayne Davison
dbd697b578 - Send a flag from the client to the server to indicate if the protocol
is going to run in inc_recurse mode or not.
- Verify that the options we received (as a server or as a batch-reader)
  are compatible with the requested inc_recurse mode.
2007-10-16 04:08:18 +00:00
Wayne Davison
5ca70927be Incremented the SUBPROTOCOL_VERSION. 2007-10-16 04:08:14 +00:00
Wayne Davison
2e52ba36cb Added braces to an empty "if" (to avoid any complaints from a compiler
that likes to point out an "if (...)" with a semicolon after it).
2007-10-15 00:16:12 +00:00
Wayne Davison
fd78520dca If there's no lchmod(), don't itemize permission differences for
symlinks.
2007-10-15 00:13:59 +00:00
Wayne Davison
3f655ca08d If the user told us to use a password file and we used it, there's
no need to comment if a RSYNC_PASSWORD environment variable is set.
2007-10-14 21:20:31 +00:00
Wayne Davison
76edd33498 Fixed a typo in a comment. 2007-10-14 18:55:49 +00:00
Wayne Davison
e5f35681e6 Forward MSG_IO_ERROR to the generator so that it can disable deletions. 2007-10-13 05:23:34 +00:00
Wayne Davison
32b9011ae9 Improvements surrounding --list-only and --dirs. 2007-10-13 04:32:53 +00:00
Wayne Davison
fdad5aad3f Get the version # right in the changelog. 2007-10-12 14:08:19 +00:00
Wayne Davison
90ac152deb Modify the changelog section in the .spec file for each release. 2007-10-12 14:04:29 +00:00
Wayne Davison
e9df0a6242 Fixed the day of the week. 2007-10-12 14:04:00 +00:00
Wayne Davison
4cf94b8a01 Improved the summary, the description, and the changelog. 2007-10-12 13:57:37 +00:00
Wayne Davison
a6fa5bdef3 Improved the initial description summary. 2007-10-12 13:57:15 +00:00
Wayne Davison
8f61dfdbd4 One more tweak to the synopsis. 2007-10-12 01:21:02 +00:00
Wayne Davison
ddf8c2b0b2 Improvements suggested by Matt's improved manpage. 2007-10-12 01:12:05 +00:00
Wayne Davison
44ae628c59 Preparing for release of 3.0.0pre2 2007-10-12 00:09:19 +00:00
Wayne Davison
44a7ba4587 Tweaked a couple minor things. 2007-10-12 00:07:28 +00:00
Wayne Davison
44c4492acf Conditionalize the call to setup_iconv(). 2007-10-10 19:24:35 +00:00
Wayne Davison
609e6dda6b - Use the new *_CONTENT_DIR flag names (was *_XFER_DIR).
- Check the FLAG_IMPLIED_DIR flag to find implied dirs.
- Expect flagged implied dirs for all protocol 30 transfers.
2007-10-08 18:02:11 +00:00
Wayne Davison
3f30927214 - Mark implied dirs with FLAG_IMPLIED_DIR.
- Use the new *_CONTENT_DIR flag names (was *_XFER_DIR).
- Send implied dirs with XMIT_TOP_DIR | XMIT_NO_CONTENT_DIR.
- All protocol 30 transfers send flagged implied dirs.
2007-10-08 18:02:07 +00:00
Wayne Davison
ae11e4ee2d - Added a flag for implied dirs: FLAG_IMPLIED_DIR.
- Changed the *_XFER_DIR flags to *_CONTENT_DIR flags.
- Increment SUBPROTOCOL_VERSION.
2007-10-08 18:02:03 +00:00
Wayne Davison
b61665d5b6 Reposition the call to setup_iconv() so that it gets called only once
is a local_server copy, and so that arg-parsing code doesn't interfere
with the sending of a remote charset value.
2007-10-07 20:43:49 +00:00
Wayne Davison
38943d29d3 Improved on the list-only fix and on the other similar checks that want
to ignore implied dirs that are actually present in the file list
when inc_recurse is active and --no-implied-dirs was specified.
2007-10-07 07:18:49 +00:00
Wayne Davison
ff0284ddc4 - Simplified the code in recv_file_entry() for protocol 30.
- Simplified the flag setting in send1extra since we know that
  recurse is set.
- Make sure that FLAG_XFER_DIR is unset for a non-dot-dir when
  recurse is not set.
- The --relative code wasn't setting is_dot_dir enough.
2007-10-07 07:18:45 +00:00
Wayne Davison
3f65576881 Mention how --list-only w/o -r now abandons an old kluge. 2007-10-07 04:04:57 +00:00
Wayne Davison
3caf40356d We now send -d to the server for a list-only transfer w/o -r (rather
than sending -r with a kluged exclude).
2007-10-07 03:52:28 +00:00
Wayne Davison
26bbb6aa4b Set xfer_dirs when we set list_only. 2007-10-07 03:52:24 +00:00
Wayne Davison
bf66c2da14 Got rid of some old exclude trickery for --list-only w/o -r. 2007-10-07 03:52:20 +00:00
Wayne Davison
65f6b6b0ef Got rid of a useless list_only tweak. 2007-10-07 03:52:17 +00:00
Wayne Davison
983f647c7e Fix list-only output of dirs w/--relative but w/o --recursive. 2007-10-07 03:29:04 +00:00
Wayne Davison
14dfad3873 A couple tweaks to the AIX ACL code. 2007-10-05 20:47:18 +00:00
Wayne Davison
215465713b Make sure ICONV_OPTION is unset if we didn't find iconv_open()
and iconv.h.
2007-10-05 20:40:36 +00:00
Wayne Davison
6be5ac61bd Simplified a SMB_ACL_NEED_SORT conditional because some preprocessors
couldn't handle an #if embedded in a macro.
2007-10-05 02:45:09 +00:00
Wayne Davison
90c71caeb3 The hpux_count_obj() function should have been declared with a
void return type.
2007-10-05 02:30:39 +00:00
Wayne Davison
d46b5646c6 A few more improvements and some reshuffling. 2007-10-05 02:22:51 +00:00
Wayne Davison
da564b51a1 Preparing for release of 3.0.0pre1 2007-10-05 00:45:13 +00:00
Wayne Davison
f89617f7f2 One more tweak. 2007-10-05 00:41:38 +00:00
Wayne Davison
0f8984ed78 The latest changes. 2007-10-01 06:13:16 +00:00
Wayne Davison
306847ea67 Mention that we abort if the pid file exists. 2007-10-01 02:32:54 +00:00
Wayne Davison
d4eba300c9 The lp_load() function doesn't fudge the pszFname arg anymore. 2007-10-01 02:25:58 +00:00
Wayne Davison
dd589118d0 - Set config_file to a default filename if it is NULL.
- Changed create_pid_file() to fail if the pidfile already exists,
  which makes the daemon exit with an error.
- Output errors about a failure to open the config file or the lock
  file to (a still open) stderr.
- We now notice (and complain) if fork() fails.
2007-10-01 02:25:54 +00:00
Wayne Davison
f92e15efd5 Mention the latest way to specify multiple remote args. 2007-09-30 07:46:28 +00:00
Wayne Davison
4f3c1df6c3 Made list more complete. 2007-09-30 07:34:33 +00:00
Wayne Davison
eb8f5c74e1 Got rid of some SPACE-TAB sequencs in the indentation. 2007-09-30 07:30:48 +00:00
Wayne Davison
a960239f39 Allow additional remote args to contain an identical hostname instead
of requiring it to be empty.  This allows for the easy use of braces:
rsync -av host:file{1,2} /dest/
2007-09-30 07:14:16 +00:00
Wayne Davison
5621e5105a Moved become_daemon() into clientserver.c. 2007-09-30 06:57:12 +00:00
Wayne Davison
a1d2685b08 - Moved become_daemon() here from socket.c and made it static.
- Call lp_load() before we call become_daemon().
- Output an error to stderr if we fail to open/parse the config file.
- Added a create_pid_file() static function and call it earlier in
  the startup sequence.
2007-09-30 06:57:07 +00:00
Wayne Davison
0f6b4909db Improved --acls, --xattrs, and --fake-super. 2007-09-29 17:01:01 +00:00
Wayne Davison
b0ca7d2500 Specify a better SMB_ACL_VALID_NAME_BITS value for OS X. 2007-09-29 16:06:40 +00:00
Wayne Davison
7ed6bc53b9 Added get_xattr_acl(), set_xattr_acl(), and del_def_xattr_acl(). 2007-09-29 16:06:37 +00:00
Wayne Davison
f57ab2f718 When running with --fake-super, get/put ACLs from/to an xattr and don't
range-check the incoming values.
2007-09-29 16:06:34 +00:00
Wayne Davison
5ebb7935d2 Tweaked a variable name. 2007-09-29 04:35:26 +00:00
Wayne Davison
c50a9076e1 Added support for OS X testing using chmod +a and ls. 2007-09-29 02:26:23 +00:00
Wayne Davison
d417c51669 - Added OS X ACL support.
- Simplified some of the ge/set calling sequences.
- Got rid of SMB_ACL_PERMSET_T.
2007-09-28 21:54:11 +00:00
Wayne Davison
5b934f5133 Added OS X ACL support, using slightly tweaked sys_acl_*()
functions.
2007-09-28 21:54:07 +00:00
Wayne Davison
49ea69b3ff We enable ACL compilation on OS X by default now. 2007-09-28 21:54:01 +00:00
Wayne Davison
578219bed5 Determine the previous version number in a more reasonable fashion. 2007-09-26 17:43:57 +00:00
Wayne Davison
2e4a3d17b4 Some improvements and fixes for the upcoming release. 2007-09-26 14:57:52 +00:00
Wayne Davison
b4b24520f6 Added (conditional) include of stdint.h. 2007-09-23 22:31:14 +00:00
Wayne Davison
13710874ce Changed "statx" to "stat_x" to try to work around a build problem on AIX. 2007-09-23 22:19:55 +00:00
Wayne Davison
7341ee2dfd Fixed a crash bug in get_local_name() when the file list is empty. 2007-09-23 21:54:03 +00:00
Wayne Davison
e0cfd15bcc Fixed a glitch in the sending of mount-point dirs in inc_recurse mode. 2007-09-23 21:46:51 +00:00
Wayne Davison
5a47354882 Added a stub function for make_bak_dir(). 2007-09-23 21:05:15 +00:00
Wayne Davison
f5b532b144 Added an option to copy_file() that tells it to try to make a
backup directory if the open of the dest file fails.
2007-09-23 21:03:46 +00:00
Wayne Davison
c0dba635ba The --inplace code now properly handles creating a backup when
the --whole-file and/or --read-batch options are specified.
2007-09-23 21:03:41 +00:00
Wayne Davison
e1ac7791fe Changed make_bak_dir() to take a const char *. 2007-09-23 21:03:38 +00:00
Wayne Davison
5b3f6a2730 Use make_bak_dir() if we get ENOENT while trying to open an
inplace backup file.
2007-09-23 19:45:22 +00:00
Wayne Davison
f203266889 Made make_bak_dir() global. 2007-09-23 19:45:19 +00:00
Wayne Davison
21914d8135 Made clean_flist() only duplicate *_DIR_* flags on a dropped dir
when the kept entry is also a dir.
2007-09-23 19:45:00 +00:00
Wayne Davison
200aec7db4 Avoid a checker warning about unfreed memory. 2007-09-23 19:10:10 +00:00
Wayne Davison
a15c4b38b5 Fix a glitch in the handling of the last path element in a -R path
with a trailing slash.
2007-09-23 16:02:33 +00:00
Wayne Davison
40e383765a - Don't allow -x to drop implied directories.
- Improved the code that tries to avoid scanning the same dir
  twice in a row to not drop any relnamecache entries.
2007-09-23 15:46:11 +00:00
Wayne Davison
5441088298 Added the relnamecache structure and improved some variable names. 2007-09-23 14:35:12 +00:00
Wayne Davison
d0a6cdb62e Make sure that the dirs we are merging have the same timestamps. 2007-09-23 02:18:57 +00:00
Wayne Davison
19531e1f74 Got rid of some unneeded externs. 2007-09-23 02:03:20 +00:00
Wayne Davison
6f0805f564 Moved list-only output from flist.c to generator.c so that it works
properly even in inc_recurse mode.  Got rid of double output, weird
output order, and outputting of implied dirs w/--no-implied-dirs.
2007-09-23 02:00:53 +00:00
Wayne Davison
6191429b50 Added a missing "void" to the arg-spec of setup_iconv(). 2007-09-23 01:18:03 +00:00
Wayne Davison
89b76bac1f Added a test to make sure that merging relative items continues to
work right.
2007-09-23 00:30:40 +00:00
Wayne Davison
0758b2db30 Document the change to how --releative works. 2007-09-22 22:57:50 +00:00
Wayne Davison
74db1f1498 Always send implied dirs as dirs. 2007-09-22 22:37:52 +00:00
Wayne Davison
4f802c6637 Fixed a just-introduced glitch in directory creation with --no-implied-dirs. 2007-09-22 21:51:08 +00:00
Wayne Davison
33a04593ee We now forward the --no-implied-dirs option to the receiving side,
just in case we end up talking protocol 30 in inc_recurse mode.
2007-09-22 21:43:19 +00:00
Wayne Davison
6303f9a25f The latest --relative --no-implied-dirs code in inc_recurse mode
sends us a normal sequence of dirs, and we just skip the implied
ones.
2007-09-22 21:43:15 +00:00
Wayne Davison
3932c42373 Using relative with incremental recursion now results in a normal
sequence of directories in the hierarchy, and works properly when
merging things from multiple sources.
2007-09-22 21:43:11 +00:00
Wayne Davison
bc5df0f4e6 Fixed name of PTR_EXTRA_CNT (was PTR_EXTRA_LEN). 2007-09-22 21:43:08 +00:00
Wayne Davison
4b163f00c2 - Incremented the SUBPROTOCOL_VERSION to 9.
- Fixed name of PTR_EXTRA_CNT (was PTR_EXTRA_LEN).
- Added F_DIR_RELS_P() to support --relative in inc_recurse mode.
2007-09-22 21:43:05 +00:00
Wayne Davison
f07992739a Added ifuncs.h. 2007-09-22 18:07:44 +00:00
Wayne Davison
c605c2cdbd Tweaked opening comments. 2007-09-22 18:07:17 +00:00
Wayne Davison
1b42f628f4 Moved inline functions from rsync.h into ifuncs.h. 2007-09-22 16:52:58 +00:00
Wayne Davison
5dafe360de Moving inline functions into its own .h file. 2007-09-22 16:46:49 +00:00
Wayne Davison
6619d5fcc1 Added some stub functions for compilers not smart enough to get rid
of static inline functions that are not called.
2007-09-22 14:18:32 +00:00
Wayne Davison
b960483e99 Avoid affecting the proto.h file. 2007-09-22 14:16:48 +00:00
Wayne Davison
dd4a039515 Added some stub functions for compilers not smart enough to get rid
of static inline functions that are not called.
2007-09-18 19:53:50 +00:00
Wayne Davison
229554084d Added missing "#ifdef ICONV_OPTION" conditionals. 2007-09-18 18:46:03 +00:00
Wayne Davison
4a1edb63dd If iconv_t isn't needed, define it as an "int" so that our
proto.h file can be parsed.
2007-09-18 18:45:59 +00:00
Wayne Davison
3170b20967 Mention that a negative max-connections value disables the module. 2007-09-18 14:18:45 +00:00
Wayne Davison
d34cd639fc If max-connections is < 0, disable the module. 2007-09-18 14:14:22 +00:00
Wayne Davison
236df01b15 One final tweak. 2007-09-18 14:11:25 +00:00
Wayne Davison
21cafc50cc Some minor improvements in claim_connection(). 2007-09-18 14:09:38 +00:00
Wayne Davison
de80679b67 Switching to --no-i-r from --no-ir. 2007-09-18 14:04:46 +00:00
Wayne Davison
27999abab4 Document the changed name of --no-i-r. 2007-09-18 14:03:41 +00:00
Wayne Davison
82f37486a1 Mention the --protect-args (-s) option and how it interacts with
--iconv and --files-from.
2007-09-18 01:29:36 +00:00
Wayne Davison
7820fa949f Relocated the setting of ic_ndx. 2007-09-18 01:14:33 +00:00
Wayne Davison
2ac9793064 - Added new iconvbufs() conversion function that is now used for
our --iconv support.
- Moved the setup of the ic_ndx value to compat.c.
2007-09-18 01:11:57 +00:00
Wayne Davison
a4453606cc - Improved -s support.
- Handle setup_iconv() call in parse_arguments() so it gets set early.
2007-09-18 01:11:54 +00:00
Wayne Davison
71605b0f4d - Make use of new iconvbufs() function.
- Convert protected args when -s and --iconv are active.
- Simplified the splitting of args between normal and protected.
- Relocated setup_iconv() call so that it takes effect earlier.
2007-09-18 01:11:49 +00:00
Wayne Davison
ba525f770c - Make use of new iconvbufs() function.
- Convert remote --files-from filenames when -s and --iconv are
  active.
2007-09-18 01:11:45 +00:00
Wayne Davison
2509753fd3 Make use of new iconvbufs() function. 2007-09-18 01:11:42 +00:00
Wayne Davison
5688c74d25 - Setup the ic_ndx value here with the other FOO_ndx values.
- Don't disable inc_recurse due to --no-implied-dirs.
- Set filesfrom_convert bool.
2007-09-18 01:11:35 +00:00
Wayne Davison
2ac081ff60 - Added an xbuf type for use in the --iconv and --files-from code.
- Incremented the SUBPROTOCOL_VERSION.
2007-09-18 01:11:32 +00:00
Wayne Davison
5d3e5f641d Improved -s and support cvs's -e30.8 version idiom. 2007-09-17 06:02:09 +00:00
Wayne Davison
a0f29ed824 Make sure that the hashed hard-link numbers from different file
lists can't overlap in inc_recurse mode.
2007-09-17 01:45:44 +00:00
Wayne Davison
0b515981fc Changed print_child_argv() to take its prefix message as an arg. 2007-09-16 21:41:42 +00:00
Wayne Davison
2e8259bb0b Disable -s by default. 2007-09-16 02:42:55 +00:00
Wayne Davison
d274524317 Adding knowledge of some new options. 2007-09-15 21:10:35 +00:00
Wayne Davison
71845bd2a0 That should have been -s. 2007-09-15 21:10:18 +00:00
Wayne Davison
bdd53557a8 Force knowledge the -p option, since it gets passed specially. 2007-09-15 21:08:08 +00:00
Wayne Davison
d6ca255c21 - Fixed a bug in the passing of the --max-delete option.
- Added --no-i-d as a shorter no-implied-dirs.
- Changing to --no-i-r instead of --no-ir.
2007-09-15 20:54:31 +00:00
Wayne Davison
2dc7b91dd2 Handle inheritance of SGID bit on dirs marked with FLAG_DIR_CREATED. 2007-09-15 19:58:15 +00:00
Wayne Davison
288b12eefe We set FLAG_DIR_CREATED on a dot dir that got created by
get_local_name() rather than using the (now removed)
new_root_dir global.
2007-09-15 19:58:12 +00:00
Wayne Davison
f7d6dce6c8 - Fixed an inc_recurse problem with implied dirs not getting created
with the right attributes and getting omitted from the output.
- Got rid of the directory touch-up pass in inc_recurse mode again.
  This requires us to create any missing directories early, but we
  still report on what happened in the normal course of the transfer
  sequence.
- Use the FLAG_DIR_CREATED flag instead of (the removed)
  new_root_dir global.
2007-09-15 19:58:09 +00:00
Wayne Davison
48a481c4d0 Changed FLAG_DIR_CHANGED to FLAG_DIR_CREATED. 2007-09-15 18:43:36 +00:00
Wayne Davison
8db8eacbdd - If two duplicate directories have identical outside-the-transfer
paths, we only scan one of them in inc_recurse mode.
- When unduplicating directories in inc_recurse mode, dump the
  ealier directory if it is implied.
2007-09-15 17:29:25 +00:00
Wayne Davison
e8e9e12c3a Reverting last change for a re-think. 2007-09-15 17:00:41 +00:00
Wayne Davison
6e6daf5ac6 Fixed a problem with duplicate dirs being unduplicated in the list:
in inc_recurse mode, we must keep the last dir of the duplicates.
2007-09-15 16:32:38 +00:00
Wayne Davison
e73eed8563 Added more local-network IPs to the "hosts allow" rsyncd config
so that the FreeBSD machine in the compile farm can test.
2007-09-15 15:50:59 +00:00
Wayne Davison
da1319128a - Parse hard-link info as soon as we get it in inc_recurse mode.
- Improve the chances of the generator finding a match for a
  hard-link file in inc_recurse mode.
2007-09-15 15:40:57 +00:00
Wayne Davison
f2179fd370 The server should not wait around for an extra end-of-run message. 2007-09-15 15:36:04 +00:00
Wayne Davison
969cdffbea Prevent a server from outputting an end-of-run message about its
error-code that cannot be sent successfully.
2007-09-15 15:30:45 +00:00
Wayne Davison
3b7bcaaf34 Got rid of duplicate error when push_pathname() fails. 2007-09-15 15:27:56 +00:00
Wayne Davison
4abe379c05 Added an "ndx" arg to all the finish_hard_link() calls. 2007-09-10 06:15:28 +00:00
Wayne Davison
c980db5f08 - Simplified the flist-spanning gnum logic in match_gnums().
- Don't use hlink_flist in hard_link_check().
- Made the prev_name logic in hard_link_check() better.
- Added an "ndx" arg to the finish_hard_link() call.  Also, set the
  prev value of any prior entries to the first finished item (which
  ensures that any item that follows a re-shuffled item (which was
  waiting for a transferred file to finish) can find the FIRST+DONE
  item.
2007-09-10 06:15:25 +00:00
Wayne Davison
c35d6e3522 Added --no-protect-args and --no-s. 2007-09-09 07:58:19 +00:00
Wayne Davison
044dc29307 - Made glob_expand_one() public.
- Tweaking the calling syntax for glob_expand().
2007-09-09 07:53:22 +00:00
Wayne Davison
7a4addaa74 Added the --protect-args (-s) option, and made parse_arguments()
clear out an old popt context before starting a new one.
2007-09-09 07:53:18 +00:00
Wayne Davison
f7e5068d94 - If the user specifies a source arg with a hostspec in it in a local-
source transer, complain and exit.  This can help to find option
  problems were an arg to an option turns into a local-source arg,
  and the real remote-source arg will now get rejected rather than
  attempting to find a file with a colon in its name.
- We now support the ability to specify more than one remote arg using
  the ":FILENAME" idiom for additional remote filenames.
- If the --protect-args (-s) option was specified, we send just the
  "--server -s" options to the remote rsync when it is starting, and
  then the real args are sent over the socket.
2007-09-09 07:53:15 +00:00
Wayne Davison
67b8f3dfe7 - Renamed read_line() to be read_line_old().
- Renamed read_filesfrom_line() to read_line() and added args to allow
  the caller to control how it works.
- Added a new function, read_args(), that reads args from a file
  descriptor (using read_line()) and expands any wildcards in them.
  This function has relocated daemon code (from clientserver.c) and
  is also used by the new --protect-args (-s) option.  The new code
  also got rid of an extra strdup() that wasn't needed.
2007-09-09 07:53:12 +00:00
Wayne Davison
95a44066da Call the renamed read_line() function (was read_filesfrom_line()). 2007-09-09 07:53:08 +00:00
Wayne Davison
7909e65f83 - Made start_socket_client() and start_inband_exchange() take a variable
number of remote args.
- We now exchange a "VERSION.SUBVERSION" value in the initial @RSYNCD
  message.  This is backward compatible with pre-protocol 30 rsyncs,
  and fixes a problem where rsync daemons weren't checking if they were
  speaking a compatible pre-release protocol.
- Moved the protocol-handling code (which was in two places) into a new
  function:  exchange_protocols().
- Protocol 30 now sends/receives the daemon args using NULLs as a separator
  rather than a newline.
- Moved the arg-reading code into a new function in io.c:  read_args().
2007-09-09 07:53:05 +00:00
Wayne Davison
f74a3d813b Call the renamed read_line_old() function (was read_line()). 2007-09-09 07:53:02 +00:00
Wayne Davison
ac59386027 Used a couple "#if SUBPROTOCOL_VERSION != 0" conditionals. 2007-09-09 07:52:59 +00:00
Wayne Davison
73a649b7cb Tweaked the pretend-ssh script. 2007-09-08 20:16:28 +00:00
Wayne Davison
9b49704959 Added a remote-shell substitute for use in testing and for certain
other esoteric needs.
2007-09-08 20:03:42 +00:00
Wayne Davison
ffbffc647b Improved the argv/argc variable names that are really pointers. 2007-09-08 19:42:27 +00:00
Wayne Davison
968061bb65 Clarified something in the new --hard-links text. 2007-09-04 20:10:52 +00:00
Wayne Davison
c47e3ee1b6 Fixed two flist->files[first_hlink_ndx] references. 2007-09-04 07:13:01 +00:00
Wayne Davison
549a3efbb7 Improved a sentence. 2007-09-04 06:58:19 +00:00
Wayne Davison
accf8d12bc Added a test combining -H with -c and a hard-linked file that has only
one instance inside the copy hierarchy.  (Used to fail with protocol 29
or --no-ir.)
2007-09-04 06:57:57 +00:00
Wayne Davison
0eeb9f5481 If we turn off FLAG_HLINKED, set FLAG_HLINK_DONE so that any
file-entry values affected by HLINK_BUMP() stay put.
2007-09-04 06:53:47 +00:00
Wayne Davison
7b46e30fd4 Changed HLINK_BUMP() to look for either FLAG_HLINKED or FLAG_HLINK_DONE. 2007-09-04 06:52:52 +00:00
Wayne Davison
35c8fd761f Disabled the debug messages relating to the e_fds vars. 2007-09-03 21:51:59 +00:00
Wayne Davison
ba2d43d702 - Got rid of caveat about -H not working with incremental recursion.
- Talk about how inc_recurse affects -H.
- Mention --no-inc-recursive and --no-ir options.
2007-09-03 21:32:21 +00:00
Wayne Davison
29349024c4 Improved the handling of the file-status events received by
the generator.
2007-09-03 21:21:24 +00:00
Wayne Davison
d108e04f38 We don't disable inc_recurse due to -H anymore. 2007-09-03 21:21:21 +00:00
Wayne Davison
d4d6646aae Changes to allow hard-linking to work in inc_recurse mode. 2007-09-03 21:21:17 +00:00
Wayne Davison
cf2d26656d - Changes to allow hard-linking to work in inc_recurse mode.
- Incremented SUBPROTOCOL_VERSION to 7.
2007-09-03 21:21:12 +00:00
Wayne Davison
7918f24405 Changed some instances of \" in checkit calls to '. 2007-09-03 20:43:58 +00:00
Wayne Davison
9544261a45 Added weeding of "sending incremental file list" line to filter_outfile(). 2007-09-03 19:52:35 +00:00
Wayne Davison
354c9da60d Added hashtable.o. 2007-09-03 04:59:15 +00:00
Wayne Davison
626065702f Removed the old version of the hashtable functions and updated
the code to use the structures and functions calls.
2007-09-03 04:59:12 +00:00
Wayne Davison
9863bdbc93 - Use the new hashtable structures and functions.
- Tweaked a {read,write}_varint30() call set that didn't need to be "30".
2007-09-03 04:59:09 +00:00
Wayne Davison
83135e8f6a Updated hashtable structures. 2007-09-03 04:59:05 +00:00
Wayne Davison
369233927c The hashtable routines from hlink.c modified to have more generic names,
to support 2 sizes of key (32 and 64 bits), and to have a non-allocating
option for the find routine (returning NULL for no match).
2007-09-03 04:46:57 +00:00
Wayne Davison
7e4b6b7bc4 Use new0() function instead of new() followed by memset(). 2007-09-03 04:19:11 +00:00
Wayne Davison
a2dc4d687b Tweaked _new_array() to handle new use_calloc parameter. 2007-09-03 04:19:02 +00:00
Wayne Davison
a4431563e8 Added new0() and new_array0() to allocate and zero the memory. 2007-09-03 04:18:58 +00:00
Wayne Davison
fbd91cae0c One more tweak to latest omit-dir-times code. 2007-09-02 06:25:26 +00:00
Wayne Davison
eb7a6e09cb Added --no-omit-dir-times and --no-O. 2007-09-02 06:20:42 +00:00
Wayne Davison
9889a34bf2 Don't include the checksum_seed in the full-file MD5 checksum. 2007-09-02 06:00:30 +00:00
Wayne Davison
8e1e60e98f Bump up the SUBPROTOCOL_VERSION number. 2007-09-02 06:00:27 +00:00
Wayne Davison
f9998046a3 Made omit_dir_times a static variable in options.c by encoding
all the time-preserving semantics into preserve_times.
2007-09-01 16:57:01 +00:00
Wayne Davison
07bbf8703f Document the new --append and --append-verify options. 2007-09-01 16:38:09 +00:00
Wayne Davison
77502cbade Downgrade the new --append option to --append-verify for protocols < 30. 2007-09-01 16:38:04 +00:00
Wayne Davison
936fa865e1 Handle the new --append and --append-verify options. 2007-09-01 16:38:00 +00:00
Wayne Davison
2f188c8d96 Tweaked a comment. 2007-09-01 00:59:44 +00:00
Wayne Davison
83f5394810 Make the verbose message about the file-list expansion clearer in
what is being expanded.
2007-08-29 23:10:16 +00:00
Wayne Davison
24d677fc16 Don't omit the -4/-6 options if no IPv6 support was compiled into
rsync.  Just make them a no-op.
2007-08-22 00:36:56 +00:00
Wayne Davison
65a22a5ff7 In pool_free_old(), one code path was not clearing a "next" pointer,
so the code could try to free an extent twice in certain circumstances.
2007-08-21 05:04:02 +00:00
Wayne Davison
a0f70237f5 Fix pool_create() to honor the POOL_INTERN flag.
(Thanks to Brion Vibber.)
2007-08-21 04:54:30 +00:00
Wayne Davison
4eff3051a0 Fixed a null-pointer dereference pointed out by Olivier Thauvin. 2007-08-16 01:22:46 +00:00
Wayne Davison
e208631a5b Improved the arg-checking of a daemon command. 2007-08-11 16:53:31 +00:00
Wayne Davison
b553a3dd20 Document the RSYNC_CONNECT_PROG environment variable. 2007-08-11 16:51:48 +00:00
Wayne Davison
e5f1a96ff8 Added support for a %H escape in the value of the RSYNC_CONNECT_PROG
environment variable.
2007-08-11 16:20:56 +00:00
Wayne Davison
eb7e7b2499 Get rid of the comment that --xattrs implies --perms and the
outdated text that said it was a non-standard option.
2007-08-04 22:19:49 +00:00
Wayne Davison
3caafdfd2f Make the --xattrs option not imply --perms. 2007-08-04 22:19:43 +00:00
Wayne Davison
26ac181223 Let's go with "delta transfer algorithm" (thanks, Matt). 2007-08-04 19:09:26 +00:00
Wayne Davison
7fa60281bf Avoid a crash if pop_local_filters() has some pointer gaps. 2007-08-04 19:09:21 +00:00
Wayne Davison
73f2fa8189 - Call the rsync algorithm differential rather than incremental.
- Don't refer to --files-from in the talk of incremental recursion,
  since it might make people think that --files-from disables
  incremental recursion for any recursively scanned directories.
2007-08-04 17:47:08 +00:00
Wayne Davison
75f162e46f - Use the new XMIT_NON_XFER_DIR flag.
- Make sure that non-inc-recurse mode sets FLAG_XFER_DIR on all
  the non-implied directories.
- Don't set FLAG_XFER_DIR on non-directories.
2007-08-04 17:47:02 +00:00
Wayne Davison
1d2ca00703 - Added XMIT_NON_XFER_DIR flag.
- Incremented the SUBPROTOCOL_VERSION number.
2007-08-04 17:46:59 +00:00
Wayne Davison
4d91a5f8f4 Only honor XFLAGS_HLINKED on a non-directory. 2007-08-04 16:10:37 +00:00
Wayne Davison
61cb031ca4 Changed flags variable in send_file_entry() to xflags. 2007-08-04 16:08:16 +00:00
Wayne Davison
ff0c27c926 Files with the same size should also be skipped by --append. 2007-08-01 22:47:36 +00:00
Wayne Davison
d1d0a7051f Don't output a negative time-remaining value if the file has grown. 2007-08-01 22:35:54 +00:00
Wayne Davison
444f9f7b04 Fixed the port-parsing in an rsync:// path; e.g., this now
works properly:  rsync://backup@otherbox/module/a:123:b
2007-08-01 22:25:02 +00:00
Wayne Davison
411c04f06f If readdir() gives us an empty name, reject it. 2007-08-01 22:18:46 +00:00
Wayne Davison
5d935dce63 If --no-ir is specified, pass it to the server. 2007-07-24 04:09:46 +00:00
Wayne Davison
b88f6fe7e5 Let's try using egrep instead of grep since grep on Solaris
systems was failing to work right.
2007-07-15 06:37:17 +00:00
Wayne Davison
e6109f496c Updated the --max-delete docs. 2007-07-15 06:01:27 +00:00
Wayne Davison
836ce36a4f Mention the improved --max-delete behavior. 2007-07-15 05:51:05 +00:00
Wayne Davison
35da2ec35a We don't need a compatibility check for --max-delete anymore. 2007-07-15 05:43:05 +00:00
Wayne Davison
7b9598b2d5 We now take a negative value specified to --max-delete as being
synonymous with --max-delete=0.  We also pass a request for 0
deletions to the server as --max-delete=-1.  This ensures that we
can send a backward-compatible option to old and new versions alike.
2007-07-15 05:42:30 +00:00
Wayne Davison
4a4622bbe5 Improve the description of --update with respect to symlinks and
special files.
2007-07-14 22:24:03 +00:00
Wayne Davison
c9ec460807 Make extra-verbose output of touch_up_dirs() only mention the dirs. 2007-07-14 21:58:36 +00:00
Wayne Davison
79cd0c7fa4 Using --relative with --no-implied-dirs turns off incremental recursion.
(A temporary measure until some bugs can be fixed.)
2007-07-14 21:49:11 +00:00
Wayne Davison
de8c8b28c0 - When --omit-implied-dirs is specified and the creation of a directory
fails, we must make sure that the item we're skipping has a name that
  is still inside the missing hierarchy by using a prefix matching func.
- We now handle the failure to remove a file to create a dir the same
  way as a failed mkdir() (skipping the failed dir's contents).
2007-07-14 21:25:51 +00:00
Wayne Davison
569e6f432b - Made f_name() and f_name_cmp() take const pointers.
- Added f_name_has_prefix().
2007-07-14 21:21:15 +00:00
Wayne Davison
0d585188f9 Make sure that any "dont compress" patterns that have wildcards in a
suffix match stay in the wildcard-matching list.
2007-07-14 19:36:52 +00:00
Wayne Davison
34ca58d440 The "dont compress" daemon option points to the --skip-compress option
for the default set of non-compressed file suffixes.
2007-07-14 19:32:10 +00:00
Wayne Davison
9c528e2935 Mention the latest changes. 2007-07-14 19:29:04 +00:00
Wayne Davison
2b967218eb Document --skip-compress. 2007-07-14 19:24:44 +00:00
Wayne Davison
6e058b4b60 - Added support for the new --skip-compress option.
- Optimized the matching of non-compressing file suffixes.
2007-07-14 19:24:35 +00:00
Wayne Davison
b1e436ec17 Parse the --skip-compress=LIST option and sent it to the sending side. 2007-07-14 19:24:32 +00:00
Wayne Davison
4319cc56d8 Added more suffixes to the default "dont compress" value. 2007-07-14 19:24:27 +00:00
Wayne Davison
952ae75138 Make sure that --dry-run with --del doesn't output extraneous info
when the dest directory does not exist.
2007-07-14 04:47:42 +00:00
Wayne Davison
4d745d3cf5 The delete-during code needs to skip directories that don't exist
yet in --dry-run mode to avoid outputting bogus delete details.
2007-07-14 04:20:13 +00:00
Wayne Davison
8798be8e63 Mention license change. 2007-07-14 04:06:33 +00:00
Wayne Davison
42b06481c3 Made some descriptions concerning modification times clearer. 2007-07-12 14:43:26 +00:00
Wayne Davison
dbe287b701 Needed to use ndx_end in decrement_flist_in_progress(). 2007-07-12 14:04:11 +00:00
Wayne Davison
8e3b627d07 Mention how --ignore-existing can be useful for restarting a copy
that uses --link-dest.
2007-07-10 14:49:35 +00:00
Wayne Davison
809724d7e2 - Use "filename", not "file name".
- Say "regular file" instead of "file" when itemizing a list of
  non-directory types.
- Try to avoid "file" in its generic sense, as it is hard to figure
  out when it includes dirs and when it doesn't.
2007-07-10 14:21:59 +00:00
Wayne Davison
8e41b68e8f Tweaking the license text a bit more. 2007-07-10 13:55:49 +00:00
Wayne Davison
dc77edf218 Martin gave his approval to use GPLv3 with this code. 2007-07-09 01:24:01 +00:00
Wayne Davison
65ba6af61b - Do directory touch-ups at the end, even in inc-recurse mode.
- Use the latest F_DIR_*() defines (whose names were tweaked).
2007-07-08 20:53:42 +00:00
Wayne Davison
83d5e90054 - Use the new DEV_EXTRA_CNT and DIRNODE_EXTRA_CNT defines.
- Use the latest F_DIR_*() defines (whose names were tweaked).
2007-07-08 20:53:38 +00:00
Wayne Davison
e434f0ebfe Use the latest F_DIR_*() defines (whose names were tweaked). 2007-07-08 20:53:35 +00:00
Wayne Davison
a08979d564 - Define DEV_EXTRA_CNT and DIRNODE_EXTRA_CNT.
- Define and use ACL_BUMP(), fixing a clash between -A and -x in a
  directory's data.
- Tweaked the F_DIR_*() defines to have more consistent names.
- Don't make F_SUM() return a char pointer that is const.
2007-07-08 20:53:31 +00:00
Wayne Davison
252af65bb4 Changed the spots that referred to the filter_level as filter_flags
to make the naming consistent.
2007-07-08 06:30:28 +00:00
Wayne Davison
d048c2f225 Added a test for --prune-empty-dirs. 2007-07-08 06:25:57 +00:00
Wayne Davison
9b9d5f89b3 Got rid of the output differences for protocol 30 since it is now
the same as earlier protocols.
2007-07-08 06:25:54 +00:00
Wayne Davison
e5bf3b5855 - Incremental recursion mode does not process the dirs while scanning a
file list's contents.  Instead, it handles a parent dir prior to each
  extra file list.  This makes the dir-processing order the same in
  protocol 30 as it is in earlier protocols.
- Moved the permission-fudging code for dirs into recv_generator() to
  make the new protocol-30 dir-handling logic easier.
2007-07-08 06:25:51 +00:00
Wayne Davison
6755a7d742 If we get an ndx that is 1 entry prior to an incremental flist's
start, it refers to the file list's parent dir.
2007-07-08 06:25:47 +00:00
Wayne Davison
5459e693a3 - The sending side now sets the parent_ndx value in each file list.
- Leave a 1-entry gap between incremental file lists so that we can use
  that index value to refer to the parent directory of each file list.
- Set and use the new ndx_end value in the file list.  The incremental
  recursion mode omits dirs in this value (except in the first list)
  since the generator will be using the new "gap" ndx value to process
  each parent dir.
2007-07-08 06:25:42 +00:00
Wayne Davison
24108eb854 - Increased the SUBPROTOCOL_VERSION to 4 due to the new dir-ndx logic.
- Added ndx_end value to struct file_list.
2007-07-08 06:25:36 +00:00
Wayne Davison
4635fb9995 Avoid the prune-empty-dir code when cleaning a file list created
by get_dirlist().
2007-07-07 20:43:14 +00:00
Wayne Davison
9decb4d2ef Changed "count" to "used" in struct file_list since there can
be empty items that make the count inaccurate (and the name
somewhat deceiving).
2007-07-07 20:22:05 +00:00
Wayne Davison
b3b326016a The length check in make_file() doesn't need to subtract pathname_len
anymore, as the sender code never concatenates the F_PATHNAME() value
with the dirname+basename string these days.
2007-07-07 16:01:59 +00:00
Wayne Davison
4bde45f60e Make the comment even better. 2007-07-07 15:37:56 +00:00
Wayne Davison
4fd842f98d Switching to GPL 3. 2007-07-07 05:33:14 +00:00
Wayne Davison
f92f5b166e Tweaked a comment to remove a (really old) rsync version reference. 2007-07-07 05:25:50 +00:00
Wayne Davison
9b25ef35bd Switch the checking of preserve_[ug]id var to checking [ug]id_ndx var
when the code is about to use the [ug]id_ndx value as an index (since
this saves a memory reference).
2007-07-02 22:11:23 +00:00
Wayne Davison
7c73536c25 Use module_dir instead of lp_path(). 2007-07-02 22:06:48 +00:00
Wayne Davison
33cbd577ad If a module's path is not absolute, make it absolute. 2007-07-02 22:02:14 +00:00
Wayne Davison
524eaa8245 We omit copying any user-space rsync.%FOO attributes unless the
user specified -X twice.
2007-07-02 21:35:14 +00:00
Wayne Davison
9742b386b3 Make option variables a little clearer by using separate FOO_ndx
values to index into the file-list extra-attribute array instead
of abusing the preserve_FOO variables.
2007-07-02 21:29:49 +00:00
Wayne Davison
8b498b9f1a Decided against the last change. 2007-06-06 15:43:34 +00:00
Wayne Davison
c04af69701 Allow a NULL address to be passed to pool_free_old() to indicate that
it should free all old mem and reset to an empty state.
2007-06-06 15:38:31 +00:00
Wayne Davison
f87fb190b3 Check for the setacl command for Tru64 (which doesn't have setfacl). 2007-06-02 16:44:23 +00:00
Wayne Davison
a21e72c3e6 Attempting to make the mask test compatible with Solaris 8. 2007-06-02 16:30:04 +00:00
Wayne Davison
1c4ffe64db Mention the pool_alloc changes. 2007-05-29 04:23:50 +00:00
Wayne Davison
abdcb21a7a Unified the file-list pool used in incremental recursion mode so that
we use less memory, especially in small transfers.  As file lists are
discarded, we use the new pool_boundary() and pool_free_old() functions
to discard pool extents that are no longer needed.
2007-05-29 04:19:47 +00:00
Wayne Davison
f5ba7bfbb6 - Changed FILE_EXTENT to NORMAL_EXTENT and HLINK_EXTENT to SMALL_EXTENT.
- Added a pool_boundary variable to struct file_list.
2007-05-29 04:19:44 +00:00
Wayne Davison
676e604135 Added pool_free_old() and pool_boundary() functions to add a way to
free all wholly affected extents older than a particular point in time.
2007-05-29 04:19:41 +00:00
Wayne Davison
3fac8ca8d1 Tweaked a variable and a label to make them less confusing. 2007-05-29 02:47:23 +00:00
Wayne Davison
33766a8daa Improvements to increase clarity, fix misstatements, add missing
punctuation, and fix some typos.
2007-05-29 02:46:44 +00:00
Wayne Davison
e3d27df444 - Fixed a bug where a pool_free() on the most-recently allocated pool
item was trying to make that memory available to the pool, but it
  failed to adjust the right variable.
- Fixed a bug in pool_free() where the return of the entire live
  extent back to unallocated status did not obey POOL_CLEAR.
- Use the new() and new_array() functions instead of malloc().
- Changed the sqew variable to skew.
- Some other minor formatting tweaks.
2007-05-29 00:52:08 +00:00
Wayne Davison
6aa27a7ce5 - Do less seeking when writing a sparse file.
- Don't rewrite the last byte of a file in sparse mode when the
  file didn't end with a null char.
2007-05-26 21:46:22 +00:00
Wayne Davison
47cffb77de Handle EINTR in a couple places where we handle the --file-from I/O. 2007-05-26 21:44:19 +00:00
Wayne Davison
565a340b0a Changed verbosity back from -vvvv to -vv. 2007-05-25 14:32:08 +00:00
Wayne Davison
f45b64d8dd Improved the sort comment. 2007-05-25 14:29:35 +00:00
Wayne Davison
56ce72c447 Improved a comment. 2007-05-25 14:23:05 +00:00
Wayne Davison
898fab2577 Got rid of superfluous acl_clear_perms() call that Antti Tapaninen
pointed out.
2007-05-25 14:16:57 +00:00
Wayne Davison
0e5dd89866 Mention latest improvements. 2007-05-24 23:11:33 +00:00
Wayne Davison
79028af116 Changed dup-detection code to keep the first item in the user's args.
This is more in keeping with the way cp works, and also makes the dir-
joining code (in inc_recurse mode) easier.
2007-05-24 23:08:39 +00:00
Wayne Davison
a572e12675 - Added fsort() and fsort_tmp() that implement a mergesort routine
that ensures that any identical items in the file-list stay in the
  same order as they had in the input.  It will also obey the --qsort
  option (which causes it to punt the sort to the qsort() routine).
- Changed the various places that sort the file-list to call fsort().
2007-05-24 02:50:41 +00:00
Wayne Davison
c8e8394615 If someone forces the use of qsort() via --qsort, disable incremental
recursion (at least for now).
2007-05-24 02:50:38 +00:00
Wayne Davison
8487f9cf29 - Added the --qsort option.
- Added several new --no-FOO options.
2007-05-24 02:50:35 +00:00
Wayne Davison
d750be6ad8 Make sure we don't try to output a NULL pointer in a verbose message. 2007-05-23 00:48:27 +00:00
Wayne Davison
0bb8616535 - Output a -vvv(erbose) message in the touch_up_dirs() loop.
- Made the keep-alive counter in touch_up_dirs() work better.
- Use !(N & 0xFF) instead of !(N % 200).
2007-05-23 00:42:38 +00:00
Wayne Davison
1faa1a6da9 Output a -vvv(erbose) message when receiving an incremental file list. 2007-05-23 00:42:32 +00:00
Wayne Davison
b5ae4e25c2 Added a comment to the do_chmod() to mark it as a discouraged function. 2007-05-22 05:59:02 +00:00
Wayne Davison
3d0a159d96 Added a comment to a shared iterator to avoid a warning from IBM's checker. 2007-05-22 05:58:59 +00:00
Wayne Davison
8ea07c0030 - Changed the dir_flist code on the sending side to derive its sorted
data from the sorted parent flist.  This ensures that any entries
  marked with FLAG_DUPLICATE are in the same order in the dir_flist
  (where the flags get checked) as they are in the parent flist
  (where the flags get set).
- Made the flist_expand() function static.
- Added a growth count arg to flist_expand().
- Made make_file() set a pool variable instead of tweaking flist.
- Improved the error message when a dir-number is out of bounds.
2007-05-22 05:50:47 +00:00
Wayne Davison
59fd2a5e7d Improved the error message when a dir-number is out of bounds. 2007-05-22 05:50:41 +00:00
Wayne Davison
ae87c43452 One more output_flist() call that should verify if my analysis
of the Solaris 10 host's merge-test failure is correct or not.
2007-05-22 03:58:18 +00:00
Wayne Davison
f1599b9ef2 Be more verbose so that we can debug what is going wrong on solaris. 2007-05-22 00:00:51 +00:00
Wayne Davison
ee83e1bd4d Improved the index values that output_flist() outputs when we're being
extra verbose:  they now have the list's ndx_start value added in.
2007-05-22 00:00:07 +00:00
Wayne Davison
7455467c17 One more try at silencing some checker warnings. 2007-05-21 23:45:26 +00:00
Wayne Davison
19395697b9 Let's see if we can silence some more code-checker warnings. 2007-05-21 18:39:05 +00:00
Wayne Davison
7787579ad4 Added some "FALL THROUGH" comments in the main switch. 2007-05-21 10:20:18 +00:00
Wayne Davison
58a37ed34a Get rid of compiler warning about iconv()'s second parameter. 2007-05-21 03:56:06 +00:00
Wayne Davison
fe8d61e5d5 Fixed a thinko in the calling of recv_add_gid(). 2007-05-21 03:20:39 +00:00
Wayne Davison
87b0cc726b Got rid of the temporary "set -x" that was added for debugging. 2007-05-21 03:09:25 +00:00
Wayne Davison
4504b2259f The match_gid() function needed to affect the *flags_ptr value
when re-using the last-found match.
2007-05-21 03:08:55 +00:00
Wayne Davison
cf1b4969b9 The recv_file_entry() function needed to remember the gid flags so that
it can reuse them when the gid stays the same.
2007-05-21 03:08:01 +00:00
Wayne Davison
434e77193c Set -x option to diagnose what is going wrong on FreeBSD. 2007-05-21 02:31:20 +00:00
Wayne Davison
858d45f160 Cast some F_OWNER()/F_GROUP() values to make sure that we don't get
a signed/unsigned compiler warning on some systems.
2007-05-21 02:17:48 +00:00
Wayne Davison
63186ec077 Fixed a problem in a couple OS's sys_acl_get_access_bits() functions. 2007-05-21 02:09:45 +00:00
Wayne Davison
dfcb386569 Make sure that the scratch dirs have rwx permissions before we try
a recursive rm.
2007-05-21 02:06:51 +00:00
Wayne Davison
d15f2ff0cf Tweaked a sentence in the --size-only section. 2007-05-21 01:06:16 +00:00
Wayne Davison
c395acd804 Create a symlink back to the source dir in the scratchdir of a test. 2007-05-21 01:05:36 +00:00
Wayne Davison
030820d5dc - Unified the formerly separate user & group name-lists into a single
name-list.  On POSIX systems, this list will be sorted with the user
  names first, so the code will work essentially the same way it did
  before for the currently supported OSes.  However, the code will now
  more easily support non-POSIX ACL setups such as (hopefully) the one
  used in OS X.
- Increased the (potentially) available access-bit storage for name
  elements from 3 to 31 bits.  For non-name elements, the access bits
  now have the potential to store 7 bits instead of 3.  (All the
  current POSIX implementations still error-check their values at 3
  bits, but this will allow adding non-POSIX ACL setups more easily.)
- The protocol that transmits the ACL information was changed to send
  names in a single list, and to use {read,write}_varint() functions
  instead of {read,write}_byte().  This supports sending access-bit
  values up to 32-bits (minus any bits reserved for xmit flags).
- The construction of the internal access-bit value was moved into the
  lib/sysacls.c code, so that it could be handled in an appropriate
  manner for each OS.

(Aside: the code still does not support transmitting incompatible ACL
information between systems, but I envision improving --fake-super to
store the ACL information that is received as xattr information, and
this would allow a system that supports extended attributes to backup
a source system that had an incompatible ACL method.)
2007-05-21 01:04:40 +00:00
Wayne Davison
043ef55b22 - Define what the valid access bits are for a name element and a
non-name element.
- Set a define when the OS needs the name-list sorted.
- Got rid of the permset-related defines.
- Got rid of some function prototypes that rsync doesn't need.
- Got rid of the defines for the do-nothing ACL code.
2007-05-21 01:04:37 +00:00
Wayne Davison
a30dcbc0a8 - Added a function to get/set all the access-bit values with a single
call.  This allows the per-OS compatibility code to construct the
  value with however many bits are supported by each OS.
- Removed several functions that rsync doesn't (and won't) need.
- Got rid of the do-nothing ACL code (the ACL code in rsync should be
  disabled on a system that we can't support).
2007-05-21 01:04:34 +00:00
Wayne Davison
02f0227e87 Changed SUBPROTOCOL_VERSION from 2 to 3 because of the ACL protocol changes. 2007-05-21 01:04:31 +00:00
Wayne Davison
142a5e7b8b Moved GID_NONE define from rsync.h to uidlist.c. 2007-05-20 07:40:07 +00:00
Wayne Davison
fdfc67406c - Added more users and some groups to one of the files we're copying. 2007-05-20 07:10:48 +00:00
Wayne Davison
fb7b9ddcb1 - Use F_OWNER() and F_GROUP() instead of F_UID() and F_GID(). 2007-05-20 07:10:45 +00:00
Wayne Davison
4ade505c7e - Use F_OWNER() and F_GROUP() instead of F_UID() and F_GID().
- Use the new FLAG_SKIP_GROUP define.
2007-05-20 07:10:41 +00:00
Wayne Davison
1564cd5a87 - Use F_OWNER() and F_GROUP() instead of F_UID() and F_GID().
- Made recv_file_entry() name the xmit-flags variable "xflags" to
  prevent confusion with the internal flags value we're creating.
- Added an arg to the calls of recv_group_name() and match_gid().
- Use the improved function names: send_id_list() and recv_id_list().
- Improved the display of the GID values in output_flist().
2007-05-20 07:10:37 +00:00
Wayne Davison
33233b4900 - Fixed a bug in the match_racl_ids() function's iteration.
- Fixed a bug with preserving a group ID in an ACL when running as
  a non-super user that the user is not a member of.
2007-05-20 07:10:34 +00:00
Wayne Davison
d6b422a61c - Changed id & id2 from int to id_t in the struct iflist.
- Added a uint16 flags var to struct iflist.
- We now mark a group with FLAG_SKIP_GROUP if the receiving user
  can't set a group rather than turning it into GID_NONE.  This
  allows us to keep the real group ID mapping, which is needed by
  the ACL code.
2007-05-20 07:10:31 +00:00
Wayne Davison
ff2001b91b - Added FLAG_SKIP_GROUP define.
- Removed F_UID() and F_GID() defines.
2007-05-20 07:10:28 +00:00
Wayne Davison
d858b27400 A couple more minor tweaks. 2007-05-08 17:04:05 +00:00
Wayne Davison
1874f7e2e1 Improved the documentation on the "quick check" algorithm and the
--size-only option.
2007-05-08 17:01:24 +00:00
Wayne Davison
377d22ab9f If the server is exiting with an error, delay our exit just a little
in order to give the client side a better chance of reading any error
message we just sent.
2007-05-06 19:44:26 +00:00
Wayne Davison
4f3797c7e2 Clumped some option-sending together that only happens on the sending side. 2007-05-05 18:34:37 +00:00
Wayne Davison
6b5a8f80fc Try a better way to deduce if the xattr functions we need are there. 2007-04-30 02:58:14 +00:00
Wayne Davison
bf10faa9dc Added a "sleep 1" to make certain failures more reproducible. 2007-04-29 15:01:57 +00:00
Wayne Davison
548ca46fec Use the --super option for the non-fake test, just in case a system
can chown without appearing to be root (uid 0).
2007-04-28 23:47:16 +00:00
Wayne Davison
e8c64ffdc7 If the lgetxattr() function isn't found, disable xattr support. 2007-04-28 18:40:23 +00:00
Wayne Davison
0eb05245f1 Authorize 10.0.1.2 for one of the BSD test-farm systems. 2007-04-28 17:22:53 +00:00
Wayne Davison
0156c7842d Improved the --iconv description. 2007-04-27 14:09:22 +00:00
Wayne Davison
1acb8f5119 Added the $(CHECK_SYMLINKS) var to installcheck target. 2007-04-27 13:52:07 +00:00
Wayne Davison
76e754a0fd Fixed the buildability of the file without ICONV_OPTION enabled. 2007-04-27 00:19:21 +00:00
Wayne Davison
e7f905accb Fixed the comment about --iconv. 2007-04-27 00:19:02 +00:00
Wayne Davison
a9a8bc962c Got rid of the --no-ir kluge in this test. 2007-04-26 23:15:51 +00:00
Wayne Davison
a6e7b97868 - Fixed the merging of duplicated directory hierarchies in incremental
recursion mode.
- Fixed some problems with --iconv in incremental recursion mode.
2007-04-26 23:15:47 +00:00
Wayne Davison
1befb74b13 Refer to the right sorted/unsorted file list array in touch_up_dirs(). 2007-04-26 23:15:43 +00:00
Wayne Davison
8f3335a18c The server now needs the F_NDX() data for --iconv with incremental
recursion.
2007-04-26 23:15:39 +00:00
Wayne Davison
505c0579f7 Added FLAG_DUPLICATE for the sender to mark a duplicate flist entry
(which is better on the sending side than clearing the duplicate's
data).
2007-04-26 23:15:36 +00:00
Wayne Davison
a430691df1 Prevent a hang in incremental-recursion mode when the receiver encounters
an error updating the file:  the receiver now sends MSG_NO_SEND to the
generator so that it knows when all outstanding work is completed.
2007-04-26 23:06:38 +00:00
Wayne Davison
332cf6df7c The --iconv option has now made it to the trunk. 2007-04-26 05:53:13 +00:00
Wayne Davison
3f7afe7ec1 Changed a "mkdir -p" into a makedir. 2007-04-26 05:32:38 +00:00
Wayne Davison
8fc4033ef0 Changed F_ROOTDIR() to F_PATHNAME(). 2007-04-26 00:23:52 +00:00
Wayne Davison
ef35abb2b7 - Renamed flist_dir to pathname to avoid confusion with dir_flist var.
- Renamed push_flist_dir() to push_pathname().
- Set a pool var in recv_file_ent() instead of playing games with flist.
- Simplified the top_flags computation in send_file_list().
2007-04-26 00:23:48 +00:00
Wayne Davison
0b68d6b6f4 Create symlinks for fake tests. 2007-04-24 19:33:12 +00:00
Wayne Davison
f1271537a4 Put the files down in a subdir so that we test backup's dir-
creating functionality (which had a bug until recently).
2007-04-24 19:03:54 +00:00
Wayne Davison
b13505da1d Need to call unmake_file() instead of free() on a file_struct. 2007-04-24 18:43:31 +00:00
Wayne Davison
7ea6ea98c8 Use a single makepath call with multiple args. 2007-04-24 18:21:08 +00:00
Wayne Davison
d1798a2fda Allow makepath to take multiple args. 2007-04-24 18:19:25 +00:00
Wayne Davison
e911ff75d6 Specify an arg sequence that was recently failing to work. 2007-04-24 18:18:57 +00:00
Wayne Davison
49f7162e7d Use a slightly different rsync calling syntax. 2007-04-24 18:18:29 +00:00
Wayne Davison
3bb88b4388 Fixed a directory push problem with the user specified an arg
with a subdir followed by an arg with no subdirs.
2007-04-24 17:53:54 +00:00
Wayne Davison
b3fbe3ce35 The chown script now has a --fake-super mode if the script name has
"fake" in it.  Added a symlink named chown-fake.test.
2007-04-24 17:22:01 +00:00
Wayne Davison
9557eabaa7 Made the devices.test script do a real device test when called
normally, or a fake-device test when called with "fake" in the
script name.  Added a devices-fake.test symlink.
2007-04-24 17:06:09 +00:00
Wayne Davison
acac1f5c6f Conditionalize xattr code for systems without xattr support. 2007-04-24 16:54:38 +00:00
Wayne Davison
3427355422 A little more popt tweaking. 2007-04-24 16:11:02 +00:00
Wayne Davison
cbf626fd62 Fixed build problem for tls for those using the included popt. 2007-04-24 16:06:29 +00:00
Wayne Davison
1c702303eb Moved the header info from smb_acls.h into lib/sysacls.h. 2007-04-24 08:11:02 +00:00
Wayne Davison
9a234269ed Improved the usage message. 2007-04-24 08:00:49 +00:00
Wayne Davison
db9c9e2766 Added arg-parsing to tls.c. 2007-04-24 07:52:45 +00:00
Wayne Davison
9439c0cb5a Adding the --fake-super option. 2007-04-24 07:32:44 +00:00
Wayne Davison
2ed790f354 Improved the SUBPROTOCOL_VERSION code a little, and bumped the value
to 2.
2007-04-23 19:54:07 +00:00
Wayne Davison
486f8cd1ab Changed the prerelease-protocol support to use an idiom that will not
slow down the initial version handshake between the two sides.
2007-04-23 19:03:29 +00:00
Wayne Davison
875a13b42c No need to reset quiet, since we tell parse_arguments() that it
should prevent quiet from getting set.
2007-04-23 18:40:00 +00:00
Wayne Davison
719522b9bd Tweaked --version in a few minor ways, including the mentioning of
the SUBPROTOCOL_VERSION if it is non-zero.
2007-04-21 19:46:19 +00:00
Wayne Davison
753849fdbc Batch files need to be written with the new subprotocol value
for protocol 30.
2007-04-21 19:32:46 +00:00
Wayne Davison
bb25779de7 Mention how many bits our local timestamps support. 2007-04-21 19:31:54 +00:00
Wayne Davison
348d54d6d1 Mention the latest changes that have been made. 2007-04-21 19:27:04 +00:00
Wayne Davison
4471d9e570 Added a way to exchange a protocol's sub-protocol value. This will be
0 when a protocol goes final, and non-zero for an intermediary CVS
version of a protocol that is in flux.  If we find that we're talking
to a CVS version with a different sub-protocol #, we automatically
drop back to the prior protocol that the sides have in common.
2007-04-21 18:40:42 +00:00
Wayne Davison
19d4cac996 We now allow verbose messages to be sent when forwarding incremental-recursion
file-list data from the receiver to the generator.
2007-04-20 22:40:01 +00:00
Wayne Davison
e4c877cf70 Added a message queue for the receiver->generator messages to handle the case
where the message pipe is being used to forward the file-list data.
2007-04-20 22:39:58 +00:00
Wayne Davison
f14b3ef430 Verify that the modtime value is not being truncated, and complain if it is. 2007-04-20 22:39:55 +00:00
Wayne Davison
f3c93b1761 Check the size of a time_t. 2007-04-20 21:39:08 +00:00
Wayne Davison
a72ba0cfac Call the new {read,write}_varlong30() names for the long-int
functions that are protocol sensitive.
2007-04-20 08:17:06 +00:00
Wayne Davison
ba59bd68fc - Call the new {read,write}_varlong30() names for the long-int
functions that are protocol sensitive.
- Changed the sending of the time value in protocol 30 to support
  64-bit values without bloating positive 32-bit values.
2007-04-20 08:17:03 +00:00
Wayne Davison
1c60d21947 Got rid of the NVAL*() defines. 2007-04-20 08:16:59 +00:00
Wayne Davison
473feecff3 Added {read,write}_varlong30() inline functions to use the
right long-int function based on protocol version.
2007-04-20 08:16:56 +00:00
Wayne Davison
351e23ad8e - Changed the {read,write}_longint() functions into separate
{read,write}_varlong() and {read,write}_longint() functions:
  the former handles variable-length transmissions, and the
  latter is backward-compatible with older rsync versions.
- Improved the {read,write}_var{int,long}() functions to be
  simpler and to use a different byte order.
- The {read_write}_varlong() functions also allow the caller
  to specify the minimum number of bytes to send.  This allows
  time values to be sent efficiently with a 4-byte minimum,
  while length values continue to be sent with a (more optimal
  for them) 3-byte minimum.
2007-04-20 08:16:53 +00:00
Wayne Davison
f31514adb7 Changed the *_abbbrevint() functions to *_varint(). 2007-04-20 02:17:58 +00:00
Wayne Davison
2fcc265c2f Got rid of protocol-29 check. 2007-04-18 03:30:53 +00:00
Wayne Davison
b58e40332f If ssh access is not enabled, use a shell function to test that
we can copy using a spawned rsync process.
2007-04-18 03:23:26 +00:00
Wayne Davison
a217c45359 Got rid of ACL's uid/gid iterators in favor of a single function
that converts the uids & gids in a loop.
2007-04-18 02:33:02 +00:00
Wayne Davison
764782662d Can eliminate the testtmp.* ignore rule now. 2007-04-14 07:11:32 +00:00
Wayne Davison
4b24f4a2b5 Changed scratchbase from using a "testtmp." name prefix to using a
"testtmp/" name prefix (i.e. using a subdir).  This allows me to create
a testtmp as a symlink to a different file system to assist with testing
ACLs and xattrs.
2007-04-14 07:10:52 +00:00
Wayne Davison
c64ff141b8 Improved the description of the --checksum option. 2007-04-12 02:44:41 +00:00
Wayne Davison
1b896f8d1e The check for GCC <= 2 was in the wrong part of an #ifdef sequence. 2007-04-12 02:37:31 +00:00
Wayne Davison
01894cf01f Allow a local-server copy to use -X and -A even if a --protocol-version
is forced, which makes some testing idioms easier.
2007-04-07 19:22:20 +00:00
Wayne Davison
16edf86595 The improved --xattrs option is landing on the trunk. 2007-04-07 17:22:25 +00:00
Wayne Davison
1c53e5171c Tweaked an error message and a comment. 2007-04-07 17:22:09 +00:00
Wayne Davison
63d83e9477 Improved push_dir() error reporting. 2007-03-25 17:01:48 +00:00
Wayne Davison
5463453489 The print now uses a more straight-forward map() instead of a join(). 2007-03-21 13:51:54 +00:00
Wayne Davison
108133689d Use relative directories, and note that the merge code is only
working because it is not yet using --inc-recursion.
2007-03-18 20:41:51 +00:00
Wayne Davison
46ad63b7cf Added a test of a multi-file copy from a nested directory using a
relative source path.
2007-03-18 20:40:01 +00:00
Wayne Davison
dbb20f6bc0 One more tweak. 2007-03-18 20:05:24 +00:00
Wayne Davison
25c2a6ac0e Fixed a multi-file, no-dir, relative copy, such as:
rsync -av lib/*.c /var/tmp/lib
2007-03-18 17:35:39 +00:00
Wayne Davison
161fba6903 Put the checksum seed at the end of the checksum2 buffer in md5 mode. 2007-03-18 06:28:51 +00:00
Wayne Davison
55edf18c42 Made a char* arg const. 2007-03-18 06:20:07 +00:00
Wayne Davison
a0456b9c46 Protocol 30 now uses MD5 checksums instead of MD4. 2007-03-18 06:00:53 +00:00
Wayne Davison
1a515b494b In option descriptions, the short form of --copy-dirlinks is -k, not -K. 2007-03-15 23:17:26 +00:00
Wayne Davison
33cd9ad54b I managed to duplicate the hang, so hopefully it's fixed now.
Let's restore the full test suite and find out.
2007-03-14 00:22:05 +00:00
Wayne Davison
896f046f79 Fixed more potential hang cases for incremental recursion. 2007-03-14 00:20:44 +00:00
Wayne Davison
b9d5eea5c6 Next step: allow protocol 30 to be used, but disallow the use
of incremental recursion.  If this still avoids the hanging, I
will need to try to track down how inc_recurse can deadlock.
2007-03-14 00:02:39 +00:00
Wayne Davison
5275029d11 Added an explicit option that will disallow the use of
incremental recursive mode (and an option to negate that).
2007-03-14 00:00:01 +00:00
Wayne Davison
271aeaa49e Next step: see if the hang returns with a partial restoration of
protocol 30.
2007-03-12 18:05:03 +00:00
Wayne Davison
91763a9c2f It looks like some of the compile-farm hosts are hanging on this test,
so let's try some remote-diagnostics (let's try protocol 29 first).
2007-03-12 04:56:15 +00:00
Wayne Davison
18438f0bac Changed the sending of device major/minor numbers in protocol 30 to
take fewer protocol bytes and use one less bit in the XMIT_* flags.
2007-03-12 04:33:30 +00:00
Wayne Davison
057f649fc9 When a hard-linked device is duplicating the data from the prior
device, we need to allocate 2 extra option slots for the device
numbers.
2007-03-11 22:02:26 +00:00
Wayne Davison
88467ec444 Don't enable ACLs on darwin until we figure out how they work. 2007-03-11 14:25:00 +00:00
Wayne Davison
1b897d50a9 Leave out two unneeded sys*_fd() functions due to their using
a function & struct that is not available in the rsync code.
2007-03-11 07:31:17 +00:00
Wayne Davison
d4a013edb7 We now compile on systems where ENOTSUP is not defined. 2007-03-11 07:21:07 +00:00
Wayne Davison
545584cb9a Leave SUPPORT_ACLS undefined instead of giving it a 0 value. 2007-03-11 07:13:11 +00:00
Wayne Davison
e5abce8e0d Silence a compiler warning about a printf() %d mismatch. 2007-03-11 06:50:48 +00:00
Wayne Davison
3060ca8d42 Temporarily skip this test as it is taking too long on the
compile farm at the moment.
2007-03-11 06:27:59 +00:00
Wayne Davison
ab14d01a0e Use the abbrevint30 routines in a few more places. 2007-03-11 05:59:46 +00:00
Wayne Davison
987838fd2c Make configure continue if ACL support is not found and the user
didn't explicitly ask for ACLs.
2007-03-11 05:54:21 +00:00
Wayne Davison
6d4e718f5f Moved the new static internal functions from rsync.h to io.h. 2007-03-11 05:43:55 +00:00
Wayne Davison
1c3344a105 The ACL support has arrived! This version has a brand new protocol
that makes it incompatible with all prior versions.  A patch will be
provided to allow talking with older (patched) rsync versions.
2007-03-11 00:13:34 +00:00
Wayne Davison
085e2fd588 Changed the code that cleans up the old nightly releases from
time-based to count-based (keeping the newest 10 items).
2007-03-08 02:00:48 +00:00
Wayne Davison
f41152d393 Decided that we don't really want the rule that preserves the
backup-suffix files to be perishable.
2007-03-05 17:08:00 +00:00
Wayne Davison
d0c59b0e88 A local server needs to process the auto-exclude rules since we don't
send the excludes over the socket for a local copy.
2007-03-04 14:56:22 +00:00
Wayne Davison
f49c837651 Mention the slight change to the auto-filter rules that are created
for the --backup option and the --partial-dir option.
2007-03-03 01:14:08 +00:00
Wayne Davison
c12895089c Moved a couple auto-filter rules from options.c into compat.c so
that we are sure to only apply the perishable filter modifier when
the receiving side is new enough to understand it.
2007-03-03 01:06:45 +00:00
Wayne Davison
27122338dc Make the auto-generated protect filters use the perishable flag so
that they don't stop a vanished directory from being removed.
2007-03-02 21:14:01 +00:00
Wayne Davison
d762dfe94b Mention a couple more changes. 2007-02-17 17:05:22 +00:00
Wayne Davison
c4750c2a07 Make sure that a newly-created destination directory gets the same
rules applied to it as other newly-created directories when --perms
wasn't specified.
2007-02-17 17:00:40 +00:00
Wayne Davison
3831f06319 - Moved the second send_extr_file_list() call to a better spot.
- Moved the FILECNT_LOOKAHEAD define into rsync.h.
2007-02-16 02:47:12 +00:00
Wayne Davison
be91bd81b8 Improved the incremental sending of file lists in two ways: (1)
when the sender gets an index of a file to send, we make sure to
send enough future file-list data relative to the new cur_flist
value before we send the data for the file transfer (ensuring that
the generator gets the data in a more timely manner), and (2) the
generator flushes the output socket after each file-list object
has completed its scan so that the sender knows in a more timely
manner that more list data is needed.
2007-02-16 02:35:31 +00:00
Wayne Davison
2a40b503c0 Make sure that the am_server variable is non-zero after parsing the
options we received over the socket.  (Thanks, Matt!)
2007-02-16 01:20:29 +00:00
Wayne Davison
ba2133d6ad Further modifications to the copyright comment section. 2007-02-04 14:54:58 +00:00
Wayne Davison
4f47fec04d Added a license comment to the top of the file. 2007-02-03 22:46:57 +00:00
Wayne Davison
ab3d6c6025 The "ndx" variable now holds the unique, over-the-wire value, not
a value that is relative to the cur_flist object.  This makes the
variable consistent with how the sender and the receiver use it.
2007-02-03 05:13:17 +00:00
Wayne Davison
121bfb2b4d The ndx arg passed to increment_active_files() is now the unique,
over-the-wire value, making it consistent with the ndx arg that
is passed to decrement_active_files().
2007-02-03 05:13:14 +00:00
Wayne Davison
100018b7cd Mention the year 2007 in the copyright declarations. 2007-01-31 21:46:49 +00:00
Wayne Davison
1ff66d4c68 Changed the main file-scan loop to not check for redo items when
in incremental recurse mode -- it is enough to check for them
when changing from one file-list to another.
2007-01-31 21:45:42 +00:00
Wayne Davison
87a34ce56a The code can now set cur_flist to NULL sooner than it used to, so the
flist_for_ndx() routine needs to work when cur_flist is NULL.
2007-01-30 03:57:55 +00:00
Wayne Davison
04c722d5e0 - Renamed done_cnt -> msgdone_cnt.
- Changed increment_active_files() to call check_for_finished_files()
  and to avoid calling both io_flush() and read_msg_fd() in the same
  iteration of a loop (since the former may have called the latter).
2007-01-30 03:57:52 +00:00
Wayne Davison
7730114b30 Moved the code that checks for finished file-lists, for finished "redo"
sends, and finished hard-links into check_for_finished_files(), a new
function that takes the place of check_for_finished_hlinks().  This
lets us signal the sender more rapidly when a file-list is done (which
ensures that it sends us more work to do in a timely manner), and also
avoids two potential deadlocks in the old code.
2007-01-30 03:57:48 +00:00
Wayne Davison
7a2fa0c2d3 Changed how send_extra_file_list() checks if we have enough future work. 2007-01-30 03:57:45 +00:00
Wayne Davison
4eeaa16253 Improved a sentence. 2007-01-30 03:37:47 +00:00
Wayne Davison
8dca155fca Some improvements from Matt. 2007-01-28 06:39:52 +00:00
Wayne Davison
2a5df86299 - Fixed a potential hang bug in wait_for_receiver() that could occur
if the io_flush() call happened to read the last message from the
  receiver, causing the read_msg_fd() call to deadlock.
- Fixed an error-looping problem when the server-side receiver failed
  to send a message down the error-msg pipe:  we no longer try to send
  a new error about this new failure down the same failing pipe.
- Make sure that we stop any deferring of forwarded messages in the
  generator when we are exiting with an error.
2007-01-27 16:30:33 +00:00
Wayne Davison
3ea6e0e7a1 Changed the variable "incremental" to "inc_recurse". 2007-01-27 14:56:09 +00:00
Wayne Davison
051ad69634 Improved the talk of --hard-link improvements. 2007-01-27 14:53:10 +00:00
Wayne Davison
744e63fb2a More extern tweaking. 2007-01-27 14:37:53 +00:00
Wayne Davison
cc7b86bf9b The last MSG_DONE from the receiver to the generator is now followed
by the stats.total_read value so that the generator can set its value
to that of the receiver.  This makes log_exit() log the right value
when we're on the server side.
2007-01-27 14:34:15 +00:00
Wayne Davison
8c18ebe81d Got rid of unused externs. 2007-01-27 14:26:19 +00:00
Wayne Davison
33689f4803 Added an extra paragraph to the --link-dest option to make it more
explicit that it is best used with an empty destination hierarchy.
2007-01-23 15:34:43 +00:00
Wayne Davison
424d369179 Paul's patch to silence some 64-bit compiler warnings. 2007-01-23 15:24:36 +00:00
Wayne Davison
d0221f1d2b Fixed handling of "redo" items in protocol 30. 2007-01-21 14:51:52 +00:00
Wayne Davison
3be97bf931 - Make sure that we can't write via io_flush() when msg_fd_in is
temporarily set to -1.
- Got rid of the msg2genr message cache.
2007-01-20 22:10:14 +00:00
Wayne Davison
4afab31607 We need to call msg2sndr_flush() in read_msg_fd() now. 2007-01-20 20:19:24 +00:00
Wayne Davison
be21e29c35 Make sure defer_forwarding_messages is set when msg_fd_in gets
set to -1.
2007-01-20 19:56:03 +00:00
Wayne Davison
c5b6e57a13 Fixed some typos Matt found. 2007-01-20 08:42:53 +00:00
Wayne Davison
ca947dea3e Moved the code that adds each file's length to stats.total_size
so that the delete code doesn't change the value.
2007-01-10 01:49:35 +00:00
Wayne Davison
2aea85ab54 Removed a couple items (one complete, one that we don't need). 2007-01-09 20:03:34 +00:00
Wayne Davison
05a41409b1 Mention that --prune-empty-dirs forces a non-incremental recursive scan. 2006-12-29 14:17:26 +00:00
Wayne Davison
7a28d18448 If prune_empty_dirs is set, don't set incremental. 2006-12-29 14:17:21 +00:00
Wayne Davison
1e05b590c4 Fixed a typo and improved a sentence. 2006-12-29 01:22:51 +00:00
Wayne Davison
ce5fddc3ed Added a sleep so that the --delete-delay action will always tweak
the directory time, and reveal any lack of dir-time touch-up.
2006-12-29 00:56:25 +00:00
Wayne Davison
fd3f5af2aa - Put directory retouching code into a separate function that
is now called for all our touch-up needs.
- Fixed a problem with --delete-delay interfering with the
  directory-time touch-up in incremental mode.
2006-12-29 00:55:28 +00:00
Wayne Davison
dde5b77226 - My use of readfd_unbuffered() in read_msg_fd() really needed to be
readfd() so that the buffer is never partially filled.
- Make sure that msg2genr_flush() does not flush any messages while
  the flist-forwarding is active.
- Changed io_flush() to honor its flush_it_all arg again.
2006-12-29 00:12:42 +00:00
Wayne Davison
f845ef7dec An incremental-recursion transfer can't switch from delete-delay to
delete-after.
2006-12-28 19:02:01 +00:00
Wayne Davison
9ae7a2cddb Use write_ndx() and read_ndx(). 2006-12-28 18:49:13 +00:00
Wayne Davison
8a65e0ce00 Added write_ndx() and read_ndx(), functions that allow us to transmit
fewer bytes when exchanging the file-list index values.
2006-12-28 18:49:08 +00:00
Wayne Davison
98b1689dcb Output a file-list message when verbose and using incremental recursion
mode.
2006-12-28 18:43:20 +00:00
Wayne Davison
012d1a01f5 Mention incremental recursion and change to --delete. 2006-12-28 16:40:24 +00:00
Wayne Davison
d9f46544a3 Document the incremental recursion algorithm and the change in the
--delete default.
2006-12-28 16:37:01 +00:00
Wayne Davison
42c6b13901 Restored the calling of send_file_entry() back to send_file_name()
(since the reason I had separated it no longer exists).
2006-12-28 15:43:30 +00:00
Wayne Davison
f1482c3391 Assign the owner and group using F_OWNER() and F_GROUP(). 2006-12-28 09:42:48 +00:00
Wayne Davison
5bb7348509 - Define F_OWNER() and F_GROUP() to be used for assigning the UID and GID.
- F_UID() is now defined to return a uid_t value.
- F_GID() is now defined to return a gid_t value.
2006-12-28 09:42:44 +00:00
Wayne Davison
4c9d5fef07 Repositioned a misplaced assignment. 2006-12-28 08:57:25 +00:00
Wayne Davison
5607803376 - Added a sleep to make sure that the preservation of the mtime on
implied directories is working.
2006-12-28 07:54:47 +00:00
Wayne Davison
76e0a49efe Handle slight differences in the output of protocol 30's incremental mode. 2006-12-28 07:54:44 +00:00
Wayne Davison
76a1013cc6 Use --delete-delay instead of --delete-after. 2006-12-28 07:54:41 +00:00
Wayne Davison
496c809f8c - Made match_uid(), match_gid(), recv_user_name(), and recv_group_name()
public functions.
- Made add_uid() and add_gid() return the name or NULL.
2006-12-28 07:54:37 +00:00
Wayne Davison
3ac830b9f9 A few minor tweaks to handle the newest variable names. 2006-12-28 07:54:34 +00:00
Wayne Davison
f3d6d4800b Handle the new incremental-recursion mode. 2006-12-28 07:54:31 +00:00
Wayne Davison
8ef246e0b5 - Handle the new incremental-recursion mode.
- Changed some function names to make them more consistent.
2006-12-28 07:54:27 +00:00
Wayne Davison
c7e6f84f89 New functions, variables, and file-list code to support the new
incremental-recursion mode.
2006-12-28 07:54:23 +00:00
Wayne Davison
fe04532ad2 New support function: change_local_filter_dir(). 2006-12-28 07:54:19 +00:00
Wayne Davison
e4b619b46d - Choose --delete-before or --delete-during depending on protocol version.
- Set incremental-recursion mode, if possible.
- Protocol 30 gets generator->sender messages enabled.
2006-12-28 07:54:16 +00:00
Wayne Davison
9ec3828b03 Some new defines for incremental-recursion mode. 2006-12-28 07:54:13 +00:00
Wayne Davison
e0e3203156 - Changes to handle new default of --delete-during for --delete.
- Allow -H to be repeated.
2006-12-28 07:54:10 +00:00
Wayne Davison
edb977215b Only append_mode > 0 now indicates option is enabled. 2006-12-28 07:54:07 +00:00
Wayne Davison
18233a170e Only sparse_files > 0 now indicates option is enabled. 2006-12-28 07:54:04 +00:00
Wayne Davison
283887d777 Neaten up use of uid_t/gid_t variable types. 2006-12-28 07:08:13 +00:00
Wayne Davison
c2f0e4d965 Don't include MATCHFLG_PERISHABLE in CVS-exclude handling unless
we're talking protocol 30 or above.
2006-12-28 06:27:22 +00:00
Wayne Davison
8576397c3e Fix the building of mkrounding$(EXEEXT) when building outside the
source directory (provided by Art Haas).
2006-12-27 21:40:16 +00:00
Wayne Davison
c09af06d0c Made the int_byte_cnt[] array 75% smaller. 2006-12-27 17:43:51 +00:00
Wayne Davison
ded73ed90f Ignore all conftest* items, as Matt suggested. 2006-12-27 17:36:57 +00:00
Wayne Davison
f335eb1f83 Fix usage message. 2006-12-26 05:56:38 +00:00
Wayne Davison
7afa34fd27 Test --only-write-batch option. 2006-12-26 05:29:05 +00:00
Wayne Davison
1f56188f8c Can just test ignore_errors w/o lp_ignore_errors(module_id) now. 2006-12-25 17:49:23 +00:00
Wayne Davison
3162ea6f67 Set ignore_errors variable based on lp_ignore_errors(module_id). 2006-12-25 17:49:19 +00:00
Wayne Davison
327c559aff Improved the new --pasword-file error message. 2006-12-24 06:13:08 +00:00
Wayne Davison
99effefc81 Fixed a thinko in the last news item. 2006-12-24 05:47:21 +00:00
Wayne Davison
e8dad39518 Mention checking of --password-file's use. 2006-12-24 01:30:44 +00:00
Wayne Davison
09a54c399c Make the --password-file option's summary even better. 2006-12-24 01:30:24 +00:00
Wayne Davison
9586e59370 Improved the docs for the --password-file option. 2006-12-24 00:58:30 +00:00
Wayne Davison
ce455b03e7 Improved the summary of the --password-file option. 2006-12-24 00:58:24 +00:00
Wayne Davison
a39da29ac5 If the user specified --password-file without using daemon mode,
complain and die.
2006-12-24 00:58:21 +00:00
Wayne Davison
794a0b6c25 Make use of the SHORT_SUM_LENGTH define. 2006-12-23 23:57:16 +00:00
Wayne Davison
1b81f797a2 Fixed a problem with the output of %f for non-daemon rsyncs. 2006-12-23 20:48:29 +00:00
Wayne Davison
889ae39d7a Mention the %f fix. 2006-12-23 20:46:33 +00:00
Wayne Davison
5f4e991c70 Fixed the item numbers in the regex comment. 2006-12-20 00:50:17 +00:00
Wayne Davison
c96f6eb584 Call SIGACTION() instead of signal(). 2006-12-18 07:24:24 +00:00
Wayne Davison
e10664c5e8 Moved the write_stream_flags() call from io.c into main.c so that
it gets called before the transfer starts (thus ensuring that it
can write out un-tweaked values of preserver_[ug]id vars).
2006-12-18 06:56:30 +00:00
Wayne Davison
99a957d3f4 Renamed flist_extra_cnt to file_extra_cnt. 2006-12-18 06:56:26 +00:00
Wayne Davison
658a63694b Got rid of the "tweaked" versions of the uid and gid vars. 2006-12-18 06:56:23 +00:00
Wayne Davison
30e50494bb Tweaked the output a little. 2006-12-18 06:41:00 +00:00
Wayne Davison
719985cb9c A few more minor tweaks. 2006-12-17 04:42:33 +00:00
Wayne Davison
2d2414f39e - We now define int16 and uint16.
- Make use of the [u]int{16,32,64}_t types, if they're around.
2006-12-17 02:05:11 +00:00
Wayne Davison
edb4ba5fdb We now check for these: int16_t, uint16_t, int32_t, uint32_t, and int64_t. 2006-12-17 01:59:03 +00:00
Wayne Davison
007996b40d Got rid of the code that sorted based on struct idev objects since
we always use a hardlinked group-number now.
2006-12-17 00:40:39 +00:00
Wayne Davison
dbd9ea3e5a Use F_ROOTDIR() in place of dir.root. 2006-12-17 00:40:36 +00:00
Wayne Davison
2ef0340517 Use F_DEPTH() in place of dir.depth. 2006-12-17 00:40:33 +00:00
Wayne Davison
9d737ecb7a Got rid of the hlink_pool in favor of using the new hashtable code
on the receiving side.  This allows us to always use a 32-bit number
to identify the hardlink clusters, even on a system where pointers
are 64-bits.  Also made changes to handle the use of F_ROOTDIR() and
F_DEPTH() instead of the old union that wasted space on the
receiving side when pointers are 64-bits.
2006-12-17 00:40:28 +00:00
Wayne Davison
bd6edd3fa2 - Got rid of "struct idev".
- Use just the 32-bit numbers in the file_extras union.
- Re-ordered the items in the file_struct to avoid padding
  on systems with 64-bit pointers.
- Got rid of the "dir" union in the file_struct, making the
  two items into "extras": F_DEPTH() for the receiving side,
  and F_ROOTDIR() for the sending side.
- Added PTR_EXTRA_LEN define.
- Got rid of F_HL_IDEV() define.
2006-12-17 00:40:24 +00:00
Wayne Davison
6eee13cf58 Moved the flist_extra_cnt stuff from options.c to compat.c so that
the values will be computed separately for the sender and the
receiver.
2006-12-17 00:40:21 +00:00
Wayne Davison
9602b5cfbd - Ensure that mkrouding gets rebuilt when rsync.h changes.
- Added an easy way to run the tests using protocol 29.
2006-12-17 00:40:18 +00:00
Wayne Davison
48ffc11e9c Make the error messages a little clearer. 2006-12-16 23:14:59 +00:00
Wayne Davison
5a3e9ff608 Output some info about the size of our structures. 2006-12-16 21:11:58 +00:00
Wayne Davison
aac5cab80b Changed the static file_struct var to match the changes in rsync.h. 2006-12-16 19:24:17 +00:00
Wayne Davison
a3e18c763a Use the new rounding.h file to optionally round up the count of
extra values we put at the start of the file_struct.  Also, deal
with the extras variable no longer being in the file_struct.
2006-12-16 19:24:14 +00:00
Wayne Davison
403dbc1377 Build & run mkrounding to make the rounding.h file used by flist.c.
Also, clean up the new items.
2006-12-16 19:24:11 +00:00
Wayne Davison
5b30412c68 Moved the file_extra union out of the file_struct. 2006-12-16 19:24:08 +00:00
Wayne Davison
d5833800a8 New file to figure out if a system has any rounding needs when
prepending extra values at the start of the file_struct.
2006-12-16 19:24:05 +00:00
Wayne Davison
8d3a785fa5 Added mkrounding and rounding.h. 2006-12-16 19:24:02 +00:00
Wayne Davison
3a5a7de6c9 Mention hard-link memory savings and byte-transfer savings. 2006-12-16 07:39:53 +00:00
Wayne Davison
c58c1dc446 Added a basename var to file_struct at the end, making it clearer
where the basename exists without actually changing how the data
is organized.
2006-12-16 07:18:41 +00:00
Wayne Davison
eefe189e1d Changed the test for the 2.6.8 bug to preserve owner and group. 2006-12-16 02:18:44 +00:00
Wayne Davison
f05c801194 Moved the calls to init_hard_links() into flist.c. 2006-12-15 22:31:16 +00:00
Wayne Davison
c905bf37f6 Added a simple hashtable routine for hashing st_dev and st_ino info
on the sending side, and the support routines for the receiving side
that handle using a "group number" for each hard-link cluster rather
than having to manage a pool of dev+inode data. (For protocol 30)
2006-12-15 22:31:13 +00:00
Wayne Davison
8cae71ebc3 For protocol 30, the sender uses the new idev_node() hashfile
routine to keep track of which item is the first one in a particular
hard-link cluster.  It then abbreviates the sending of any follow-on
items in the cluster, reducing transfer bytes.  It also omits the
sending of any dev+inode data to the receiver, saving even more xfer
bytes (since the receiver can associate the entries based on the the
group's index number that is sent when abbreviating an entry).
2006-12-15 22:31:10 +00:00
Wayne Davison
14d776ff0c - The XMIT_SAME_DEV define is now pre-protocol-30 specific.
- Added XMIT_HLINK_FIRST define.
- Added struct idev_node.
- Added F_HL_GNUM() for protocol 30 (used in place of F_HL_IDEV()).
2006-12-15 22:31:07 +00:00
Wayne Davison
c7565dad84 Renamed XMIT_HAS_IDEV_DATA to XMIT_HLINKED. 2006-12-14 22:38:21 +00:00
Wayne Davison
b7cfb9e2c0 Renamed the F_*HLINK* macros to make their purpose clearer. 2006-12-13 15:36:15 +00:00
Wayne Davison
0d152437df Tweaked the option-passing code's delete logic to make it cleaner. 2006-12-13 14:52:59 +00:00
Wayne Davison
6aef83c97d Cast FILE_STRUCT_LEN & EXTRA_LEN to int for rprintf(). 2006-12-12 20:42:06 +00:00
Wayne Davison
225aeca346 Use new BITS_EQUAL() define. 2006-12-12 20:17:05 +00:00
Wayne Davison
0a62f5f382 Added BITS_EQUAL() define. 2006-12-12 20:17:02 +00:00
Wayne Davison
234844915e Removed last reference to "struct hlist". 2006-12-12 15:01:57 +00:00
Wayne Davison
263d3bfb40 Neaten some function formatting. 2006-12-12 14:58:10 +00:00
Wayne Davison
bf466c0f82 Provide alternate F_LENGTH() define for systems with no 64-bit type. 2006-12-12 14:55:21 +00:00
Wayne Davison
8b58407586 Mention fix for -vv --stats. 2006-12-10 21:56:37 +00:00
Wayne Davison
64119c792d Added MSG_CLIENT to the acceptable messages the generator can
get from the receiver.
2006-12-10 14:55:44 +00:00
Wayne Davison
8388e011ae Added MSG_CLIENT to the msgcode enum. 2006-12-10 14:54:08 +00:00
Wayne Davison
0fddbd8a09 A minor format tweak. 2006-12-09 17:35:36 +00:00
Wayne Davison
badb8c24b9 Handle the new output from the hard-link code, including a fix
for a long-standing bug combinding -H with --compare-dest.
2006-12-09 00:24:11 +00:00
Wayne Davison
bfd3137246 - Added FLAG_HLINK_DONE.
- Added BITS_SET() and BITS_SETnUNSET() defines.
- Got rid of unused HL_* defines.
- Got rid of no-longer-needed struct hlist.
- Changed F_HL_LIST() to F_HL_PREV().
- Added F_NOT_HLINK_FIRST() and F_NOT_HLINK_LAST().
- Got rid of WITH_HLINK and WITHOUT_HLINK.
- Got rid of the hlink_pool in the file list.
2006-12-09 00:24:08 +00:00
Wayne Davison
6de0d06259 Got rid of the pool-destroy call since this is not around anymore. 2006-12-09 00:24:05 +00:00
Wayne Davison
89d730a098 Call the new hard-link init functions. 2006-12-09 00:24:01 +00:00
Wayne Davison
18979194cf - Use the revamped hard-link functions.
- Turned maybe_ATTRS_REPORT var into a global for use by hlink.c.
2006-12-09 00:23:58 +00:00
Wayne Davison
aadc84d359 - Revamped the hard-link algorithm to save memory.
- Improved the function names.
- Improved a few variable names.
- Got rid of the "is a hard link" message in favor of the normal status
  messages for files (e.g. --itemize-changes indicates hard-links).
- Fixed a long-standing bug when combining -H with --compare-dest.
- Made sure that code compiles when hard-linking is not available.
2006-12-09 00:23:55 +00:00
Wayne Davison
9d155ecd12 Changed the hlink_pool variable to be a global since only the main
file list ever has a pool for hard-linking.
2006-12-09 00:23:51 +00:00
Wayne Davison
60af946576 Explicitly cast the length values down to an uint32 so that some
compilers don't complain about the value getting smaller.
2006-12-08 21:02:11 +00:00
Wayne Davison
ca0e8296bc Get rid of some signed/unsigned-comparison compiler warnings. 2006-12-08 20:58:51 +00:00
Wayne Davison
c4a28da3ad Use --delete-delay instead of --delete-after. 2006-12-08 20:47:09 +00:00
Wayne Davison
20319fd9ed - The --delete-delay code now does its own output buffering. This
allows us to delay opening a temp file to hold the list of deletions
  until we overflow the buffer (and thus, it's not usually needed).
- Fall back to doing a --delete-after pass if the --delete-delay
  code has a temp-file-writing failure.
2006-12-08 20:42:45 +00:00
Wayne Davison
01d29d7b02 Fixed --delete-delay by making the fprintf() output an unsigned short
for the mode.
2006-12-08 15:10:12 +00:00
Wayne Davison
1183260426 Added missing initialization of new solo_file variable. 2006-12-07 06:22:22 +00:00
Wayne Davison
07613def0a Some minor format tweaks. 2006-12-07 03:31:44 +00:00
Wayne Davison
c2a608d9f1 - Use renamed hard-link defines: F_HL_IDEV() and F_HL_LIST(). 2006-12-07 03:31:41 +00:00
Wayne Davison
49b86442ff - Set "solo_file" bool and use that for improved clarity.
- Use the new device defines: F_RDEV_P(), DEV_MAJOR(), and DEV_MINOR().
2006-12-07 03:31:38 +00:00
Wayne Davison
4785cd43d1 - Use the new device defines: F_RDEV_P(), DEV_MAJOR(), and DEV_MINOR().
- Use renamed F_HL_IDEV() define.
2006-12-07 03:31:34 +00:00
Wayne Davison
e238c9977d Use the new device defines: F_RDEV_P(), DEV_MAJOR(), and DEV_MINOR(). 2006-12-07 03:31:31 +00:00
Wayne Davison
b37b7c9949 - Added a signed number to the flist_extras union.
- Renamed F_IDEV() to F_HL_IDEV() and F_HLIST() to F_HL_LIST().
- Changed device defines to be: F_RDEV_P(), DEV_MAJOR(), and DEV_MINOR().
2006-12-07 03:31:28 +00:00
Wayne Davison
f7d7fb381d Improved the format of the debug output for mknod(). 2006-12-07 02:37:42 +00:00
Wayne Davison
3481bdf493 Mention waitpid() fix (which helps pre-xfer exec). 2006-12-06 17:27:47 +00:00
Wayne Davison
d365e22967 The wait_process() call now handles EINTR. 2006-12-06 17:21:59 +00:00
Wayne Davison
d02363609a If the pre-xfer exec failed with -1, output the strerror()
from the waitpid() call.
2006-12-06 16:56:19 +00:00
Wayne Davison
1e1ca25343 #ifdef calls to hard-link functions. 2006-12-06 01:32:17 +00:00
Wayne Davison
a2ebbffca7 - Make some char* pointers const.
- Tweaked a couple variable names.
- Changed the #ifdefs to not define any hard-link functions
  when hard-linking is disabled.
2006-12-06 01:26:11 +00:00
Wayne Davison
0395130c06 Changed i -> ndx in several variables. 2006-12-06 00:55:33 +00:00
Wayne Davison
b8c167e804 F_SUM() needed to use HLINK_BUMP(). 2006-12-06 00:52:34 +00:00
Wayne Davison
17026f2741 Handle the FLAG_LENGTH64 flag in unmake_file(). 2006-12-05 17:45:29 +00:00
Wayne Davison
112d728f48 Use the latest F_*() accessors. 2006-12-05 15:59:58 +00:00
Wayne Davison
96293cf991 Saved 9 more bytes per file in a typical transfer by making the length
32 bits by default, by removing the basename pointer, and by making the
mode value a unsigned short.
2006-12-05 15:59:53 +00:00
Wayne Davison
f0fbf1d670 Changed flist_extra_ndx into flist_extra_cnt. 2006-12-05 15:59:49 +00:00
Wayne Davison
7a821d518b Tweaked some externs. 2006-12-05 15:59:46 +00:00
Wayne Davison
663b2857eb Use new send_msg_int() function. 2006-12-04 02:07:37 +00:00
Wayne Davison
155d9206a4 Added send_msg_int() function. 2006-12-04 02:07:30 +00:00
Wayne Davison
6b2a3d5de6 Moved an extern. 2006-12-03 07:58:12 +00:00
Wayne Davison
82ad07c418 - Typical tranfers now save 12-20 bytes per file because several vars
were moved out of file_struct into an optional member-var setup.
- Renamed and reorganized the FLAG_* defines.
- Use NDX_DONE instead of a literal -1 when sending/checking the
  end-of-phase index value.
2006-12-03 06:44:16 +00:00
Wayne Davison
d144e43bb3 Restored write_ndx_and_attrs() and made it public. 2006-12-02 16:17:11 +00:00
Wayne Davison
d2aee174e6 Moved write_ndx_and_attrs() to sender.c and made it public. 2006-12-02 16:16:54 +00:00
Wayne Davison
20f0d0f9b9 Moved write_ndx_and_attrs() too. 2006-12-02 16:13:02 +00:00
Wayne Davison
b675ba6f79 Added a couple externs. 2006-12-02 16:11:33 +00:00
Wayne Davison
d1c178dd53 Moved read_item_attrs() from sender.c to rsync.c since the function
is used by both the sender and the receiver.
2006-12-02 16:08:59 +00:00
Wayne Davison
d619ff1376 Change the format/order of the capabilities --version outputs. 2006-12-01 18:29:18 +00:00
Wayne Davison
db0f7613e1 Got rid of an incorrect comment. 2006-11-28 19:34:01 +00:00
Wayne Davison
45d8bfe09e Added some more "const" prefixes to some "char *" vars. 2006-11-28 19:31:41 +00:00
Wayne Davison
d521e1c2a1 - Use write_shortint() to send the 2 bytes in an extended flag.
- Improved a comment.
2006-11-24 20:21:13 +00:00
Wayne Davison
4ea4acf17b - Added checking of SIZEOF_INT64 to the new code in read_longint().
- Improved the SIZEOF_INT64 checking code in write_longint().
2006-11-24 18:35:00 +00:00
Wayne Davison
3a993aa4bf - Changed {read,write}_shortint() to use unsigned short.
- Added explicit char-casting to new long-int code.
2006-11-24 17:28:57 +00:00
Wayne Davison
c7871d9892 Document the latest changes. 2006-11-24 08:46:21 +00:00
Wayne Davison
482f48cca9 - Fixed a bug when sending a negative 64-bit number (which may not
be needed, but it at least works right now).
- Improved the transmission of 32-bit negative numbers on systems
  where the 32-bit type is larger than 32 bits.
- Changed the sending of 64-bit numbers for protocol 30:  we send
  them in MSB-first order with the number of bytes used in the
  transmission encoded into the earliest bits.  This lets us save
  transmitted bytes for both small and large numbers.  The new
  method sends from 3 to 9 bytes, the old sent either 4 or 12.
2006-11-24 08:38:44 +00:00
Wayne Davison
36e6594dce Added some defines for sending variable-sized MSB-first numbers. 2006-11-24 08:22:23 +00:00
Wayne Davison
e17883827b Silenced a compiler warning. 2006-11-23 04:16:48 +00:00
Wayne Davison
37a4386d2c Fix a unused-variable compiler warning. 2006-11-23 03:28:58 +00:00
Wayne Davison
fd0a130c14 Document the new --delete-delay option. 2006-11-22 20:52:51 +00:00
Wayne Davison
5e77efaf41 - Implement new --delete-delay option.
- Tweaked a variable name in delete_item().
2006-11-22 20:51:03 +00:00
Wayne Davison
b0cacef14b Added parsing for --delete-delay. 2006-11-22 20:49:23 +00:00
Wayne Davison
b20830b338 Made get_tmpname() non-static. 2006-11-22 20:48:04 +00:00
Wayne Davison
c63625d41a Switch over to testing --remove-source-files, not *-sent-*. 2006-11-22 16:34:25 +00:00
Wayne Davison
7de7b49f6c Don't define NORETURN for older gcc versions. 2006-11-21 22:29:33 +00:00
Wayne Davison
d0d0e41fd2 Mention latest changes. 2006-11-21 19:08:59 +00:00
Wayne Davison
2a28dd32fd The exclude code wasn't sending the MATCHFLG_NEGATE (!) char to the
other side.
2006-11-21 17:46:54 +00:00
Wayne Davison
65e83e097c Don't set an "rc" var that we aren't going to use. 2006-11-21 08:37:28 +00:00
Wayne Davison
4f37559232 Avoid a compiler warning about setting "len" without using it. 2006-11-21 08:37:06 +00:00
Wayne Davison
604dbf6d94 Make the file_list stats value an int64. 2006-11-21 08:36:48 +00:00
Wayne Davison
53593085cf - Use an explicit cast when a value gets stored in a smaller var.
- The msgtype var should have been an enum.
2006-11-21 08:36:31 +00:00
Wayne Davison
eb0144d79b Output the size of the file list using human_num(). 2006-11-21 08:36:15 +00:00
Wayne Davison
54b0dfa0f7 Explicitly cast the tag value in read_msg_fd() to an enum. 2006-11-21 08:36:06 +00:00
Wayne Davison
264042760b Use an explicit cast when a value gets stored in a smaller var. 2006-11-21 08:35:58 +00:00
Wayne Davison
1e999f9f1b The call to do_chmod() needed to be conditional. 2006-11-21 08:35:22 +00:00
Wayne Davison
f9b66bc464 Fixed a problem with the new iconv const check. 2006-11-20 19:12:35 +00:00
Wayne Davison
60d465dbdd Use the new ICONV_CONST definition. 2006-11-20 18:17:48 +00:00
Wayne Davison
3ebdd3c7fc Added a test to figure out if iconv() takes a const char **. 2006-11-20 18:17:17 +00:00
Wayne Davison
f0fa8c6df2 Moved the options_rejected label to avoid a compiler warning on
some systems.
2006-11-19 04:39:35 +00:00
Wayne Davison
9d33e6f7cf Use rwrite() to output the err_msg string. 2006-11-19 04:37:52 +00:00
Wayne Davison
4a19c3b254 Added "const" to appropriate char pointers. 2006-11-19 00:23:21 +00:00
Wayne Davison
4743f0f41b Some bf(...) tweaks. 2006-11-14 07:56:05 +00:00
Wayne Davison
0abe148fd9 - Use double quotes for a quoted string.
- Some bf(...) tweaks.
2006-11-14 07:55:47 +00:00
Wayne Davison
39411fa876 Added: also tweak single-/double-quotes and em-dashes. 2006-11-14 07:54:26 +00:00
Wayne Davison
662fd70b54 Changed name of tweak_manpage script. 2006-11-14 07:48:56 +00:00
Wayne Davison
cd87e2f59a Turned the char * vars flist_dir and lastdir into const char * vars. 2006-11-13 00:27:10 +00:00
Wayne Davison
2c70847654 Turned the char * args to push_dir() and pop_dir() into const char *. 2006-11-13 00:27:04 +00:00
Wayne Davison
eaf895e6ef Turned the char *dir.root var in struct file_struct into a const char *. 2006-11-13 00:27:00 +00:00
Wayne Davison
149a78e33f Ignore a time-setting error on a symlink (which is only attempted
on a system with lutimes() anyway).
2006-11-12 21:18:26 +00:00
Wayne Davison
88897638a9 Tweaked a couple comments. 2006-11-11 17:09:32 +00:00
Wayne Davison
c575f8ce87 Document the new p (perishable) filter modifier. 2006-11-11 17:01:58 +00:00
Wayne Davison
5303941021 If ignore_perishable is set, increment a count of all excluded
items found by make_file().
2006-11-11 16:44:22 +00:00
Wayne Davison
c0f1e57b51 Added the MATCHFLAG_PERISHABLE flag. 2006-11-11 16:43:13 +00:00
Wayne Davison
ccdb23bb90 - Added the 'p' (perishable) flag to the filter rules, as suggested
by Matt.
- If ignore_perishable is set, we ignore all perishable rules.
- Mark all default-cvsignore rules as perishable (e.g. excludes such
  as *.o CVS .svn/ will not prevent a directory from being deleted).
2006-11-11 16:39:57 +00:00
Wayne Davison
146c2c368c - Restored some of Matt's suggested logic that I left out, as it
is needed to get --dry-run to output appropriately.
- Got rid of DR_PINNED from the enum delret.
- Set a flag when we're deleting outside the transfer hierarchy and
  initialize a counter that flist.c will use to count excluded files.
2006-11-11 16:39:02 +00:00
Wayne Davison
60cc01a6c6 When make_file() gets a stat() error on a file, the check-for-
exclusion-before-reporting-an-error code allows a dir-specific
rule to match the unknown file, not just a non-dir rule.
2006-11-11 15:34:31 +00:00
Wayne Davison
f5761a342b - Make delete_dir_contents() use less stack by recursing directly
to itself, and then calling delete_item() w/o DEL_RECURSE.
- Fixed the return value handling of delete_dir_contents().
2006-11-11 14:45:00 +00:00
Wayne Davison
caf8299e2e Tweaked an exit_cleanup() value. 2006-11-11 08:01:40 +00:00
Wayne Davison
c6fadc0ee1 My adaptation of Matt's cleanup of the delete_item() code.
The new code splits out part of the directory deletion into
its own function, delete_dir_contents(), and it outputs more
warnings when something could not be deleted.
2006-11-11 07:03:57 +00:00
Wayne Davison
2dc3db2a3e Docment that --max-delete=0 now works. 2006-11-11 05:09:22 +00:00
Wayne Davison
771d0add8f Die if we sent --max-delete=0 to a receiving side that is too old. 2006-11-11 05:09:17 +00:00
Wayne Davison
e5e85283a9 Allow --max-delete=0 (zero used to be ignored). 2006-11-11 05:09:14 +00:00
Wayne Davison
21068d8e87 Increased the PROTOCOL_VERSION to 30. 2006-11-11 05:09:10 +00:00
Wayne Davison
4d2ea5a838 Mention another internal change. 2006-11-10 15:39:03 +00:00
Wayne Davison
9ba53f26a3 Test --del too. 2006-11-10 15:36:15 +00:00
Wayne Davison
3aeedbfd11 Fixed the hard-linking of symlinks test (we need to use a symlink
to a non-existent file for the test to work right).
2006-11-10 07:49:02 +00:00
Wayne Davison
989b0b8802 Changed how we deal with the alternate-dest directory because
some systems change the time on a directory that gets moved.
2006-11-10 07:37:51 +00:00
Wayne Davison
b2e4811db2 Changed two more references to "st" to "real_st" in the dir-handling
code.
2006-11-10 07:17:20 +00:00
Wayne Davison
b467495cd0 - Fixed a problem where the real stat struct for a newly-created
root-of-transfer directory could get overwritten by the check
  for basis dirs.
- Fixed a potential problem where the stat struct for a new dir
  could get passed uninitialized to delete_in_dir().
2006-11-10 07:13:21 +00:00
Wayne Davison
3b8ed84245 If the OS can't hard-link a symlink, tweak the expected output
when using --link-dest.
2006-11-10 06:27:35 +00:00
Wayne Davison
3a72cc2929 Mention latest bug fixes. 2006-11-10 05:07:08 +00:00
Wayne Davison
c202424a03 Changed to reflect new (more correct) output of what updating is
happening.
2006-11-10 05:07:05 +00:00
Wayne Davison
083f75ee42 Improved to test --link-dest (when hard-linking of devices works). 2006-11-10 05:07:02 +00:00
Wayne Davison
45760f5f05 Allow all itemize types to change all-dots (no changes) into spaces. 2006-11-10 05:06:59 +00:00
Wayne Davison
116a4769c1 - Improved try_dests_non() so that it works with all non-regular
files (including dirs).
- Changed the directory-creating code to call try_dests_non() when a
  --*-dest option is used.
- Revamped the device/special-files code to have the same logic as
  the symlink code, making it both simpler and more correct.
- All the above makes us output changes for all items consistently
  when a --*-dest option is used.
- Fixed an output bug in try_dests_reg() and try_dests_non() when
  -ii is enabled (we use to fail to output unchanged files).
2006-11-10 05:06:56 +00:00
Wayne Davison
1e4f5f6342 Added flag ITEM_MATCHED. 2006-11-10 05:06:53 +00:00
Wayne Davison
a19d285ae3 Changed strcat() calls to strlcat(). 2006-11-10 03:34:51 +00:00
Wayne Davison
564782ba95 Disable POPT_WCHAR_HACK for now. 2006-11-09 02:55:32 +00:00
Wayne Davison
2dc7b8bd0e Got rid of type-casting into isFOO() and toFOO() functions by
using static inline functions that take a signed char pointer.
2006-11-09 02:39:29 +00:00
Wayne Davison
e0930845ce Improved the vmefail() code. 2006-11-09 02:37:38 +00:00
Wayne Davison
cf81788366 Fixed a problem with the xstrdup() change. 2006-11-09 02:36:03 +00:00
Wayne Davison
89a0e3a927 Get rid of the last strcpy() call by using an static inline function. 2006-11-09 02:34:17 +00:00
Wayne Davison
a8facdc090 Use a new isSpace() inline function to call isspace() safely
when using a signed character pointer.
2006-11-09 02:14:38 +00:00
Wayne Davison
c5e29261f3 Need to include lib/snprintf.o when building wildtest. 2006-11-09 01:58:28 +00:00
Wayne Davison
1acb2e15b4 Changed _ABS to be defined as MY_ABS. 2006-11-09 01:55:17 +00:00
Wayne Davison
06898c80d9 Got rid of code to twiddle _ABS. 2006-11-09 01:54:59 +00:00
Wayne Davison
684576ff45 Moved definition of DBL_EPSILON. 2006-11-09 01:51:57 +00:00
Wayne Davison
574a24a2ec Try a full prototype for alloca() for those systems that need it. 2006-11-09 01:34:36 +00:00
Wayne Davison
9775d6ab66 - Define snprintf() when needed.
- Improved the compatibility of the standard includes.
2006-11-09 01:26:27 +00:00
Wayne Davison
2b916250d8 The Mac version of GCC can now handle __attribute__ . 2006-11-09 01:07:35 +00:00
Wayne Davison
2955529bb4 Rolling over the NEWS file for the next version. 2006-11-09 01:06:30 +00:00
Wayne Davison
d094b5eb3c Change the version for new CVS work. 2006-11-09 00:59:58 +00:00
Wayne Davison
bc93ee842f - Upgraded popt to version 1.10.2.
- Modified all sprintf() and strcpy() calls to use snprintf()
  and strlcpy().
2006-11-09 00:57:55 +00:00
Wayne Davison
0c6d79528a Preparing for release of 2.6.9 2006-11-07 04:41:35 +00:00
Wayne Davison
556e03a3c9 Modified to recognize FreeBSD's setfacl command. 2006-11-04 00:18:49 +00:00
Wayne Davison
e4887738bb Updated to the version dated 2006-07-02. 2006-11-02 02:01:25 +00:00
Wayne Davison
0f5c1c193a Need to include netinet/tcp.h to get TCP_NODELAY defined. 2006-10-31 19:21:57 +00:00
Wayne Davison
ab6dcad61c Mention the addition of the fake-super.diff patch. 2006-10-28 21:22:26 +00:00
Wayne Davison
b6855ddc9c Don't put backslashes before the dashes in " -- ". 2006-10-27 17:51:21 +00:00
Wayne Davison
0cbb958f34 Mention the fix for bug #4079. 2006-10-27 17:29:09 +00:00
Wayne Davison
418da6d952 Mention WIFEXITED() change. 2006-10-26 19:19:23 +00:00
Wayne Davison
51d133d686 Mention Mac OS X xattr work. 2006-10-26 17:22:15 +00:00
Wayne Davison
cbb95d3d24 Preparing for release of 2.6.9pre3 2006-10-26 17:06:41 +00:00
Wayne Davison
d9126a861f Run tweak_manpage_dashes on the man pages we generate. 2006-10-24 16:17:31 +00:00
Wayne Davison
b4768a1397 Undo temporary changes used for build-farm testing of ACL patch. 2006-10-24 15:09:57 +00:00
Wayne Davison
47b032e97f Added a define for WIFEXITED() that is used if one is missing. 2006-10-24 03:31:30 +00:00
Wayne Davison
50dfd5b4fe Document the --no-motd option. 2006-10-24 00:56:46 +00:00
Wayne Davison
1de02c273d Document the --no-motd option, with a caveat on how it can also
hide the module listing.
2006-10-24 00:36:46 +00:00
Wayne Davison
9ce7fc3887 Obey the new --no-motd option. 2006-10-24 00:36:42 +00:00
Wayne Davison
dc1f7b9ea3 Added the --no-motd option to silence just the text output at the
start of a daemon transfer.
2006-10-24 00:36:38 +00:00
Wayne Davison
ee7cf95b13 Post-process manpages with the tweak_manpage_dashes perl script. 2006-10-24 00:33:32 +00:00
Wayne Davison
492fc3536d Run patch with -t so that it doesn't ask any questions. 2006-10-24 00:24:56 +00:00
Wayne Davison
5e61bdb4d5 A perl script that does appropriate backslash escaping of '-' chars
in manpages.
2006-10-24 00:09:18 +00:00
Wayne Davison
f964ac5eee - Fixed an error-handling path in try_dests_reg().
- Added a comment.
2006-10-22 22:36:36 +00:00
Wayne Davison
c55b39afad Use "test" instead of "[ ... ]" for better portability. 2006-10-22 07:29:21 +00:00
Wayne Davison
a27463a9a2 Added missing cleanup of empty ACL files. 2006-10-22 07:18:21 +00:00
Wayne Davison
590eb6c02d Change the unpatch code for NetBSD. 2006-10-22 04:26:59 +00:00
Wayne Davison
0d7a6b4906 Temporary changes to have the build-farm configure and build
the ACL version of rsync (patched in via patches/acls.diff).
2006-10-22 03:17:45 +00:00
Wayne Davison
b4f0287197 Mention the fix that lets a push now override the partial-dir exclude. 2006-10-18 05:20:05 +00:00
Wayne Davison
8d6386809e The server should not be adding an assumed filter rule based on the
partial-dir setting (since the client is sending us the rules).
2006-10-18 05:15:35 +00:00
Wayne Davison
230328a30a Added a risk filter for the partial-dir since we use --delete-after. 2006-10-18 05:14:10 +00:00
Wayne Davison
5819d6b14a Stop disabling the RSYNC_PARTIAL_DIR environment variable now that
there is a newer rsync on samba.org.
2006-10-18 04:46:26 +00:00
Wayne Davison
7b4a40ed70 Make sure the new link_dest_used value gets zeroed on init. 2006-10-17 18:49:04 +00:00
Wayne Davison
f210dcadf4 - Fixed a compile problem ("len" not defined) in inet_ntop4().
- Replaced sprintf() with snprintf() in inet_ntop6().
2006-10-16 18:11:24 +00:00
Wayne Davison
178a1d2048 - Die if we can't edit the release date into NEWS or OLDNEWS.
- Don't remove any *pre*diff* files until the final release.
2006-10-15 21:44:15 +00:00
Wayne Davison
a4b4e0770b Improved a comment. 2006-10-15 15:57:27 +00:00
Wayne Davison
2a6e35db31 Improved a couple existing items. 2006-10-15 15:49:31 +00:00
Wayne Davison
e3794138d8 Use the new case_N.h file to make sure that our cleanup_step case
statements never get out of sequence when the code changes.
2006-10-15 15:43:26 +00:00
Wayne Davison
fdd10da6f7 A helper file for cleanup.c. 2006-10-15 15:42:01 +00:00
Wayne Davison
5f12a07bff Now that samba.org has a modern rsync, we can go back to using
hard-links on the moved files and use rsync to effect the hard-
links on the remote system (which will make a future transfer
more efficient in the absense of --detect-renamed).
2006-10-15 05:04:59 +00:00
Wayne Davison
6a4a1d0cb0 Preparing for release of 2.6.9pre2 2006-10-14 20:35:17 +00:00
Wayne Davison
434c40986d Use the MAX_RENAMES_DIGITS define in the relevant snprintf(). 2006-10-14 20:31:33 +00:00
Wayne Davison
8ee6857702 Improved the description of the code-checker work.. 2006-10-14 20:30:43 +00:00
Wayne Davison
721ddc903f Updated the news about the exit_cleanup() improvement. 2006-10-14 20:01:22 +00:00
Wayne Davison
154c345db0 Improved the _exit_cleanup() function to handle potential recursions
back to the function via the calls that it is making.  The new code
treats each recursion back into the function as an opportunity to
take up where we left off (skipping whatever step just failed).
2006-10-14 19:58:52 +00:00
Wayne Davison
25f637a334 Got rid of EXIT_OR_RETURN() macro again -- switching to a better
recursion-prevention heuristic in _exit_cleanup().
2006-10-14 18:51:21 +00:00
Wayne Davison
2356d73bb4 The cleanup code that handles moving the temp file to the partial
file needed to check that cleanup_fname was not NULL to prevent
any possibility of a recursion starting into that code again.
2006-10-14 02:29:29 +00:00
Wayne Davison
4968423e71 Mention the latest fixes and internal changes. 2006-10-14 02:02:47 +00:00
Wayne Davison
99eba67585 Got rid of the recent paranoid length check because it didn't help
to silence a code-checker warning.
2006-10-14 01:17:36 +00:00
Wayne Davison
5abe03d6e8 Restore build order back to normal. 2006-10-14 01:15:16 +00:00
Wayne Davison
83078af5b0 Changed sprintf() calls to snprintf(). 2006-10-13 23:46:32 +00:00
Wayne Davison
185aa5b0e5 Turned an sprintf() call into snprintf(). 2006-10-13 23:42:52 +00:00
Wayne Davison
cabd60fdce - Changed some sprintf() calls to snprintf() calls.
- Changed two last strcpy() calls to strlcpy() calls.
2006-10-13 23:38:14 +00:00
Wayne Davison
10944395bf Changed sprintf() calls to snprintf() calls. 2006-10-13 23:35:53 +00:00
Wayne Davison
204f4f4d09 Changed strcpy() calls into memcpy() calls. 2006-10-13 23:17:37 +00:00
Wayne Davison
c9bce0b8f8 Changed strcpy() calls into strlcpy() calls, just to be extra safe. 2006-10-13 23:17:33 +00:00
Wayne Davison
deee574b11 Added a paranoid length check. 2006-10-13 23:17:30 +00:00
Wayne Davison
55410368e5 - Changed strcpy() calls into strlcpy() calls, just to be extra safe.
- Added a default: exit_cleanup() case to a switch.
- Made the check_name() function take a buffer size arg.
2006-10-13 23:17:27 +00:00
Wayne Davison
e4fdf1debe - Use precompiler conditionals in to_wire_mode() and from_write_mode()
to get rid of code that is not needed on the current system.
- Silence a code-checker warning in send_file_entry().
- Silence a code-checker warning in make_file().
- Fixed a bug in f_name_cmp() that could compare an empty filename
  incorrectly (which might only happen if we transformed a dot-dir
  into an empty name).  (Thanks, code checker!)
2006-10-13 17:07:13 +00:00
Wayne Davison
1580899c1d More temporary name juggling to get all code analyzed. 2006-10-13 17:02:39 +00:00
Wayne Davison
f863b76300 Changed one more exit_cleanup() call into EXIT_OR_RETURN(). 2006-10-13 14:28:56 +00:00
Wayne Davison
5e1ec06f09 Temporarily reorder the OBJS line so that the IBM code checker
can analyze some of the other programs (since it runs out of
time analyzing them all).
2006-10-13 14:17:22 +00:00
Wayne Davison
36e2ea6068 Use new FNONE value when setting/comparing enum logcode vars. 2006-10-13 07:48:35 +00:00
Wayne Davison
f4164b73b4 - Use the new FNONE enum instead of a literal 0 value. 2006-10-13 07:38:21 +00:00
Wayne Davison
9ef506a2b2 If in_exit_cleanup is set, some of our functions return instead of
calling exit_cleanup() (which is a safer way to avoid an infinite
loop when the exit code uses the log functions than allowing the
_exit_cleanup() function to return back into our code).
2006-10-13 07:38:18 +00:00
Wayne Davison
b1b54199ef - When exiting, set the flag "in_exit_cleanup".
- Mark _exit_cleanup() with NORETURN.
- Don't ever return from _exit_cleanup().
2006-10-13 07:38:15 +00:00
Wayne Davison
33394b769d Mark out_of_memory() and overflow_exit() with NORETURN. 2006-10-13 07:38:11 +00:00
Wayne Davison
011e85a5e3 - Added FNONE to the "enum logcode" values.
- Added a NORETURN define to mark a function that never returns.
2006-10-13 07:38:05 +00:00
Wayne Davison
d5dcb6f775 Silence some IBM checker warnings and made a slight optimization
to get_tmpname().
2006-10-13 07:18:29 +00:00
Wayne Davison
0c25dedf31 Simplified the function-finding regex, and made it more versatile
(so we don't need to keep adding variable-type strings).
2006-10-13 06:50:56 +00:00
Wayne Davison
6105464b79 Indented the function comments with "* ". 2006-10-13 06:49:44 +00:00
Wayne Davison
4d51f0db79 Don't use a bool directly in an int comparison. 2006-10-13 06:27:59 +00:00
Wayne Davison
ff530f04a0 Function fcntl() only takes 2 args when using F_GETFL. 2006-10-13 06:26:02 +00:00
Wayne Davison
e8b21fe406 Cast pat_len to an int when using it as a field width. 2006-10-13 06:24:24 +00:00
Wayne Davison
71cb9df386 Some OSes can't chmod -t for a file, so I changed the logic of our
to to substitute a chmod that will work everywhere.
2006-10-13 04:59:53 +00:00
Wayne Davison
f97c2d4a9b - Clarified the "dont compress" option.
- Cleaned up some trailing whitespace.
2006-10-13 01:37:44 +00:00
Wayne Davison
b8a6dae038 Updated the man pages to work with version 2.x of yodl. 2006-10-13 01:24:57 +00:00
Wayne Davison
969f7ed5b7 Fixed an infinite loop in parse_rule() when a filter rule is too
longer for MAXPATHLEN.  Also fixed a couple spots nearby that were
erroneously treating pointer "cp" as a '\0'-terminated string.
2006-10-13 01:22:48 +00:00
Wayne Davison
e825409a84 Preparing for release of 2.6.9pre1 2006-10-12 03:45:53 +00:00
Wayne Davison
b8d29fd8e6 Added a line for 2.6.9. 2006-10-12 03:44:44 +00:00
Wayne Davison
200f2d98db Make sure we tweak the right RSYNC_VERSION line in configure. 2006-10-12 03:32:18 +00:00
Wayne Davison
1a7f3d99c5 Removed the changes in symlink handling in non-chroot daemon mode as
they were not yet safe (I'll consider similar changes for the next
release).
2006-10-12 03:01:18 +00:00
Wayne Davison
e80876700c Got rid of changes that aren't going to make it into 2.6.9. 2006-10-12 03:01:12 +00:00
Wayne Davison
ec55b4f2fb Changed the indent for one else ... if section. 2006-10-12 03:01:01 +00:00
Wayne Davison
798cde474f Some minor improvements to parse_merge_name(). 2006-10-12 02:14:47 +00:00
Wayne Davison
558d482c47 Renumbered tests after adding one in the middle. 2006-10-11 00:51:50 +00:00
Wayne Davison
418b6a2703 Handle the itemizing of of the "." dir when it is newly created. 2006-10-11 00:04:48 +00:00
Wayne Davison
1ef5bf3cfd If new_root_dir is set, itemize the output of the "." dir as a
directory-creation event.
2006-10-11 00:04:44 +00:00
Wayne Davison
2a94207ad6 Added a new variable, new_root_dir, that is set if we created the
destination directory.
2006-10-11 00:04:41 +00:00
Wayne Davison
ddcba3f075 Changed the fix_basis_dirs() function to only remove a single ../
prefix from each --*-dest option's path.
2006-10-10 23:44:59 +00:00
Wayne Davison
db3ae95cac Made some of the --link-dest tests use a relative destination
directory, and made one of those do a --dry-run test before
the regular test.
2006-10-09 03:06:50 +00:00
Wayne Davison
1a05de2bff - If a finished link came from a link-dest dir and --dry-run is in
effect, we now stat the link-dest file instead of the non-existent
  destination file.
- Use int32 for the index variables.
2006-10-09 03:05:19 +00:00
Wayne Davison
d9163a4cf5 If the combination of --dry-run, --link-dest, and -H finds a matching
file in on of the extra basis dirs, make a note of which basis dir
we would have used in the hard-link with the destination file.
2006-10-09 02:59:23 +00:00
Wayne Davison
44885a398f Added link_dest_used unsigned short to struct hlink and made the
other values explicitly 32-bit so that the total size can't be
larger than the other struct we're in a union with.
2006-10-09 02:57:04 +00:00
Wayne Davison
dfe1ed5e97 Another tweak to the --chmod summary. 2006-10-09 00:55:04 +00:00
Wayne Davison
242f6052c2 Mention the latest bug fix. 2006-10-08 22:17:39 +00:00
Wayne Davison
519d55a950 Make the daemon's "incoming chmod" tweaks happen last, as documented. 2006-10-08 22:02:13 +00:00
Wayne Davison
b6008dc645 Clarify the short description of --chmod. 2006-10-08 22:00:31 +00:00
Wayne Davison
6f3684ffb5 Call push_dir() with its new boolean arg. 2006-10-08 20:57:01 +00:00
Wayne Davison
615a5415c9 - Call push_dir() with its new boolean arg, including the spot in
get_local_name() where we need push_dir() to skip the chdir() because
  the destination dir does no yet exist and --dry-run was specified.
- Added fix_basis_dirs(), which will combine the dest-dir with each non-
  absolute basis_dir arg to make sure that they end up being relative to
  the right dir when --dry-run was specified and the dest dir does not
  yet exist.
2006-10-08 20:56:56 +00:00
Wayne Davison
ba081be327 Made the push_dir() function take an option to skip the actual chdir()
call.  Used when the dest-dir doesn't exist and --dry-run was specified.
2006-10-08 20:56:52 +00:00
Wayne Davison
3e88414e4e Moved some of the variable setup from "make check" into the
runtest.sh script.
2006-10-07 14:54:56 +00:00
Wayne Davison
0888952768 Moved some variable setup here from the Makefile and made it
possible to specify extra rsync options for the test.
2006-10-07 14:54:14 +00:00
Wayne Davison
5dcd9a2b70 Changed the -o to -a in the "if". 2006-10-07 14:39:01 +00:00
Wayne Davison
6ce9432d75 A bug-fix for die_on_unsafe_path() when the path doesn't exist. 2006-10-07 14:19:00 +00:00
Wayne Davison
6c8507724b Added exception-checking to a couple select() calls, as suggested
by Hugh Daschbach.
2006-09-30 22:11:20 +00:00
Wayne Davison
d04e95e968 Document that --ignore-times thwarts all --link-dest linking. 2006-09-30 15:21:25 +00:00
Wayne Davison
b06050f9ad I decided that combining --link-dest with -I doesn't make much sense
(without some kind of a post-transfer identicality check, at least)
so I'm removing the code that tried to make the two play nice.
2006-09-30 15:20:17 +00:00
Wayne Davison
ad75d18d2e Mention that the --backup-dir option is a receiver-side path. 2006-09-26 16:44:27 +00:00
Wayne Davison
ed4b8da048 Mention the latest bugfix. 2006-09-24 03:36:04 +00:00
Wayne Davison
2cd421d809 Output the who_am_i() info in out-of-memory() and overflow_exit(). 2006-09-24 03:12:24 +00:00
Wayne Davison
ea0ea357f4 Provide the who_am_i() function. 2006-09-24 03:11:41 +00:00
Wayne Davison
0480a946f5 Some more testing based on Matt's recent patch. 2006-09-23 23:49:20 +00:00
Wayne Davison
67f8a41be5 Matt tracked down a bug in the daemon option "incoming chmod" where
a newly created directory would get the chmod permissions that were
specified for a file (via the F previx).
2006-09-23 23:15:11 +00:00
Wayne Davison
5e1f082d0c Improvments by Matt for the --progress option, including updating
the examples to look like the actual output in a modern rsync.
(I did a little rewording too...)
2006-09-23 00:07:28 +00:00
Wayne Davison
a633351962 Mention the current limitation of the RSYNC_EXIT_STATUS value. 2006-09-20 14:04:19 +00:00
Wayne Davison
2edfe52230 Mention the new --remove-s*-files error. 2006-09-20 01:54:40 +00:00
Wayne Davison
acee1ad853 Complain if a --remove-s*-files option is set and we can't remove
the source file.
2006-09-20 01:53:32 +00:00
Wayne Davison
8f4ae68ca7 The [ & ] are now removed from a literal IPv6 hostname passed to the
remote shell.
2006-09-18 17:39:13 +00:00
Wayne Davison
ff1b9344c9 When parsing a literal IPv6 address in square brackets, pass the
whole string (including the brackets) to the remote shell.  (The
old code stripped the leading '[' but left the trailing ']'.)
2006-09-18 01:19:26 +00:00
Wayne Davison
a923437bc0 Added a missing '-' to the string "-rsh". 2006-09-18 01:15:19 +00:00
Wayne Davison
dde698c2e8 Mention the permission bug-fix for new files created by --inplace. 2006-09-18 00:47:56 +00:00
Wayne Davison
c2b47e31a5 Mention the adding of the --remove-source-files option. 2006-09-18 00:38:20 +00:00
Wayne Davison
4e0bf97716 Mention the --server and --sender option as being internal,
not-for use by a normal user options.  Also mention the
support/rrsync script in this context.
2006-09-18 00:19:04 +00:00
Wayne Davison
174e51b5bf Added parsing for all the latest options. 2006-09-18 00:16:31 +00:00
Wayne Davison
30cd7ec1cf The --min-size arg doesn't need to be path-checked either. 2006-09-18 00:13:50 +00:00
Wayne Davison
48459ba15c The --inplace option now notices when the basis data is not coming
from the destination file (or an identical copy) and always writes
out the data (instead of seeking when at an identical offset).
2006-09-17 23:28:19 +00:00
Wayne Davison
48ecccce2d The --delete-excluded code now also drops any merge file that was
marked as MATCHFLG_NO_PREFIXES because they can only contain
include/exclude rules.
2006-09-09 18:59:10 +00:00
Wayne Davison
a739128df9 Document the new RSYNC_PID environment variable. 2006-09-09 18:56:13 +00:00
Wayne Davison
2c1775620a Try various long, long-long, etc. types for a 64-bit integer
before trying off64_t.
2006-09-09 18:53:23 +00:00
Wayne Davison
40f910c43a Mention the latest changes. 2006-09-09 18:31:45 +00:00
Wayne Davison
503114a782 Added the RSYNC_PID environment variable for the pre-/post-xfer
commands so that the pre-xfer command has a unique ID it can
use to cache information for the post-xfer command.
2006-09-09 17:59:02 +00:00
Wayne Davison
71f9e4673e A slight simplification to the last change. 2006-09-02 20:05:08 +00:00
Wayne Davison
176e8e94c3 An even better way to un-backslash-escape the filenames from find. 2006-09-02 19:57:56 +00:00
Wayne Davison
814b340c27 Improved the --delete-excluded test based on Matt's input and
another corner case I noticed.
2006-09-01 00:43:52 +00:00
Wayne Davison
f167879035 Matt pointed out that the code was not properly dropping excludes
that were read from a per-dir merge file when --delete-excluded
is enabled.  This additional code fixes that.
2006-09-01 00:42:39 +00:00
Wayne Davison
4187572616 Fixed handling of filenames with an embedded $, @, or %. 2006-08-31 20:30:16 +00:00
Wayne Davison
ff43d8b449 Added Matt's --delete-excluded test for merge-file correctness. 2006-08-31 17:19:26 +00:00
Wayne Davison
97bf86f8ee Make sure that --delete-excluded does not elide a per-dir merge
filter file, while still dumping the .cvsignore file from -C.
2006-08-31 17:18:24 +00:00
Wayne Davison
8c449e6285 When we're cleaning up a path of "/" in relative mode, we must make
the name "/." (as it was of old) so that there is a filename for us
to send.  Fixes a problem with --delete --relative when copying from
the root (/) of the filesystem.
2006-08-26 16:02:17 +00:00
Wayne Davison
29930a9fd2 Fixed an exclude bug with --relative excluding "/". 2006-08-12 16:22:03 +00:00
Wayne Davison
c98ad3df96 Check return value of asprintf() in full_fname(), as pointed
out by Ilja van Sprundel.
2006-07-29 21:04:35 +00:00
Wayne Davison
9c3c30e5c7 Assign datarootdir=@datarootdir@ so that a modern autoconf
doesn't complain about our Makefile.in.
2006-07-21 13:58:52 +00:00
Wayne Davison
b4a09b72ee Use new MAKEDEV() macro instead of makedev() directly. 2006-07-10 04:25:53 +00:00
Wayne Davison
5a3810b463 Define MAKEDEV() based on the MAKEDEV_TAKES_3_ARGS define. 2006-07-10 04:25:10 +00:00
Wayne Davison
e8d97006e5 If makedev() takes 3 args, define MAKEDEV_TAKES_3_ARGS. 2006-07-10 04:24:07 +00:00
Wayne Davison
8adc22e362 Mention the "munge symlinks" daemon setting. 2006-07-03 22:35:41 +00:00
Wayne Davison
dcebf78fe0 Obey the new "munge symlinks" dameon setting. 2006-07-03 22:35:00 +00:00
Wayne Davison
651c8510e8 Document "munge symlinks". 2006-07-03 22:33:56 +00:00
Wayne Davison
1ed3f5ed61 Added the "munge symlinks" setting. 2006-07-03 22:33:49 +00:00
Wayne Davison
70c81b0c07 Fixed the indentation on a few lines. 2006-07-03 22:30:13 +00:00
Wayne Davison
47c1197534 Decided that I like remove-source-files better than remove-sender-files. 2006-06-30 15:52:52 +00:00
Wayne Davison
fb41a3c669 Changed --remove-sent-files into --remove-sender-files. 2006-06-30 15:42:41 +00:00
Wayne Davison
2700069d5a Added --remove-sender-files and deprecated --remove-sent-files. 2006-06-30 15:42:36 +00:00
Wayne Davison
044ccbaacf The remove_sent_files var was renamed to remove_sender_files. 2006-06-30 15:42:32 +00:00
Wayne Davison
841d943651 Handle the --remove-sender-files option by sending MSG_SUCCESS for
any file that is being hard-linked.
2006-06-30 15:42:29 +00:00
Wayne Davison
04cd8789cb Handle the --remove-sender-files option by sending MSG_SUCCESS for
any up-to-date file (non-dir).
2006-06-30 15:42:26 +00:00
Wayne Davison
9578783a71 Changed the name of the nightly symlink. 2006-06-30 14:26:01 +00:00
Wayne Davison
4cff5fa462 Make use of module_dirlen in full_fname(). 2006-06-30 14:24:25 +00:00
Wayne Davison
cc1b4f776a Allow --with-nobody-group=GROUP (patch from Olivier Thauvin). 2006-06-19 19:30:51 +00:00
Wayne Davison
72d1b262ac Mention the latest bug-fix. 2006-06-16 09:05:21 +00:00
Wayne Davison
6fb7cc38a2 Make sure that the %f escape always has the full path info when
receiving files.
2006-06-16 09:01:31 +00:00
Wayne Davison
8a7b8400e7 Updated the "use chroot" section with the latest symlink info. 2006-06-16 08:56:26 +00:00
Wayne Davison
d2ab094dec Mention the latest log-file improvements. 2006-06-07 23:06:18 +00:00
Wayne Davison
ccd2966da9 Moved the "log file" and "syslog facility" sections into the per-module
options and improved them a little.
2006-06-07 23:05:27 +00:00
Wayne Davison
6dc9b74bc6 Call log_init() with its new "restart" (0 or 1) arg. 2006-06-07 23:05:24 +00:00
Wayne Davison
04c841190f - Pass "module_id" to the two log-related settings that are no longer
global.
- Added a "restart" arg to log_init() that lets us request that logging
  be reinitialized if the log-file/syslog-facility params changed.
2006-06-07 23:05:17 +00:00
Wayne Davison
d20ce6e144 Made "log file" and "syslog facility" per-module settings. 2006-06-07 23:05:14 +00:00
Wayne Davison
a7d461fccd Improved some comments in get_local_name() and improved the
error checking a little more.
2006-06-05 22:50:52 +00:00
Wayne Davison
4c5a2da65f Mention the latest bug-fix. 2006-06-05 17:00:47 +00:00
Wayne Davison
caff33228e If we fail to create a new directory, skip trying to update
everything that is inside that dir.
2006-06-05 16:56:50 +00:00
Wayne Davison
f38f6f80b7 Added FLAG_MISSING. 2006-06-05 16:52:34 +00:00
Wayne Davison
e848e06618 Got rid of an unused extern. 2006-06-05 16:17:33 +00:00
Wayne Davison
eece5fe32c Mention the temp-file fix. 2006-06-01 08:40:55 +00:00
Wayne Davison
8590993185 Got rid of the FNAME logcode enum. 2006-06-01 08:04:50 +00:00
Wayne Davison
b64ee91a41 Changed rprintf() messages that started with a newline into two
rprintf() calls (the first of which just outputs an empty line).
2006-06-01 08:04:47 +00:00
Wayne Davison
d0133e6eba - Got rid of the FNAME logcode enum.
- rwrite() no longer supports newlines at the start of the string.
- maybe_log_item() avoids outputting a non-significant update to
  the log file if the log-file-format doesn't include %i.
2006-06-01 08:04:43 +00:00
Wayne Davison
1925c3448c - Got rid of the FNAME logcode enum.
- We no longer output " is uptodate" messages to the log file.
2006-06-01 08:04:40 +00:00
Wayne Davison
19b8587654 Fixed a typo that set stdout_format_has_i instead of logfile_format_has_i. 2006-06-01 06:49:15 +00:00
Wayne Davison
051f5df526 Mention the latest --log-* option changes. 2006-05-30 18:35:36 +00:00
Wayne Davison
e525519509 Authorize the current host in the rsyncd.conf file in addition
to localhost and 127.0.0.1 (which will hopefully fix the failing
of the daemon tests on FreeBSD).
2006-05-30 18:26:17 +00:00
Wayne Davison
4b90820d9f - Added the --log-file-format option to the daemon section.
- Updated and improved the --out-format section.
- Moved and improved the description of the non-daemon --log-file and
  --log-file-format options.
2006-05-30 17:47:20 +00:00
Wayne Davison
2873603ab5 If the user specifies --log-file-format without --log-file,
ignore the useless value.
2006-05-30 17:41:54 +00:00
Wayne Davison
ec52c3b9da Skip transfer logging if the logfile_format string is empty. 2006-05-30 17:41:04 +00:00
Wayne Davison
10ae3406ee Allow the --log-file-format=FMT option (if given when starting a daemon)
to override the "log format" setting.
2006-05-30 17:15:24 +00:00
Wayne Davison
232658d9d3 - Allow the --log-file-format option to override the "log format"
setting when starting a daemon.
- Make a daemon refuse all --log-file* options.
- Don't use refuse logic on daemon-mode options given to a daemon
  module -- reject them via their own message.
2006-05-30 17:14:17 +00:00
Wayne Davison
c000002f46 Document the new --log-file-format option and renamed --log-format to
--out-format.
2006-05-29 22:57:05 +00:00
Wayne Davison
2fedf3d596 - Use the renamed stdout_format_has_i variable.
- Call log_item() with its new arg (and call it more often).
2006-05-29 22:57:01 +00:00
Wayne Davison
887d745549 Turn off the --log-file option on the server side for a local transfer. 2006-05-29 22:56:58 +00:00
Wayne Davison
20f90d5e8a Use the renamed stdout_format_has_i variable. 2006-05-29 22:56:55 +00:00
Wayne Davison
17bda2d109 - Use the renamed stdout_format_has_i variable.
- Call log_item() with its new arg.
2006-05-29 22:56:51 +00:00
Wayne Davison
b534351058 - Use the renamed stdout_format_has_i, stdout_format_has_o_or_i, and
stdout_format variables.
- In rwrite(), make FNAME output only go to the client.
- Added an arg to log_item() that indicates what kind of output is
  desired: FNAME (stdout only),  FLOG (log file only), or FINFO (both).
2006-05-29 22:56:48 +00:00
Wayne Davison
b3e4e7ef2e - Renamed log_format -> stdout_format.
- Renamed log_format_has_i -> stdout_format_has_i.
- Renamed log_format_has_o_or_i -> stdout_format_has_o_or_i.
- Changed the --log-format to --out-format (though we still accept
  the old option, and still send it as well).
- Added the --log-file-format option (and got rid of the code that
  made --out-format sometimes affect the log-file's format).
2006-05-29 22:56:45 +00:00
Wayne Davison
a3f6dbdf5c The print_child_argv() function should be outputting FCLIENT
messages these days, not FINFO.
2006-05-29 22:33:06 +00:00
Wayne Davison
95ae5224b0 The cleanup_set() call was not getting called w/o --partial. 2006-05-18 18:53:24 +00:00
Wayne Davison
03dbc0b831 - Improved the setting of cleanup_new_fname and cleanup_fname.
- Don't try to keep a partial file if cleanup_new_fname is not set.
2006-05-18 18:52:40 +00:00
Wayne Davison
ffa8ab8eb5 Improved two lseek() error messages. 2006-05-18 17:04:40 +00:00
Wayne Davison
a17e119d8b Mention the latest fixes. 2006-05-17 06:54:11 +00:00
Wayne Davison
6bfc7b4d79 Tweaked a couple things in try_dests_reg(). 2006-05-16 22:27:26 +00:00
Wayne Davison
b3e8e7c79e Make --quiet quieter (like it used to be), but also don't allow it
to interfere with any logging of messages that is going on.
2006-05-14 00:27:33 +00:00
Wayne Davison
bdd3a4fef5 Updated the (commented out) valgrind command. 2006-05-11 23:41:18 +00:00
Wayne Davison
a00f5a371e Got rid of the .ignore kluge. 2006-05-11 23:38:10 +00:00
Wayne Davison
55c412630c Added ".bzr/" to the default CVS exclusions. 2006-05-11 07:54:33 +00:00
Wayne Davison
778ee637ee This file hasn't been needed for a while now... 2006-05-10 18:34:32 +00:00
Wayne Davison
80aff93b32 Added the updating of a symlink to the very latest nightly tar file. 2006-05-10 16:37:07 +00:00
Wayne Davison
6721973e37 Mention the --log-file option. 2006-05-09 18:44:58 +00:00
Wayne Davison
a2ed5801d3 Document the new --log-file option. 2006-05-09 18:31:24 +00:00
Wayne Davison
15ce4b24fc Output the progress message as FCLIENT instead of FINFO. 2006-05-09 18:31:19 +00:00
Wayne Davison
c5260884d6 Got rid of the call to log_exit() now that the cleanup code handles this. 2006-05-09 18:31:16 +00:00
Wayne Davison
ea124cb324 - Turned some FINFO rprintf() calls into FCLIENT calls that don't go
into a client-side log-file.
- Added a couple FLOG rprintf() calls.
2006-05-09 18:31:13 +00:00
Wayne Davison
13b597fa71 - Use the new logfile_* variables that are set by the --log-file
option instead of the old daemon_log_* variables.
- Renamed the "logfile" variable "logfile_fp".
- Enhanced the logic in rwrite() to handle client-side FLOG output.
2006-05-09 18:31:10 +00:00
Wayne Davison
ecc7623e7f Some demon_log_* variables changed into logfile_* variables that are
also used by the new --log-file option.
2006-05-09 18:31:06 +00:00
Wayne Davison
87c0f9d6b4 Added --log-file and several logfile_* support variables. 2006-05-09 18:31:03 +00:00
Wayne Davison
1cfcb8af11 Revised the logic for when to call log_exit() to handle the
new --log-file option.
2006-05-09 18:31:00 +00:00
Wayne Davison
56aaa4c44c Tweaked the comment about log-message categories. 2006-05-09 18:30:57 +00:00
Wayne Davison
4b6a7bd706 Got rid of an unused variable. 2006-05-09 18:00:15 +00:00
Wayne Davison
5bc933a285 Mention the latest bugfix and improved an old description. 2006-05-09 17:46:04 +00:00
Wayne Davison
01d124d9e2 If the --partial-dir value is an absolute path and we use a file in
it as an alternate basis file, make sure that we delete it when the
associated destination file is successfully updated.
2006-05-09 17:38:47 +00:00
Wayne Davison
58a06312a4 Improved the doc for --existing and --ignore-existing. 2006-05-05 20:41:17 +00:00
Wayne Davison
c2c8db9195 - Moved the sanitizing of the partial_dir value here from options.c.
- Call die_on_unsafe_path() in a few needed places.
- Handle the server-excluded checks for an absolute partial_dir and
  the --*-dest options.
2006-05-05 16:00:33 +00:00
Wayne Davison
d1e6b0e225 - Added some calls to die_on_unsafe_path() to the path-sanitizing code.
- Moved the sanitizing of the partial_dir value into main.c.
2006-05-05 15:58:44 +00:00
Wayne Davison
8936367695 - Added a call to die_on_unsafe_path() to handle_partial_dir().
- Fixed some strange slash handling in partial_dir_fname().
2006-05-05 15:54:20 +00:00
Wayne Davison
8517e9c10a A few minor changes to match the recent --help changes in
options.c.
2006-05-05 06:24:25 +00:00
Wayne Davison
fcecb70b1d - Don't check HAVE_LINK directly, use SUPPORT_HARD_LINKS instead.
- Updated a few items in the --help text.
2006-05-05 06:16:22 +00:00
Wayne Davison
582c1589f3 Call the new die_on_unsafe_path() function in a few places. 2006-05-05 05:57:48 +00:00
Wayne Davison
cb15269eb0 Call the new die_on_unsafe_path() function in a couple spots. 2006-05-05 05:56:37 +00:00
Wayne Davison
f47807900b Added a new function named die_on_unsafe_path(). This is used
by a non-chroot daemon to ensure that a user-supplied path does
not contain an unsafe symlink element.
2006-05-05 05:55:40 +00:00
Wayne Davison
40410a38bc - Don't check HAVE_LINK directly, use SUPPORT_HARD_LINKS instead.
- Tweaked Paul's recent change just a tad.
- Fixed the output of --compare-dest when SUPPORT_HARD_LINKS is
  not defined.
2006-05-05 05:53:36 +00:00
Wayne Davison
6b54a688cf Cast file->mode to an int when printing it via %o. 2006-05-05 05:40:17 +00:00
Paul Green
b59dc8d5ae Fix generator.c to avoid calling do_link() on systems that do not support
the link() function.  The changes test OK on SuSE Linux and on my own
Stratus VOS system, but I would be grateful if other folks could
double-check this change.  Paul G.
2006-05-04 19:00:37 +00:00
Wayne Davison
45ba206a94 A few more improvements. 2006-05-04 02:42:55 +00:00
Wayne Davison
2220ec0a69 A few minor twiddles. 2006-05-04 02:38:58 +00:00
Wayne Davison
5fdbb87df8 Added/clarified the latest bug-fix info. 2006-05-04 02:29:58 +00:00
Wayne Davison
f1c9bcd0fc Cast the enum in rwrite() when calling send_msg(). 2006-05-03 16:58:36 +00:00
Wayne Davison
3723548ded Use send_msg() when forwarding a log message, not io_multiplex_write().
This allows send_msg() to decide if the message should be sent right
away, or should be deferred.
2006-05-03 16:17:49 +00:00
Wayne Davison
12ccc73ae7 Changed read_msg_fd() to always use send_msg()/rwrite() instead of
sometimes calling io_multiplex_write()/rwrite() or msg_list_add().
This simplifies the code that does the defer_forwarding_messages
checking because it can now be done in just one place, in send_msg()
(because rwrite() also calls send_msg() now when forwarding a msg).
2006-05-03 16:17:46 +00:00
Wayne Davison
ee8d9636d1 A small optimization to the new code in msg2sndr_flush(). 2006-05-03 06:32:59 +00:00
Wayne Davison
38de2866e5 Made log_init() call timestring() instead of just localtime() prior to a
chroot (note that timestring() makes use of localtime() plus strftime()).
2006-05-03 06:11:11 +00:00
Wayne Davison
bdac7621ee Improved the last bugfix description. 2006-05-03 05:37:00 +00:00
Wayne Davison
8ac4774675 Mention the fix for the "unexpected tag 3" bug. 2006-05-03 05:22:01 +00:00
Wayne Davison
229e1950ed Fixed a bug where deferred MSG_INFO/MSG_ERROR/MSG_LOG messages were
not being forwarded from the generator to the sender using rwrite()
(and MSG_LOG messages didn't need to be deferred at all).
2006-05-03 05:19:01 +00:00
Wayne Davison
93977bca10 Added module_dirlen now that utils.o needs it. 2006-05-03 00:49:31 +00:00
Wayne Davison
c2a2147a5b - Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Got rid of startdir_depth code (in favor of util.c's curr_dir_depth).
- Use the new calling syntax for sanitize_path().
2006-05-03 00:48:32 +00:00
Wayne Davison
73173af955 - Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Don't sanitize the string of a symlink -- just use it verbatim.
2006-05-03 00:48:29 +00:00
Wayne Davison
a2248aea2e - Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Use the new calling syntax for sanitize_path().
2006-05-03 00:48:26 +00:00
Wayne Davison
a8167c6611 - Added curr_dir_depth, a variable that keeps track of the depth past
the module root when a sanitizing daemon is running.
- Use the new calling syntax for sanitize_path().
- Updated count_dir_elements() to not count a . component.
- Improved sanitize_path() so that it can take a symlink target string
  and combine it with the symlink's name when the target is relative.
  When working with a symlink, the routine also returns NULL if any ..
  elements try to escape past the module root.
- The new routine safe_stat(), is used when sanitizing paths (i.e. when
  the daemon does not have chroot enabled).  This manually follows a
  chain of symlinks, ensuring they don't try to escape the module.
2006-05-03 00:48:23 +00:00
Wayne Davison
91f4b31fe1 Use the new calling syntax for sanitize_path(). 2006-05-03 00:48:20 +00:00
Wayne Davison
cad8f6f980 Tweaked some variable names in readlink_stat() and link_stat(). 2006-05-02 19:52:28 +00:00
Wayne Davison
d8bf7ea8e9 Mention the latest bug-fixes. 2006-05-02 17:38:34 +00:00
Wayne Davison
d8f28a663c Test the new symlink sanitizing fix by using ::test-scratchdir/to
as the destination and including a symlink with a leading "../" .
2006-05-02 17:13:11 +00:00
Wayne Davison
2ae4126a9e Tweaked our test config file to include transfer logging that
includes %i, and to have a test-scratchdir module.
2006-05-02 17:11:42 +00:00
Wayne Davison
6f1c2aab43 Moved the sanitizing of a symlink's link string here from flist.c. 2006-05-02 16:52:51 +00:00
Wayne Davison
e71c1c26df Fixed a problem in the --link-dest processing where -I (--ignore-times)
or --size-only could adversely affect our ability to find identical
files to hard-link.
2006-05-02 16:46:48 +00:00
Wayne Davison
b24498ec2c Set a new variable, startdir_depth, to indicate how deep the
destination dir is in a daemon module's path.
2006-05-02 16:42:20 +00:00
Wayne Davison
b2d4639543 Got rid of the sanitizing of a symlink's link string because it
is happening too early to work correctly (before we know what
our destination-directory's depth in the module will be).
2006-05-02 16:36:07 +00:00
Wayne Davison
d3ef985954 We can't check the --*-dest args against the server filter rules
here because we don't know what the args are going to be relative
to yet.
2006-04-28 17:34:53 +00:00
Wayne Davison
7c58c99184 We sanitize the --*-dest args here so they can be relative to the
destination directory.
2006-04-28 16:58:20 +00:00
Wayne Davison
ad77db8b71 Moved the sanitizing of the --*-dest args into main.c. 2006-04-28 16:57:39 +00:00
Wayne Davison
e7c67065c0 Updated the FSF's address to an even newer one. 2006-04-25 23:51:12 +00:00
Wayne Davison
0f78b81511 - Updated the address for the FSF in the opening comment.
- Standardized the format of the opening comment, including adding a
  brief description of what's in the file for those that lacked it.
- Added some missing copyright lines.
- Some minor whitespace tweaks (in a few of the files).
2006-04-25 20:23:34 +00:00
Wayne Davison
d051056f92 Tweaked some whitespace to match the latest version from autoconf. 2006-04-24 23:43:45 +00:00
Wayne Davison
a4a38e8df0 Incremented the version to 2.6.9cvs. 2006-04-24 22:24:40 +00:00
Wayne Davison
60ef8ed128 Rolled over the news file for the next version. 2006-04-24 22:23:56 +00:00
Wayne Davison
8aa0dc7838 Updated to the version dated 2006-02-23. 2006-04-24 22:20:10 +00:00
Wayne Davison
4177f09b83 Preparing for release of 2.6.8 2006-04-22 15:39:57 +00:00
Wayne Davison
acaadb55c1 Mention the phase-unknown changes. 2006-04-21 16:57:13 +00:00
Wayne Davison
b88c2e8ffe - Got rid of the (mostly useless) io_read_phase and io_write_phase
variables.  In the future it might be useful to get rsync to
  mention what kind of a message it was trying to write, but the
  'phase "unknown"' output was ubiquitous and confusing.
- Got rid of the completely unused write_int_named() function.
2006-04-21 16:40:19 +00:00
Wayne Davison
f4ea5f47dc Got rid of the setting of io_write_phase. 2006-04-21 16:36:30 +00:00
Wayne Davison
62ae66d43b Mention the security fix for patches/xattrs.diff. 2006-04-21 00:05:30 +00:00
Wayne Davison
8641d28740 Improved the --owner and --group sections. 2006-04-18 18:58:07 +00:00
Wayne Davison
de3438407c Twiddle the trailing output in non-live mode. 2006-04-18 06:43:17 +00:00
Wayne Davison
434764269c Fixed a typo in the new code. 2006-04-18 06:38:58 +00:00
Wayne Davison
ba212fe0b6 - Fixed --copy-dest behavior on a system where CAN_HARDLINK_SYMLINK
and/or CAN_HARDLINK_SPECIAL is not defined.
- Changed --link-dest behavior on such systems to work just like
  --copy-dest for the non-hard-linkable files.
2006-04-18 05:48:46 +00:00
Wayne Davison
5f93b4d35e A slight improvement to the logic in try_dests_non(). 2006-04-18 05:24:02 +00:00
Wayne Davison
f8db4a8ab4 Mention the latest bugfix. 2006-04-17 19:55:16 +00:00
Wayne Davison
398612ba07 Fixed a bug where special files were not getting hard-linked via
the --link-dest option.
2006-04-17 19:53:41 +00:00
Wayne Davison
77b013afb5 Don't use the -C option to make (since it's not portable). 2006-04-17 18:15:02 +00:00
Wayne Davison
08c0cd8a42 Mention the latest fixes. 2006-04-17 18:00:09 +00:00
Wayne Davison
1c6e9dfabc Use the new CAN_HARDLINK_SYMLINK and CAN_HARDLINK_SPECIAL defines
from configure instead of the old (and not quite correct) run-time
checking.
2006-04-17 17:56:10 +00:00
Wayne Davison
0037bf23fc Added two new checks: 1. Does link() hard-link symlinks (not the
referent)?  2. Does link() hard-link a fifo?
2006-04-17 17:53:47 +00:00
Wayne Davison
285edc9169 Don't use -C with make because it's not portable. 2006-04-17 17:37:13 +00:00
Wayne Davison
c4aa84ad50 Got rid of the unused REPLACE_INET_NTOA and REPLACE_INET_ATON checks. 2006-04-13 16:54:24 +00:00
Wayne Davison
b635bc92d1 Got rid of inet_ntoa -> rep_inet_ntoa tom-foolery because rsync
doesn't use inet_ntoa() anymore.
2006-04-13 16:53:15 +00:00
Wayne Davison
146d2228cc Got rid of the replacement inet_aton() and inet_ntoa() functions
because no code in rsync has used these functions since 2.4.8.
2006-04-13 16:52:15 +00:00
Wayne Davison
b2501ccf12 Improved a sentence. 2006-04-12 16:59:32 +00:00
Wayne Davison
e60bba3fbc A few minor changes to some messages and a couple variable improvements. 2006-04-12 16:35:53 +00:00
Wayne Davison
e26cfccf16 Preparing for release of 2.6.8pre1 2006-04-12 16:23:46 +00:00
Wayne Davison
74f80abce2 Moved the include of netinet/ip.h into socket.c. 2006-04-11 00:48:55 +00:00
Wayne Davison
5899b8cf3e Moved the include of netinet/ip.h here along with its apparent
prerequisite, netinet/in_systm.h .
2006-04-11 00:48:28 +00:00
Wayne Davison
08e0a62956 Tweaked a comment. 2006-04-11 00:28:02 +00:00
Wayne Davison
2bd17a51ae Include netinet/ip.h . 2006-04-09 13:51:56 +00:00
Wayne Davison
c7b9ebb598 Mention the read-position fix. 2006-04-08 16:43:21 +00:00
Wayne Davison
e3db43ffe5 Fixed the value of map->p_fd_offset when a read() fails or is
abbreviated.
2006-04-08 16:37:50 +00:00
Wayne Davison
f61ab01d96 Use --delete-after instead of --delete. 2006-04-08 16:36:57 +00:00
Wayne Davison
ceca8ccac8 We don't need log_initialised exported after all. 2006-04-08 16:04:34 +00:00
Wayne Davison
374c3e1278 Moved the calls to client_addr() and client_name() below the lp_load()
call so that their potential to output log messages can't cause the
log-file to initialize before we know what "log name" to use.
2006-04-08 16:03:16 +00:00
Wayne Davison
e09d8a304c Clarified a few items. 2006-04-06 07:54:03 +00:00
Wayne Davison
2a7d9fe9b8 A slightly better fix than the last version. 2006-04-06 07:38:54 +00:00
Wayne Davison
e63aeb6d68 Made log_initialised public. 2006-04-06 07:33:12 +00:00
Wayne Davison
077d5d4ebc There's no need for lp_load() to check am_daemon. 2006-04-06 07:28:22 +00:00
Wayne Davison
e2d774cdd7 Improved the bind()-failure message to mention what family failed. 2006-04-02 21:15:37 +00:00
Wayne Davison
415b598346 Got rid of duplicate rsync: prefix from an rsyserr() call. 2006-04-02 15:02:02 +00:00
Wayne Davison
69627d66f8 Improved a couple sentences. 2006-04-02 14:23:22 +00:00
Wayne Davison
ac98cd98e3 - Mention the logging fix for a single-use daemon.
- Mention the fatal error for when --daemon can't be honored.
2006-03-31 17:56:19 +00:00
Wayne Davison
91d324b4ea Log the connect message after calling log_init(). 2006-03-31 17:37:21 +00:00
Wayne Davison
89fb50263b - Complain if the user specified --delete without -r or -d.
- Got rid of the saw_delete_* vars.
2006-03-28 23:09:36 +00:00
Wayne Davison
e257c6c20b Use the regular delete* vars instead of the saw_delete* vars
(which are no longer around).
2006-03-28 23:09:07 +00:00
Wayne Davison
43eae40e45 Include the version number when we exit with an error or warning. 2006-03-28 18:23:24 +00:00
Wayne Davison
920240a687 - Mention two omitted --files-from bug-fixes.
- Added a place-holder release line for 2.6.8.
2006-03-28 16:49:23 +00:00
Wayne Davison
f8b9da1a2c Output the who_am_i() info in the "unknown message" error. 2006-03-28 06:12:18 +00:00
Wayne Davison
3c987ee956 Mention latest tweaks. 2006-03-22 18:26:44 +00:00
Wayne Davison
5c6d46329b If open_socket_in() fails, we now log the reasons why. 2006-03-22 17:48:59 +00:00
Wayne Davison
8b3e964d14 Mention the new support/file-attr-restore script. 2006-03-21 18:11:43 +00:00
Wayne Davison
91a93df049 A nice file-attribute maintenance script that lets you restore
permissions, ownership, and group-info on files that may be
different than the originals.
2006-03-21 18:06:26 +00:00
Wayne Davison
19826af5f0 Fixed a few things that looked like yodl macros but were not. 2006-03-21 03:45:03 +00:00
Wayne Davison
49f4cfdf39 Improved a few things that a more modern yodl complained about. 2006-03-21 03:41:00 +00:00
Wayne Davison
b3222792ad Changed where ITEM_REPORT_ATIME goes in the list. 2006-03-17 23:57:19 +00:00
Wayne Davison
0640710115 Go ahead and define upcoming ITEM_REPORT_* defines now. 2006-03-17 21:59:25 +00:00
Wayne Davison
fa65989a8b Added support for using solaris's "setfacl -s" in place of
GNU's "setfacl -k".
2006-03-16 21:37:18 +00:00
Wayne Davison
4209f079dd Make sure that the --relative test creates the implied directories
with user-write permission, and turns any symlinks in the implied
dirs into real dirs.
2006-03-16 20:02:36 +00:00
Wayne Davison
a7704777ce An extra safeguard for msg2sndr_flush(). 2006-03-16 10:08:08 +00:00
Wayne Davison
7d51b8374d Made the new msg2sndr handling even better. 2006-03-16 09:57:32 +00:00
Wayne Davison
a27042b521 Mention fix for stunnel-using rsync. 2006-03-16 03:18:16 +00:00
Wayne Davison
5b51c893c5 Optimized the reacquisition of the code value from the msg2sndr list. 2006-03-16 02:26:27 +00:00
Wayne Davison
408e69396c Fixed the reacquisition of the code value from the msg2sndr list. 2006-03-16 01:27:26 +00:00
Wayne Davison
954bbed84a - Optimized the msg_list_item structure to make the buffer an
integral part of the structure instead of pointer to a
  separately allocated buffer.
- Improved the code that was ensuring that no messages from the
  receiver could be merged into the middle of a partially written
  buffer from the generator.  The new code ensures that we never
  avoid reading the messages from the receiver (like we used to).
  This ensures that the generator will not hang when the receiver
  got a read error on the socket, sent us a message about it, but
  the socket in the generator never becomes writable for it to get
  a similar error (now we are assured of getting the receiver's
  note about their read error, and we know to shut things down).
2006-03-16 00:57:54 +00:00
Wayne Davison
7c329ec72c Mention the log-file.diff. 2006-03-15 18:47:31 +00:00
Wayne Davison
07a8a360a5 Got rid of an errant newline. 2006-03-15 16:54:13 +00:00
Wayne Davison
1618c9e6d1 Improved the regex to match syslog lines and be easier to read. 2006-03-13 16:45:24 +00:00
Wayne Davison
ba0147ac42 Changing the version to 2.6.8cvs. 2006-03-13 16:44:47 +00:00
Wayne Davison
9e88f057b4 Starting the news for 2.6.8. 2006-03-13 16:42:50 +00:00
Wayne Davison
f171bf5b8f Rolling over the NEWS from 2.6.7. 2006-03-13 16:42:33 +00:00
Wayne Davison
1b1628b90a Fixed a bug where the NEWS file got an extra newline inserted when
the release date was added.  Changed "ln -f" to "cp -p" because
samba.org doesn't allow ln to be used at the moment.
2006-03-13 16:42:08 +00:00
Wayne Davison
50cf25672e Added a test of a simple exclude when --relative is enabled. 2006-03-13 01:57:13 +00:00
Wayne Davison
b316862831 Fixed a problem when copying an absolute source path with
the --relative option enabled.
2006-03-13 01:56:19 +00:00
Wayne Davison
38a4b9c297 Block-quote the itemized list in the --stats section so that
it is indented in the manpage.
2006-03-13 00:45:07 +00:00
Wayne Davison
a058cbc410 Preparing for release of 2.6.7 2006-03-11 18:43:42 +00:00
Wayne Davison
1ef7913497 Mention solo-dir fix for a dir without S_IWUSR. 2006-03-11 17:59:37 +00:00
Wayne Davison
88a16c8b4f Don't force S_IWUSR on a solo directory transfer. 2006-03-10 15:57:03 +00:00
Wayne Davison
8030b28ff8 Make extra sure that authbuf can't overflow. 2006-03-07 08:46:29 +00:00
Wayne Davison
1c598b1db8 Mention fix for Proxy-Authorization header. 2006-03-06 18:28:06 +00:00
Wayne Davison
6854bf69a8 Call base4_encode() with "1" for its new "pad" arg so that the
Proxy-Authorization header is properly padded with trailing '='
chars.
2006-03-06 18:22:26 +00:00
Wayne Davison
293def601d The base4_encode() function now takes a "pad" arg which indicates
if the caller wants to pad the value with trailing '=' chars.
2006-03-06 18:22:20 +00:00
Wayne Davison
651dc65efc Tweaked the mode of the files in the tar file. 2006-03-04 08:21:58 +00:00
Wayne Davison
c2b2bd6a93 Since the samba.org rsync is so old that it doesn't handle
out-of-order hard-linked files, changed the script to do the
hard-linking manually.
2006-03-02 23:42:56 +00:00
Wayne Davison
e32a48d256 Preparing for release of 2.6.7pre3 2006-03-02 22:49:27 +00:00
Wayne Davison
b5cf121d70 Mention the get_local_name() change. 2006-03-02 03:56:14 +00:00
Wayne Davison
44c26bf2a1 Don't allow overwriting a non-directory with a directory (just
like cp).
2006-03-02 03:53:42 +00:00
Wayne Davison
cc8c5057fe If get_local_name() fails to stat() the destination for any
reason other than the destination does not exist, mention the
error and exit.
2006-03-02 03:40:09 +00:00
Wayne Davison
b4c7c1ca99 A couple more improvements for --list-only. 2006-03-01 01:04:57 +00:00
Wayne Davison
16d3b31b2c Improved a couple sentences. 2006-03-01 00:59:22 +00:00
Wayne Davison
89a8180c5e One more bugfix. 2006-02-28 21:48:45 +00:00
Wayne Davison
34f961bbf3 Got the order of s1 and s2 right in the debug output. 2006-02-28 21:48:15 +00:00
Wayne Davison
2384f9e1db Update for hash-table change. 2006-02-28 21:21:44 +00:00
Wayne Davison
48cce779a2 Decided to drop the dynamically sized hash table for now. This was
due to timing tests showing that the per-byte modulus calculation
slowed down regular sized files.  Kept the other improvements
because they lessened our memory use and actually sped up the code.
2006-02-28 21:20:08 +00:00
Wayne Davison
6820753732 Renamed sum_table -> hash_table. 2006-02-28 07:32:48 +00:00
Wayne Davison
fbbe9a016d Changed the name of GETTAG() to SUM2HASH(). 2006-02-28 01:00:03 +00:00
Wayne Davison
c64ca7ef58 Eliminated one variable from hash_search(). 2006-02-28 00:31:51 +00:00
Wayne Davison
900cfcb584 - Fixed a problem with the new gettag2() macro by getting rid of the
need for it.
- Fixed a really old bug in the verbose output where it would output
  the wrong sum value (off by one).
- Renamed the tag_hit variables & debug output to hash_hit.
2006-02-28 00:09:19 +00:00
Wayne Davison
beab3078d6 Added --no-H and --no-hard-links. 2006-02-27 23:35:18 +00:00
Wayne Davison
530a2199da Mention the hash table change. 2006-02-27 21:29:44 +00:00
Wayne Davison
d9bca0c32f This is Shachar Shemesh's patch for making the hash-table code
work better with large files.  I further modified it to eliminate
the extra level of indirectness (and the qsort()), which saves
memory.
2006-02-27 21:16:04 +00:00
Wayne Davison
d733de97f5 Added a "chain" item to the struct sum_buf. 2006-02-27 21:11:56 +00:00
Wayne Davison
f06c11ed40 Tweaked a sentence. 2006-02-27 20:53:35 +00:00
Wayne Davison
c638caa63e In read_sum_head(): if we read a negative checksum count, die
with an error.
2006-02-27 03:12:26 +00:00
Wayne Davison
d775372a34 Tweaked a sentence. 2006-02-24 19:50:22 +00:00
Wayne Davison
07affc3d93 Document the latest changes. 2006-02-24 17:58:24 +00:00
Wayne Davison
f2ebbebead - Document the new --copy-dirlinks option.
- Improved the docs for --no-implied-dirs and --keep-dirlinks
  (based on a patch from Matt).
- Improved a few other misc. sentences.
- Shuffled the order of a couple options.
2006-02-24 17:54:47 +00:00
Wayne Davison
a695b379b5 Make sure the receiver resets copy_dirlinks (so that it can't
affect the delete scan).
2006-02-24 17:54:41 +00:00
Wayne Davison
88c2190a7c - Got rid of unused externs.
- Added support for copy_dirlinks.
- Fixed a bug where --copy-links would not affect implied dirs
  unless --copy-unsafe-links was also specified.
2006-02-24 17:54:35 +00:00
Wayne Davison
2dbf36ef55 Added the new --copy-dirlinks (-k) option. 2006-02-24 17:54:30 +00:00
Wayne Davison
cca9208697 Got rid of unused externs. 2006-02-24 16:43:44 +00:00
Wayne Davison
aa37022ef7 A recently added stat() call needed to be do_stat(). 2006-02-24 09:35:47 +00:00
Wayne Davison
85c417579f Made create_directory_path() return -1 if it couldn't create some
portion of the filename's path.
2006-02-24 09:34:44 +00:00
Wayne Davison
baed67efc4 Need to define an orig_umask value now that utils.c uses it. 2006-02-24 01:56:29 +00:00
Wayne Davison
c5b7aa1532 The orig_umask value is now a mode_t. 2006-02-24 01:56:26 +00:00
Wayne Davison
904e5af128 The create_directory_path() function no longer takes a base_umask
arg.
2006-02-24 01:56:21 +00:00
Wayne Davison
a41d110647 - The orig_umask value is now a mode_t.
- Use CHMOD_BITS instead of 07777.
2006-02-24 01:56:18 +00:00
Wayne Davison
a92d6ff13c Moved the orig_umask variable's definition into main.c since it
has nothing to do with option settings.
2006-02-24 01:56:14 +00:00
Wayne Davison
05278935a3 - Call mkdir_defmode() instead of do_mkdir().
- Define orig_umask in this file, not options.c.
- Made orig_umask a mode_t, not an int.
2006-02-24 01:56:10 +00:00
Wayne Davison
a56cdef9b1 Call mkdir_defmode() instead of do_mkdir(). 2006-02-24 01:56:07 +00:00
Wayne Davison
e9357a2deb + Added mkdir_defmode().
+ Changed create_directory_path() to drop the (now) unneeded
  base_umask arg and to call mkdir_defmode().
2006-02-24 01:56:01 +00:00
Wayne Davison
8d94d27af0 Moved an extern into its proper place. 2006-02-24 01:39:10 +00:00
Wayne Davison
6f2a222c59 One more fuzzy tweak. 2006-02-23 20:29:55 +00:00
Wayne Davison
8470a515ef Some improved fuzzy-parent-dir logic. 2006-02-23 20:27:17 +00:00
Wayne Davison
06982ac43b Mention latest fixes. 2006-02-23 20:17:09 +00:00
Wayne Davison
865c3b5f92 The new fuzzy-dir logic once again avoids calling get_dirlist()
until a regular file is found in the current parent directory.
2006-02-23 20:00:48 +00:00
Wayne Davison
8c9e06d7b9 Fixed the creation of symlinks and devices when both --relative
and --no-implied-dirs are specified and the destination dir does
not yet exist.
2006-02-23 19:43:54 +00:00
Wayne Davison
a9cc128308 Renamed fuzzy_dirname -> parent_dirname. 2006-02-23 19:07:33 +00:00
Wayne Davison
ccb16b467b Make sure that the --fuzzy option's dir-scan doesn't generate an
I/O error when --no-relative is used and the destination dir does
not exist yet.
2006-02-23 18:58:30 +00:00
Wayne Davison
1e44aeb92a Mention the --list-arg change. 2006-02-23 00:43:17 +00:00
Wayne Davison
c897f7119a Document the revised --list-only behavior and the ability to use
rsync with one local source arg (i.e. no destination).
2006-02-23 00:40:58 +00:00
Wayne Davison
ee8e2b1547 Rsync no longer returns a usage error when used with one local
source arg and no destination: this now implies the --list-only
option, just like one remote source arg has always done.
2006-02-23 00:38:34 +00:00
Wayne Davison
5fa38cd679 - Improved the way we generate the tar file.
- The second run of verify-patches is in a better spot now.
- Made various improvements to the output.
2006-02-22 19:09:51 +00:00
Wayne Davison
65535b5482 Mentioned that the daemon now logs connections. 2006-02-21 17:19:49 +00:00
Wayne Davison
439a198d02 Log every connect to the daemon. 2006-02-21 17:09:23 +00:00
Wayne Davison
f041b02557 Added a comment. 2006-02-21 00:29:55 +00:00
Wayne Davison
4d8639eb2d A few more tweaks and fixes. 2006-02-20 19:58:06 +00:00
Wayne Davison
519c8de16f - Moved the checkout of the cvs source above the version prompting so
that we can use the version from the configure.in file to provide
  good default values for the user.
- When moving old tar/diff files into the old-* dirs, first hard-link
  them into place, then (if "live"), use rsync to update these new
  files on the server (which saves us later re-sending), and _then_
  delete the old names.
2006-02-20 19:36:56 +00:00
Wayne Davison
7f20af4674 Made the new warning more visible. 2006-02-20 18:35:41 +00:00
Wayne Davison
55d24e5fed Mention if any of the CVS files we're putting in the tar file
aren't up-to-date.
2006-02-20 18:34:27 +00:00
Wayne Davison
81f654e396 Mention a couple more bug fixes. 2006-02-20 18:03:55 +00:00
Wayne Davison
8f1dc165e2 A brief msleep() in option_error() may be helpful to ensure that
an option error always arrives intact from the remote rsync.
2006-02-20 17:58:13 +00:00
Wayne Davison
9a0cfff57f Don't try to obey bwlimit restriction until bwlimit_writemax is set.
This fixes a bug with option errors not getting reported because the
write code gets called with bwlimit != 0 and bwlimit_writemax == 0.
2006-02-20 17:50:36 +00:00
Wayne Davison
d749eb6896 When starting up a transfer, substitute the remember_children()
SIGCHLD handler in place of the minimal one that socket.c enabled.
2006-02-20 17:17:51 +00:00
Wayne Davison
6d59ac192b Made the formerly static sigchld_handler() available as a
public function named remember_children().
2006-02-20 17:16:21 +00:00
Wayne Davison
94d3725cf2 In dest_mode(), we now apply any "incoming chmod" changes from
the daemon.
2006-02-20 00:01:27 +00:00
Wayne Davison
8840ec0f49 Set a new daemon_chmod_modes pointer with the daemon's chmod
(incoming or outgoing) changes.
2006-02-20 00:00:35 +00:00
Wayne Davison
44a8e86d47 Mention the change in how "incoming chmod" works when --perms was
not specified.
2006-02-19 23:58:59 +00:00
Wayne Davison
73abdda442 Slightly tweaked the output in non-live mode. 2006-02-19 23:33:15 +00:00
Wayne Davison
15b03ab1a8 Changed parse_chmod() to return the pointer to the new items on
success.
2006-02-19 23:31:56 +00:00
Wayne Davison
dc5245679a Preparing for release of 2.6.7pre2 2006-02-19 16:21:30 +00:00
Wayne Davison
60414e5bce The tar command needed --no-recursion. 2006-02-19 16:14:39 +00:00
Wayne Davison
af40c7d667 The hide filter rule is no longer needed. 2006-02-19 16:05:08 +00:00
Wayne Davison
7eb2ecda0f Improved the description of a fix in 2.6.4. 2006-02-19 15:52:59 +00:00
Wayne Davison
6d12a859bc The perl script I use to create new rsync releases. This is an
adapted and extended version of an old shell script.
2006-02-18 21:27:54 +00:00
Wayne Davison
920071e242 A perl script I wrote to make a new "nightly" tar file and
maintain the nightly dir on samba.org.
2006-02-18 21:26:48 +00:00
Wayne Davison
2a24b4bd0c Some more refinement of the --checksum section. 2006-02-16 07:40:55 +00:00
Wayne Davison
a753502200 Don't try to help the ACKs for the --remove-sent-file option
when --delay-updates was specified.
2006-02-15 20:09:49 +00:00
Wayne Davison
8958fae362 One last change to make the --checksum distinction very clear. 2006-02-15 19:58:53 +00:00
Wayne Davison
e2d68210d7 Another attempt to make --checksum clearer. 2006-02-15 19:24:39 +00:00
Wayne Davison
99534debc8 Improved the --checksum description and mention our whole-file
checksum verification checksum is different.
2006-02-15 18:20:23 +00:00
Wayne Davison
5b98629747 Improved the while's logic in increment_active_files(). 2006-02-15 08:26:51 +00:00
Wayne Davison
42003f6af3 Mention the change to --remove-sent-files. 2006-02-15 08:16:42 +00:00
Wayne Davison
434573b226 Call increment_active_files() during the first phase of a transfer
where --remove-sent-files was specified.
2006-02-15 08:06:45 +00:00
Wayne Davison
d6081c829c Added increment_active_files() and decrement_active_files() which
allows the generator to ask us to limit the number of files that
are currently active in the transfer when --remove-sent-files is
enabled.
2006-02-15 08:05:31 +00:00
Wayne Davison
58718881ef - Changed "called" to "named".
- Fixed a filter option to have the right syntax.
- Mention --prune-empty-dirs in a couple more places.
2006-02-14 16:45:38 +00:00
Wayne Davison
ac669e8b92 Tweaked a comment. 2006-02-14 16:44:11 +00:00
Wayne Davison
567f1566a9 List more of the doc improvements, list some of the best diffs in
the patches dir, and unified the discussion of the "dest" options.
2006-02-13 18:45:04 +00:00
Wayne Davison
59a5687105 Modified the sentence about doc improvements. 2006-02-13 18:19:59 +00:00
Wayne Davison
7b13ff9704 Document what all the items in the --stats output mean. 2006-02-13 18:19:26 +00:00
Wayne Davison
5e7b826a4f Made the receiver count the size of symlinks in the total_size
value, just like the sender does.
2006-02-13 18:08:45 +00:00
Wayne Davison
cbc63b9b48 Added missing release-history lines for 2.6.6 and 2.6.7. 2006-02-12 19:15:35 +00:00
Wayne Davison
71a84cbab0 Mention the ignoring of SIGXFSZ. 2006-02-11 02:37:58 +00:00
Wayne Davison
55e54e464b We now ignore the SIGXFSZ signal (if it is defined). 2006-02-11 02:36:35 +00:00
Wayne Davison
467688dc06 More improvements for "--help", and a couple hyphenation fixes. 2006-02-11 00:02:15 +00:00
Wayne Davison
375d8f913b Added a backward-compatibility note about -h to the --help option
in the help text.
2006-02-11 00:01:22 +00:00
Wayne Davison
021849204a Fixed some typos, got rid of some extraneous spaces, got rid of
a hyphen in hard-link (since we consistently use it unhyphenated),
and refer to "unix" as "*nix".
2006-02-09 17:32:36 +00:00
Wayne Davison
b635f2e964 The -h was missing from the daemon's option summary. 2006-02-09 11:56:33 +00:00
Wayne Davison
1e2b96bbee - Improved the description of how 'D' because 'D' and 'S' for -i.
- Improved the --devices and --specials item, and moved it next to
  the --super item.
- Mention that "rsync -h" still works as before.
2006-02-09 10:25:25 +00:00
Wayne Davison
2857451ca2 Got rid of an statement that is no longer true. 2006-02-09 04:08:38 +00:00
Wayne Davison
2bc3835ee0 Preparing for release of 2.6.7pre1 2006-02-09 03:59:17 +00:00
Wayne Davison
4f417448b4 Updated the %i section. 2006-02-09 01:27:03 +00:00
Wayne Davison
503f163446 Decided against shortening the output of --itemize-changes. 2006-02-09 01:17:01 +00:00
Wayne Davison
f17e769e28 There's no need to send --size-only to a remote sender. 2006-02-09 01:15:04 +00:00
Wayne Davison
f65e6a1276 Tweaked the mention of --human-readable. 2006-02-08 17:03:00 +00:00
Wayne Davison
4c248a3615 Documented the change in the --human-readable option. 2006-02-08 16:54:10 +00:00
Wayne Davison
7794db7c0d Tweaked the --human-readable code to work with the new option parsing. 2006-02-08 16:52:51 +00:00
Wayne Davison
3ca9e5d8ad Changed -h to mean powers of 1000 when used once, and powers of 1024
when repeated.  Got rid of --si.
2006-02-08 16:52:25 +00:00
Wayne Davison
5ca8a90c24 Tweaked the name of one of dest_mode()'s args. 2006-02-08 02:34:06 +00:00
Wayne Davison
0679ac4ca9 Tweaked a comment. 2006-02-08 02:32:35 +00:00
Wayne Davison
20a0269782 Mention --dry-run doesn't force --verbose. 2006-02-07 20:08:30 +00:00
Wayne Davison
a892d905bb Don't force verbose for --dry-run; let the user decide. 2006-02-07 20:06:43 +00:00
Wayne Davison
bc880cb8d2 Don't look for $RSYNC_PARTIAL_DIR on the server side. 2006-02-07 19:12:37 +00:00
Wayne Davison
2243a9353e Clarified something in "incoming chmod". 2006-02-07 18:45:16 +00:00
Wayne Davison
10f994a52a Moved the delay-bit functions into util.c, making them more generic. 2006-02-07 18:15:51 +00:00
Wayne Davison
0f86c74eba Call renamed cmp_time() function (was cmp_modtime()). 2006-02-07 18:15:46 +00:00
Wayne Davison
c2b5407678 - Renamed cmp_modtime() -> cmp_time().
- Moved the delay-bit functions here from receiver.c and transformed
  them into some more generic "bitbag" functions.
2006-02-07 18:15:37 +00:00
Wayne Davison
350879d8d1 Only call the just-added "touch" if autoheader succeeded. 2006-02-07 17:30:35 +00:00
Wayne Davison
a6a276027c Changed --8-bit to --8-bit-output. 2006-02-06 18:51:25 +00:00
Wayne Davison
45b79c8959 Mentioned --8-bit (-8). 2006-02-06 18:45:48 +00:00
Wayne Davison
d0022dd908 Document --8-bit (-8). 2006-02-06 18:43:12 +00:00
Wayne Davison
e0f4a661be Don't setup ic_chck if --8-bit was specified. 2006-02-06 18:42:46 +00:00
Wayne Davison
507433f6ca Don't call isprint() if --8-bit was specified. 2006-02-06 18:42:02 +00:00
Wayne Davison
5974c662ff Added the --8-bit (-8) option. 2006-02-06 18:41:32 +00:00
Wayne Davison
aa0bec8a52 Ensure that the timestamp for config.h.in is changed after
running autoheader.
2006-02-06 18:27:45 +00:00
Wayne Davison
2d2f71fb27 Got rid of a newly-added trailing tab. 2006-02-06 18:00:37 +00:00
Wayne Davison
36f59b5802 Mention the new output-escaping idiom and the multibyte support. 2006-02-06 17:58:29 +00:00
Wayne Davison
7fc87d2daf Allow the iconv_open() call to fail since we can now fall-back on
isprint().  Got rid of the "646" mapping kluge too.
2006-02-06 16:55:01 +00:00
Wayne Davison
3648ab3a24 - The iconv-supporting code can now ask filtered_fwrite() to use
isprint() when iconv() could not be setup.
- Changed the output idiom for escaped chars to use \#123 instead
  of \0123 because that makes it possible for a script to know for
  sure what version of rsync did the output (and thus, what the
  unescape rules are).
2006-02-06 16:54:12 +00:00
Wayne Davison
7a9d183fc4 Have default_charset() try mapping "646" -> "ASCII" instead of "ascii". 2006-02-06 09:04:20 +00:00
Wayne Davison
2a62f5ee19 Added "const" to the default_charset() return. 2006-02-06 09:00:37 +00:00
Wayne Davison
f9cfaae952 Solaris 9 and HP-UX 11.11 need us to look for libiconv_open,
not iconv_open (perhaps because iconf.h wasn't included in
the autoconf test).
2006-02-06 08:57:16 +00:00
Wayne Davison
bd4576fe4b Check to see if we need to include the iconv library. 2006-02-06 08:35:18 +00:00
Wayne Davison
4e194bf178 Mention the prepare-source script and the changes in the patches
dir.
2006-02-06 07:57:03 +00:00
Wayne Davison
ef4e0d5e7e Added dependencies for proto.h. 2006-02-06 05:06:52 +00:00
Wayne Davison
e6d8e70925 The "proto" target now builds target "proto.h" from the new
prepare-source.mak makefile.
2006-02-06 04:54:30 +00:00
Wayne Davison
a6c5741c37 Changed the "proto" target to "proto.h". 2006-02-06 04:53:02 +00:00
Wayne Davison
3ea7fc6ccf Moved the targets "gen", "proto", and "man" to prepare-source.mak. 2006-02-06 04:09:48 +00:00
Wayne Davison
20926fbd63 An easy way to run all the commands in prepare-source.mak. 2006-02-06 04:08:14 +00:00
Wayne Davison
2a3f3ba45d Moved the rules for generating files such as configure, config.h.in,
proto.h, and the manpages into this separate makefile, allowing it to
be used without first running configure (which builds the Makefile).
2006-02-06 04:07:49 +00:00
Wayne Davison
662127e6c7 Include --no-g in the popt-alias example in --perms. 2006-02-05 15:31:31 +00:00
Wayne Davison
0be05d6038 In default_charset(): if nl_langinfo() gives us "646", return "ascii". 2006-02-05 07:20:10 +00:00
Wayne Davison
1f77038ef2 Added a missing comma. 2006-02-05 07:00:21 +00:00
Wayne Davison
77ed253c73 Some more improvements to --perms and --executability from Matt and me. 2006-02-05 06:40:18 +00:00
Wayne Davison
b988781801 Allow itemize() to flag ITEM_REPORT_PERMS anytime the permissions
change (even if -p or -E aren't set).
2006-02-05 06:13:34 +00:00
Wayne Davison
595251de24 Make sure that we don't try to use iconv() without iconv.h. 2006-02-05 04:52:11 +00:00
Wayne Davison
c85631421d Changed HAVE_ICONV to HAVE_ICONV_OPEN. 2006-02-05 04:45:23 +00:00
Wayne Davison
12c8cd02fc Switched back to checking for iconv_open() due to HP-UX. 2006-02-04 23:06:39 +00:00
Wayne Davison
9656de5d13 Call setup_iconv(). 2006-02-04 22:03:44 +00:00
Wayne Davison
9a31746b10 Use iconv() (when available) to allow us to output multibyte
characters that are legal in the current locale.
2006-02-04 22:03:39 +00:00
Wayne Davison
ceccbacc34 The new function setup_iconv() initializes the ic_chck var. 2006-02-04 22:03:33 +00:00
Wayne Davison
ff2e2ccfc1 - Changed the check for iconv_open() to just iconv().
- Got rid of the --enable-iconv option for now.
2006-02-04 22:03:21 +00:00
Wayne Davison
12bda6f710 Don't do so much memory copying in mplex_write(). 2006-02-04 21:52:32 +00:00
Wayne Davison
c53b6fd0ac In the compatibility comments: mention why we don't use grep -q. 2006-02-04 19:44:19 +00:00
Wayne Davison
b31243b472 Test directory setgid inheritence when --perms is not in effect. 2006-02-04 19:42:47 +00:00
Wayne Davison
c8d19f90a6 Added a missing '(' in the opening comments. 2006-02-04 19:29:13 +00:00
Wayne Davison
114bafe0d0 Added a special permission (o+t) to one of the files in the test. 2006-02-04 19:28:45 +00:00
Wayne Davison
5ef8c5c6d4 Tweaked a function declaraion. 2006-02-04 19:27:07 +00:00
Wayne Davison
9b499e9537 - When not preserving permissions, ensure that a newly-created
directory's inherited sgid bit is preserved.
- When not preserving permissions, ensure that newly-created
  files/dirs don't inherit any special permissions.
2006-02-04 19:09:46 +00:00
Wayne Davison
00f00f846b Ignore setfacl unless it tells us that it supports the -k option. 2006-02-04 18:41:47 +00:00
Wayne Davison
998113fedf Needed to make %G output "DEFAULT" when gid == GID_NONE. 2006-02-04 18:40:41 +00:00
Wayne Davison
ee5544112a Improved the --partial-dir section. 2006-02-03 23:50:16 +00:00
Wayne Davison
7eaabd8fac Decided to undo the last change to avoid backward compatibility
inconsistencies (it would have been the right thing to do if it
were done that way from the start, but not now).
2006-02-03 23:40:37 +00:00
Wayne Davison
4fc808dd98 Avoid adding our own exclude of the partial-dir name if the
user's filter rules already match it.
2006-02-03 23:16:46 +00:00
Wayne Davison
7cfb250c93 Made the new %M escape handle multiple spaces in the timestamp
(which can occur if the user's system doesn't have strftime()).
2006-02-03 22:41:19 +00:00
Wayne Davison
47f480b619 Removed completed items. 2006-02-03 20:49:25 +00:00
Wayne Davison
fa9e950b1a Mention who is outputting the "rsync error" or "rsync warning". 2006-02-03 20:39:58 +00:00
Wayne Davison
49f4d850ce Mention latest changes. 2006-02-03 20:32:27 +00:00
Wayne Davison
b3e15181ae Log when someone requests a module list. 2006-02-03 20:28:19 +00:00
Wayne Davison
aca5500aea Document the new "log format" options: %M (modtime), %U (uid),
%G (gid), and %B (perm bits).
2006-02-03 20:00:24 +00:00
Wayne Davison
427b6179b9 - Allow tab characters to appear in rwrite() messages.
- Added %M (modtime), %U (uid), %G (gid), and %B (perm bits) to
  log_formatted().
2006-02-03 19:59:25 +00:00
Wayne Davison
afa73c75b5 A minor optimization to timestring. 2006-02-03 19:40:16 +00:00
Wayne Davison
8261af7422 Allow sigaction() to be used even if sigprocmask() isn't around
(or was manually disabled).
2006-02-03 18:48:26 +00:00
Wayne Davison
44e604f416 Simplified the conditional prior to the SIGACTION code. 2006-02-03 18:46:38 +00:00
Wayne Davison
5173f99e68 A slight tweak to the conditionalized definition of SIGACTION(). 2006-02-03 18:34:09 +00:00
Wayne Davison
8a3d4658eb Decided I don't like "set -x". 2006-02-03 17:58:48 +00:00
Wayne Davison
6b43924848 The calls to check_perms now pass a test number arg and
don't check for failure (it will die on failure).
2006-02-03 17:55:24 +00:00
Wayne Davison
eace352b39 Improved check_perms() to work with a directory, to have better
output on error, and to call test_fail on error.
2006-02-03 17:54:18 +00:00
Wayne Davison
fdbe8989fe Moved check_perms() into rsync.fns and tweaked how it is called. 2006-02-03 17:29:43 +00:00
Wayne Davison
18d7e9f46e Added a new function: check_perms(). 2006-02-03 17:28:03 +00:00
Wayne Davison
c6fbd563d8 Matt's executability test with a few tweaks (e.g. to avoid using
"stat").
2006-02-03 06:47:26 +00:00
Wayne Davison
a5df33bb62 Scratch-dir normalization from Matt: turn off any default ACLs (if
setfacl is available) and disable any directory setgid bit to avoid
confusing some tests.
2006-02-03 06:15:46 +00:00
Wayne Davison
5cf4896050 Mention the sigaction() and sigprocmask() goodness. 2006-02-02 22:38:55 +00:00
Wayne Davison
2fb450bd99 Fixed a hang. 2006-02-02 22:34:30 +00:00
Wayne Davison
4ea58045e2 Moved the potential disabling of __attribute__ above the
relocated UNUSED() define.
2006-02-02 22:24:33 +00:00
Wayne Davison
29433538ff Tweaked a couple lines in the code that handles --version. 2006-02-02 11:40:32 +00:00
Wayne Davison
d382140904 Changed default logfile setting from /var/adm/rsyncd.log to
/var/log/rsyncd.log.
2006-02-02 10:20:13 +00:00
Wayne Davison
b8e9c234e6 Changed sig_int() to use a standard signal-handler prototype. 2006-02-02 02:39:40 +00:00
Wayne Davison
60ee01f517 - Call SIGACTION() instead of signal().
- Umask all the signals we need using sigprocmask() (if available).
2006-02-02 02:39:29 +00:00
Wayne Davison
2b28968dfb Call SIGACTION() instead of signal(). 2006-02-02 02:39:25 +00:00
Wayne Davison
90b13cf606 - Moved definition of UNUSED() above inclusion of proto.h.
- Replaced definition of SIGNAL_CAST with new SIGACTION() define,
  which will use sigaction() if it is available, else signal().
2006-02-02 02:39:19 +00:00
Wayne Davison
d81894fc21 Added checks for sigaction() and sigprocmask(). 2006-02-02 02:32:39 +00:00
Wayne Davison
f5cbae9329 Look for public functions that return RETSIGTYPE. 2006-02-02 02:29:30 +00:00
Wayne Davison
7a6653bc6c Ignore the --quiet option if someone sent it to us (which doesn't
happen when talking to a normal client).
2006-02-01 19:36:37 +00:00
Wayne Davison
72f2d1b384 When complaining about a socket-read problem, use an FSOCKERR
code instead of a normal FERROR.  The generator is the only
process that will receive this, and it uses it to close down
the multi-I/O over the socket so that it won't ever hang trying
to write an error down a dead socket.
2006-02-01 19:35:17 +00:00
Wayne Davison
b66e31bf15 Turn an FSOCKERR into a normal FERROR if it's not going to our
sibling.
2006-02-01 19:33:12 +00:00
Wayne Davison
ea26c854af Added FSOCKERR and MSG_SOCKERR (a sibling-only message). 2006-02-01 19:26:34 +00:00
Wayne Davison
ef1f62807e We should be using wait_process(), not waitpid() directly. 2006-02-01 19:25:34 +00:00
Wayne Davison
d8aeda1e50 Changed a few "ret" variables to have better names. 2006-02-01 19:24:28 +00:00
Wayne Davison
07efba8ec0 The itemize() output now mentions -E permissions changes. 2006-01-31 06:25:46 +00:00
Wayne Davison
2959fe7447 Mention the --executability option. 2006-01-31 03:40:22 +00:00
Wayne Davison
4601589720 Another help-text tweak. 2006-01-31 03:11:07 +00:00
Wayne Davison
9f8225566e Moved where --chmod was listed. 2006-01-31 03:05:24 +00:00
Wayne Davison
5e65c96705 Moved --chmod in the help output. 2006-01-31 03:04:00 +00:00
Wayne Davison
a9d6e6fcac When permissions aren't being preserved, set them via the new
dest_mode() function.
2006-01-31 02:30:09 +00:00
Wayne Davison
860dcf68ad Got rid of the orig_umask-based file->mode tweak in receive_file()
(which got moved into the dest_mode() function).
2006-01-31 02:30:05 +00:00
Wayne Davison
812848323b Added the dest_mode() function: it figures out the permissions for
a file when we aren't preserving permissions, including the honoring
of the new --executability option.
2006-01-31 02:30:02 +00:00
Wayne Davison
344f9ba7fa Added the --executability (-E) option. 2006-01-31 02:29:58 +00:00
Wayne Davison
2d5279ac9a Documented the new --executability (-E) option, with improvements
to the --perms and --chmod sections as well.
2006-01-31 02:29:55 +00:00
Wayne Davison
fa3e4a0548 Mention the chmod utility's manpage number. 2006-01-31 02:26:49 +00:00
Wayne Davison
656c20715e Mention that --chmod's work can still be masked by the receiving
end's umask when permissions are not being preserved.
2006-01-30 22:10:33 +00:00
Wayne Davison
a72885e042 Mention files-to-excludes. 2006-01-30 21:54:00 +00:00
Wayne Davison
b587adda1f This perl script automates the conversion of a list of pathnames
to a set of includes/excludes needed for rsync to copy just the
listed files.
2006-01-30 21:52:17 +00:00
Wayne Davison
50fd4832c2 Mentioned the new "outgoing chmod" daemon option. 2006-01-30 21:47:23 +00:00
Wayne Davison
c094d9320d Documented the new "outgoing chmod" daemon option. 2006-01-30 21:47:08 +00:00
Wayne Davison
aaccaa887d Added support for the new "outgoing chmod" daemon option. 2006-01-30 21:47:02 +00:00
Wayne Davison
5481e42cd6 Mentioned the early-EOF bugfix (which was fixed a while ago). 2006-01-30 20:09:46 +00:00
Wayne Davison
b3964d1d86 Improved the documentation for --force. 2006-01-30 18:46:17 +00:00
Wayne Davison
e35d9f2d6d I realized that there were instances where --force could still be
required to be combined with a delete option (if a non-dir was
overwriting a dir in a directory that was not included in the
transfer), so I extended the change I just made for --delete-after
to include all delete modes.
2006-01-30 18:45:57 +00:00
Wayne Davison
4d16780366 Allow --force to work even if --recurse was not specified. 2006-01-30 18:35:54 +00:00
Wayne Davison
1661fe9b0c Made get_dirlist() always include directories. 2006-01-30 18:32:47 +00:00
Wayne Davison
63344ad4e1 Mention the latest improvements. 2006-01-30 18:19:55 +00:00
Wayne Davison
90cf7d199f Allow a non-empty dir to be overwritten by a non-dir with all the
delete options (--delete-after used to require --force).
2006-01-30 18:14:02 +00:00
Wayne Davison
730df9d222 If the module has defined an "incoming chmod" option, call
parse_chmod() on it.
2006-01-30 17:53:38 +00:00
Wayne Davison
882d8c1cab Added the "incoming chmod" config option. 2006-01-30 17:53:32 +00:00
Wayne Davison
17af842d2d Document the new "incoming chmod" config option. 2006-01-30 17:53:27 +00:00
Wayne Davison
bbe42182df Call the parse_chmod() with its new syntax. 2006-01-30 17:53:19 +00:00
Wayne Davison
81b096feef Changed the way the parse_chmod() function is called. 2006-01-30 17:53:13 +00:00
Wayne Davison
7627e92c54 Added extern for io_write_phase. 2006-01-30 17:39:43 +00:00
Wayne Davison
f7bce90cf0 - Got rid of the externs for io_read_phase and io_write_phase.
- Added stub definition for chmod_mode_struct.
2006-01-30 17:39:34 +00:00
Wayne Davison
b33ce4c800 Moved the filter_outfile() function to rsync.fns. 2006-01-30 08:12:17 +00:00
Wayne Davison
757287d8a5 Moved the filter_outfile() function here since it was identical
in devices.test and itemize.test.
2006-01-30 08:11:50 +00:00
Wayne Davison
3ed8eafccb The robust_rename() function now takes a "partialptr" arg that, if
non-NULL, will be used if we are forced to copy the file.
2006-01-30 07:18:16 +00:00
Wayne Davison
d8b1c923ef The finish_transfer() function now takes a "partialptr" arg that, if
non-NULL, will be used if robust_rename() is forced to copy the temp
file.
2006-01-30 07:18:13 +00:00
Wayne Davison
4a4d2b1ba0 Call finish_transfer() with a valid partialptr string, when
appropriate.
2006-01-30 07:18:10 +00:00
Wayne Davison
12fa790ea0 Call finish_transfer() with its newly-added arg. 2006-01-30 07:18:06 +00:00
Wayne Davison
21955d9c92 Call robust_rename() with its newly-added arg. 2006-01-30 07:18:03 +00:00
Wayne Davison
a0d9819f8c Document the side-effect that --partial-dir can have on --temp-dir. 2006-01-30 07:18:00 +00:00
Wayne Davison
a9af5d8eba More improvements to --temp-dir. 2006-01-30 06:34:57 +00:00
Wayne Davison
65854cf91a Changed the mode arg from an int to a mode_t. 2006-01-30 00:39:59 +00:00
Wayne Davison
9ec1ef2535 Improved the --temp-dir description and a couple other sentences. 2006-01-29 20:31:59 +00:00
Wayne Davison
36119f6e2a - Renamed set_perms() to set_file_attrs().
- Use the renamed PERMS_* defines: ATTRS_*.
2006-01-29 20:30:24 +00:00
Wayne Davison
e912bd4dfb - Use the renamed PERMS_* defines: ATTRS_*.
- Call the new name of set_perms():  set_file_attrs().
2006-01-29 20:30:18 +00:00
Wayne Davison
c3ef136d41 Call the new name of set_perms(): set_file_attrs(). 2006-01-29 20:30:12 +00:00
Wayne Davison
8eda7a4bb8 Renamed the PERMS_* defines to ATTRS_* defines. 2006-01-29 20:30:07 +00:00
Wayne Davison
78d146e866 Use PERMSTRING_SIZE rather than a hard-wired "11". 2006-01-29 20:30:02 +00:00
Wayne Davison
77860bacd0 No need to send --partial when we're the receiver. 2006-01-29 19:17:13 +00:00
Wayne Davison
63cf5ae72c Made a bunch of char* args const. 2006-01-29 18:52:53 +00:00
Wayne Davison
120cde9562 Avoid forwarding the --temp-dir option to the server when we're
the receiver.
2006-01-29 07:19:38 +00:00
Wayne Davison
e6ffb966dd Made the new --prune-empty-dirs code a little more memory efficient. 2006-01-28 19:20:02 +00:00
Wayne Davison
207522aef5 Tweaked a variable name in flist_find(). 2006-01-28 08:12:16 +00:00
Wayne Davison
a1cc199b34 We enforce at least protocol 29 for --prune-empty-dirs because the
file-list's sort order can be slightly wrong in older versions.
2006-01-28 07:40:52 +00:00
Wayne Davison
c22260706c Don't add the "protect" filter rule for backup-suffix filenames
if --backup was not specified.
2006-01-28 01:55:55 +00:00
Wayne Davison
d5782b52a2 - We need to send exclude info from the client to a server-receiver
when --prune-empty-dirs was specified.
- Changed the output of debug include/exclude/show/hide/risk/protect
  messages to use the appropriate filter terminology instead of
  always using the (potentially unclear) include/exclude terms.
2006-01-28 00:14:02 +00:00
Wayne Davison
85aecef6c3 The user can now use a "protect" filter to avoid pruning one or
more empty directories when --prune-empty-dirs is in effect.
2006-01-28 00:13:59 +00:00
Wayne Davison
876c993680 Changed --skip-empty-dirs (-k) to --prune-empty-dirs (-m). 2006-01-28 00:13:55 +00:00
Wayne Davison
a272ff8c1b Changed --skip-empty-dirs (-k) to --prune-empty-dirs (-m) and
improved the docs a bit more, including documenting how "protect"
filtering affects empty dirs.
2006-01-28 00:13:52 +00:00
Wayne Davison
7402d58369 Improved flist_find()'s empty-entry handling to deal with the case
where more entries may have been removed since the last find.
2006-01-27 14:29:58 +00:00
Wayne Davison
c0b134a445 Optimized flist_find() so that we never scan a series of empty
file-list items twice (which can be very important with the new
--skip-empty-dirs option).  Also optimized the code that strips
root slashes in clean_flist().
2006-01-27 12:59:07 +00:00
Wayne Davison
a324d49bfc Mention the --skip-empty-dirs option. 2006-01-27 01:20:11 +00:00
Wayne Davison
9c000f5e7b Implement the new --skip-empty-dirs (-k) option. 2006-01-27 00:32:57 +00:00
Wayne Davison
0e887ef29a Added the --skip-empty-dirs (-k) option. 2006-01-27 00:32:53 +00:00
Wayne Davison
fb72aaba48 Document the new --skip-empty-dirs (-k) option. 2006-01-27 00:32:49 +00:00
Wayne Davison
a3869e9227 Include popt.h using <popt.h> instead of "popt.h". 2006-01-26 22:32:59 +00:00
Wayne Davison
d671ccfc8e Mention the change in the --itemize-changes output. 2006-01-26 22:32:18 +00:00
Wayne Davison
35bf8fa084 - Include popt.h using <popt.h>, not "popt.h".
- A minor twiddle in server_options().
2006-01-26 22:28:08 +00:00
Wayne Davison
f7916cbf3f Mention --sockopts and an improvement to the testsuite environment. 2006-01-26 22:10:08 +00:00
Wayne Davison
2b7dab686c The setting of HOME got moved to rsync.fns. 2006-01-26 21:23:25 +00:00
Wayne Davison
a98cad00eb Set $HOME to $scratchdir so that our tests are not affected by
anything unexpected, such as a ~/.popt file.
2006-01-26 21:22:57 +00:00
Wayne Davison
facdce2c1f Fixed two typos. 2006-01-26 12:41:52 +00:00
Wayne Davison
34937987a6 Make use of the new sockopts variable. 2006-01-26 12:31:47 +00:00
Wayne Davison
831f06a5a5 Added the --sockopts option. 2006-01-26 12:31:24 +00:00
Wayne Davison
5fe3c86f25 Mention the --sockopts option. 2006-01-26 12:31:14 +00:00
Wayne Davison
04f48837d1 Document the new --sockopts option. 2006-01-26 12:30:20 +00:00
Wayne Davison
f5b14759fb Mentioned the --super option. 2006-01-26 11:14:10 +00:00
Wayne Davison
def97ff9a9 Added the --super option. 2006-01-26 11:10:32 +00:00
Wayne Davison
d38772e06f Document the new --super option and how it affects other options. 2006-01-26 11:10:28 +00:00
Wayne Davison
351f5e2f6c Check MY_UID() directly instead of accessing am_root. 2006-01-26 11:01:00 +00:00
Wayne Davison
8778174936 Mention new --specials option and --devices change. 2006-01-26 10:50:18 +00:00
Wayne Davison
e5f6a04d15 The itemized output for the fifo changed. 2006-01-26 10:39:04 +00:00
Wayne Davison
f8d47c1cb4 Added 'S' to the itemized output for special files. 2006-01-26 10:39:01 +00:00
Wayne Davison
b5c6a6aeeb Handle separated devices and special files. 2006-01-26 10:38:58 +00:00
Wayne Davison
4e7d07c8d4 Document the new --specials option and how -D and --devices now work. 2006-01-26 10:38:54 +00:00
Wayne Davison
fc2dd77ec7 One more minor tweak. 2006-01-25 17:34:39 +00:00
Wayne Davison
7b6fa00ff8 Decided to hold off on the potential memory savings of indexed
uid/gid pairs until the next release.
2006-01-25 17:10:29 +00:00
Wayne Davison
9ac3591366 Added testing of the --itemize-changes output for devices. 2006-01-24 22:23:51 +00:00
Wayne Davison
6a819e02da Changed to handle removed 'a' slot in %i output. 2006-01-24 22:23:14 +00:00
Wayne Davison
4cff7c50db Fixed a problem in the output of %i's 'T' flag on devices and
got rid of the unused 'a' flag.
2006-01-24 22:22:17 +00:00
Wayne Davison
669302a172 Got rid of the description of 'a' in the %i flags. 2006-01-24 22:14:40 +00:00
Wayne Davison
c738605098 Got rid of some debug code. 2006-01-24 21:40:43 +00:00
Wayne Davison
90cf838b18 Dump some debug code. 2006-01-24 21:39:10 +00:00
Wayne Davison
67e4043e8c Optimized id_pair() so that clumps of IDs get handled more
efficiently.
2006-01-24 19:39:09 +00:00
Wayne Davison
5e58e3f9cf The uid & gid are now stored using an id_pair structure. 2006-01-24 19:02:55 +00:00
Wayne Davison
49140b27c6 Another small improvement to the --one-file-system option. 2006-01-24 19:02:48 +00:00
Wayne Davison
9cdadbb13a The in_del_hier code needs to use lastname instead of thisname
because the latter gets cleaned and (possibly) sanitized.
2006-01-24 17:26:24 +00:00
Wayne Davison
0ace7b2567 FERROR messages also need to leave leading newlines unmangled. 2006-01-24 01:07:19 +00:00
Wayne Davison
ccb8f5788b Tweaked the copyright message. 2006-01-23 18:48:12 +00:00
Wayne Davison
4e5baafedf More improvements to the -x option (some from Matt & some from me). 2006-01-22 21:04:21 +00:00
Wayne Davison
0e82af2d27 New -x code had some problems, so restore the old code for now
(keeping the more optimal stat() calling, though).
2006-01-22 20:37:00 +00:00
Wayne Davison
535737bf39 New -x code had some problems, so restore the old code for now. 2006-01-22 20:30:56 +00:00
Wayne Davison
6e6cc16399 Matt's disambiguation. 2006-01-21 21:02:13 +00:00
Wayne Davison
bb0d8edfad - Got rid of the filesystem_dev variable now that --one-file-system
is handled in a new way.
- Moved a stat out of delete_in_dir() into do_delete_pass() to make
  --delete-during more efficient.
- Added a missing "#ifdef SUPPORT_LINKS...#endif" block around some
  symlink code.
2006-01-21 20:59:19 +00:00
Wayne Davison
ebec5eb689 - Changed how --one-file-system works so that we can skip all mount
points (including "bind" mounts).
- The --chmod option now affects devices (only skipping symlinks).
2006-01-21 20:59:16 +00:00
Wayne Davison
5cb31dcf92 Fixed a problem with the FLAG_* defines. 2006-01-21 20:16:37 +00:00
Wayne Davison
0ccffd7c80 Disable popt aliases when we're a server so that any user-redefined
options can't cause a compatibility problem.
2006-01-21 20:15:49 +00:00
Wayne Davison
57b66a2458 A tweak to --dirs and --chmod. 2006-01-21 19:55:47 +00:00
Wayne Davison
b8a39ed58a Use the new saw_delete* variables to ensure that the server side
always reads the exclude information when it is present.
2006-01-21 19:54:14 +00:00
Wayne Davison
f5a910dd73 - We now set some saw_delete* vars to keep track of the case where
we disabled a delete option that the client sent us (since we may
  still need to await exclude information from the client in such a
  case).
- If -d and --delete are in effect without -r, we may need to send
  the -d to the server even if it was implied, and we may need to
  send --no-r to the server to ensure that we don't get into a
  protocol-corrupting situation should the remote rsync disable the
  --delete option (this works because the --no-r option was added in
  the same version as the functionality which allows --delete to
  work with -d sans -r.
2006-01-21 19:52:55 +00:00
Wayne Davison
e16adcdff3 - Allow multiple --chmod options to be specified.
- Call parse_chmod() with its new arg.
2006-01-21 09:14:42 +00:00
Wayne Davison
cf9b4794fd Tweaked parse_chmod() so that it takes a pointer to an existing list
of chmod items (or NULL) and appends the new items onto the end.
2006-01-21 09:14:39 +00:00
Wayne Davison
6d8c6bdbe5 Document the new --one-file-system behavior, with improvements to
the option's text taken from Matt's patch in bugzilla.
2006-01-21 08:10:45 +00:00
Wayne Davison
8bbe41b53b Handle the --chmod option as either the sender or the receiver so
that only the client needs to know about --chmod (but if an older
version sends the option to the server, we'll still handle it).
2006-01-21 08:03:18 +00:00
Wayne Davison
ba30fb5c3c For a local rsync, turn off the --chmod option on the receiving
side so that only the sending side does the work.
2006-01-21 07:58:35 +00:00
Wayne Davison
0938e8eee5 We don't ever need to send the --chmod option to the remote rsync. 2006-01-21 07:53:40 +00:00
Wayne Davison
3b17384631 Implemented the -xx behavior that skips mount-point dirs. 2006-01-21 01:20:03 +00:00
Wayne Davison
243c995f5f Allow the -x option to be repeated. 2006-01-21 00:36:15 +00:00
Wayne Davison
96b87581ff - Changed send_file_entry() into a static function again.
- Made send_file_entry() derive the base_flag value from *file.
- Added a flags arg to make_file().
- The flag we send to send_file_name() is a FLAG_* value, not an
  XMIT_* value.
2006-01-20 21:21:43 +00:00
Wayne Davison
3de73827d7 Call make_file() with one more arg (the base flags). 2006-01-20 21:21:36 +00:00
Wayne Davison
458aeea4a6 Mentioned the addition of -ii. 2006-01-20 19:33:24 +00:00
Wayne Davison
14cbb64539 Document the behavior of -ii. 2006-01-20 18:52:52 +00:00
Wayne Davison
a9e4762634 Handle the extra output needed when log_format_has_i > 1. 2006-01-20 18:49:38 +00:00
Wayne Davison
487094a0d7 Allow the --itemize-changes (-i) option to be repeated to indicate
that unchanged files should also be itemized.
2006-01-20 18:49:07 +00:00
Wayne Davison
f608ebb106 Got rid of unused function u_strcmp(). 2006-01-20 00:14:04 +00:00
Wayne Davison
87001ac6c2 Improved a sentence. 2006-01-19 21:21:28 +00:00
Wayne Davison
ede1f0ebc9 The code in send_file_list() needed a little more improvement to
handle --relative really well:
- We must set "is_dot_dir" when we strip off a trailing "/" or "/.".
- If a trailing "/" or "/." caused us to treat a symlink as a dir,
  we now pass our stat() info down to make_file() so that it will
  always treat the cleaned-up name as a dir too.
- We must not strip a leading "/".
- Improved the check for ".." elements in the implied dirs.
2006-01-19 21:16:44 +00:00
Wayne Davison
b435d7174c Added a new arg to the make_file() call. 2006-01-19 21:16:40 +00:00
Wayne Davison
2a59d2cc31 Another bugfix. 2006-01-19 19:05:49 +00:00
Wayne Davison
b8595e609a In delete_in_dir(), skip a directory that isn't really a directory on
the local disk (can easily happen if --dry-run was specified).
2006-01-19 18:53:48 +00:00
Wayne Davison
d37bc73a48 Mention the changes made in recent checkins. 2006-01-19 07:34:41 +00:00
Wayne Davison
1902a7652f When --relative is active, simply trim off trailing slashes and
dot dirs.  Also, reject a ".." dir if it would be sent as part
of the relative path.
2006-01-19 01:43:10 +00:00
Wayne Davison
6ab423a5b6 - Fixed the --help and --version output to avoid using embedded
newlines (which are no longer allowed in rprint()).
- Updated the Copyright info for 2006.
2006-01-17 04:26:12 +00:00
Wayne Davison
c2be690cc6 Got rid of a few empty lines. 2006-01-17 02:16:57 +00:00
Wayne Davison
f5a49d0e44 Got rid of a now-unused static variable. 2006-01-17 01:26:35 +00:00
Wayne Davison
03e23e0730 A few more items to check for, including libcharset.h, langinfo.h,
locale_charset(), and nl_langinfo().
2006-01-15 14:52:12 +00:00
Wayne Davison
eb598fac4f - Improved get_local_name() using ideas from Matt McCutchen's
version:  lots more comments, and a "local name" copy now
  does a chdir to the parent dir of the destination file.
- Moved the setlocale() call prior to the parse_arguments() call.
2006-01-15 07:11:23 +00:00
Wayne Davison
be0602ec3c - We now filter all rwrite() output when it goes out to the terminal
to make sure that it contains readable characters.
- Got rid of the buf[len] = '\0' in rwrite().
- Call f_name() with revised args (which also replaces f_name_to()).
2006-01-14 20:26:28 +00:00
Wayne Davison
6cbde57d88 Call f_name() with revised args (which also replaces f_name_to()). 2006-01-14 20:26:23 +00:00
Wayne Davison
5e4ff5f9c5 Merged f_name() with f_name_to(). 2006-01-14 20:26:20 +00:00
Wayne Davison
18e1289f27 Defined new FNAME logcode enum (only used on the client side when
logging a filename).
2006-01-14 20:26:17 +00:00
Wayne Davison
99aaa6ca25 Fixed a couple out-of-memory function-name strings in make_file(). 2006-01-14 17:19:12 +00:00
Wayne Davison
24172e4b2f If the --human-readable option is in effect, output the size of
each file in human-readable units instead of a raw byte count.
2006-01-14 17:10:52 +00:00
Wayne Davison
beaf495400 Added a "continue" missing from a recent change. 2006-01-14 00:29:50 +00:00
Wayne Davison
79f48760f3 Added --enable-iconv and cleaned up the other enable/disable options. 2006-01-13 23:05:16 +00:00
Wayne Davison
785abd4802 Got rid of the safe_fname() function and the calls to it. 2006-01-13 22:06:34 +00:00
Wayne Davison
0ee6ca9800 Got rid of calls to the (soon to vanish) safe_fname() function. 2006-01-13 22:06:31 +00:00
Wayne Davison
7543020807 Fixed a bug in the explode_mode code that was causing a crash
on BSD systems.
2006-01-13 21:40:26 +00:00
Wayne Davison
47b50b9bd0 We now use lib/compat.o when building wildtest. 2006-01-13 21:38:43 +00:00
Wayne Davison
45c49b52a4 Got rid of calls to (the soon to vanish) safe_fname() function. 2006-01-13 21:17:09 +00:00
Wayne Davison
0ee32c62d3 Improved a couple sentences. 2006-01-13 21:10:11 +00:00
Wayne Davison
70e98a4348 Changed RSYNC_ARGn to RSYNC_ARG#. 2006-01-12 19:35:54 +00:00
Wayne Davison
fddf529df9 Mention the new RSYNC_ARGn environment variables for pre-xfer exec. 2006-01-12 19:24:25 +00:00
Wayne Davison
141c62659e We now send all the option args to the pre-exec command. 2006-01-12 19:15:31 +00:00
Wayne Davison
61e16468f0 We need to call clearerr() when getc() returns EOF with errno == EINTR. 2006-01-06 22:20:07 +00:00
Wayne Davison
b74b3d538e + Changed two buffers to use BIGPATHBUFLEN instead of MAXPATHLEN+512.
+ Changed a strncpy() call into a (more appropriate) memcpy() call.
+ Made the ellipsis[] string static because some older compilers may
  not like the dynamic initialization of a character string.
+ Expanded some 1-line "case ... break;" statements onto separate
  lines.
2006-01-05 02:29:16 +00:00
Wayne Davison
d3db3eef1b Document the new "dir/***" feature. 2006-01-02 17:46:32 +00:00
Wayne Davison
90d5b12e72 Added a test for the new "dir/***" feature. 2006-01-02 17:46:27 +00:00
Wayne Davison
955a3a3ded We now test all the patterns using both a normal wildtest run and
a wildtest run with various -x and -e options.
2006-01-02 17:46:24 +00:00
Wayne Davison
aec75b037b Added -x and -e options, which are used to exercise wildmatch_array(). 2006-01-02 17:46:21 +00:00
Wayne Davison
e5daa2731a We use the new wildmatch_array() and litmatch_array() functions to
make our include/exclude code easier to read and maintain, and to
eliminate a buffer copy when handling an absolute-path pattern
(which eliminated the full_name[] buffer).  Also added handling
for the new MATCHFLG_WILD3_SUFFIX define that allows a string that
ends with "dir/***" to match the "dir" as well as its contents.
2006-01-02 17:46:18 +00:00
Wayne Davison
390621a7ab Added a new function, wildmatch_array(), that lets the caller pass
the text-string as an array of strings (with a terminating NULL
pointer at the end).  Also added litmatch_array(), which does a
literal match (no wildcards or special chars) against an array of
strings.
2006-01-02 17:46:15 +00:00
Wayne Davison
478bb47c40 The latest prototypes. 2006-01-02 17:46:12 +00:00
Wayne Davison
685517abd1 Added MATCHFLG_WILD3_SUFFIX define, shuffling a few others to put
it in a nice spot.
2006-01-02 17:46:09 +00:00
Wayne Davison
515afe7cf1 Mention dont-compress fix. 2005-12-30 07:24:17 +00:00
Wayne Davison
ec497df1a0 Optimized set_compression() to remove the per-file strdup(), strlower(),
and free() calls (it now uses iwildmatch()).
2005-12-30 07:19:16 +00:00
Wayne Davison
8e74463643 - Added a new public function, iwildmatch(), which will treat all
upper-case letters in the "text" as lower-case.
- Renamed variable "ch" -> "p_ch" and "prev" -> "prev_ch".
- Added variable "t_ch" to hold the current *text value.
- Return ABORT_ALL if we reach the end of the text string with
  more pattern to match.
2005-12-30 07:12:48 +00:00
Wayne Davison
933d1dfd0f Added a prototype for iwildmatch(). 2005-12-30 07:09:34 +00:00
Wayne Davison
0fe987e226 Fixed a bug in set_compression() where the default dont-compress
patterns (e.g. *.gz) would not match a pathname containing a slash.
2005-12-30 06:03:40 +00:00
Wayne Davison
770de8994e - Renamed match_start -> anchored_match.
- Twiddled one comment and added another.
- Twiddled the placement of two else statements.
2005-12-24 08:00:12 +00:00
Wayne Davison
37cf7b4191 Improved the usage info in the opening comment. 2005-12-19 16:57:55 +00:00
Wayne Davison
1a3ef40da9 A few extra directory-style matching tests. 2005-12-19 02:30:59 +00:00
Wayne Davison
0314302e9c Added an anchored exclude to a filter file. 2005-12-19 02:23:57 +00:00
Wayne Davison
9639c71842 + Put --existing back in the main option summary.
+ Improved the discussion of wildcard characters.
2005-12-19 02:18:16 +00:00
Wayne Davison
d2da915cd0 Made --existing the main option, with --ignore-non-existing
as its alias.
2005-12-19 01:59:00 +00:00
Wayne Davison
e725abcf4e Added a comment, improved a comment, tweaked the recursive function's
name, tweaked the arg names to wildmatch(), and tweaked the style of
the "else" statements when they follow a brace.
2005-12-18 19:40:50 +00:00
Wayne Davison
de01941274 Tweaked the name of the first arg to wildmatch(). 2005-12-18 19:38:47 +00:00
Wayne Davison
d802ea54da Fixed one config-file reference that was misspelled. 2005-12-18 15:48:00 +00:00
Wayne Davison
c81a20fb7a Tweaked the debug output for cvs_filter_list and server_filter_list. 2005-12-17 21:03:25 +00:00
Wayne Davison
6bf32edb8c Return RERR_SIGNAL1 from sigusr1_handler(). 2005-12-16 23:48:34 +00:00
Wayne Davison
4a50a2176e Added RERR_SIGNAL1's message and tweaked ERR_SIGNAL. 2005-12-16 23:48:31 +00:00
Wayne Davison
9e90555fd1 Added RERR_SIGNAL1 to separate SIGUSR1 from the rest of the
signals that return RERR_SIGNAL.
2005-12-16 23:48:28 +00:00
Wayne Davison
2067ec7342 Mentioned the auto-protect rule for --backup. 2005-12-16 17:20:22 +00:00
Wayne Davison
c2c5682c0b If the user specifies --backup with --delete (but without --backup-dir
and --delete-excluded), append a protect-filter rule onto the list of
filter rules.  We run this on both the client and server side so that
an older client talking to a newer server still gets the protection
rule.  (This rule will not cause compatibility problems with older
versions of rsync due to the graceful way that a protect rule turns
into an exclude rule if it needs to be sent to an older server.)
2005-12-16 17:18:29 +00:00
Wayne Davison
4c72f27dd9 Document the new auto-added protect filter-rule when using --backup
with --delete (but without --backup-dir and --delete-excluded).
2005-12-16 17:18:26 +00:00
Wayne Davison
36d8d1a626 - Added a comment about configure figuring out the default user
and group to use in daemon mode.
- Belatedly updated the version of popt that comes with rsync.
- Updated the Mac OS X info.
2005-12-16 16:57:26 +00:00
Wayne Davison
3447d61048 Fixed a bug in the hard-linking of a group of fifos/devices in a
transfer where the leader got hard-linked to a --link-dest item.
2005-12-16 04:02:54 +00:00
Wayne Davison
a3887c2644 Improved the RERR_SIGNAL message to include all possible signals. 2005-12-16 00:18:41 +00:00
Wayne Davison
8a1f3153b9 Mention the improvements in the comare-dest/link-dest/copy-dest handling. 2005-12-15 23:00:23 +00:00
Wayne Davison
165dd4a636 Improved the tests we run to test more output variations and to work
with the new way link-dest handles symlinks.
2005-12-15 23:00:05 +00:00
Wayne Davison
541b23d144 When compare-dest/link-dest/copy-dest are in effect, we now check
if the file we're about to hard-link to the leader is present in
one of the dest dirs -- if it is, we adjust the text we output
accordingly.
2005-12-15 23:00:02 +00:00
Wayne Davison
7987ece7cc The ITEM_NO_DEST_AND_NO_UPDATE define is no longer needed. 2005-12-15 22:59:59 +00:00
Wayne Davison
48224e4c43 Improved the compare-dest/link-dest/copy-dest code to make it more
readable, to make it output properly in double-verbose mode, and
to allow the hard-linking of symlinks and devices (if supported by
the OS).
2005-12-15 22:59:56 +00:00
Wayne Davison
6d4ecad122 - Eliminate an all-dot itemization for a locally-copied file.
- Got rid of some redundant output in maybe_log_item().
2005-12-15 22:59:53 +00:00
Wayne Davison
1578919c37 Improved an old bullet point. 2005-12-15 21:23:44 +00:00
Wayne Davison
10a1d6b4a0 Use AC_SEARCH_LIBS() instead of AC_CHECK_LIB() to figure out if
we need to include libresolv or not.
2005-12-14 22:54:54 +00:00
Wayne Davison
2b7e12924d Mention that the MD4 password protection is weaker than
previously thought.
2005-12-14 22:14:26 +00:00
Wayne Davison
82f0c63e8a Parse single- and double-quotes in the --rsh/-e option (and RSYNC_RSH). 2005-12-14 22:00:01 +00:00
Wayne Davison
5d9530fe47 Mention new quote-parsing for the --rsh/-e and RSYNC_RSH handling. 2005-12-14 21:59:11 +00:00
Wayne Davison
37f35d89d1 Made msg_list_push() static and renamed it to msg_list_flush(). 2005-12-08 21:19:22 +00:00
Wayne Davison
08c88178aa Tweaked the msg_list code so that the head and tail pointers
are contained by a structure.
2005-12-08 21:01:38 +00:00
Wayne Davison
0fb2fc4a1d Fixed a typo in a comment. 2005-12-08 16:12:25 +00:00
Wayne Davison
da2d13e3ce Improved/fixed some of the entries. 2005-11-29 15:53:18 +00:00
Wayne Davison
64318670a8 Improved the description of how --delay-updates chooses it's dir. 2005-11-16 16:12:04 +00:00
Wayne Davison
3c19f72c16 Made the parsing in parse_size_arg() a little more strict. 2005-11-15 17:49:59 +00:00
Wayne Davison
8938d67ef8 Fixed a typo in the --help output for --no-OPTION. 2005-11-15 07:05:55 +00:00
Wayne Davison
05724c07cf Changed -h to be an alias for --human-readable (getting rid of -m).
Also added backward-compatibility code so that "rsync -h" shows the
help page on stdout like it would in older versions.
2005-11-15 06:35:27 +00:00
Wayne Davison
955c3145c3 Document the change in the -h option. 2005-11-15 06:35:22 +00:00
Wayne Davison
8ea17b5098 Twiddled some brace positions and removed a superfluous ';' in a macro. 2005-11-14 21:24:30 +00:00
Wayne Davison
b20fe0e6ac Improved an error message. 2005-11-13 17:15:00 +00:00
Wayne Davison
24787acd08 Moved the DEL_* flags into generator.c. 2005-11-12 20:30:40 +00:00
Wayne Davison
d71dad3bd3 Moved the DEL_* flags from rsync.h here and got rid of DEL_NO_RECURSE. 2005-11-12 20:30:36 +00:00
Wayne Davison
889439c205 Mention the latest options. 2005-11-12 20:08:10 +00:00
Wayne Davison
bee9df73c1 Changed the parsing of suffixes for --min-size and --max-size a little. 2005-11-12 20:08:00 +00:00
Wayne Davison
60613dc896 Output the stats and the end-of-run verbose output using the new
human_num() and human_dnum() functions, which both honor the
new --human-readable option.
2005-11-12 19:53:26 +00:00
Wayne Davison
e175fb07f7 Added two new functions: human_num() and human_dnum(), which
output numbers in human-readable units if the --human-readable
option was specified.
2005-11-12 19:53:23 +00:00
Wayne Davison
4a70af6f81 Added the human_readable variable (for linking with util.o). 2005-11-12 19:53:20 +00:00
Wayne Davison
8f14cc496b Parse the new --human-readable (-m) option. 2005-11-12 19:53:17 +00:00
Wayne Davison
3b4ecc6b80 Document the new --human-readable (-m) option. 2005-11-12 19:53:12 +00:00
Wayne Davison
a7e60f0c59 Only call cleanup_set() if keep_partial is set. 2005-11-10 16:57:30 +00:00
Wayne Davison
3d7cc5710d If cleanup_set() gets passed a NULL fnametmp or fname, set
cleanup_fname to NULL.
2005-11-10 16:56:32 +00:00
Wayne Davison
86fc7e6880 Got rid of a superfluous newline. 2005-11-10 16:47:52 +00:00
Wayne Davison
acee11fc60 - Indent the "oom:" label away from column 0.
- Got rid of a superfluous newline.
2005-11-10 16:47:27 +00:00
Wayne Davison
b2e7c91313 Indent the "prepare_to_open:" and "notify_others:" labels away
from column 0.
2005-11-10 16:47:03 +00:00
Wayne Davison
97b7bff4d6 - Got rid of a superfluous empty line.
- Indent the "oom:" and "skip_filters:" labels away from column 0.
2005-11-10 16:45:00 +00:00
Wayne Davison
e16ca9ef31 Got rid of a superfluous empty line. 2005-11-10 16:44:06 +00:00
Wayne Davison
b2e6caa01e Indent the "failure:" label away from column 0. 2005-11-10 16:43:44 +00:00
Wayne Davison
2997e9f769 Indent the "oom:" label away from column 0. 2005-11-10 16:42:46 +00:00
Wayne Davison
2374023982 Mention the big improvement when --delete and --checksum were
specified.
2005-11-10 06:43:10 +00:00
Wayne Davison
902f03d101 In make_file(), only compute the checksum when we're the sender.
This stops computing useless checksums during the delete scan
when --checksum (-c) was specified.
2005-11-10 06:01:55 +00:00
Wayne Davison
cfe3978049 Use the new checksum_len value instead of recomputing the
right value for the current protocol_version over and over.
2005-11-10 03:07:18 +00:00
Wayne Davison
7752df41b7 Compute the right checksum length for the current protocol_version
only once instead of over and over again.
2005-11-10 03:00:38 +00:00
Wayne Davison
d8b108c2a1 If a partial-dir file is present but the main file is up-to-date,
just remove the partial-dir file.
2005-11-10 02:56:58 +00:00
Wayne Davison
184dd27a18 Call delete_in_dir(NULL, NULL, NULL) in do_delete_pass(). 2005-11-09 19:46:42 +00:00
Wayne Davison
0e5665d3ab Made recursively deleting extraneous directories more memory
efficient by removing the need for a MAXPATHLEN buffer on the
stack of delete_item().
2005-11-09 19:39:46 +00:00
Wayne Davison
ef3bb69ad8 Mention the new --chmod option. 2005-11-07 04:47:06 +00:00
Wayne Davison
45d41d08bd Test the --chmod option. 2005-11-07 04:28:52 +00:00
Wayne Davison
dd32e2c3d4 Added support for the new --chmod option. 2005-11-07 04:28:35 +00:00
Wayne Davison
2b7e0f33a6 Call tweak_mode() on regular files and dirs if --chmod was specified. 2005-11-07 04:28:32 +00:00
Wayne Davison
0582cdae8d Added chmod.o to OBJS2. 2005-11-07 04:28:29 +00:00
Wayne Davison
9e8ea423e2 Document the new --chmod option. 2005-11-07 04:28:23 +00:00
Wayne Davison
0c983c1fd4 New --chmod support routines. 2005-11-07 04:23:22 +00:00
Wayne Davison
3381ffa6ea Fixed a sign error in the output. 2005-11-03 19:55:30 +00:00
Wayne Davison
3b15340966 Mention the change in the output of --progress. 2005-11-03 19:46:45 +00:00
Wayne Davison
91683c434b Make the just-updated file-count status even less cryptic. 2005-11-03 19:45:59 +00:00
Wayne Davison
9e7530c414 Improved the output of the transferred-file count and the position
in the flist (which was changed to a countdown of files to check)
so that it's clearer what the numbers mean.
2005-11-03 19:38:14 +00:00
Wayne Davison
8fd30fc43c Got rid of some early-checksum code that accidentally got committed. 2005-11-02 07:22:02 +00:00
Wayne Davison
b1b04fcdd4 Mention lower stack requiements for recursion. 2005-11-01 20:13:20 +00:00
Wayne Davison
56f0c976be Decreased the amount of stack needed for each level of directory
recursion by eliminating the need for a MAXPATHLEN buffer in
send_if_directory().  Also improved a few variable names in
send_file_list().
2005-11-01 20:09:41 +00:00
Wayne Davison
9aacb4df0e Fixed a typo pointed out by Peter Strazovec. 2005-10-30 22:29:59 +00:00
Wayne Davison
0fdb1aa8ff In the device section, avoid calling unlink() if the stat() failed. 2005-10-30 22:28:11 +00:00
Wayne Davison
bad0110609 Document the new --compress-level option. 2005-10-26 16:48:44 +00:00
Wayne Davison
3cc185a088 Handle new def_compress_level setting. 2005-10-26 16:48:07 +00:00
Wayne Davison
e8a8167ad9 Obey new def_compress_level setting. 2005-10-26 16:47:49 +00:00
Wayne Davison
854a1aad35 Added --compress-level option. 2005-10-26 16:47:15 +00:00
Wayne Davison
84e6d6fdcd - Changed the "status" variables into "exit_code" variables.
- Added an error message to wait_process_with_flush() that
  reports the errno we get when waitpid() fails.
- Increased the value of MAXCHILDPROCS.
2005-10-26 15:53:04 +00:00
Wayne Davison
f14a65d94c Tweaked the error message for RERR_WAITCHILD. 2005-10-26 15:50:14 +00:00
Wayne Davison
37439b36e7 Updated the docs for pre-/post-xfer exec. 2005-10-24 21:03:53 +00:00
Wayne Davison
c95ca2a228 Enhanced the "pre-xfer exec" handling so that it gets the user's
request info and puts that into the environment as RSYNC_REQUEST.
2005-10-24 21:03:50 +00:00
Wayne Davison
97d8e7095f Changed wait_process() into a simpler, yet more versatile function,
and used it in the new wait_process_with_flush() function (the old
function's new name).  Made wait_process() public.
2005-10-24 21:03:47 +00:00
Wayne Davison
20c1926a01 Fixed a typo in a comment. 2005-10-20 18:30:33 +00:00
Wayne Davison
d030233def Get rid of some superfluous empty lines. 2005-10-19 07:49:10 +00:00
Wayne Davison
35812ea1f9 One extra tweak to the just-committed code. 2005-10-15 19:15:29 +00:00
Wayne Davison
d649b78920 Added relative_paths extern. 2005-10-15 19:11:36 +00:00
Wayne Davison
7e43da819e If we're sanitizing paths with --relative enabled, we need to
preserve the first /./ dir so that we can use its position to
trim the implied directories.
2005-10-15 19:08:31 +00:00
Wayne Davison
40aaa571b4 Document --ignore-non-existing (not --existing) and what happens
if the option is combined with --ignore-existing.
2005-10-15 16:39:31 +00:00
Wayne Davison
470319d33b Changed the --help text to mention --ignore-non-existing
instead of --existing.
2005-10-15 16:38:35 +00:00
Wayne Davison
1db954e9bc Made parse_size_arg()'s parsing a little stricter. 2005-10-15 06:53:04 +00:00
Wayne Davison
d697314b42 Mention --min-size/--max-size changes. 2005-10-14 20:40:31 +00:00
Wayne Davison
59dd678603 Documented --min-size. 2005-10-14 20:16:21 +00:00
Wayne Davison
02b5cb238b Added code to implement the --min-size logic. 2005-10-14 20:16:09 +00:00
Wayne Davison
74de13d19c Added handling of the --min-size option. 2005-10-14 20:15:18 +00:00
Wayne Davison
837d01dd5a Improved parse_size_arg() a little more. 2005-10-14 19:48:34 +00:00
Wayne Davison
926d86d1f9 Document the extended parsing of --max-size values. 2005-10-14 19:03:05 +00:00
Wayne Davison
aeb213ea0c Improved parse_size_arg() so that it can be told to use powers of
ten instead of binary K/M/G powers, and so that it can be told to
add or subtract one from the result.  We also make sure to pass
the arg to --max-size in a compatible manner with older versions.
2005-10-14 18:56:07 +00:00
Wayne Davison
7c6ea3d8c7 Fixed a typo in an option name. 2005-10-12 23:59:00 +00:00
Wayne Davison
d409c6ac9c Mention va_copy change. 2005-10-11 20:21:56 +00:00
Wayne Davison
92f0b9d6ab If va_copy is defined, use it when defining VA_COPY. 2005-10-11 20:21:03 +00:00
Wayne Davison
2c8c8bbaad Pass XFLG_ABS_IF_SLASH instead of XFLG_ANCHORED2ABS for server excludes. 2005-10-07 18:40:30 +00:00
Wayne Davison
4fc8140a60 Support new XFLG_ABS_IF_SLASH flag. 2005-10-07 18:39:40 +00:00
Wayne Davison
699f7024f1 Added XFLG_ABS_IF_SLASH. 2005-10-07 18:38:25 +00:00
Wayne Davison
ce0da32a9c Mention recent changes. 2005-10-07 18:24:35 +00:00
Wayne Davison
82360c6b17 Clarify how the fitler rule "-/" works. 2005-10-07 18:18:16 +00:00
Wayne Davison
493568465b Improved the usage comments. 2005-10-04 04:12:28 +00:00
Wayne Davison
bf485d3d6b A simple filter script to output messages from a single module. 2005-10-03 18:40:59 +00:00
Wayne Davison
e90aab4982 Changed the variable names for --existing and --ignore-existing. 2005-09-29 18:07:55 +00:00
Wayne Davison
550d4e2346 Reverted one xfer_dirs change from the last commit that should not
have gone in.
2005-09-29 17:27:11 +00:00
Wayne Davison
991daf008d Keeping silent about stat() errors is never a good idea -- it hides
files that are not up-to-date.
2005-09-29 17:07:45 +00:00
Wayne Davison
505ada146c Mention that --delete now works with --dirs. 2005-09-29 08:15:34 +00:00
Wayne Davison
75c51953f1 - When --dirs is specified w/o --recursive, avoid marking solo dirs
with the XMIT_TOP_DIR flag.
- Only set in_del_hier if --recursive is enabled.
2005-09-29 07:48:05 +00:00
Wayne Davison
8d6c1c4e97 Allow deletions to occur in directories transferred with the
--dirs option in addition to the regular --recursive behavior.
2005-09-29 07:41:50 +00:00
Wayne Davison
10a1a3f511 Fixed a poorly-worded sentence and a misspelled word. 2005-09-29 07:37:00 +00:00
Wayne Davison
40e6752fba Some systems don't define WCOREDUMP(), so #ifdef that code. 2005-09-26 17:41:14 +00:00
Wayne Davison
dbefb6b4e4 Fixed wait_process() to handle cases where waitpid() fails or
the child process did not exit cleanly.
2005-09-26 17:12:13 +00:00
Wayne Davison
6016841086 Changed RERR_CRASH to RERR_CRASHED. 2005-09-26 17:11:03 +00:00
Wayne Davison
0047f535ef Handle new RERR_CRASH AND RERR_TERMINATED exit codes. 2005-09-26 17:07:50 +00:00
Wayne Davison
90eca40d27 Defined RERR_CRASH and RERR_TERMINATED. 2005-09-26 17:06:33 +00:00
Wayne Davison
0417c34e2d Mention some chanages in the patches dir. 2005-09-26 04:47:25 +00:00
Wayne Davison
d64c2b226a Use AC_HELP_STRING() in the two AC_ARG_WITH() macros that used a
hard-wired string.
2005-09-24 17:17:30 +00:00
Wayne Davison
868676dc15 Reordered the usage lines to cover push, then pull (which has a
better visible pattern than covering push & pull for each host-type).
2005-09-21 22:39:49 +00:00
Wayne Davison
e31058d41e Cast some time values to (int), just to silence some warnings on
Stratus VOS.
2005-09-21 17:42:15 +00:00
Wayne Davison
ea8291d8f7 Include limits.h (if it exists), which defines NAME_MAX on some
systems.
2005-09-21 17:38:44 +00:00
Wayne Davison
1348267518 If we get less data than expected from a read() in map_ptr(), we
need to try to keep reading to see if we get an error or more data.
2005-09-21 17:37:41 +00:00
Wayne Davison
f0323d68eb Check for limits.h. 2005-09-21 17:35:51 +00:00
Wayne Davison
12a01be14f Tweaked the output that the mknod() tests generate. 2005-09-21 17:15:58 +00:00
Wayne Davison
e0a18ce3f7 Tweaked some comments. 2005-09-19 17:21:00 +00:00
Wayne Davison
8ad5cea371 Changed one strcpy() into a strlcpy(). 2005-09-17 21:49:24 +00:00
Wayne Davison
9059e0ac2f Improved the sDefault initialization so that the prefixed
comments exactly match the variable names (making sure that
they will sort exactly the same way as the variables).
2005-09-16 20:35:05 +00:00
Wayne Davison
29fad7a3d8 Got rid of some old command-line parsing code that was only
useful when talking to a 1.x client.
2005-09-16 16:40:30 +00:00
Wayne Davison
02efda9f01 Mention '!' fix. 2005-09-16 16:14:24 +00:00
Wayne Davison
35a388b141 Really fix '!' in a .cvsignore file this time. 2005-09-16 16:10:01 +00:00
Wayne Davison
9a4a237ede Tweaked the code a little in the always_checksum handling of the
send & receive file-list functions.
2005-09-16 05:52:54 +00:00
Wayne Davison
5efbddbadb Mention that the dir used with --delay-updates cannot be on a
different filesystem from the destination files.
2005-09-15 22:27:14 +00:00
Wayne Davison
6a94c58b00 Added a comment. 2005-09-15 22:25:55 +00:00
Wayne Davison
e3f8395360 Mention doc changes. 2005-09-15 17:19:30 +00:00
Wayne Davison
f2b4c0840e Removed conflicting ssh citation in the SETUP section. 2005-09-15 15:36:27 +00:00
Wayne Davison
08d82b84cb The --help text was outputting some incomplete information on how
SRC is expanded or word-split, so I removed that text and replaced
it with an explaination of how ':' differs from '::' & 'rsync://'.
2005-09-13 01:02:54 +00:00
Wayne Davison
fbe57fdc95 Mention the latest fix. 2005-09-09 17:07:39 +00:00
Wayne Davison
92cdc39372 When pop_dir(olddir) fails, pass the right string pointer
in the error message.
2005-09-09 16:17:01 +00:00
Wayne Davison
78be8e0fc9 Improved the -F, --exclude-from, and --include-from sections. 2005-09-09 07:27:25 +00:00
Wayne Davison
a5b786d80f Tweaked the calculation that goes into sum->count so that it cannot
overflow into a negative value (which is particularly important if
configure didn't find a real int64 type).
2005-09-06 18:12:38 +00:00
Wayne Davison
f853b777be Complicate the lseek64() function prototype because some systems
don't have off64_t.
2005-09-03 16:56:53 +00:00
Wayne Davison
fed1f3f4fe Make use of the per-module "temp dir" setting. 2005-09-03 16:50:20 +00:00
Wayne Davison
18cad44967 Added a per-module "temp dir" setting. 2005-09-03 16:24:23 +00:00
Wayne Davison
d17c9a4486 Sorted some of the data structures (using vim's "!sort" command
makes it easy).
2005-09-03 16:22:06 +00:00
Wayne Davison
b6e22a47d3 - Allow --no-v and --no-verbose in the daemon options.
- If a too-long --temp-dir is specified when starting a daemon,
  omplain to the daemon-starting user, not later to the client.
2005-08-30 16:13:54 +00:00
Wayne Davison
ec69bdbd64 Mention latest changes. 2005-08-30 05:12:49 +00:00
Wayne Davison
a8cbb57c9b Mention how --inplace conflicts with --sparse and how --append
does not.
2005-08-30 05:10:51 +00:00
Wayne Davison
b8cc35874e Allow --temp-dir to be specified with --daemon to set the default. 2005-08-30 05:00:56 +00:00
Wayne Davison
c3851185f3 Fixed a comment. 2005-08-30 02:59:30 +00:00
Wayne Davison
e7ee91defc When --append is entering the redo phase, make sure that
sparse_files is disabled (because it conflicts with an
inplace update).
2005-08-30 02:58:42 +00:00
Wayne Davison
cfce9f6dc3 Reject attempts to combine --sparse with --inplace. 2005-08-30 02:57:19 +00:00
Wayne Davison
4afcb709a7 Forgot the --no-v option. 2005-08-28 00:43:51 +00:00
Wayne Davison
a912a980ec Mention the new --no-* options. 2005-08-28 00:34:46 +00:00
Wayne Davison
2c64b25827 A small improvement to the daemon-connecting instructions. 2005-08-28 00:25:44 +00:00
Wayne Davison
38b9170c52 One more tweak to the option data. 2005-08-27 21:12:44 +00:00
Wayne Davison
f40aa6fb07 Documented the new --no-* options. 2005-08-27 21:07:27 +00:00
Wayne Davison
b616493883 Added the ability to prefix "no-" to various options, which gives the
user an easy way to override implied option switches.
2005-08-27 21:01:45 +00:00
Wayne Davison
e86e2fa173 A little more reordering of the option data. 2005-08-27 20:43:35 +00:00
Wayne Davison
11bfaf6351 Reordered some of the option data to make their grouping more logical. 2005-08-27 20:01:45 +00:00
Wayne Davison
d37d1c44ff Make the --append docs a little better. 2005-08-20 17:21:06 +00:00
Wayne Davison
c89330313e Moved a variable in glob_expand_one(). 2005-08-03 04:51:29 +00:00
Wayne Davison
c9dc1300ba Got rid of the argp var that is not needed now that argv is no
longer a literal array.
2005-08-03 04:42:56 +00:00
Wayne Davison
53cf0b8bfb Improved the --relative section a little more. 2005-08-03 01:13:15 +00:00
Wayne Davison
56961becc2 Mention the latest changes. 2005-08-01 22:18:11 +00:00
Wayne Davison
1dc42d123d Improved the --relative section, including mentioning the addition
of dot-dir path trimming.
2005-08-01 22:18:00 +00:00
Wayne Davison
d2ea5980ba Allow the user to specify a dot dir in the source path when
using --relative, making it trim the duplicated dirs.
2005-08-01 21:58:16 +00:00
Wayne Davison
15cf186b85 Don't recreate a device if just the permissions bits have changed
in the st_mode.
2005-08-01 04:09:58 +00:00
Wayne Davison
4fdb03a648 Mention hard-link fix. 2005-07-31 23:21:46 +00:00
Wayne Davison
8f5b554f0b Hard-link a device in order to test that this works properly. 2005-07-31 23:20:12 +00:00
Wayne Davison
8cd3db27b6 There is no longer a need to check file->link_u.links at the start
of hard_link_check() (because the caller has already checked it).
2005-07-31 23:19:42 +00:00
Wayne Davison
273a7ed59f Fixed the handling of hard-linked symlinks and devices. 2005-07-31 23:18:28 +00:00
Wayne Davison
23deb0bcee Export RUNSHFLAGS. 2005-07-31 23:15:38 +00:00
Wayne Davison
7ea7bebf6b Mention the --inplace new-file permissions fix. 2005-07-30 16:17:21 +00:00
Wayne Davison
97894c6473 - The combination of --update and --progress now outputs progress
information during the checksum scan of the already-sent data.
- When --inplace creates a file, give it 0600 permissions, not 0000.
2005-07-30 16:14:22 +00:00
Wayne Davison
1f86fcf5dc The combination of --update and --progress now outputs progress
information during the checksum scan of the already-sent data.
2005-07-30 16:13:19 +00:00
Wayne Davison
bb9bdba4c9 Improved the text around the last example in the USAGE section. 2005-07-29 19:52:50 +00:00
Wayne Davison
5b9cc6953a Mention the latest changes. 2005-07-29 18:48:58 +00:00
Wayne Davison
33544bf422 - Use BIGPATHBUFLEN for the length of several buffers.
- If io_printf() tries to overflow the buffer, die with
  an error instead of sending a truncated buffer.
2005-07-29 18:31:12 +00:00
Wayne Davison
20accf4d06 - Use BIGPATHBUFLEN for the length of two line buffers.
- Improved the handling of the start_glob variable.
- Made the line buffer in start_daemon() a little bigger.
2005-07-29 18:31:10 +00:00
Wayne Davison
3fac51e21e Use BIGPATHBUFLEN for the length of two line buffers. 2005-07-29 18:31:07 +00:00
Wayne Davison
d999d312c4 Use BIGPATHBUFLEN for the length of a line buffer. 2005-07-29 18:31:05 +00:00
Wayne Davison
a22ca88565 Define BIGPATHBUFLEN -- a roomy line-buffer that can hold a
MAXPATHLEN string plus a message, and it's at least 4096+1024
bytes for those systems where MAXPATHLEN is overly short.
2005-07-29 18:31:03 +00:00
Wayne Davison
9ec8bd87bb Updated to match 2.6.6 release (which occurred on a branch). 2005-07-28 20:00:43 +00:00
Wayne Davison
f11ece28ff Changed the version to 2.6.7cvs. 2005-07-28 19:49:47 +00:00
Wayne Davison
f90f71498e Updated to reflect new 2.6.7cvs status. 2005-07-28 19:49:24 +00:00
Wayne Davison
32199c6b00 Removed a duplicated item. 2005-07-28 18:17:56 +00:00
Wayne Davison
870dddc5eb Mention the recent changes. 2005-07-28 17:42:56 +00:00
Wayne Davison
9d0d18b590 If the user has specified "pre-xfer exec" or "post-xfer exec", run
the indicated command(s), each at the appropriate time.
2005-07-28 17:15:47 +00:00
Wayne Davison
bec617b934 Added 2 new config options: "pre-xfer exec" and "post-xfer exec". 2005-07-28 17:15:44 +00:00
Wayne Davison
c20936b88b Document the new pre-/post-xfer exec config options. 2005-07-28 17:15:42 +00:00
Wayne Davison
0869881764 Regenerated. 2005-07-28 16:58:04 +00:00
Wayne Davison
a840b5c736 Removed one more client-oriented command-line syntax sentence. 2005-07-28 09:40:08 +00:00
Wayne Davison
2907884f94 Removed erroneous section on using daemon features over a
remote-shell connection -- client-use is better described in the
rsync manpage, and the advanced restricted-ssh section needs a
better treatment (perhaps as a support script).
2005-07-28 09:36:12 +00:00
Wayne Davison
754a080ffc Improved the sections dicussing the various types of transfer
connections and how a normal transfer differs from a daemon
transfer.
2005-07-28 09:18:20 +00:00
Wayne Davison
94f20a9f45 Document new --append option. 2005-07-28 01:46:16 +00:00
Wayne Davison
6cc1198288 Support new --append option. 2005-07-28 01:46:12 +00:00
Wayne Davison
a015788d21 Added the --append option. 2005-07-28 01:46:09 +00:00
Wayne Davison
c8d3465726 - Call set_modtime() with its new mode arg.
- Don't mask the mode bits being sent to do_chmod().
- Don't skip calling set_modtime() or do_chmod() when the item
  is a symlink.
2005-07-27 23:30:58 +00:00
Wayne Davison
00b9618460 - Fixed the mode comparison in itemize() to mask off the bits
outside of the CHMOD_BITS mask.
- Don't call do_chmod() unless HAVE_CHMOD is defined.
- Don't mask the mode bits being sent to do_chmod().
2005-07-27 23:30:55 +00:00
Wayne Davison
d11f5c6e2b - Don't call do_chmod() unless HAVE_CHMOD is defined.
- Made do_chmod() handle symlinks or return 1 if not possible.
- We now mask off the mode bits in do_chmod() sing CHMOD_BITS.
2005-07-27 23:30:53 +00:00
Wayne Davison
25007999df - Changed set_modtime() to take the file's mode as an arg.
- Made set_modtime() handle symlinks or return 1 if not possible.
2005-07-27 23:30:51 +00:00
Wayne Davison
8ce6546310 Check for the lchmod() and lutimes() functions. 2005-07-27 23:18:28 +00:00
Wayne Davison
151f59f155 Tweaked a comment and some null-char assignments. 2005-07-22 19:09:45 +00:00
Wayne Davison
89f2a4c231 Changed implied_dirs to only be non-0 if relative_paths is non-0. 2005-07-22 19:05:25 +00:00
Wayne Davison
496be30db6 Got rid of some unused externs. 2005-07-22 17:59:21 +00:00
Wayne Davison
cd426074e1 Updated to zlib 1.2.3. 2005-07-22 15:54:43 +00:00
Wayne Davison
3f7bfac2a0 Avoid newest test when no destination was specified. 2005-07-15 19:10:03 +00:00
Wayne Davison
9425918d74 Output a syntax error if both the source and destination are remote. 2005-07-15 19:06:43 +00:00
Wayne Davison
cc637fcc51 Preparing for release of 2.6.6pre1 2005-07-07 22:53:59 +00:00
Wayne Davison
9db1743490 Mentioned the zlib changes and tweaked a couple sentences. 2005-07-07 22:50:12 +00:00
Wayne Davison
ba3542cfcb - Attempt to make the discussion of host-specifying args less confusing.
- Fixed the names of the uid and gid daemon options in a sentence.
2005-07-07 21:33:40 +00:00
Wayne Davison
81f5b275db Changes for new zlib. 2005-07-07 21:29:57 +00:00
Wayne Davison
f3ee726894 Fixed a typo. 2005-07-07 21:19:14 +00:00
Wayne Davison
b5be9e6c5f Fix latest zlib security exploit (CAN-2005-2096). 2005-07-07 21:14:29 +00:00
Wayne Davison
1e1cf68934 Upgraded to version 1.2.2. 2005-07-07 20:48:02 +00:00
Wayne Davison
4a2744cee3 One more "#undef BAD" for AIX. 2005-07-07 20:37:31 +00:00
Wayne Davison
12febd804f Use a define to handle conflicting function read_buf instead of
renaming it in the code.
2005-07-07 20:17:35 +00:00
Wayne Davison
687c6b14a0 Changed "Overflow" back to "overflow". 2005-07-07 20:16:41 +00:00
Wayne Davison
a1f99493b3 Changed overflow() to overflow_exit(). 2005-07-07 19:49:14 +00:00
Wayne Davison
9819f005b6 Changed zBAD back to BAD (with a simpler kluge for AIX). 2005-07-07 19:31:23 +00:00
Wayne Davison
2a6793bf1f Fixed some whitespace to match the original source. 2005-07-07 19:22:55 +00:00
Wayne Davison
bf287ee946 Got rid of bogus RCS keyword expansions (that create differences
between these files and the original zlib source).
2005-07-07 19:15:44 +00:00
Wayne Davison
b8b0668e85 Mention the EEXIST fix. 2005-06-30 17:18:30 +00:00
Wayne Davison
092906933b Ignore EEXIST on second mkdir() call. 2005-06-30 17:03:14 +00:00
Wayne Davison
e8432be95f Mention the latest time-comparing fixes. 2005-06-28 00:15:44 +00:00
Wayne Davison
6ff2f4ba67 Use cmp_modtime() in a couple more spots where a local modtime is
compared with a remote modtime.
2005-06-28 00:12:08 +00:00
Wayne Davison
309a5be873 Fixed test to work when objdir != srcdir (thanks to Art Haas). 2005-06-24 02:14:12 +00:00
Wayne Davison
26c87bb630 Changed the arg-splitting code so that it can handle a literal
backslash prior to whitespace without treating it as escaped
whitespace (e.g. if we receive "foo\\ bar", it is two args,
while "foo\ bar" and "foo\\\ bar" are each just one).
2005-06-23 15:58:57 +00:00
Wayne Davison
ea9b2add97 Tweaked a comment in the perl code we output. 2005-06-23 15:53:26 +00:00
Wayne Davison
301569f081 Improved a couple sentences. 2005-06-20 07:01:29 +00:00
Wayne Davison
b21456102a Changed the code to use the single long-option hash from cull_options. 2005-06-17 23:23:00 +00:00
Wayne Davison
b8a47c9bc6 - Fixed a bug where the --*-dest options weren't being culled.
- Simplified the output format by putting all the long-name
  options into a single hash.
2005-06-17 23:16:22 +00:00
Wayne Davison
85fbfa10a8 - Improved some comments (some taken from the new cull-options output).
- Made the user-config sections easier to find.
- Default to running a fully-specified rsync executable so that there
  are not PATH surprises.
- A few minor tweaks to the arg-checking code to make it clearer without
  actually changing its logic.
2005-06-17 16:48:02 +00:00
Wayne Davison
555bc0e31a Another readability improvement in the perl code we output. 2005-06-17 16:29:21 +00:00
Wayne Davison
ef1233cbb3 Improved some of the comments that are output into the perl code. 2005-06-17 16:12:05 +00:00
Wayne Davison
1524815ed3 - Make sure that the command contained the '.' arg at the end of the
options.
- Fixed the expanding of wildcards for a restriction of '/'.
2005-06-17 05:14:15 +00:00
Wayne Davison
985af7035e - Be restrictive on matching the --sender option so that the user
can't fool us into thinking we're the sender by using a filename
  of --sender (or similar ploy).
- Make sure that our '..' check can't be fooled by sly backslashing.
- Tweaked some comments.
2005-06-17 04:50:22 +00:00
Wayne Davison
b3181708f2 Output a leading comment and surrounding blank lines. 2005-06-17 04:46:02 +00:00
Wayne Davison
3f6c17cf14 Mention rrsync changes. 2005-06-17 01:26:33 +00:00
Wayne Davison
2e5a7629c0 If SUBDIR is specified as a non-absolute path, make it absolute. 2005-06-17 01:17:44 +00:00
Wayne Davison
70318468df - Made it easy to configure the path of the rsync executable.
- Fully parse all legal options that might come from a stock rsync and
  validate/restrict any option's args (previously we rejected options
  with args).
- Made it easy to disable specific options.
- Properly handle a multi-arg copy's multiple args.
- Make sure that the restricted dir actually exists and we can chdir
  to it.
- Just reject any dangerous args that have .. in them instead of trying
  to munge them.
- We don't treat single-or double-quotes specially, just backslash-
  escaped characters.
- Turn on strict mode.
- Use the array-arg version of exec() so that we don't spawn a shell.
- Use File::Glob to glob wildcards in args.
- Tweaked the log-file format so that it logs the modified command
  without any "OK" suffix.
2005-06-16 19:30:53 +00:00
Wayne Davison
782d109121 A developer-oriented script that outputs perl code for valid server
options.
2005-06-16 19:17:47 +00:00
Wayne Davison
30e7b0b28d Mention latest fix. 2005-06-12 06:10:14 +00:00
Wayne Davison
910ee8c92e In clean_flist(), fixed the setting of the flist->high value for an
empty list so that it can't cause a crash if it gets passed to
flist_find().
2005-06-12 06:07:23 +00:00
Wayne Davison
8af1bc9011 - Added a comment to the filter_outfile function.
- Twiddled where the calls to filter_outfile happen.
2005-06-10 23:36:57 +00:00
Wayne Davison
6a12f0d619 Simplified the regular expressions for sed due to problems on some
OSes.
2005-06-10 21:56:52 +00:00
Wayne Davison
4f3be36e30 - Put the output we're expecting into an rsync.chk file, for easier
debugging on failures.
- Added the function filter_outfile() and used it in place of the
  various output-filtering commands.
- Use the sed rules for filtering the combination of --itemized
  output with double-verbose output so that we're sure there's no
  superfluous lines being output (which the old grep filtering
  would have ignored).
2005-06-10 20:33:57 +00:00
Wayne Davison
fc9d64c947 Several expansions of $srcdir were not double-quoted. 2005-06-10 20:04:42 +00:00
Wayne Davison
db10766ab2 One expansion of $srcdir wasn't double-quoted. 2005-06-10 20:04:11 +00:00
Wayne Davison
a3dcb79085 One more instance of the umask kluge was needed. 2005-06-10 18:02:14 +00:00
Wayne Davison
20667b6d7f Mention backup change. 2005-06-10 17:58:39 +00:00
Wayne Davison
93e28fbd99 Fixed a problem in the backing up of symlinks and devices: we
need to remove any old symlink/device/file to create the backup.
Also fixed a couple minor logic errors in the handling of symlinks
and devices.  NOTE:  the code still doesn't handle the changing of
a name from a dir to a non-dir or visa versa (which is a very old
deficiency in the code).
2005-06-10 17:57:18 +00:00
Wayne Davison
87a57a3072 Use umask kluge from rsync.fns to try to get rid of a potential
permissions difference when copying symlinks.
2005-06-10 17:51:33 +00:00
Wayne Davison
bad1fa4476 Make the sed commands compatible with Solaris (hopefully). 2005-06-10 17:21:52 +00:00
Wayne Davison
8fe27e7631 Starting NEWS for 2.6.6. 2005-06-10 17:17:38 +00:00
Wayne Davison
a1c75ed05c Aged news from NEWS file. 2005-06-10 17:17:24 +00:00
Wayne Davison
e73ad2be54 Got rid of some potentially unhandled permissions differences. 2005-06-10 17:06:43 +00:00
Wayne Davison
59b0e7a82d Changed the "max verbosity" setting from global to per-module. 2005-06-10 16:57:43 +00:00
Wayne Davison
b4fc3987f2 Use the new NOBODY_USER and NOBODY_GROUP configure defines. 2005-06-10 16:50:09 +00:00
Wayne Davison
58418cb0c4 Added a simple check to see if the /etc/group file has the
group "nobody" or "nogroup".
2005-06-10 16:46:50 +00:00
Wayne Davison
5794112ad0 Test that our outputting of itemized messages (as well as
double-verbose output) is happening correctly.
2005-06-09 22:27:59 +00:00
Wayne Davison
f2b6fe44a6 - Fixed the overzealous outputting of unchanged hard-linked items
when verbose > 1.
- An unchanged hard-link with -i (log-format w/%i) now changes the
  trailing dots to spaces.
2005-06-09 22:27:22 +00:00
Wayne Davison
215b444cae Don't set ITEM_REPORT_TIME when a hard-linked file is already
linked up as it should be and --times was not enabled.
2005-06-09 21:57:45 +00:00
Wayne Davison
a45f581b2a - Never output the '"FOO" is a hard link' message when -i (%i)
output is enabled.
- Go back to outputting '"FOO" is a hard link' message when -i (%i)
  is not enabled and verbose > 1.
2005-06-09 21:56:11 +00:00
Wayne Davison
dfdd71ecff Updated version to 2.6.6cvs. 2005-06-09 21:18:26 +00:00
Wayne Davison
2dfe1c37ad Preparing for release of 2.6.5 2005-06-02 03:57:58 +00:00
Wayne Davison
b9949780f4 Improved a few of the items. 2005-06-02 03:54:00 +00:00
Wayne Davison
5fe857d4be One more configure item. 2005-06-01 16:21:41 +00:00
Wayne Davison
3d86c6b18f Mention HAVE_REMSH fix. 2005-05-31 06:09:42 +00:00
Wayne Davison
0f0b2e66b8 Simplified the last change a bit. 2005-05-27 18:15:18 +00:00
Wayne Davison
5d24ee71ad Test for various past problems with --relative. 2005-05-27 18:09:34 +00:00
Wayne Davison
3a05c5d3ce If we unduplicate '.', make sure we also copy FLAG_DEL_HERE (in
addition to FLAG_TOP_DIR), so that the unduplication of a real
dir and an implied dir (implied by --relative) works right.
2005-05-27 18:04:04 +00:00
Wayne Davison
89ec535af5 - Only define HAVE_REMSH if it is going to have a non-0 value.
- Got rid of ssh warning that was added for 2.6.0.
2005-05-27 16:41:19 +00:00
Wayne Davison
e96d7972c4 Improved the opening comment. 2005-05-26 18:00:09 +00:00
Wayne Davison
962a3f0b6e Mention the latest bug-fix. 2005-05-25 15:52:03 +00:00
Wayne Davison
cbb5fa4f07 Handle nested "." dirs (caused by --relative and a trailing slash or
a trailing "/.") in f_name_cmp() when dirname is not an identical
pointer.
2005-05-25 01:24:01 +00:00
Wayne Davison
b57907efb2 Mention the output change for a mount-dir when -x is used. 2005-05-22 20:53:18 +00:00
Wayne Davison
26beb7861f - Don't stop deleting in a dir if one item fails.
- Don't skip deleting in a dir if the initial rmdir fails
  (2.6.4 only continued if it was a non-empty error).
2005-05-22 20:52:32 +00:00
Wayne Davison
6e8b9f1341 Must check FLAG_MOUNT_POINT in delete_in_dir() to avoid starting a
descent into a mounted directory when -x is specified.
2005-05-22 17:19:16 +00:00
Wayne Davison
6efe94167f Improved the SYMBOLIC LINKS section, as suggested by John. 2005-05-20 17:57:31 +00:00
Wayne Davison
51cc96e469 Improved a --files-from example (as suggested by Paul). 2005-05-20 17:39:10 +00:00
Wayne Davison
bdedced84b Tweaked a sentence. 2005-05-19 22:16:50 +00:00
Wayne Davison
f497ad722d Preparing for release of 2.6.5pre2 2005-05-19 21:45:41 +00:00
Wayne Davison
339eb8943e Tweaked the opening comments. 2005-05-19 21:42:20 +00:00
Wayne Davison
c36864e40e Mentioned the improved keep-alive code. 2005-05-19 21:38:25 +00:00
Wayne Davison
af6155bb0e Clarifications related to --dirs. 2005-05-19 21:36:30 +00:00
Wayne Davison
605fed4b46 Periodically call maybe_send_keepalive() when timeouts are in effect
(this ensures that the receiver doesn't timeout when we're still
doing work reading data from the generator).
2005-05-19 08:52:24 +00:00
Wayne Davison
ac40b74788 The global allowed_lull is now already set, so just set lull_mod. 2005-05-19 08:52:22 +00:00
Wayne Davison
3e6ddb3738 - Call the new set_io_timeout() function to set the timeout value.
- If the user specified a shorter timeout than the config-file,
  don't override the shorter value.
2005-05-19 08:52:19 +00:00
Wayne Davison
9ac756c6ea - The variable allowed_lull is now our global.
- Tweaked the --timeout option handling to call set_io_timeout().
2005-05-19 08:52:17 +00:00
Wayne Davison
3b0a30eba8 - Added set_io_timeout(), which sets all the timeout-dependent
variables when the timeout value changes.
- Split last_io into last_io_in and last_io_out.
- Made select_timeout static.
2005-05-19 08:52:13 +00:00
Wayne Davison
bac7259081 The latest bug-fix. 2005-05-19 00:02:29 +00:00
Wayne Davison
4d474ad513 One place that was testing errno for ENOTEMPTY was failing to
also test for EEXIST (which is returned by some OSes).
2005-05-19 00:00:28 +00:00
Wayne Davison
e50e82ab40 Fixed a typo. 2005-05-18 23:59:12 +00:00
Wayne Davison
4922175589 Two more items. 2005-05-17 15:08:05 +00:00
Wayne Davison
a289f89fbe Treat a trailing ".." dir-name as if "../" had been specified so
that we don't use the name in the destination path and save files
into a higher destination directory.
2005-05-14 18:44:57 +00:00
Wayne Davison
ba64001df8 Mention the latest bug fix. 2005-05-13 23:03:00 +00:00
Wayne Davison
b225b089b8 Have do_delete_pass() immediately return if list_only is set. 2005-05-13 23:00:20 +00:00
Wayne Davison
557a35f55b If adding a trailing dot to a directory name overflows
MAXPATHLEN, die with an overflow error.
2005-05-13 22:02:24 +00:00
Wayne Davison
1848fd6fa1 An example filter script to maintain .cvsinclude files. 2005-05-13 18:37:11 +00:00
Wayne Davison
f2a4853c93 Improved the use of the "remaining" var in readfd_unbuffered() to
make certain that the static value is always set correctly anytime
we call out to another function.
2005-05-12 17:36:29 +00:00
Wayne Davison
e65154085c Got rid of some code from writefd_unbuffered() that was only needed
back when the generator had a writeable pipe to the receiver.
2005-05-12 07:45:21 +00:00
Wayne Davison
e4676bb59b Make the --stats output come out after any delete-after messages. 2005-05-12 07:43:14 +00:00
Wayne Davison
3b968014c9 Improved a few sentences. 2005-05-12 07:34:45 +00:00
Wayne Davison
21b9b93377 Fixed a typo. 2005-05-10 18:31:46 +00:00
Wayne Davison
c4d1b2983d Preparing for release of 2.6.5pre1 2005-05-10 17:28:34 +00:00
Wayne Davison
7d7a34aeb2 Added more missing NEWS items. 2005-05-10 17:27:39 +00:00
Wayne Davison
65c84700fc Mention two more changes. 2005-05-10 16:55:22 +00:00
Wayne Davison
5a727522f0 Refer to the rsync daemon as a "daemon", not a "server". This is
to avoid confusion with the server that rsync runs in a normal
remote-shell transfer.
2005-05-10 16:14:26 +00:00
Wayne Davison
1599754727 - Improved the GENERAL section.
- Improved the description of --list-only.
- Added a VERSION section, like the rsyncd.conf manpage.
2005-05-10 16:04:02 +00:00
Wayne Davison
d90338cec6 Refer to the rsync daemon as a "daemon", not a "server". This is
to avoid confusion with the server that rsync runs in a normal
remote-shell transfer.
2005-05-10 16:00:24 +00:00
Wayne Davison
d0e94abb40 Fixed one synopsis line to make the DEST arg optional. 2005-05-09 15:39:24 +00:00
Wayne Davison
d8c4d6de10 Use new MAX_SERVER_ARGS define instead of hard-wired "100". 2005-05-03 17:04:26 +00:00
Wayne Davison
74ba98a51b There was no reason to have MAX_BASIS_DIRS factored into the
length of the argstr[] array.
2005-05-03 17:01:59 +00:00
Wayne Davison
c296031d9f Added MAX_SERVER_ARGS. 2005-05-03 17:00:47 +00:00
Wayne Davison
81c453b16a A few minor doc tweaks. 2005-05-03 16:47:03 +00:00
Wayne Davison
4a34c6f176 - Moved the --version option in the help text.
- Tweaked the --log-format option's description.
- Added a comment.
2005-05-03 16:46:49 +00:00
Wayne Davison
9b3150bd2e Mention the change in error message and exit status when we pull an
empty file list.
2005-05-03 16:45:40 +00:00
Wayne Davison
6f2245c8fa Tweaked the checking of the "limit" in safe_fname(). 2005-05-03 16:44:47 +00:00
Wayne Davison
0f9941dc5a Fixed a typo. 2005-05-03 16:03:31 +00:00
Wayne Davison
060f31500b - Improved the comments on the backslash-escaped output, and moved it
to the top in an "OUTPUT CHANGES" section.
- Added a mention of the generator's new output-flushing optimization.
2005-05-03 15:59:24 +00:00
Wayne Davison
7c2a83c635 Improved a sentence. 2005-05-03 15:58:06 +00:00
Wayne Davison
97e3c50cd9 Mention the '?'-in-filenames change. 2005-05-02 18:04:32 +00:00
Wayne Davison
b2360dabf6 Fixed some misspellings. 2005-05-02 17:27:20 +00:00
Wayne Davison
723160280f Tweaked the description of --from0. 2005-05-02 17:23:08 +00:00
Wayne Davison
fa92818af3 Tweaked the doc for --from0. 2005-05-02 17:22:42 +00:00
Wayne Davison
289a32167c Moved the max-size checking code down so that it only checks
regular files.
2005-04-28 16:26:23 +00:00
Wayne Davison
95e107db96 Moved the size-parsing code for --max-size into its own function. 2005-04-28 16:11:32 +00:00
Wayne Davison
513fd04d21 Set ignore_timeout before starting the transfer, regardless of
what protocol level is in effect.  This guards against the
generator timing out when the output pipe is full and the input
pipe (to the receiver) is slow.
2005-04-27 22:58:06 +00:00
Wayne Davison
7a16e12207 If the user specified --relative and a source dir with a trailing
slash, make sure we strip of the trailing "/." from the dir's len
(in del_hier_name_len) so that its subdirs get marked with
FLAG_DEL_HERE.
2005-04-27 22:56:47 +00:00
Wayne Davison
de8252f67f Added a new test to check how we interact with --link-dest and
--copy-dest.
2005-04-26 16:25:01 +00:00
Wayne Davison
98e4741463 A slightly better fix than the last one (though it won't make any
difference in how the code behaves due to how it is called).
2005-04-26 16:09:03 +00:00
Wayne Davison
028245a57b Mention newest fix. 2005-04-26 15:25:43 +00:00
Wayne Davison
2765f2e4a7 Fixed problem with -C when we're the sender, the remote is using an
older protocol, and we're not sending the exclude list (i.e. the
user didn't specify --delete or they specified --delete-ignored).
2005-04-26 15:24:40 +00:00
Wayne Davison
79db59d1a7 Try to make rsync's behavior w/o "--perms" a little clearer. 2005-04-25 19:30:29 +00:00
Wayne Davison
c48cff9fbe Fixed two typos. 2005-04-25 19:23:43 +00:00
Wayne Davison
f4b8e829e9 Mention fix for --one-file-system. 2005-04-24 22:35:03 +00:00
Wayne Davison
468d766819 Simplified the last change a little using a fix derived from
Mike Castle's suggestion.
2005-04-24 22:34:20 +00:00
Wayne Davison
f3ab64d3a8 When deleting files, we need to take any local FLAG_MOUNT_POINT
flag-bit and put it into the regular flist's flags for that dir,
and delete_in_dir() now refuses to delete a directory that has
that bit set.
2005-04-24 22:11:26 +00:00
Wayne Davison
a234bca4ef Reject any --remove-* options when read-only, just in case there
are new ones added in the future.
2005-04-24 16:19:16 +00:00
Wayne Davison
42e9c7eb56 Mention the latest fixes. 2005-04-24 00:34:39 +00:00
Wayne Davison
9d19f8a5fe When rsync encountered an empty file list, it behaved differently
when pulling files than when pushing files:  pulling it output a
(mostly) unhelpful error message and then exited with a 0 status,
even when the remote side exited with an error code.  I changed this
to output the normal end summary (when verbose) and to exit with the
status intact (just like when pushing files).
2005-04-23 22:30:08 +00:00
Wayne Davison
24e61cffe3 For those rare individuals without web access, mention how to
send bug reports via email.
2005-04-23 22:17:10 +00:00
Wayne Davison
3556fe5d86 Fixed a problem where a --link-dest hard-link could cause us to
miss out on the hard_link_cluster() call.
2005-04-23 19:46:22 +00:00
Wayne Davison
ee887d98f6 Two more tests:
- Update the hard-linked cluster and copy over the old versions.
- Add a new hard-linked item down in a new subdir to make sure that
  the new file doesn't get handled before the subdir gets created.
2005-04-23 18:20:47 +00:00
Wayne Davison
5c7b1feb4c Added --no-whole-file option to one of the runs. 2005-04-23 18:17:25 +00:00
Wayne Davison
3cd5301f40 - Added a new function, maybe_hard_link(), which now holds the code
(moved from hard_link_cluster()) that checks the inode/dev of an
  existing file and either does nothing (when properly linked), or
  removes the existing file before calling hard_link_one().
- Changed hard_link_check() so that it checks if the master item is
  marked with FINISHED_LINK (in its hlindex int), and if so, it
  finishes the current file by calling maybe_hard_link() (and
  marking it as finished too).  Otherwise it marks the item as
  skipped by setting hlindex to SKIPPED_LINK.
- Fixed the outputting of an error in hard_link_one() so that the
  message is always output when the caller did not request "terse"
  processing.
- Changed hard_link_cluster() so that it marks the master item with
  FINISHED_LINK and then links only the skipped items (marking them
  with FINISHED_LINK too).
2005-04-23 17:48:34 +00:00
Wayne Davison
d8169e6f6b - Call hard_link_check() with its new args.
- Got rid of a duplicate error after the hard_link_one() call.
2005-04-23 17:48:31 +00:00
Wayne Davison
c4833b024e Mention how a module reference doesn't need a trailing slash
to copy its contents.
2005-04-22 17:17:18 +00:00
Wayne Davison
2a5d5a8cc4 If we're outputting a message about the remote file in a
single-file transfer, we need to make sure that the file's
name is the generic-transfer name and not a local name.
2005-04-22 16:45:33 +00:00
Wayne Davison
f7112154e9 Moved "port" and "address" into the global section where they
belong.
2005-04-22 15:19:10 +00:00
Wayne Davison
f83051b2e3 Updated FSF's address and some minor non-license tweaks taken
from the latest GPL file on the web.
2005-04-17 08:25:50 +00:00
Wayne Davison
2e42adb302 Simplified the newly added test so that it should stop sporadically
failing.
2005-04-16 07:34:49 +00:00
Wayne Davison
c09ebb8c04 Call rsync via $RSYNC. 2005-04-15 17:39:35 +00:00
Wayne Davison
042dc7360e Make sure that the $chkdir has the same mtime/etc. as the
$fromdir.
2005-04-15 17:26:27 +00:00
Wayne Davison
7a6e294f7b Added a test that copies a single file with -H specified. 2005-04-15 08:28:02 +00:00
Wayne Davison
97e786c331 - Fixed a potential crash/infinite-loop bug if -H was used
when sending a single file.
- Made a couple variable improvements in link_idev_data().
- Got rid of the non-NULL check of hlink_list in init_hard_links()
  because is enough to just check file->link_u.links these days.
2005-04-15 08:26:58 +00:00
Wayne Davison
8ee6adefe3 Call logfile_close() and logfile_reopen() (tweaked function names). 2005-04-14 16:08:12 +00:00
Wayne Davison
64c37826e4 - Changed log_open() into two functions, logfile_open() and
logfile_reopen().
- Changed log_close() into logfile_close().
- Improved the logic in logit().
2005-04-14 16:08:10 +00:00
Wayne Davison
2e8015e0da Mention that less data is sent over the wire when --only-write-batch
is used and we're pushing files to a remote system.
2005-04-14 01:47:47 +00:00
Wayne Davison
5b6281afcf Got rid of ITEM_DUMMY_BIT. 2005-04-14 01:46:08 +00:00
Wayne Davison
e732fb0c4f - Got rid of the iflag kluge for 2.6.4pre3.
- When we're handling --only-write-batch on the client side, we now
  send all index/header info to the receiver (not just to the batch
  file, like we do with the xfer data) so that the connection cannot
  timeout.
2005-04-14 01:45:47 +00:00
Wayne Davison
b10917a426 Support the reception of a file-transfer header without xfer data
when we're on the server side and --only-write-batch was specified.
2005-04-14 01:42:13 +00:00
Wayne Davison
7ae64260e0 Mention how the daemon handles a failure to open a user-specified
"log file".
2005-04-12 23:09:35 +00:00
Wayne Davison
f97f6bcd3a Mention how we now handle a log-file that the daemon can't open. 2005-04-12 23:06:45 +00:00
Wayne Davison
e86d98cbaa Got rid of RERR_LOG_FAILURE. 2005-04-12 23:04:10 +00:00
Wayne Davison
6afb90778b If we can't open the daemon's log file, fall-back to using
syslog (rather than trying to output an error on stderr,
which would usually be lost, and then exiting).
2005-04-12 23:03:49 +00:00
Wayne Davison
32c7f91a14 A couple improvements for the --only-write-batch section. 2005-04-12 03:55:56 +00:00
Wayne Davison
b28a27e9e9 Mention the latest bug-fix. 2005-04-10 20:08:00 +00:00
Wayne Davison
15164c0aa9 Paul's patch to improve the "not creating new ..." message
for directories.
2005-04-10 19:44:16 +00:00
Wayne Davison
bf011fedfc Made the code a little cleaner by having gen_challenge() return
the challenge string base64-encoded (instead of forcing the caller
to handle this).  Also improved a couple comments.
2005-04-10 17:09:10 +00:00
Wayne Davison
d7d11b7ebd Mention fix for SUPPORT{,_HARD}_LINKS defines. 2005-04-10 07:17:47 +00:00
Wayne Davison
9a929c8f68 - Don't define HAVE_READLINK unless HAVE_READLINK is defined.
- Don't define SUPPORT_HARD_LINKS unless HAVE_LINK is defined.
2005-04-10 06:24:14 +00:00
Wayne Davison
298d8c0a9b Mention the new --only-write-batch=FILE option. 2005-04-09 18:59:59 +00:00
Wayne Davison
a054570942 - Use the new do_xfers variable in place of some dry_run checks
(with appropriate negation).
- If write_batch is < 0, we write out the file-transfer data to
  just the batch file, not the socket.
2005-04-09 18:59:57 +00:00
Wayne Davison
a0009fc30d - Use the new do_xfers variable in place of some dry_run checks
(with appropriate negation).
- If we get a transfer when write_batch is < 0, discard it.
2005-04-09 18:59:55 +00:00
Wayne Davison
beb51aa09e Use the new do_xfers variable in place of some dry_run checks
(with appropriate negation).
2005-04-09 18:59:52 +00:00
Wayne Davison
e8a96e275e - Only do read-/write-batch processing if we're not the server (needed
now that write_batch is no longer forced to 0 for the server).
- If write_batch is < 0, force "dry_run = 1" (but only after we've
  finished any appropriate write-batch file creation).
2005-04-09 18:59:49 +00:00
Wayne Davison
11e758a430 - Added do_xfers variable.
- Handle the new --only-write-batch=FILE option.
2005-04-09 18:59:47 +00:00
Wayne Davison
d630f53e0d Also change --only-write-batch to --read-batch (in addition to
changing --write-batch).
2005-04-09 18:59:44 +00:00
Wayne Davison
5918daf8a4 We no longer force write_batch to 0 for the server. 2005-04-09 18:59:42 +00:00
Wayne Davison
326bb56e40 Document the new --only-write-batch=FILE option. 2005-04-09 18:59:40 +00:00
Wayne Davison
f96154f44c Mention the latest changes. 2005-04-09 18:15:22 +00:00
Wayne Davison
45c5b903eb - Call auth_server() with its new "host" arg.
- Don't log an auth-failed error -- auth_server() now handles that.
2005-04-09 18:11:25 +00:00
Wayne Davison
5037cf3adf - Use the MD4_SUM_LENGTH define in place of some hard-wired values.
- Pass the hostname in to auth_server().
- Generate a unique error for each failure type in auth_server() so
  that the log-file contains why the authorization failed.
- Don't use sscanf() to parse the client's auth-challenge response.
2005-04-09 18:11:23 +00:00
Wayne Davison
180443af42 The "@ERROR" handler in start_inband_exchange() was not returning
the right value.
2005-04-09 16:49:51 +00:00
Wayne Davison
4f3f97fbde Fixed one typo and improved another sentence. 2005-04-08 01:40:57 +00:00
Wayne Davison
664cf3278a Make sure that "- !" or "+ !" aren't interpreted as a list-clearing
token.
2005-04-07 18:06:06 +00:00
Wayne Davison
cd36049cd1 Combine one of the backup tests with --delete-after. 2005-04-07 09:09:17 +00:00
Wayne Davison
c2523a0541 Don't call maybe_flush_socket() quite so often. 2005-04-07 08:32:32 +00:00
Wayne Davison
92739a0aa7 Mention the latest changes. 2005-04-07 08:28:06 +00:00
Wayne Davison
cd908ef4ff Fix a bug with --delete-after combined with --backup. 2005-04-07 08:13:44 +00:00
Wayne Davison
ebd33e0cea Use the new HAVE_LSEEK64 define. 2005-04-06 02:08:21 +00:00
Wayne Davison
5f2c5bf110 Added skipping of mkstemp() on HP-UX. 2005-04-06 02:07:21 +00:00
Wayne Davison
417099fa20 Periodically call maybe_flush_socket(). 2005-04-05 20:08:51 +00:00
Wayne Davison
626bec8e84 - Added maybe_flush_socket() for use by the generator.
- Always maintain the last_io value for the generator.
2005-04-05 20:07:42 +00:00
Wayne Davison
a06e2b7cab When doing a delete pass with do_progress output, get rid of the
temporary output (it used to always be covered up by output in
older versions, but it might be followed by a newline in newer
versions).
2005-04-05 19:51:13 +00:00
Wayne Davison
3ae5367ff2 Document the use of --address in client mode. 2005-04-05 06:00:17 +00:00
Wayne Davison
b4ef0bca47 Allows --address to be used in client mode. 2005-04-05 05:59:49 +00:00
Wayne Davison
4313d6f9c0 Changed the bind_address local variables to be named bind_addr
in order to avoid confusion with the bind_address global.
2005-04-05 05:52:49 +00:00
Wayne Davison
2a0dd9bd70 Make sure that the line buffer in readfd_unbuffered() is large
enough to handle long-filename messages on a system that has a
really short MAXPATHLEN value.  Also, make it large enough to
be able to comment on a MAXPATHLEN filename.
2005-04-04 17:27:56 +00:00
Wayne Davison
3eeac9bc7e In writefd_unbuffered(), make sure that we don't look at the r_fds
variable when we're ignoring msg_fd_in.
2005-04-04 00:48:39 +00:00
Wayne Davison
67de72bd9b Mention fix for --compare-dest. 2005-04-01 18:18:17 +00:00
Wayne Davison
552a218468 Make a local-copy caused by a not-quite-up-to-date --compare-dest
or --link-dest file be output as a 'c' (local change) when itemizing
or as transfered file when not itemizing.
2005-04-01 18:12:22 +00:00
Wayne Davison
d940151496 - Conditionally include <locale.h>.
- Conditionally call setlocale(LC_CTYPE, "").
2005-04-01 17:25:37 +00:00
Wayne Davison
f5c7f4abe7 - Changed version to 2.6.5cvs.
- Look for setlocale(), locale.h, and honor --disable-locale.
2005-04-01 17:25:34 +00:00
Wayne Davison
3ae6c1875d Starting the 2.6.5 news. 2005-04-01 17:25:28 +00:00
Wayne Davison
1ad6a7f611 Moved the 2.6.4 news here. 2005-04-01 17:25:26 +00:00
Wayne Davison
89d26123ff Changed safe_fname() to output \### (octal) to escape non-printable
characters (not ?) and \\ to escape \ itself.
2005-04-01 16:48:54 +00:00
Wayne Davison
46bffd98cb Fix the setting of module_dirlen for a module path of "/".
This fixes a crash in the exclude code when chroot is off.
2005-04-01 00:18:40 +00:00
Wayne Davison
41b84ce012 Don't try to tweak read-only dest-dir permissions in list-only mode. 2005-03-31 23:30:03 +00:00
Wayne Davison
de392f1e5c Preparing for release of 2.6.4 2005-03-31 03:14:34 +00:00
Wayne Davison
0455cd933d - Made the handling of adjacent percents (e.g. "%%b") work like it
did in older versions.
- Added a comment for log_format_has().
2005-03-31 03:01:26 +00:00
Wayne Davison
d9c0051fae In log_formatted(), add the newline to the format string so
that we can call rwrite() instead of rprintf().
2005-03-31 01:09:18 +00:00
Wayne Davison
126e7affb7 Enabled width-sizing for %L. 2005-03-31 00:50:58 +00:00
Wayne Davison
624d6be2a5 Use new log_format_has() function instead of strstr(). 2005-03-31 00:21:15 +00:00
Wayne Davison
16f960feb5 Added log_format_has(). 2005-03-31 00:19:13 +00:00
Wayne Davison
e145d51ba6 Make sure that we can't scan past the end of the format string. 2005-03-30 23:39:00 +00:00
Wayne Davison
dcbae65444 Optimized '%f' a little more. 2005-03-30 20:41:11 +00:00
Wayne Davison
b4bf2b5a7e Allow %i to have a field width. 2005-03-30 20:18:48 +00:00
Wayne Davison
9baed7609c - Allow the infix field width to start with a '-'.
- Apply the field width to all escapes, not just numeric ones.
2005-03-30 19:44:29 +00:00
Wayne Davison
1c2efa1706 Mention the numeric field width now possible in the % escapes. 2005-03-30 19:41:51 +00:00
Wayne Davison
80a24d52d4 Mention that the % escapes can now have a numeric infix. 2005-03-30 19:39:11 +00:00
Wayne Davison
af9f56a09d dropped the "const" from the return value of safe_fname() because
some callers would like to manipulate the string in the buffer.
2005-03-30 19:34:20 +00:00
Wayne Davison
ddd74b67be Allow the escapes in the log-format string to contain a numeric
field width (e.g. %8l %07p).
2005-03-30 18:27:09 +00:00
Wayne Davison
7b558d7f8b Fixed a comment. 2005-03-30 17:31:35 +00:00
Wayne Davison
c87ae64a82 Moved a call to output_summary() up a line. 2005-03-30 16:55:11 +00:00
Wayne Davison
b9f0ca7274 Tweaked a couple sentences. 2005-03-30 16:51:33 +00:00
Wayne Davison
c1759b9fa2 Changed %i to output '>' for a local copy. 2005-03-30 16:35:01 +00:00
Wayne Davison
9c63d83d3d Got rid of a useless extern. 2005-03-30 16:33:41 +00:00
Wayne Davison
1ed91a04fe - Fixed a potential crash if the receiver couldn't open the basis file
and the sender (possibly via a batch) tells us to use basis data.
- Enhanced the batched-update skipping message to indicate what phase
  is being skipped.
2005-03-29 22:05:33 +00:00
Wayne Davison
154cdaaa40 - Warn about missing batched updates the generator wants but the
batch doesn't have.
- Tweaked the "skipping ..." message that is output for already-
  applied batched updates.
2005-03-29 19:49:40 +00:00
Wayne Davison
33c4b445ef Split report() into handle_stats() and output_report() so that (1)
the report happens after all --delete-after activity has ceased when
pulling, and (2) a batch-file created when pushing gets the stats
values written out prior to any end-of-run keep-alive packets.
2005-03-29 11:11:35 +00:00
Wayne Davison
53135fe89a Changed maybe_emit_filelist_progress() and emit_filelist_progress()
to take an integer count instead of a struct file_list so that we
can pass in a file-list-count offset for delete's separate calls
to send_directory().
2005-03-29 10:57:31 +00:00
Wayne Davison
083acd496d Turn off do_progress during the file-update phase so that
--delete-during and --fuzzy don't get any superfluous
" N files..." lines output in the middle of the processing.
2005-03-29 10:41:26 +00:00
Wayne Davison
00348fd793 Preparing for release of 2.6.4pre4 2005-03-29 06:18:24 +00:00
Wayne Davison
ddb6fc696b Improved several items and preparing for final 2.6.4 release. 2005-03-29 06:15:47 +00:00
Wayne Davison
f7e48a5cb8 Add data for 2.6.4. 2005-03-29 06:15:08 +00:00
Wayne Davison
70352269ba If --delay-updates wasn't specified, write out two -1 indexes at
the same time to avoid a useless round-trip delay for an empty
delay-updates phase.
2005-03-29 01:04:20 +00:00
Wayne Davison
0b94147928 Added --protocol and made some batch-file improvements. 2005-03-28 20:54:06 +00:00
Wayne Davison
da9f59264f Added --protocol to --help output. 2005-03-28 20:40:25 +00:00
Wayne Davison
96b7b48efa Some temporary code for 2.6.4pre3 compatibility (which can be
safely removed for the next release).
2005-03-28 17:29:27 +00:00
Wayne Davison
aea4bf2894 Chaging ITEM_UNUSED back to ITEM_DUMMY_BIT for now -- we'll need
to get rid of it later on.
2005-03-28 17:08:47 +00:00
Wayne Davison
855ef72f3f Changed ITEM_DUMMY_BIT to ITEM_UNUSED. 2005-03-27 05:58:40 +00:00
Wayne Davison
98dc857b32 Got rid of temporary code that detected and rejected older 2.6.4
pre-release versions.
2005-03-27 05:58:38 +00:00
Wayne Davison
94af17a6eb Got rid of temporary code that set the ITEM_DUMMY_BIT. 2005-03-27 05:58:36 +00:00
Wayne Davison
00fd35482e --compress is now saved in a batch's option-state flags. 2005-03-27 05:49:24 +00:00
Wayne Davison
cc3e0770bc Decided that the '<' and '>' output in the %i format were
the opposite of what they should be.
2005-03-27 05:32:36 +00:00
Wayne Davison
e7f7064cc5 - Fixed a bug in the saving of the --dirs option's state.
- Added the saving of the --compress option's state.
- Deal with the xfer_dirs var in a better way for pre-29 batches.
2005-03-27 05:02:49 +00:00
Wayne Davison
7b759fe0df Mention that --dry-run no longer conflicts with the batch options. 2005-03-25 16:45:58 +00:00
Wayne Davison
254ee3baab - Don't complain if --dry-run is specified with --read-batch
or --write-batch.
- If --write-batch is combined with --dry-run, just disable
  --write-batch (that avoids trying to create a batch file
  and tells the user what would be transferred).
2005-03-24 16:41:16 +00:00
Wayne Davison
f957e8fdf9 If --dry-run is enabled with --read-batch, we must discard the
transfer data.
2005-03-24 16:38:34 +00:00
Wayne Davison
822012eea9 List /etc instead of /, but only if it exists and is readable. 2005-03-23 16:04:17 +00:00
Wayne Davison
bb21ecac5b Mention when we run fakeroot. 2005-03-18 02:10:34 +00:00
Wayne Davison
648859bda2 If we're not root and the "fakeroot" command is available, use it
to re-run the script while pretending to be root.
2005-03-18 02:07:25 +00:00
Wayne Davison
f328e0f3a8 Set a maximum distance-measure that find_fuzzy() will accept. 2005-03-17 08:59:48 +00:00
Wayne Davison
6012eaa183 Fixed a problem with the stripping of the .bak/.old/.orig suffixes
in find_filename_suffix().
2005-03-17 08:45:36 +00:00
Wayne Davison
da2a6c1f1c Fixed the -r kluge sent for pre-2.6.4 --list-only support. 2005-03-17 00:52:33 +00:00
Wayne Davison
0438f100ae We need to run our post-processing activities after the end of
the receiver's delay-update processing.
2005-03-17 00:41:18 +00:00
Wayne Davison
b95ad9ac55 Mention one other recent change. 2005-03-16 02:50:00 +00:00
Wayne Davison
828a256123 Preparing for release of 2.6.4pre3 2005-03-16 01:12:44 +00:00
Wayne Davison
ebf447ac81 Changed error message for incompatible 2.6.4 pre-release versions. 2005-03-16 01:06:33 +00:00
Wayne Davison
124f349ea1 Document error messages 6 and 25. 2005-03-15 23:23:45 +00:00
Wayne Davison
26718401fb Added the error message for RERR_LOG_FAILURE and used it when
the daemon can't open the log-file.
2005-03-15 23:23:41 +00:00
Wayne Davison
f463e20753 Added RERR_LOG_FAILURE define. 2005-03-15 23:23:39 +00:00
Wayne Davison
1129070514 - Made read_item_attrs() detect and reject a pre1/pre2 rsync (used
by both the sender and the receiver).
- Added an extra phase to the end of the transfer to better handle
  delayed updates that have hard links.
2005-03-15 19:19:44 +00:00
Wayne Davison
ac3f7b81f8 Added an extra phase to the end of the transfer to handle
delayed updates that have hard links.
2005-03-15 19:19:41 +00:00
Wayne Davison
62f9573fb3 - Added an extra phase to the end of the transfer to better handle
delayed updates that have hard links.
- Send the new ITEM_DUMMY_BIT to the sender so that we can figure
  out if the other side is pre1 or pre2 and let the receiver reject
  it.
2005-03-15 19:19:38 +00:00
Wayne Davison
6d0e5d2e62 Added ITEM_DUMMY_BIT and moved a few other 'ITEM_*'s around. 2005-03-15 19:19:36 +00:00
Wayne Davison
8b48bf1154 Tweaked the end-of-phase code. 2005-03-15 17:30:56 +00:00
Wayne Davison
42be53201f Handle --delay-updates at the end of the first phase. 2005-03-15 17:30:52 +00:00
Wayne Davison
c7791b8cb2 Mention the index number for an "invalid packet at end of run". 2005-03-15 17:30:50 +00:00
Wayne Davison
7e9059d60f Fixed a just-introduced crash bug in the --fuzzy processing. 2005-03-14 22:22:42 +00:00
Wayne Davison
f3ebe1a77e A simple test to ensure that fuzzy processing is working. 2005-03-14 22:17:25 +00:00
Wayne Davison
301fb56ce9 Split the conditional-directory sending out of send_file_name() into
a new function: send_if_directory().  This lets the code that is
recursively descending through the directories make its list of a
dir's contents and close the DIR handle before recursing into the
subdirs.  Also, the "recurse" var is just true/false once again.
2005-03-14 17:30:15 +00:00
Wayne Davison
aa7a6e878b The "recurse" value is back to being just 1 or 0 (true or false). 2005-03-14 17:30:13 +00:00
Wayne Davison
0a39837a62 Got rid of "fudged_recurse". 2005-03-14 17:30:10 +00:00
Wayne Davison
b2e8a9b293 Got rid of an unused extern. 2005-03-14 17:06:08 +00:00
Wayne Davison
a98ad81760 Got rid of some code in f_name_cmp() that tried to make all the
dirname pointers to equivalent strings have identical pointers.
2005-03-14 03:36:56 +00:00
Wayne Davison
ccc51c8331 The --fuzzy code now handles a file->dirname that has an identical
string as another file without being an identical pointer.
2005-03-14 03:35:40 +00:00
Wayne Davison
ee171c6da9 Document the latest %i output. 2005-03-13 05:36:13 +00:00
Wayne Davison
d5609e969d Output a '*' at the start of the %i string when deleting. 2005-03-13 05:35:49 +00:00
Wayne Davison
927c806841 - Improved a couple error messages.
- Improved a function name.
2005-03-13 05:34:00 +00:00
Wayne Davison
2da9dda1c0 Some misc. improvements (I hope). 2005-03-12 23:54:05 +00:00
Wayne Davison
3117bc16a5 Improved two sentences. 2005-03-12 23:52:18 +00:00
Wayne Davison
717b04306a Tweaked the name of a variable. 2005-03-12 23:52:08 +00:00
Wayne Davison
271220c542 Mention --copy-dest. 2005-03-11 19:23:09 +00:00
Wayne Davison
566a874141 Re-enabled the --copy-dest part of the test. 2005-03-11 17:36:05 +00:00
Wayne Davison
967866d4df Added --copy-dest logic, and improved the updating of --compare-dest
and --link-dest files that are up-to-date but have differing attributes.
2005-03-11 17:36:03 +00:00
Wayne Davison
1de3e99bc5 Added --copy-dest logic. 2005-03-11 17:35:59 +00:00
Wayne Davison
3e13004b6b Tweaked the comment on copy_file(). 2005-03-11 17:35:57 +00:00
Wayne Davison
2f03ce67d6 Document --copy-dest. 2005-03-11 17:35:54 +00:00
Wayne Davison
b9232d45eb - Fixed the reading of the fuzzy xname from the socket.
- Call read_item_attrs() with its new arg.
2005-03-10 00:06:01 +00:00
Wayne Davison
6087ef2a84 - Changed read_item_attrs() to return the length of the xname string.
- Tweaked the order of the args to write_item_attrs().
2005-03-10 00:05:58 +00:00
Wayne Davison
1f1d368ad5 - Improved the error-checking for some delete_item() calls.
- Move the non-regular-file delete-check above the alt-basis check
  where it belongs.
- Keep track of the real statret and real stat-struct for certain
  alt-basis scenarios (e.g. partial-dir and fuzzy) so that we send
  the right itemized change flags.
2005-03-09 23:46:28 +00:00
Wayne Davison
dd18526e5b Mention the latest protocol-29 changes. 2005-03-09 18:55:09 +00:00
Wayne Davison
4d53c4dd46 We now handle the reading and writing of extra basis-file info: the
fnamecmp_type byte, and the extra name (currently used for fuzzy
processing and hard-link status).
2005-03-09 18:54:19 +00:00
Wayne Davison
9e4a8d29b5 Got rid of the name-pipe, so we now read the fnamecmp_type data over
the socket for protocol >= 29, or handle it like the old days for
older protocol versions.  This means that we now validate this extra
data for safety (such as the fuzzy filename).
2005-03-09 18:54:16 +00:00
Wayne Davison
ef20efcbb6 Made itemize() output the fnamecmp_type and the fuzzy name based on
the new ITEM_BASIS_TYPE_FOLLOWS and ITEM_XNAME_FOLLOWS flags.  Got
rid of the name-pipe to the receiver.
2005-03-09 18:54:12 +00:00
Wayne Davison
c70e07d9ac Got rid of the name-pipe from the generator to the receiver. 2005-03-09 18:54:09 +00:00
Wayne Davison
b7d4d28bb3 When itemizing, we now set ITEM_LOCAL_CHANGE and ITEM_XNAME_FOLLOWS. 2005-03-09 18:54:06 +00:00
Wayne Davison
9a6ed83f2c - Made an overflow in read_vstring() return an error instead of dying.
- Got rid of a flush kluge that was needed for the name-pipe.
2005-03-09 18:54:02 +00:00
Wayne Davison
fd84673e54 Handle the new way that 'c' and 'h' get output by "%i". 2005-03-09 18:53:58 +00:00
Wayne Davison
57b12568e6 Complain if a feature that requires protocol 29 doesn't get it. 2005-03-09 18:53:55 +00:00
Wayne Davison
f9a9f54720 Made the dest_option string non-static. 2005-03-09 18:53:53 +00:00
Wayne Davison
3019a9bafd Changed some of the ITEM_* defines. 2005-03-09 18:53:49 +00:00
Wayne Davison
278e3d4f6e Mention the latest bug-fix. 2005-03-09 04:00:45 +00:00
Wayne Davison
9b9dd06894 We need to mention any change to a directory, not just a time change.
Yeah, this isn't very consistent with how files are treated, but it's
backward compatible.
2005-03-09 04:00:20 +00:00
Wayne Davison
1f7e29b99c Fixed the change-report output for a directory that has no
write permissions.
2005-03-09 03:49:07 +00:00
Wayne Davison
c2f0e6e5e3 Backward compatibility fix in read_iflags() (for protocols < 29). 2005-03-09 02:25:34 +00:00
Wayne Davison
c2b11ba017 Backed out the hack that reversed ITEM_REPORT_XATTRS with
ITEM_TRANSFER.  Yes, it allowed some kludge code that made backward
compatibility seamless, but it made it impossible to remove the hack
in the future.  This way, the backward compatibility is just
slightly inaccurate in the display of the first letter in the %i
output, and the only hack can be safely removed without causing
problems.
2005-03-06 23:37:42 +00:00
Wayne Davison
f75a53e71b - When --max-delete is exceeded, we now count how many deletions
would have happend, warn about the number skipped, and set
  io_error to IOERR_DEL_LIMIT.
- When dry_run > 1 (which indicates that the destinationdir is
  missing), skip deletions in that dir.  This fixes a bug in a
  copy that is creating the destination dir w/--delete enabled.
2005-03-05 18:58:42 +00:00
Wayne Davison
054abde25f Handle new IOERR_DEL_LIMIT bit in io_error. 2005-03-05 18:58:38 +00:00
Wayne Davison
24cecf1365 Define the message for RERR_DEL_LIMIT. 2005-03-05 18:58:35 +00:00
Wayne Davison
821ff7f49a Added RERR_DEL_LIMIT. 2005-03-05 18:58:32 +00:00
Wayne Davison
ff3d3c32d5 Added IOERR_DEL_LIMIT. 2005-03-05 18:58:29 +00:00
Wayne Davison
3b2ef5b11c Mention that --max-delete must be non-zero. 2005-03-05 18:58:26 +00:00
Wayne Davison
0394e34a69 Moved the end_progress() call from match.c to sender.c so that we
report progress on 0-length files when pushing files (the receiver
already called it, so we already produced progress on a 0-length
file when pulling).
2005-03-05 17:51:23 +00:00
Wayne Davison
56efa56474 Fixed the elapsed time reported for 0-length files. 2005-03-05 17:49:46 +00:00
Wayne Davison
ed7e79553e Don't try to determine the phase we're in by looking at the value
of csum_length -- it might have been computed to be SUM_LENGTH.
Instead, look at the "phase" variable directly.
2005-03-05 16:42:52 +00:00
Wayne Davison
dec71e94f3 Added a hack that uses the ITEM_REPORT_XATTRS bit (which is the old
ITEM_UPDATING bit) to make us compatible when sending/receiving bits
to/from an earlier pre-release.
2005-03-05 04:34:06 +00:00
Wayne Davison
ac4f91a5ee Added a hack that sets the ITEM_REPORT_XATTRS bit (which is the old
ITEM_UPDATING bit) when ITEM_TRANSFER or ITEM_LOCAL_CHANGE is set.
This lets us interact compatibly when sending itemized bits to an
earlier pre-release.
2005-03-05 04:34:04 +00:00
Wayne Davison
e957626347 Swapped the bit-values for ITEM_TRANSFER and ITEM_REPORT_XATTRS.
This lets us be more compatible with the earlier pre-releases
with a better heuristic for backward-compatible itemized bits.
2005-03-05 04:34:01 +00:00
Wayne Davison
b4875de45c Improved the description of when "h" is output by %i. 2005-03-05 00:34:02 +00:00
Wayne Davison
2cfe44eee4 Turned on -i for itemized output. 2005-03-05 00:23:55 +00:00
Wayne Davison
fad3dc421c - Updated to handle the new ITEM_* flags.
- Changed read_iflags() to read/write a suffixed hard-link name.
2005-03-05 00:21:59 +00:00
Wayne Davison
22907b6bd9 - Updated to handle the new ITEM_* flags.
- Send MSG_SUCCESS for hard-linked files when -H was specified.
2005-03-05 00:21:56 +00:00
Wayne Davison
3485ae8321 A few minor tweaks to improve two error messages and make better use
of the "the_file_list" global.
2005-03-05 00:21:54 +00:00
Wayne Davison
ca62acc3ca - Make use of the new ITEM_* flags to mention when things were
updated locally instead of being updated remotely.
- Added support for outputting 'a' in the itemized log-output (for
  future use in extended-attribute handling).
2005-03-05 00:21:50 +00:00
Wayne Davison
cdf236aaf5 - Made the sock_{in,out} variables non-static.
- Added hlink_list, a FIFO list of finished hard-link items.
- Made get_redo_num() check for finished hard-link items and
  call the generator when they are found.  This ensures that
  we finish all the hard-link items by the time the MSG_DONE
  is read and returned to the generator.
- Added get_hlink_num() to read the new hlink_list.
2005-03-05 00:21:48 +00:00
Wayne Davison
9f2e3c3f52 - Changed hlink_list[] to store file-list indexes instead of
pointers.
- Made hard_link_one() non-static so that the generator can call it.
  Improved it to do itemized output.
- Replaced do_hard_links() with hard_link_cluster(), which changes
  the hard-linking from a post-transfer loop into a per-cluster
  operation that occurs incrementally as the transfer updates (or
  finds unchanged) one item in the cluster.
2005-03-05 00:21:44 +00:00
Wayne Davison
ee1d11c495 - Updated itemize() to handle sending of hard-link-name info. Made
it non-static so the hard-link code can now output itemized
  messages.
- Made the locally-changed items (such as dirs and symlinks) itemize
  using a new ITEM_LOCAL_CHANGE flag instead of the (renamed)
  ITEM_TRANSFER flag (formerly ITEM_UPDATING).
- Improved the hard-link support by having a cluster of hard-linked
  files get processed as soon as we notice that a single item is
  already up-to-date, or it succssfully finishes being updated.
- The hard-linking that occurs when using --link-dest will now be
  mentioned at higher levels of verbosity IFF %i is in the log-
  format.
2005-03-05 00:21:42 +00:00
Wayne Davison
669e76717c - Changed ITEM_UPDATING to ITEM_TRANSFER.
- Added defines ITEM_HARD_LINKED, ITEM_LOCAL_CHANGE,
  ITEM_REPORT_XATTRS, and SIGNIFICANT_ITEM_FLAGS.
- Changed the "next" var in struct hlink into an int.
2005-03-05 00:21:39 +00:00
Wayne Davison
4e107712f3 Mention latest bug fixes. 2005-03-05 00:20:37 +00:00
Wayne Davison
85aa57a7dd In read_iflags(), we need to set buf to an empty string. 2005-03-04 18:01:16 +00:00
Wayne Davison
58a14ed950 Got rid of some code in the main recv_files() loop by calling the
new functions read_iflags() and maybe_log_item().
2005-03-04 16:54:08 +00:00
Wayne Davison
165e6d446c Moved some code out of the main loop in send_files() into a new
function called read_iflags() (which was made generic enough that
the receiver could use it too).  Also call the new maybe_log_item().
2005-03-04 16:53:26 +00:00
Wayne Davison
1c3e3679ef Added maybe_log_item() for use by the sender and receiver. 2005-03-04 16:52:00 +00:00
Wayne Davison
8a513e55b0 Document the new value of %L. 2005-03-04 16:11:09 +00:00
Wayne Davison
a314f7c155 Document latest format of %i. 2005-03-04 16:08:58 +00:00
Wayne Davison
9497b0d4e9 Call log_item() instead of log_recv(). 2005-03-04 16:08:16 +00:00
Wayne Davison
b694f8a245 Call log_item() instead of log_send(). 2005-03-04 16:08:02 +00:00
Wayne Davison
afc65a5acf - Replaced log_send() and log_recv() with log_item().
- Made log_formatted() and log_item() take an "hlink" arg that
  will be used to pass in a hard-link name for use in %L.
2005-03-04 16:07:50 +00:00
Wayne Davison
5f40615cd5 Use the new "the_file_list" global instead of our "the_flist" local. 2005-03-04 15:57:14 +00:00
Wayne Davison
c6816b9444 Transformed the push/pop functions for the redo-list into more
generic flist_num_{push,pop}() functions that can support other
folks caching off file-list index numbers.
2005-03-04 15:50:22 +00:00
Wayne Davison
46e99b09b9 Added read_vstring() and write_vstring() to io.c instead of
having this code in generator.c and receiver.c.
2005-03-04 15:38:58 +00:00
Wayne Davison
af436313a0 - Got rid of the checking of msg_fd_in in read_timeout() -- it was
only needed back when the generator was reading a separate redo
  pipe from the message pipe.
- Fixed a potential data corruption in the data that the generator
  is sending:  if a message comes in from the receiver, we now make
  sure that we can't put the forwarding of this message to the sender
  into the middle of a multiplexed-write record that the generator
  is trying to flush.
2005-03-04 08:58:27 +00:00
Wayne Davison
d64e6f42b4 Use the new "the_file_list" global. 2005-03-03 18:44:42 +00:00
Wayne Davison
a00628b335 - Set the new global "the_file_list".
- Got rid of test of read_batch in an am_sender section since
  there is never a sender process for --read-batch.
2005-03-03 18:44:06 +00:00
Wayne Davison
33ab4ad879 Simplified whole_file variable checking. 2005-03-03 02:58:48 +00:00
Wayne Davison
99eb41b25f Improved some text in --compare-dest and --link-dest. 2005-03-03 02:23:12 +00:00
Wayne Davison
e86ae6bc1f Don't kluge the value of statret for --whole-file. 2005-03-03 01:50:43 +00:00
Wayne Davison
c3cbcfb8ef Moved the checks for --ignore-existing and --update higher in
recv_generator() so that they don't trigger erroneously when
--link-dest is specified.
2005-03-03 01:33:51 +00:00
Wayne Davison
a1d23b5314 - Got rid of the SID_* flags -- use the ITEM_* flags directly.
- If --compare-dest find a file that is not the same in attributes,
  we need to copy the file.
2005-03-03 00:14:35 +00:00
Wayne Davison
d4d4890d4e Added ITEM_NO_DEST_AND_NO_UPDATE for use by the generator's
itemize() function.
2005-03-03 00:14:32 +00:00
Wayne Davison
30e66e53de Fixed the --compare-dest docs. 2005-03-02 18:01:23 +00:00
Wayne Davison
e224331729 When using multiple --compare-dest options, rsync should avoid
copying a file that has an exact match in any of the dirs.
2005-03-02 17:48:36 +00:00
Wayne Davison
70b54e4e43 Fixed a bug in the --dry-run output when using --link-dest. 2005-03-02 17:27:19 +00:00
Wayne Davison
9ba463435b If the multi-dest loop falls back to the best_match index,
we need to re-stat() the file to restore "st".
2005-03-02 09:51:54 +00:00
Wayne Davison
05ee48661c Tweaked the description for --rsync-path. 2005-03-02 09:17:42 +00:00
Wayne Davison
aef9882581 A little more tweaking to the multi-dest option loop. 2005-03-02 09:09:15 +00:00
Wayne Davison
78bcddcc6a Mention that specifying "/dir/**" is a safer way than "/dir/"
alone to ensure that files inside a dir are fully protected.
2005-03-02 01:48:25 +00:00
Wayne Davison
68e169ab4d Improved the description of --rsync-path. 2005-03-01 23:02:23 +00:00
Wayne Davison
f62eaa24f1 Made the multi-FOO-dest loop a little nicer. 2005-03-01 19:42:31 +00:00
Wayne Davison
d3e553b4bd Explicitly mention that "del." does include the trailing period. 2005-03-01 19:17:27 +00:00
Wayne Davison
3753975f48 Fixed two glitches Paul pointed out. 2005-03-01 17:28:46 +00:00
Wayne Davison
2d81114b23 Preparing for release of 2.6.4pre2 2005-03-01 06:22:19 +00:00
Wayne Davison
472135e0bc Mention the latest changes. 2005-03-01 06:05:23 +00:00
Wayne Davison
c60b7056b2 A few improvements to the new check_for_hostspec() function. 2005-03-01 05:49:11 +00:00
Wayne Davison
42ccb4c091 Made the argv/argc parsing a little nicer. 2005-03-01 03:39:35 +00:00
Wayne Davison
b31c92edcc - Look for last '@' in a user@host spec. 2005-03-01 03:39:32 +00:00
Wayne Davison
08b018304f Removed section on parsing IPv6 literal addresses. 2005-03-01 03:11:28 +00:00
Wayne Davison
d19320fdf6 Changed remote_filesfrom_file to filesfrom_host. 2005-03-01 03:10:59 +00:00
Wayne Davison
860236bf90 - Changes needed to handle new filesfrom_host variable.
- Changes needed to use check_for_hostspec() in place of find_colon().
2005-03-01 01:16:03 +00:00
Wayne Davison
4d3abf1360 Changes needed to use check_for_hostspec() in place of find_colon(). 2005-03-01 01:15:59 +00:00
Wayne Davison
305666bf59 - Changed find_colon() into check_for_hostspec(), extending it to
understand the rsync:://HOST:PORT/PATH format, allowing all HOSTs
  to be IPv6 literal addresses enclosed in '[' and ']', and changing
  it to return the 3 parts of the spec separately (host, port, and
  path).
- Relocated the code that handles the sanitation and validation of
  the files_from arg in order to make its placement a little more
  logical.
- Replaced remote_filesfrom_file with filesfrom_host, which makes
  the value of the files_from variable more intuitive.
2005-03-01 01:15:57 +00:00
Wayne Davison
b03c719f04 Enhanced the option-parsing failure mode to handle the situation
where the parser didn't get a chance to parse the --files-from
option yet, but we still need to know it was there in order to get
the error message back to the client.
2005-03-01 00:42:32 +00:00
Wayne Davison
62f27e3c02 Made a couple sentences about rsync:// syntax clearer. 2005-02-28 22:04:16 +00:00
Wayne Davison
4dc67d5e30 Improved a couple sentences. 2005-02-28 02:16:49 +00:00
Wayne Davison
8ebdc9724e Say "rsync 2.6.4" instead of "protocol 29". 2005-02-28 02:16:23 +00:00
Wayne Davison
9e0582f9bf Tweaked a comment. 2005-02-28 02:04:42 +00:00
Wayne Davison
705de51a73 Improved do_lseek()'s failure message. 2005-02-27 21:12:13 +00:00
Wayne Davison
1a8e5c97eb Complain if the run-terminating keep-alive packets aren't what
we expected.
2005-02-27 20:50:07 +00:00
Wayne Davison
55bb7fff14 Don't loop forever when the receiver is waiting around to be killed
at EOF -- it should be a rapidly arriving event, so only hang around
for 10 seconds, max., and then go ahead and report the "unexpectedly
closed" error.
2005-02-27 18:24:34 +00:00
Wayne Davison
662bdcd4ac Make sure that allowed_lull will not be computed as 0 if
io_timeout is 1.
2005-02-27 18:09:17 +00:00
Wayne Davison
fef101a548 Improved a couple sentences. 2005-02-27 18:01:32 +00:00
Wayne Davison
18a11cfd48 - Made the calls to maybe_send_keepalive() happen at better intervals.
- Call do_hard_links() with its new args.
2005-02-27 09:02:32 +00:00
Wayne Davison
0f80c3e886 Added 2 args to do_hard_links() so that it can call maybe_send_keepalive(). 2005-02-27 09:02:29 +00:00
Wayne Davison
f122383179 Mention the backup fix for redone files with --inplace. 2005-02-27 08:02:06 +00:00
Wayne Davison
e6bc6f4232 We need to turn off make_backups for the redo phase so that
the inplace processing doesn't make a second backup.
2005-02-27 07:50:43 +00:00
Wayne Davison
ac1cb9380d Tweaked an error message. 2005-02-27 07:34:27 +00:00
Wayne Davison
40df65fdb4 - Seems to me that sigusr2_handler() should call close_all() for
the sake of MS Windows.
- Improved some comments.
2005-02-27 07:33:01 +00:00
Wayne Davison
cb2e1f18c2 One more comment fix. 2005-02-26 22:14:40 +00:00
Wayne Davison
0ecd03e396 Fixed comment. 2005-02-26 22:02:38 +00:00
Wayne Davison
e6f5ac116b Improved a couple sentences. 2005-02-26 21:48:12 +00:00
Wayne Davison
051182cb75 Set kluge_around_eof to a -1 for the receiver's needs. 2005-02-26 20:58:08 +00:00
Wayne Davison
574c250093 If kluge_around_eof is < 0, we go into an msleep() loop instead
of exiting.
2005-02-26 20:58:05 +00:00
Wayne Davison
8dad7fc6ea Explicitly set kluge_around_eof to a 1 when it is needed. 2005-02-26 20:58:01 +00:00
Wayne Davison
b558728875 Added keep-alive checking during the directory-touching loop at
the end of the processing.
2005-02-26 20:43:14 +00:00
Wayne Davison
e777afad6f Set kludge_around_eof when the receiver is trying to read a
potential keep-alive message that may never come.
2005-02-26 20:21:12 +00:00
Wayne Davison
87703a1b1f Improved the comment for kludge_around_eof. 2005-02-26 20:21:08 +00:00
Wayne Davison
981b202661 Added "set -x". 2005-02-26 19:49:59 +00:00
Wayne Davison
13725744fd Decided I like "set -x" after all. 2005-02-26 19:47:43 +00:00
Wayne Davison
363c3ece3a Don't allow keep-alive sending if --read-batch is enabled. 2005-02-26 19:37:49 +00:00
Wayne Davison
47780ddfef Mention the new keep-alive handling and the devices-size fix. 2005-02-26 19:17:06 +00:00
Wayne Davison
251f22b5d7 Fixed a line-ordering problem. 2005-02-26 19:11:57 +00:00
Wayne Davison
4e0fcd85ae Handle keep-alive messages at the end of the transfer when
--delete-after is happening.
2005-02-26 18:57:57 +00:00
Wayne Davison
59faec8b8b - Moved all the file-deletion code here from flist.c and receiver.c.
- Call maybe_send_keepalive() from delete_in_dir() so that a really
  long delete-pass won't timeout.
- Renamed delete_files() -> do_delete_pass().
- Renamed delete_file() -> delete_item().
- Call get_dirlist() with its new arg.
2005-02-26 18:03:49 +00:00
Wayne Davison
32cbfe7b17 - Moved file-deletion code into generator.c.
- Made filesystem_dev a global that the generator can set during its
  delete pass.
- Fixed an off-by-one boundary check in send_directory().
- Added an arg to get_dirlist() so that delete_in_dir() can call it
  efficiently.
2005-02-26 18:03:46 +00:00
Wayne Davison
f08ca43472 Moved the delete-after support into generator.c. 2005-02-26 18:03:42 +00:00
Wayne Davison
8eb6cf784b Moved the delete-before support into generator.c. 2005-02-26 18:03:40 +00:00
Wayne Davison
7433d73adc - Moved the initialization of "itemizing", "maybe_PERMS_REPORT", and
"code" from recv_generator() to generate_files() so that they
  don't get recomputed for every file (we pass them as args now).
- Allow protocols < 29 to call maybe_send_keepalive() so that we can
  try to flush the output buffer if things are slow (though we can't
  send a keep-alive packet without protocol_version >= 29).
2005-02-26 06:52:55 +00:00
Wayne Davison
3221f451a0 Calling maybe_send_keepalive() for protocol_version < 29 is
now supported, though we can only try to flush the output
buffer if we're in a lull.
2005-02-26 06:43:15 +00:00
Wayne Davison
9e4536748d - Moved the description of '%i's output into the rsync manpage.
- A few minor tweaks to the "log format" setting.
2005-02-26 05:18:03 +00:00
Wayne Davison
ea67c71505 - We now mention what "%i" outputs under --itemize-changes.
- Improved the description of --log-format.
2005-02-26 05:16:26 +00:00
Wayne Davison
ea38b5af72 Mention the change in when --log-format outputs and how it
interacts with --verbose.
2005-02-26 05:11:46 +00:00
Wayne Davison
89d19eedef Call log_delete() from delete_file() anytime that DEL_TERSE is
not set (we used to only call if verbose or log_format were also
set).
2005-02-26 04:50:55 +00:00
Wayne Davison
41b5b5e756 The log_delete() function may now be called even when the client is
not getting delete messages, which ensures that the daemon's log-
file output includes all deletions when per-file logging is enabled.
2005-02-26 04:49:30 +00:00
Wayne Davison
a3e1363aaa Make sure that our protocol-28 compatibility is OK. 2005-02-26 03:22:05 +00:00
Wayne Davison
2217b30adf Fixed a problem sending include rules to an older rsync. 2005-02-26 02:56:30 +00:00
Wayne Davison
9ac2395bf0 - Call maybe_send_keepalive() if timeouts are enabled.
- Use the new ignore_timeout variable.
2005-02-25 22:01:36 +00:00
Wayne Davison
9e2409ab22 - Added variable "ignore_timeout" that lets the generator tell
us to ignore a timeout without turning off the timeout-related
  time-keeping that the keep-alive processing needs.
- Added a new function:  maybe_send_keepalive().
2005-02-25 21:58:13 +00:00
Wayne Davison
8e6cf5d189 Accept the new keep-alive (no-op) packet. 2005-02-25 21:56:00 +00:00
Wayne Davison
d17190df44 Don't add st_size from a device to stats.total_size. 2005-02-25 20:28:27 +00:00
Wayne Davison
fbe5eeb831 Mention how --backup sometimes implies --omit-dir-times. 2005-02-25 17:10:48 +00:00
Wayne Davison
ed9d969c4c Use the new am_starting_up value in who_am_i(). 2005-02-25 17:08:57 +00:00
Wayne Davison
7f2a1f651e Got rid of kluged value for am_sender, and instead added a new
variable named am_starting_up that is non-zero during the option
parsing.  This lets the who_am_i() routine output a better value
for debugging info that is output during the option parsing.
2005-02-25 17:08:31 +00:00
Wayne Davison
bbbb44ee0f Fixed some typos. 2005-02-25 02:30:38 +00:00
Wayne Davison
29fbd1eea6 Preparing for release of 2.6.4pre1 2005-02-23 03:22:53 +00:00
Wayne Davison
33f839b319 Tweaked an entry. 2005-02-23 03:17:11 +00:00
Wayne Davison
bc83274ad6 - Fixed a problem with full_fname() when curr_dir was "/".
- Made full_fname() consistently output a leading "/" for
  module paths no matter if chroot is in use or not.
2005-02-23 02:56:42 +00:00
Wayne Davison
38e3910b6f One more tweak to the need_name_pipe logic. 2005-02-23 02:14:00 +00:00
Wayne Davison
c26c51a7ee Commenting out link-dest test for now. 2005-02-23 02:13:33 +00:00
Wayne Davison
e9973668a4 Got rid of --copy-dest references. 2005-02-23 02:07:09 +00:00
Wayne Davison
4104c3bf52 Changed --copy-dest to --link-dest. 2005-02-23 02:06:33 +00:00
Wayne Davison
b7c2481933 Got rid of --copy-dest for now -- I think it should be made to do
the copying of unchanged files locally (like --link-dest does
using a hard link).
2005-02-23 02:05:34 +00:00
Wayne Davison
cfb691ac9a Fixed a problem with the last change. 2005-02-22 22:13:04 +00:00
Wayne Davison
cb8240a291 We need the name-pipe for --inplace these days. 2005-02-22 22:13:02 +00:00
Wayne Davison
352963ddc3 Always set the SID_USING_ALT_BASIS appropriately for the transfer,
even if --inplace wasn't specified.
2005-02-22 22:12:59 +00:00
Wayne Davison
8c57732324 More cleanups. 2005-02-22 21:56:32 +00:00
Wayne Davison
8a33c406b3 Trying to fix bug #2357. 2005-02-22 21:48:10 +00:00
Wayne Davison
340bd68f59 We now look for the ITEM_USING_ALT_BASIS flag for an --inplace
transer that is using an alternate basis file (instead of reading
an extra byte after the flag word).
2005-02-22 21:43:59 +00:00
Wayne Davison
8237f9305b We now set the ITEM_USING_ALT_BASIS flag for an --inplace transfer
that is using an alternate basis file (instead of sending an extra
byte after the flag word).
2005-02-22 21:43:57 +00:00
Wayne Davison
5b1c1eefda Added ITEM_USING_ALT_BASIS. 2005-02-22 21:43:54 +00:00
Wayne Davison
6258626751 Document an alternate way to achieve the effect of this script
through the use of awk and the more powerful --filter option.
2005-02-22 21:24:24 +00:00
Wayne Davison
87fd439059 When preforming a recursive delete, push/pop the per-dir merge rules. 2005-02-22 20:42:55 +00:00
Wayne Davison
564ef546a9 Sort the dir-list returned by get_dirlist() and the dir-list that
delete_in_dir() generates.
2005-02-22 03:37:18 +00:00
Wayne Davison
94dcbf8367 - Iterate through the deletion list in reverse order so that we
can't delete a backup file that we just created.
- The rename-directory-for-backup heuristic now checks the
  DEL_FORCE_RECURSE flag, not the zap_dir variable.  We also set
  the flag when we recurse so that only the root dir of a deleted
  hierarchy can be missing the flag (and thus be a call from the
  generator).
2005-02-22 03:16:41 +00:00
Wayne Davison
1bad11c759 Only rename a directory with the backup suffix if we're removing
it to replace it with a file of the same name.
2005-02-22 01:59:15 +00:00
Wayne Davison
ba679d5194 In make_simple_backup(), if the rename() failed because we tried
to rename a directory over a file or visa versa, try to handle it.
2005-02-22 01:57:58 +00:00
Wayne Davison
e1ad7fe63d A couple changes in delete_file() make us more compatible with
older versions: (1) we no longer complain if excluded files
sticking around cause us to not be able to remove a subdir, and
(2) we output the name of the removed subdir after it has been
successfully removed.
2005-02-22 00:42:12 +00:00
Wayne Davison
f18d87b6ed Added function check for vasprintf. 2005-02-21 18:58:09 +00:00
Wayne Davison
a6c15e9a38 - Added function tests for va_copy and __va_copy for snprintf.c code.
- Added AC_C_LONG_DOUBLE for snprintf.c code.
- Got rid of unneeded ino_t check.
2005-02-21 17:08:09 +00:00
Wayne Davison
64bba1465b Check SIZEOF_LONG_LONG instead of HAVE_LONG_LONG. 2005-02-21 17:02:53 +00:00
Wayne Davison
638e106568 - Moved delete_file() into flist.c.
- No need to separately test for (make_backups && !backup_dir)
  because omit_dir_times is now set under those circumstances.
2005-02-21 10:50:32 +00:00
Wayne Davison
34e18ecd61 - Moved delete_file() here from rsync.c and improved it to avoid
removing files we just backed up to the current directory and to
  rename a non-empty dir to dir~ (when no backup-dir is specified).
- Made delete_missing() static.
2005-02-21 10:50:30 +00:00
Wayne Davison
d4021b6d9b - Set omit_dir_times if backing up files w/o a backup dir.
- Only send an explicitly specified -O (--omit-dir-times)
  if it won't be inferred by the receiver.
2005-02-21 10:03:23 +00:00
Wayne Davison
40b1393880 Pass the file-diffing flag as an arg to checkit. 2005-02-21 07:27:28 +00:00
Wayne Davison
30688bf11b If checkit is passed a 4th arg, skip the file-diffing step.
This is used by the devices.test script.
2005-02-21 07:26:59 +00:00
Wayne Davison
a7d7a805dc Touch $tmpdir/do_not_diff_the_files so that checkit does not try
to diff the devices against each other.
2005-02-21 07:19:11 +00:00
Wayne Davison
4a239e98f6 Reposition log_open() and log_close(). 2005-02-21 00:38:15 +00:00
Wayne Davison
7b97c38898 Mention two more things. 2005-02-21 00:32:04 +00:00
Wayne Davison
1f35babc6b - For win32: made --no-detach the default for daemon mode.
- Added --detach (a --daemon option).
2005-02-21 00:31:31 +00:00
Wayne Davison
80ffc3de12 Updated to remove completed items and add a little more info for
other items.
2005-02-21 00:17:10 +00:00
Wayne Davison
507b61d5a6 Some minor tweaks. 2005-02-21 00:16:36 +00:00
Wayne Davison
8db3106e0b Mention the compression-mode fix for large block sizes. 2005-02-20 23:08:56 +00:00
Wayne Davison
1b1fef20b3 Tweaked the rprintf() that outputs about the delta-transmission
enablement.
2005-02-20 22:11:43 +00:00
Wayne Davison
22c7c5fb0b - Integrated the latest version from samba.
- Tweaked the order of the code in my_modf() to avoid
  a compiler warning.
2005-02-20 22:10:33 +00:00
Wayne Davison
13d00101e8 One more tweak to the "whoami" code. 2005-02-20 21:04:03 +00:00
Wayne Davison
3e7934a5fb Changed the memory implementation of --delay-updates so that it
only allocates memory to store needed bits, it sparsely allocates
the bits in 16KB chunks, and the bit-finding loop works in a more
efficient manner.
2005-02-20 20:55:24 +00:00
Wayne Davison
815193e89e Got rid of "set -x" (runtests.sh has a way to set this, if desired). 2005-02-20 17:24:15 +00:00
Wayne Davison
4fd4b3d667 Dropped a useless "const" from the definition of poptStrerror. 2005-02-20 17:21:13 +00:00
Wayne Davison
1526b8b17d Mark a couple unused variables. 2005-02-20 17:20:14 +00:00
Wayne Davison
732537212b Cast char* to uchar* when dereferencing characters for isdigit()
and isprint().
2005-02-20 17:07:31 +00:00
Wayne Davison
4adbb5f246 Have rule_strcmp() accept and return a uchar*. 2005-02-20 17:04:53 +00:00
Wayne Davison
30fa772457 A few improvements to the "test" commands to neaten them up and
to try to fix another problem under solaris.
2005-02-20 17:01:32 +00:00
Wayne Davison
ee03617b3d Cast a uchar* arg to char* for write_buf(). 2005-02-20 16:56:30 +00:00
Wayne Davison
19cb6106d2 Improved the testuser-setting code to try to get it to work
under solaris.
2005-02-20 16:27:10 +00:00
Wayne Davison
cd6bececc1 If --delay-updates is specified with --remove-sent-files, delay
the MSG_SUCCESS messages until we actually move the files into
place at the end.
2005-02-20 02:54:30 +00:00
Wayne Davison
88b93c6159 Corrected "log format" info and added info on --remove-sent-files. 2005-02-20 02:45:10 +00:00
Wayne Davison
b62fd39392 A small twiddle. 2005-02-20 01:14:27 +00:00
Wayne Davison
95306d9d50 - For every file that we send off to the receiver, mark it with
FLAG_SENT.
- Added successful_send(), which is called when MSG_SUCCESS was
  received from the receiver/generator side.  This function
  validates the message, and removes the indicated file/symlink
  (assuming that remove_sent_files was actually set).
2005-02-20 01:04:54 +00:00
Wayne Davison
3e870a6444 If --remove-sent-files was specified and we successfully updated a
file, send MSG_SUCCESS to the sender (through the generator).
2005-02-20 01:04:51 +00:00
Wayne Davison
bf26aa2219 - If --remove-sent-files was specified, abort if we're pulling from
a read-only module.
- If need_messages_from_generator is set, make sure that the
  connection between the generator to the sender has multiplexed
  I/O enabled.
2005-02-20 01:04:49 +00:00
Wayne Davison
9981c27ef1 Handle the new MSG_SUCCESS message for both the generator and the
sender.
2005-02-20 01:04:46 +00:00
Wayne Davison
fe96018750 If we update the contents of a symlink and --remove-sent-files
is enabled, tell the sender about it via MSG_SUCCESS.
2005-02-20 01:04:43 +00:00
Wayne Davison
07c6ae7de8 - Added --remove-sent-files option.
- If a server is refusing "delete" and we're the sender, also refuse
  the --remove-sent-files option.
2005-02-20 01:04:40 +00:00
Wayne Davison
e163683020 Document how refusing "delete" affects --remove-sent-files. 2005-02-20 01:04:37 +00:00
Wayne Davison
961103049b Document --remove-sent-files. 2005-02-20 01:04:34 +00:00
Wayne Davison
0254bd46ec Test --remove-sent-files. 2005-02-20 01:04:27 +00:00
Wayne Davison
8b806ed347 Disallow --remove-sent-files with a read-only server. 2005-02-20 01:04:12 +00:00
Wayne Davison
8e3ead09a3 Got rid of maybe_DEL_TERSE. 2005-02-20 00:47:15 +00:00
Wayne Davison
8715db2cab Tweaked some externs. 2005-02-20 00:16:23 +00:00
Wayne Davison
50839b4bb0 Tweaked some externs. 2005-02-19 23:42:09 +00:00
Wayne Davison
e1f40891c7 - Needed to use a name buffer in delete_missing() to avoid having
a recursive delete reuse our buffer from f_name().
- Moved the backup-handling into delete_file() in rsync.c.
- Moved the --max-delete counting into delete_file() in rsync.c.
2005-02-19 23:41:52 +00:00
Wayne Davison
042f470ef9 Made delete_file() backup files it is removing if --backup was specified. 2005-02-19 23:39:47 +00:00
Wayne Davison
40cc28516d Moved deletion_count here so that we honor --max-delete in
delete_file().
2005-02-19 23:24:41 +00:00
Wayne Davison
8174bc3506 If the server refuses a directory, don't allow any files to be
sent to the server inside that directory.
2005-02-19 23:01:52 +00:00
Wayne Davison
9118a09c77 Changed a couple log_recv() calls back to log_send(). 2005-02-19 22:57:08 +00:00
Wayne Davison
8324bd5c21 When logging PERMS_REPORT messages, send them with the FCLIENT code
if the daemon has "%i" in its log message (because it already got a
detailed log message from the generator).
2005-02-19 22:16:53 +00:00
Wayne Davison
7f37167da5 - Always send the itemized-info bytes on to the receiver. This
not only ensures that batch files are created consistently for
  push and pull, but allows a daemon to log itemized changes.
- Improved the logging of itemized changes for the daemon.
- Make sure we debug-log our presence in send_files().
2005-02-19 22:16:50 +00:00
Wayne Davison
227a9c41c1 - Improved the logging of itemized changes for the daemon.
- Make sure we debug-log our presence in recv_files().
2005-02-19 22:16:47 +00:00
Wayne Davison
6c3862fae3 Make use of new variables (log_format_has_i, log_format_has_o_or_i,
and daemon_log_format_has_i) and the new FCLIENT logging code to
output stats in the best way possible for both the client and the
daemon.
2005-02-19 22:16:45 +00:00
Wayne Davison
1eec003a80 The FCLIENT log code aviods putting the message into the daemon's
log file and instead sends a FINFO message to the client.  This is
used when the daemon wants to log a better message locally than it
is sending to the client.  Improved log_delete() to make use of this
idiom if it needs to log a separate delete message for the daemon
and the client.
2005-02-19 22:16:41 +00:00
Wayne Davison
684d7582b6 - Added log_format_has_i.
- Fixed a problem withe option-refusing code when it refuses the
  daemon options.
- Don't sent --itemize-changes (-i) to the server -- send an
  improved --log-format value instead.
2005-02-19 22:16:39 +00:00
Wayne Davison
f39b2060fe We now set daemon_log_format_has_i and daemon_log_format_has_o_or_i
instead of itemize_daemon_changes.
2005-02-19 22:16:35 +00:00
Wayne Davison
4f2ba7e056 No more need to clear itemize_changes based on protocol_version. 2005-02-19 22:16:33 +00:00
Wayne Davison
1dcf3b4345 Changed some of the values of the MSG_* defines. 2005-02-19 22:16:31 +00:00
Wayne Davison
aa57d14ae7 We now use a regular expression to parse the (restored to its previous
version) default logfile format.  Added parsing for a version of the
default logfile format where %o has been replaced with %i.
2005-02-19 19:36:54 +00:00
Wayne Davison
3c54d8a3ad Decided to leave the "log format" default the same as in
earlier versions.
2005-02-19 17:38:51 +00:00
Wayne Davison
c0814b813f If the "log format" has a %i in it, set itemize_daemon_changes. 2005-02-19 17:37:40 +00:00
Wayne Davison
088aff1a48 - Don't log a delete message to the daemon log in dry-run mode.
- The daemon's wrote/read log message now uses the terms
  sent/received.
2005-02-19 17:23:08 +00:00
Wayne Davison
d6707171e6 Decide whether to log a delete message via the default format by
checking the new log_format_has_o_or_i variable, not itemize_changes.
2005-02-19 03:54:13 +00:00
Wayne Davison
5c5e159892 - Set new variable, log_format_has_o_or_i.
- Make sure that -i can't be set w/o an actual %i in the log_format.
- Only need to pass -i to server if we're the sender.
- Only need to pass some --log-format information to the server in
  certain circumstances.
2005-02-19 03:54:11 +00:00
Wayne Davison
6d7b3d52dc Rules read in from per-dir merge files need to have non-applicable
rules filtered out before the rule gets stored (not in a post-
filtering pass like the rules that are read-in prior to the run).
2005-02-19 03:12:21 +00:00
Wayne Davison
591b908fbf Mention the change in the default "log format" daemon-config setting. 2005-02-19 03:03:13 +00:00
Wayne Davison
742be97ce4 Log items that are unchanged if verbose > 1. 2005-02-19 02:39:33 +00:00
Wayne Davison
1f30a674cd Notify the remote side about -i (if either specified or inferred from
the user's --log-format string) and, if we're not verbose but we're
logging messages, let the server know that --log-format was specified.
2005-02-19 02:39:30 +00:00
Wayne Davison
19bc826d8b - Tweaked the letters output by "%i", including adding support for
logging a deleted item and an identical item.
- Added log_delete(), a routine that either logs the fact that a
  deletion happened, or sends a MSG_DELETED message to the client
  side (or both if we're a daemon server receiver).
2005-02-19 02:39:26 +00:00
Wayne Davison
c786a7aec5 - Changed the calling args to delete_file() to take an st_mode instead
of a DEL_DIR flag.
- Call log_delete() instead of outputting "deleting ..." messages..
- Log deletions if either verbose or log-format is specified.
2005-02-19 02:39:23 +00:00
Wayne Davison
8a8356b7db - Send the itemized data for every file, changed or not, if verbose > 1.
- Don't call set_perms() with PERMS_REPORT if we're itemizing changes.
- Don't call delete_file() with DEL_TERSE if we're itemizing changes.
- Call delete_file() with its new arg.
2005-02-19 02:39:21 +00:00
Wayne Davison
0d67e00af8 - Allow send_msg() to be called by the delete code in flist.c and
have it figure out if it should send the message to our sibling
  or the other side.
- Handle the new MSG_DELETED message in both the generator and the
  sender.  This message is used to let the client side log each
  deletion when the server side is the receiver.
2005-02-19 02:39:18 +00:00
Wayne Davison
7448177753 - Call log_delete() instead of outputting a "deleting ..." message.
- Call delete_file() with its new arg.
2005-02-19 02:39:15 +00:00
Wayne Davison
90d151f423 If the protocol is less than 29, make sure itemize_changes is off. 2005-02-19 02:39:11 +00:00
Wayne Davison
9f7c5dabf8 - Got rid of DEL_DIR define.
- Added define for ITEM_DELETED.
2005-02-19 02:39:09 +00:00
Wayne Davison
a85a151430 - Mention that "%o" can now have the value "del."
- Updated the description of "%i" to reflect the latest functioning.
2005-02-19 02:39:06 +00:00
Wayne Davison
5dd97ab999 Fixed an inaccuracy in the --archive description. 2005-02-19 02:39:03 +00:00
Wayne Davison
8daa9925cc More improvements. 2005-02-18 21:24:00 +00:00
Wayne Davison
e844be4e7b - Use read_short() and write_short().
- If the user does not want itemized changes, don't log the name
  for attribute changes.
2005-02-18 20:17:24 +00:00
Wayne Davison
88b218fa5c - Tweaked code in itemize() a bit.
- Use the new write_short() function.
- Mention the delete() when an item replaces an item of a different type.
- Make sure that this replacing of a non-same item is marked as a new
  transfer in the itemized output.
2005-02-18 20:17:20 +00:00
Wayne Davison
e66d70e34c The '%n' escape needs to append a trailing slash onto a directory name. 2005-02-18 20:17:17 +00:00
Wayne Davison
9361f83933 Added read_short() and write_short(). 2005-02-18 20:17:15 +00:00
Wayne Davison
3b2bebbf90 Improved the "log format" section some more. 2005-02-18 20:17:12 +00:00
Wayne Davison
4f90eb433a Improved --verbose, --itemize-changes, and --log-format. 2005-02-18 20:17:09 +00:00
Wayne Davison
b485e0c16c Fixed/improved the comment before safe_name(). 2005-02-18 20:17:05 +00:00
Wayne Davison
bc1fac9648 Handle uchar and short as a function return type. 2005-02-18 20:16:59 +00:00
Wayne Davison
c78779cce3 - Fixed a few bugs and compile warnings.
- Use the long-option parser for better option handling.
- Output a usage message if the options are wrong.
- Improved the option-variable names.
- Parse the new default daemon log-file format.
- Handle filenames that have spaces in them.
2005-02-18 17:58:03 +00:00
Wayne Davison
702cd15cb0 For the server, don't ever intuit verbosity higher than what
the client asked for.
2005-02-18 17:36:12 +00:00
Wayne Davison
1da05366ad The daemon loop needs to call log_open() because it called log_close(). 2005-02-18 17:34:09 +00:00
Wayne Davison
2267efeac5 Made log_open() non-static and moved log_close() next to it. 2005-02-18 17:33:43 +00:00
Wayne Davison
15954da08f Updated the default "log format" string and the output of "%i". 2005-02-17 09:19:07 +00:00
Wayne Davison
b2dc7bad39 Changed the default log format. 2005-02-17 09:16:51 +00:00
Wayne Davison
d4e0196346 Use '.' for unchanged attributes in the %i output. 2005-02-17 09:16:23 +00:00
Wayne Davison
2fc50f5a98 More improvements for the description of the %i output. 2005-02-16 20:12:20 +00:00
Wayne Davison
bd5b85dbc7 Mention the new flag-word for protocol 29. 2005-02-16 17:08:04 +00:00
Wayne Davison
8a8324657e - The itemized flags are now 2 bytes instead of 1.
- Always send/receive the itemized flags for protocols >= 29.
- The output of the verbose log-the-transfer messages is always handled
  via log_send() (when we're the client).
2005-02-16 17:02:16 +00:00
Wayne Davison
4bb0af79b7 - The itemized flags are now 2 bytes instead of 1.
- Always send/receive the itemized flags for protocols >= 29.
- The output of the verbose log-the-transfer messages is always handled
  via log_recv() (when we're the client).
2005-02-16 17:02:13 +00:00
Wayne Davison
e3bcd89319 - The itemized flags are now 2 bytes instead of 1.
- Always send the itemized flags for protocols >= 29.
- Sent an itemized-flag update for dirs and symlinks for protocols >= 29
  (instead of outputting a message directly).
2005-02-16 17:02:11 +00:00
Wayne Davison
87383697e8 - Auto-set --verbose if --dry-run is specified w/o --log-format.
- When verbose w/o a log_format specified, set it to "%n%L".
- There's no longer a need to send -i to the server.
2005-02-16 17:02:08 +00:00
Wayne Davison
e4b808989e Moved the auto-setting of --verbose when --dry-run is specified into
options.c.
2005-02-16 17:02:05 +00:00
Wayne Davison
59e52bf276 Tweaked ITEM_MISSING_DATA. 2005-02-16 17:02:02 +00:00
Wayne Davison
9b40e44ef4 No need to handle itemize_changes anymore. 2005-02-16 17:01:59 +00:00
Wayne Davison
e92f21d2f7 Tweaked the mention of --itemize-changes. 2005-02-16 08:12:34 +00:00
Wayne Davison
910e89b963 - We now accept an itemized-changes flag-byte over the socket if we're
the local client and --itemized-changes was specified.  If the item
  is not being updated, just call log_recv().
- We reject an attempt to file-update any non-regular file, not just
  dirs.
- Avoid the verbose "log the transfer" output if --log-format was
  specified and log_before_transfer is in effect.
- Call log_recv() with its new iflags arg.
2005-02-16 08:10:45 +00:00
Wayne Davison
8a9cfb2459 - We now accept an itemized-changes flag byte over the socket if we're
in --itemized-changes mode.  If the item is not being updated,
  either pass it along to the receiver (if we're the server) or just
  call log_send().
- We reject an attempt to file-update any non-regular file, not just
  dirs.
- Avoid the verbose "log the transfer" output if --log-format was
  specified and log_before_transfer is in effect.
- Call log_send() with its new iflags arg.
2005-02-16 08:10:41 +00:00
Wayne Davison
41961db0bd Ensure that -i is set consistent with the batch's data. 2005-02-16 08:10:38 +00:00
Wayne Davison
e76518843d - If log_before_transfer is possible, don't force --verbose on for
--progress.
- If --log-format contains %i, set --itemize-changes (-i).
- Always send -i to the remote rsync if it was specified/implied.
2005-02-16 08:10:31 +00:00
Wayne Davison
ef74f5d626 - Improved log_formatted() to handle long filenames better.
- Added %i, for the list of itemized changes, %n for the normal
  filename (might be shorter than %f), and %L for a " -> symlink"
  string IIF the item is a symlink (else "").
- The log_{send,recv}() functions now take an "iflags" arg.
2005-02-16 08:10:28 +00:00
Wayne Davison
c557eb8cec Changed showchg() into itemize(), which now ships off a flag byte of
what changed over to the sender instead of outputting a string itself.
This does mean that we now ship off indexes of non-file items that got
updated, but the sender will know what to do with it.
2005-02-16 08:10:25 +00:00
Wayne Davison
0cc279e0d3 - Added the new ITEM_* flags for the itemized-changes flag passing.
- Also added defines for FLAG_SENT and MSG_SUCCESS.
2005-02-16 08:10:22 +00:00
Wayne Davison
0cfdf22655 Documented that -i now sets a default --log-format string. 2005-02-16 08:10:19 +00:00
Wayne Davison
527a010f10 Documented the new log-format escapes: %n, %L, and %i. 2005-02-16 08:10:13 +00:00
Wayne Davison
c8ca974634 Some tweaks to how --itemize-changes works. 2005-02-16 01:13:03 +00:00
Wayne Davison
3296f91bb0 Check for refusal of --delete-before when it is inferred. 2005-02-15 21:15:58 +00:00
Wayne Davison
e2124620eb Moved two paragraphs. 2005-02-15 20:42:36 +00:00
Wayne Davison
69864a5ccf Made showchg() use safe_fname(). 2005-02-15 20:41:37 +00:00
Wayne Davison
5b4e1f318d - Mention the addition of --itemize-changes.
- Mention the setting of read_only when a daemon is read-only.
2005-02-15 19:47:57 +00:00
Wayne Davison
b78296cb0b Decided on a better option name --itemize-changes (-i). 2005-02-15 07:41:13 +00:00
Wayne Davison
06a1dbad61 Implemented the --what-has-changed functionality. 2005-02-15 07:20:14 +00:00
Wayne Davison
93c31c1a6d Don't force -v with -n if -w was specified. 2005-02-15 07:20:11 +00:00
Wayne Davison
a8ed495833 If -w and -v are both on, don't output the "log the transfer"
verbose message.
2005-02-15 07:20:04 +00:00
Wayne Davison
4a14ed068c Added --what-has-changed (-w), which summaries the changes
being made to the files.
2005-02-15 07:20:01 +00:00
Wayne Davison
dc0f24976d Document --what-has-changed (-w). 2005-02-15 07:19:58 +00:00
Wayne Davison
1e7098b5e3 Fixed a typo. 2005-02-15 03:38:04 +00:00
Wayne Davison
2f24fb18c4 Make sure that there are no directory-time differences between the
dirs that might trip up the check of the merged copy.
2005-02-15 02:01:02 +00:00
Wayne Davison
96a8ca6d98 Had a report that the __attribute__ code needs to check for
__APPLE__ being defined, not APPLE.
2005-02-14 22:49:51 +00:00
Wayne Davison
37a5644576 One arg to matched() is supposed to be an int32. 2005-02-14 22:48:28 +00:00
Wayne Davison
a1cbe76e2c Changed one size_t var into an int32. 2005-02-14 22:47:42 +00:00
Wayne Davison
98bf61c80e Improved description of --whole-file option. 2005-02-14 19:09:30 +00:00
Wayne Davison
01f439ec6e Fixed a mismatch in the compressed-data handling between how the
sending side and the receiving side handled implicit (unsent) data.
2005-02-14 08:28:00 +00:00
Wayne Davison
acc461c7da Changed various token variables from "int"s to "int32"s. 2005-02-14 08:19:32 +00:00
Wayne Davison
1585958497 The count of chunks should really be an int32, not a size_t,
because that's the maximum size we can transmit over the wire.
2005-02-14 08:13:47 +00:00
Wayne Davison
7cacd47edd Changed the size_t variables into int32 variables. 2005-02-14 08:12:22 +00:00
Wayne Davison
e461b9bed4 Don't let --fuzzy be used with a protocol_version < 29. 2005-02-14 02:47:44 +00:00
Wayne Davison
3723c04850 Mention --fuzzy. 2005-02-14 02:41:35 +00:00
Wayne Davison
73273075c8 Added code to read a fuzzy-basis name from the generator. 2005-02-14 02:41:30 +00:00
Wayne Davison
8e85be0a16 Added handling for fuzzy-basis scanning. When a fuzzy filename is
chosen, the name is sent down the name-pipe to the receiver.
2005-02-14 02:41:27 +00:00
Wayne Davison
37802f40dc - If send_file_name() gets f set to -2, it skips the local filter rules.
- Added get_dirlist(), which returns a file_list structure for the
  desired directory, optionally with local filter rules disabled.
2005-02-14 02:41:23 +00:00
Wayne Davison
06b96ffa86 Set need_name_pipe if --fuzzy was specified. 2005-02-14 02:41:18 +00:00
Wayne Davison
c4ed1487f9 Added parsing for the --fuzzy (-y) option. 2005-02-14 02:41:15 +00:00
Wayne Davison
e64ae6d766 Added find_filename_suffix() and fuzzy_distance(). 2005-02-14 02:41:10 +00:00
Wayne Davison
5b4837552b Document the --fuzzy (-y) option. 2005-02-14 02:41:05 +00:00
Wayne Davison
d2004814f0 Changed #if to use "defined". 2005-02-14 02:34:01 +00:00
Wayne Davison
bf0c5bec45 If f_name_cmp() discovers that two directory strings compare to an
equal value without being equal pointers, substitute one of the
pointers for the other in the file list.  This optimizes future name
comparisons.  Note also that this optimization won't be triggered
very often (because rsync tends to send the names grouped by dir-
name at transmission time), but it's nice to be able to assume that
all files in the same dir have identical dir-name pointers after the
qsort is finished.
2005-02-14 01:29:17 +00:00
Wayne Davison
0dd046d36f Don't check defined-ness of SIZEOF_OFF64_T. 2005-02-14 00:58:10 +00:00
Wayne Davison
4f5b0756df John E. Malmberg convinced me to standardize on #ifs for defined
values instead of non-zero.
2005-02-14 00:53:43 +00:00
Wayne Davison
fe1c19dcdf In clean_flist(), if a duplicate is found for a dir and a non-dir,
always dump the non-dir (because the dir might have contents in
the list).
2005-02-13 22:48:38 +00:00
Wayne Davison
24b2096e86 The dir vs non-dir test now assumes the dir wins. 2005-02-13 22:48:35 +00:00
Wayne Davison
86e97e178d Mention the new sorting method for protocol 29. 2005-02-13 22:37:29 +00:00
Wayne Davison
905d906d69 Added a test for the merging of a dir and a non-dir with the same name. 2005-02-13 22:01:15 +00:00
Wayne Davison
abce74bb93 Added some missing commas in some option summary lines. 2005-02-13 21:50:55 +00:00
Wayne Davison
f5db099330 - Made receive_file_entry() return the file_struct pointer instead
of storing it into the files[] array.
- Made flist_find() return "no match" if the found item differs in
  its directory-ness from the search item.
- Changed f_name_cmp() to sort sub-directories after non-directories
  for each directory's contents.  This makes things like the upcoming
  --fuzzy patch easier to get right.
- One complicating factor is that clean_flist() needed some extra
  code to ensure that a directory doesn't duplicate a non-directory
  of the same name.
- Make sure that the "strip_root" code in clean_flist() (for relative
  paths) strips off all leading slashes.
2005-02-13 21:15:47 +00:00
Wayne Davison
122d1771db Improved the call to f_name_cmp(). 2005-02-13 20:06:18 +00:00
Wayne Davison
8824e2cee4 Changed the prefix on the fnc_state enums. 2005-02-13 10:23:56 +00:00
Wayne Davison
8a6f3fead8 Improved the summary for the -F option. 2005-02-13 05:45:42 +00:00
Wayne Davison
9c71f56a25 Improved the help text for -F. 2005-02-13 05:44:29 +00:00
Wayne Davison
f924946eba Improved the description of the --compress (-z) option. 2005-02-12 22:22:14 +00:00
Wayne Davison
32a5edf43f Improved the documentation of the --compress (-z) option. 2005-02-12 22:21:45 +00:00
Wayne Davison
9a338344da Forgot to make sure that the dir-times on the chkdir got synced
in the newest test case.
2005-02-12 21:22:21 +00:00
Wayne Davison
df337831dc When --dry-run is set, note when a directory is missing and avoid
trying to stat() any items inside that dir's hierarchy.  This fixes
a bug where a symlink to a dir getting replaced by a dir with
identical contents to the dir at the other end of the symlink would
not report the updated files in the new hierarchy. (See bug #1673)
2005-02-12 21:18:58 +00:00
Wayne Davison
bb558f6791 Some more improvements to exercise rule-restricted merge files
(i.e. exclude patterns only) and side-restricted filter rules.
2005-02-12 20:45:39 +00:00
Wayne Davison
22558cdd7e Improved checkit() and rsync_ls_lR() to work with filenames that
might have spaces.
2005-02-12 20:25:12 +00:00
Wayne Davison
28c54e81c1 Mention the protocol change for --delete-excluded. 2005-02-12 19:52:40 +00:00
Wayne Davison
0dfffb88e1 Document the new filter rule flags for sender-/receiver-specific
rules.
2005-02-12 19:52:34 +00:00
Wayne Davison
ed243f8c29 - Added modifiers for the include/exclude rules that makes them
apply to the indicated (sender/receiver) side.
- Added the hide/show and protect/risk filter rules as an alternate
  way to specify sender-/receiver-specific include/exclude rules.
- send_rules() now allows f_out to be -1 to indicate that the list
  should be scanned but not sent.
- send_rules() now filters the list to remove any items that don't
  apply to the current side (after sending the item to the other
  side when f_out != -1).
- {send,recv}_filter_list() now transfer the list, even when the
  receiver is the server and --delete-excluded was specified (the
  exchanged list is appropriately filtered, of course).
- recv_filter_list() uses send_rules() to trim non-applicable rules
  when we're a local-server (because we got our filter list without
  send/recv calls when fork() duplicated it).
2005-02-12 19:52:26 +00:00
Wayne Davison
a427e8938a - Define MATCHFLG_SENDER_SIDE and MATCHFLG_RECEIVER_SIDE.
- Updated MATCHFLGS_FROM_CONTAINER.
2005-02-12 19:52:22 +00:00
Wayne Davison
cc25d29132 We don't need to avoid the local filter list in send_file_name()
when --delete-excluded is set because our list has been trimmed to
only include rules that apply in the current mode.
2005-02-12 19:52:18 +00:00
Wayne Davison
134f43385b - Since send_file_list() is no longer called with f == -1, got rid
of all the conditional code to support that.
- Improved the comment before send_directory() to indicate that it
  gets called with f == -1 from delete_in_dir().
2005-02-12 18:40:15 +00:00
Wayne Davison
a5a264842e Don't use underscores in the example filter rules. 2005-02-11 23:16:41 +00:00
Wayne Davison
eed47b6b9c Made "i" a size_t in receive_sums(). 2005-02-11 20:46:55 +00:00
Wayne Davison
3841a04e88 A minor tweak for the dry_run logic. 2005-02-11 20:26:08 +00:00
Wayne Davison
9eef8f0b73 Improved the "refuse options" section, including an update
to the section that talked about --del being a popt alias
(which is no longer true).
2005-02-11 10:52:50 +00:00
Wayne Davison
c258230722 - Several improvements in describing how options imply other options.
- Improved --partial-dir.
2005-02-11 10:51:25 +00:00
Wayne Davison
345e0988cb Changed rule_match() to rule_strcmp(). Likewise for the
define RULE_MATCH() being changed into RULE_STRCMP().
2005-02-11 10:47:43 +00:00
Wayne Davison
3671987f4d - Added some new refused_* variables that note if certain options
have been refused on the server daemon.  This allows us to reject
  implied options (e.g. if --partial is refused and -P specified).
- Changed the handling of the --delete refusals from the old idiom
  of upgrading "delete" to "delete*" into the new idiom of checking
  if refused_delete is set when we determine --delete was implied.
- Changed the --del option from a popt alias into a normal option.
- Mark all the daemon options as refused when a daemon is parsing
  the over-the-socket options.
- Created a new function, create_refuse_error(), which is now called
  from all the spots that check for refused options.
- Don't call clean_fname() on an empty string -- either reject it
  or handle it without erroneously expanding the string.
- If --delay-updates was specified without a --partial-dir option,
  don't send the default "--partial-dir=.~tmp~" option if the server
  is the receiver -- just let it default.
2005-02-11 10:42:55 +00:00
Wayne Davison
5aa7b20a3e Have partial_dir_fname() also check if the dir is excluded
by the server, not just the partial file.
2005-02-11 09:58:31 +00:00
Wayne Davison
68795c640b If a --delay-update can't use the partial-dir (e.g. if a server
daemon excludes the dir or file), update the file without delay.
2005-02-11 09:56:28 +00:00
Wayne Davison
4f1f94d1de Improved the --modify-window description. 2005-02-09 17:08:23 +00:00
Wayne Davison
0f7e31f7d7 Improved several items and added a new section describing what is
different for protocol version 29.
2005-02-09 04:45:36 +00:00
Wayne Davison
2f3cad893b - Decided that flist_find() should be public, not static.
- Modified f_name_cmp() so that, beginning with protocol 29,
  it will guarantee that a directory name will sort one slot
  before its contents (prior versions could sort other items
  in between in rare instances).
2005-02-09 02:36:17 +00:00
Wayne Davison
e79666267d Also test the new long-named filter rules. 2005-02-08 19:30:07 +00:00
Wayne Davison
d91de04671 Mention the new long-name filter rules. 2005-02-08 19:06:30 +00:00
Wayne Davison
64b761c19a Allow a ',' to prefix the MODIFIERS for a single-letter filter rule. 2005-02-08 18:47:25 +00:00
Wayne Davison
a1ac8edd66 - Added long-name filter rules.
- Only parse the "!" token when MATCHFLG_NO_PREFIXES is set if
  MATCHFLG_CVS_IGNORE is also set.
2005-02-08 18:33:16 +00:00
Wayne Davison
1dca857b5b Fixed a typo. 2005-02-07 20:46:42 +00:00
Wayne Davison
f8cd88dbd1 - Added more calls to safe_fname().
- Improved safe_fname() so that it changes all non-printable chars
  into '?'s, and accomodates more simultaneous (and longer) names.
2005-02-07 20:41:43 +00:00
Wayne Davison
71903f601a Added missing calls to safe_fname() and full_fname(). 2005-02-07 20:40:18 +00:00
Wayne Davison
719bc858b5 Made NS define make use of safe_fname(). 2005-02-07 20:39:13 +00:00
Wayne Davison
a6126d678b Added missing call to safe_fname(). 2005-02-07 20:38:56 +00:00
Wayne Davison
4875d6b64d Adding more calls to safe_fname(). 2005-02-07 20:36:43 +00:00
Wayne Davison
54b4059856 Needed to call safe_fname() when listing the remote names. 2005-02-07 19:40:31 +00:00
Wayne Davison
38059f8e8e One more tweak. 2005-02-06 07:24:42 +00:00
Wayne Davison
bb5f4e7285 A few tweaks to the FILTER RULES section, including a mention of
using the +/- modifiers on merge-file rules.
2005-02-06 07:16:19 +00:00
Wayne Davison
448797a1e6 Fixed an off-by-one error in the prefix-length checking in
get_rule_prefix().
2005-02-05 06:53:20 +00:00
Wayne Davison
a261103ce0 Improved the name of a variable. 2005-02-05 05:30:06 +00:00
Wayne Davison
7b82b5adb3 Mention a couple more changes. 2005-02-05 01:38:19 +00:00
Wayne Davison
397a344364 Added the "C" modifier to the itemized list of +/- modifiers. 2005-02-05 00:03:46 +00:00
Wayne Davison
bafa48759f Mention the new --filter=-C syntax that lets you position the default
CVS rules within your other filter rules.
2005-02-04 23:57:26 +00:00
Wayne Davison
46db185081 - Moved get_cvs_excludes() up above its only use and made it static.
- Changed get_cvs_excludes() to make an mflags arg.
2005-02-04 22:32:17 +00:00
Wayne Davison
1412da7c32 If we're a "local server" (i.e. we just forked a server for a
local transfer), don't duplicate all the filter rules that we
already know about in the forked process.
2005-02-04 21:54:02 +00:00
Wayne Davison
d09e800a0e Fixed the way get_rule_prefix() turns the MATCHFLG_WORD_SPLIT flag
back into a modifier character.
2005-02-04 21:16:39 +00:00
Wayne Davison
53b417e414 - Added MATCHFLG_CVS_IGNORE.
- Made the match_flags var a uint32.
2005-02-04 21:13:12 +00:00
Wayne Davison
57dee64e82 - Moved the cvs_exclude checks into send_filter_list() and
recv_filter_list().  Because of this, we never skip these
  calls anymore, though read-batch processing indicates that
  the list should not really be sent by setting f_out to -1.
- Moved the definintion of the "local_server" variable here
  from options.c.
2005-02-04 21:13:09 +00:00
Wayne Davison
fdc795015f - Changed filter_rule() to add_rule().
- Improved the debug info coming from add_rule().
- Changed add_filter() to parse_rule() and add_filter_file()
  to parse_filter_file().
- Changed get_filter_tok() to parse_rule_tok().
- Made the mflags a uint32.
- Added an extra arg to get_rule_prefix() to indicate if we're
  building the options for transmission or other purposes.
- The 'C' modifier can now be applied to a '-' rule, so it now
  sets a new flag: MATCHFLG_CVS_IGNORE.
- The send_filter_list() and recv_filter_list() functions now handle
  all the logic needed to do the right thing for -C (this used to be
  in main.c).
2005-02-04 21:13:06 +00:00
Wayne Davison
3a5e9224d0 - Changed add_filter() to parse_rule() and add_filter_file()
to parse_filter_file().
- Moved the definintion of the "local_server" variable into main.c.
2005-02-04 21:13:03 +00:00
Wayne Davison
ebfd1a1cf7 Changed add_filter() to parse_rule() and add_filter_file()
to parse_filter_file().
2005-02-04 21:13:00 +00:00
Wayne Davison
dd667c2301 Call get_rule_prefix() with its new arg. 2005-02-04 21:12:56 +00:00
Wayne Davison
d727f0ff48 Fixed the MODIFIERS_MERGE_FILE define. 2005-02-04 00:48:18 +00:00
Wayne Davison
eb9b2e53c8 Changed delete_missing() to not limit the use of DEL_FORCE_RECURSE
to just --delete-during now that the other delete routines are using
delete_in_dir().
2005-02-03 19:19:39 +00:00
Wayne Davison
b6f06b8e8b Added an mflags arg to get_filter_tok(), add_filter_file(), and
add_filter().  This made for less flag conversion between various
MATCHFLG_* and XFLG_* values.  It also made it easy to fix a bug
in the handling of no-prefix per-directory include/exclude files.
We also use the new XFLG_OLD_PREFIXES and MATCHFLGS_FROM_CONTAINER
defines.
2005-02-03 19:00:20 +00:00
Wayne Davison
0a68f869d7 Call add_filter() and add_filter_file() with their new flag args. 2005-02-03 19:00:17 +00:00
Wayne Davison
3b2461cf2e - Got rid of a bunch of XFLG_* options.
- Added XFLG_OLD_PREFIXES and MATCHFLGS_FROM_CONTAINER defines.
2005-02-03 19:00:13 +00:00
Wayne Davison
346402ddbf Use the new negated exclude to filter out all non-dirs in a few
of the rsync commands.
2005-02-03 03:45:24 +00:00
Wayne Davison
44d60d5f83 Document the new "!" modifier for include/exclude filter rules (to
negate the match).
2005-02-03 03:37:02 +00:00
Wayne Davison
f2ae9e8583 Implemented a "!" modifier for filter rules that lets a rule trigger
on a non-matching pattern.
2005-02-03 03:36:58 +00:00
Wayne Davison
7c8e23bd9f Added MATCHFLG_NEGATE. 2005-02-03 03:36:55 +00:00
Wayne Davison
0752721dc3 Mention the latest delete optimization. 2005-02-03 02:01:22 +00:00
Wayne Davison
68a94ac30f Changed delete_files() to use the delete_in_dir() function, which
saves a ton of memory for a large set of files.
2005-02-03 02:01:20 +00:00
Wayne Davison
ee3751c8d7 - We now separate the user-specified top-dir flag (via the restored
FLAG_TOP_DIR) from the del-in-this-directory flag (FLAG_DEL_HERE).
  This was needed to properly handle -x in delete_in_dir().
- The delete_in_dir() function takes a slightly changed set of args.
- Always set the FLAG_DEL_HERE flags, not just for --delete-during.
2005-02-03 02:01:17 +00:00
Wayne Davison
ec33e0e6bd - Changed {XMIT,FLAG}_DEL_START back to {XMIT,FLAG}_TOP_DIR.
- Define FLAG_DEL_HERE.
2005-02-03 02:01:14 +00:00
Wayne Davison
31937d363b Call delete_in_dir() with its new args. 2005-02-03 02:01:11 +00:00
Wayne Davison
8982a89b24 In hlink_compare(), call f_name_cmp() directly instead of using
file_compare().
2005-02-03 01:19:03 +00:00
Wayne Davison
0492fdfb2e - Improved some comments.
- Changed the index passed to recv_generator() from "i" to "ndx".
- Call delete_in_dir() with its new args.
- During the redo phase, clear a bunch of options that might interfere
  with the generator deciding it needs to redo the file (for instance,
  --update-only could have interfered if --partial was specified).
2005-02-03 01:19:01 +00:00
Wayne Davison
14698a3a1a - Moved an optimization from file_compare() into f_name_cmp() (the one
that avoids doing a string-compare on two identical char pointers),
  making it just a wrapper for f_name_cmp().  Also made file_compare()
  static because everyone now calls f_name_cmp() directly.
- Improved the flist summary that is output at high verbosity.
- Improved delete_in_dir() to better handle the push/pop semantics
  based on the depth value that is now passed in as an arg (so that
  we don't have to parse it out of the paths each time).
2005-02-03 01:18:58 +00:00
Wayne Davison
8c2ffaf095 - If recv_files() is sent the index of a directory, complain about it
and die.
- Moved a few code snippets in recv_files() into better locations.
2005-02-03 00:19:40 +00:00
Wayne Davison
afd72c78bd If the generator sends us the index of a directory, generate an
error and die.
2005-02-02 17:15:22 +00:00
Wayne Davison
6bf822649b - Fixed a problem with the setting of the --recurse option from the
batch file.
- Save the state of the --dirs option in the batch flags in a way
  that is compatible with older protocol versions.
2005-02-02 09:40:45 +00:00
Wayne Davison
67dde16163 In read_sum_head: output the who_am_i() info in our error messages. 2005-02-01 16:42:01 +00:00
Wayne Davison
f1d5ba4005 Set am_sender to -1 until the end of the option parsing. This
lets who_am_i() output better values for the command-line
--filter/--include/--exclude options.
2005-02-01 09:46:42 +00:00
Wayne Davison
794b0a037f Changed who_am_i() to output "server" or "client" when am_sender
is negative.  This will only occur during the startup phase
before we know if we're the sender or not (e.g. when parsing
client-side --filter/--exclude/--include options).
2005-02-01 09:45:09 +00:00
Wayne Davison
c32edbe02e Make sure the %f expansion handles the new dir.root properly. 2005-02-01 09:23:59 +00:00
Wayne Davison
f3c3ed44e6 - Made flist_find() and receive_file_entry() static functions.
- Changed receive_file_entry() args.
- We now store the directory depth into file->dir.depth when
  receiving the file list.  This will be used to aid in the
  traversal of the file list on the receiving side for things
  such as the future --fuzzy option and better --delete-during
  processing.
- Fixed a bug when -R was used with "." as a source directory:
  subdirectories were not being promoted to FLAG_DEL_START when
  --delete-during was specified.
- Refer to the old basedir variable as dir.root.
- Got rid of the first-push code -- I decided that it wasn't
  the right thing to do for per-dir merge-file processing.
- Improved the flist_find() function to make it a little more
  optimal.  The new code no longer needs the inline function
  flist_up().
- In clean_flist() we now set two new values in the flist struct:
  "low" and "high".  These are used by the new flist_find().
- Tweaked the output_flist() function to output each entry's
  flags and to output the directory-depth on the receiving side
  in place of the directory-root (which is still output on the
  sending side).
2005-02-01 09:21:32 +00:00
Wayne Davison
f805730493 - Put "basedir" into a union "dir" and named it "root". The other
member of the union is "depth".
- Added members "low" and "high" to the file list structure (which
  are set when the list is cleaned).
- Got rid of the flist_up() inline function.
2005-02-01 09:21:30 +00:00
Wayne Davison
2b1366635d Refer to the old basedir variable as dir.root. 2005-02-01 09:21:28 +00:00
Wayne Davison
42f23f479d Fixed a typo in a variable name. 2005-02-01 08:12:00 +00:00
Wayne Davison
62bf783f06 Changed the "s" modifier to "w" for word-splitting tokens from a
merge filter file.  Also sprinkled some bf(...) macros into that
section.
2005-01-31 23:57:35 +00:00
Wayne Davison
0b2901b72d Changed the "s" modifier to "w" for a word-splitting merge file. 2005-01-31 23:51:54 +00:00
Wayne Davison
faa82484a5 - Mark references to command-line switches with the bf(...) macro.
- Changed some verb(...) macros to use other yodl idioms because
  yodl inserts way too much vertical whitespace surrounding the
  item.
- Some items weren't indenting enough in the manpage, though they
  were indenting fine in the HTML version, so used some creative
  idioms to get things to render well in both.
- Got rid of some empty lines in lists.
- Made several quote(...) items also tt(...).
2005-01-31 23:41:08 +00:00
Wayne Davison
4ccfd96cfe Tweaked one or more warning messages. 2005-01-31 19:13:19 +00:00
Wayne Davison
408aa7b24c Improved the exclude tests to make sure that the filter files
are interacting with --delete-during correctly.
2005-01-31 18:09:23 +00:00
Wayne Davison
776b9d1c00 Added "need_first_push" logic to delete_in_dir(). 2005-01-30 20:24:11 +00:00
Wayne Davison
c93fad5ee0 The --delete-during processing only happens during the first phase
(not the redo phase).  We also call delete_in_dir(NULL, NULL) to
make sure that all the local filter files get popped.
2005-01-30 10:06:18 +00:00
Wayne Davison
19b2a5d9fd delete_in_dir() now mananges the push/pop levels of nested
directories properly.
2005-01-30 10:01:21 +00:00
Wayne Davison
f1773e09ab - Now delete_in_dir() calls send_directory(), not send_file_name().
- Moved the local-list push/pop code out of send_directory() so that
  the callers (send_file_name() and delete_in_dir()) can call the
  push/pop functions themselves.  This is in preparation for
  delete_in_dir() getting fully correct push/pop semantics (for
  its --delete-during handling of per-dir filter files).
2005-01-30 09:12:55 +00:00
Wayne Davison
462c51d9a1 - Restored the io_error test to delete_files().
- Sanity check the dir_list value from send_file_list().
2005-01-30 07:35:13 +00:00
Wayne Davison
2430e98412 - Made delete_files() call send_file_list() and delete_missing()
instead of delete_in_dir().
- Tweaked check in front of delete_files() call.
2005-01-29 22:35:53 +00:00
Wayne Davison
78fc60cd29 If --recurse wasn't specified, turn off all the --delete* options. 2005-01-29 22:35:50 +00:00
Wayne Davison
864146de58 Tweaked check in front of delete_files() call. 2005-01-29 22:35:47 +00:00
Wayne Davison
45478cc79b - Improved the handling of -x with -K.
- Changed delete_in_dir() to only be used by the --delete-during
  option.
- Added delete_missing() that is used by both delete_files() and
  delete_in_dir().
- delete_files() still uses send_file_list(), but delete_in_dir()
  now uses send_file_name().
2005-01-29 22:35:44 +00:00
Wayne Davison
5454d22ad8 The --dirs was sending -k instead of -d. 2005-01-29 21:25:44 +00:00
Wayne Davison
dc1488ae47 - Document the new "/" modifier for -/+.
- "=" is no longer a valid separator for a filter rule.
2005-01-29 20:48:27 +00:00
Wayne Davison
0121a8ecad Renamed XFLG_ABS_PATH XFLG_ANCHORED2ABS. 2005-01-29 20:48:23 +00:00
Wayne Davison
7bc90b3066 Moved the module_id define into clientserver.c. 2005-01-29 20:48:20 +00:00
Wayne Davison
bf39270e0c - Renamed make_filter() to filter_rule().
- Added the "/" modifier to the -/+ filter rules to allow the
  rule to specify an absolute path (sets MATCHFLG_ABS_PATH).
- Added the passing of the xflgags to filter_rule() and key off
  XFLG_ANCHORED2ABS to prepend the current dirbuf value (was
  keing off MATCHFLG_ABS_PATH).
- We no longer allow a '=' to separate the filter rule from its
  arg (just a single space or an underscore).
- For triple verbose levels, mention when we look for a filter
  file even if we don't find it (used to only mention the file
  when it was found).
- A chrooted daemon process now includes /.cvsignore (inside the
  chrooted hierarchy) instead of $HOME/.cvsignore.
2005-01-29 20:48:17 +00:00
Wayne Davison
211bc43b6e - Moved the module_id definition from options.c to here.
- Use the new XFLG_ANCHORED2ABS name for the old XFLG_ABS_PATH
  define.
2005-01-29 20:48:14 +00:00
Wayne Davison
91c5833bd0 Change one call to add_cvs_excludes() to add_filter() to just add
the per-dir .cvsignore rule for protocols < 29.
2005-01-29 20:29:06 +00:00
Wayne Davison
8311f1c11e A minor change to the HAVE_GETPGRP code. 2005-01-28 23:00:58 +00:00
Wayne Davison
ae2836325f Fixed some typos. 2005-01-28 22:01:02 +00:00
Wayne Davison
a897af2cde Mention a few more things. 2005-01-28 21:48:32 +00:00
Wayne Davison
cc80022e84 Pass an unsigned character to isdigit(). 2005-01-28 21:32:20 +00:00
Wayne Davison
5a016db9b6 Don't allow the user to specify a filter file that is excluded
by a daemon's config options.
2005-01-28 21:28:08 +00:00
Wayne Davison
92e1aeede7 Got rid of an unreachable free() call. 2005-01-28 21:07:05 +00:00
Wayne Davison
f846a9bfe9 Cast each value referenced from the struct mallinfo to a long
in order to print it.
2005-01-28 21:05:50 +00:00
Wayne Davison
3db859e8b5 Don't set unsigned del_heir_name_len to -1 -- it's only used
if in_del_hier is non-zero, so it doesn't need to take on an
invalid value.
2005-01-28 21:03:50 +00:00
Wayne Davison
0eeb1cf83a Case uchar pointer to a char pointer when calling strlen(). 2005-01-28 21:02:15 +00:00
Wayne Davison
5f238db203 - Use "uchar" instead of "unsigned char".
- Tweaked an initializer to try to avoid a compiler warning.
2005-01-28 21:01:21 +00:00
Wayne Davison
422696201a Call the right stat function based on USE_STAT64_FUNCS. 2005-01-28 20:43:09 +00:00
Wayne Davison
58fef0ac38 Changed direct call to fstat() into a call to do_fstat(). 2005-01-28 20:41:36 +00:00
Wayne Davison
25e1181466 Use new USE_STAT64_FUNCS define. 2005-01-28 20:33:55 +00:00
Wayne Davison
5b5f7e3b59 - Use off_t if SIZEOF_OFF_T is 8.
- Define USE_STAT64_FUNCS if we defined STRUCT_STAT as
  "struct stat64".
2005-01-28 20:32:47 +00:00
Wayne Davison
dc3afaf6aa Changed "char" to "uchar" in delayed_bits's new_array() call. 2005-01-28 20:24:23 +00:00
Wayne Davison
1164f67827 Make use of new HAVE_STRUCT_STAT64 define. 2005-01-28 20:15:08 +00:00
Wayne Davison
c83a2c8ec5 Added a check for "struct stat64". 2005-01-28 20:15:06 +00:00
Wayne Davison
43d0f38b24 Do a better job defining an int32. Also define SIZEOF_INT32
instead of the (unused) LARGE_INT32 variable.
2005-01-28 19:03:16 +00:00
Wayne Davison
e95538ca2c - Changed the main core of system include files to use the same "#if"
idioms that configure uses.
- Use "#if" (not "#ifdef") for configure-defined macros.
- Use "#if !" (not "#ifndef") for configure-defined macros.
2005-01-28 18:50:54 +00:00
Wayne Davison
25ff04417e Use "#if" (not "#ifdef") for configure-defined macros. 2005-01-28 18:50:49 +00:00
Wayne Davison
63ecee4d1a Made log_open() static and made it die with an error if the
log-file can't be opened.
2005-01-28 17:42:21 +00:00
Wayne Davison
4c8f6b6a06 No need to call log_open() in start_accept_loop() because
rsync_module() calls log_init() before it gives up its privileges.
2005-01-28 17:33:57 +00:00
Wayne Davison
2161111900 Document the "max verbosity" setting. 2005-01-28 17:11:48 +00:00
Wayne Davison
24b0922b0e Document the --verbose (-v) option for the daemon. 2005-01-28 17:10:58 +00:00
Wayne Davison
186387301f - Moved read_only variable here from options.c
- Set read_only to 1 if the module is read-only.
- Make sure that the verbose level is 0 before we parse the client's
  options.
2005-01-28 17:10:16 +00:00
Wayne Davison
1bd9db74ba - Added --verbose option parsing to the daemon options.
- Moved read_only into clientserver.c.
2005-01-28 17:07:54 +00:00
Wayne Davison
df6933406f Got rid of unused mmap section. 2005-01-28 17:06:41 +00:00
Wayne Davison
d679c8390a Changed HAVE_OFF64_T to SIZEOF_OFF64_T. 2005-01-28 16:27:02 +00:00
Wayne Davison
d4daa7b68c Changed HAVE_OFF64_T to SIZEOF_OFF64_T. 2005-01-28 16:21:37 +00:00
Wayne Davison
44d98d6166 Improved the option summaries. 2005-01-28 09:55:36 +00:00
Wayne Davison
b3708acf27 Improved the option-descriptions in the --help text. 2005-01-28 09:55:18 +00:00
Wayne Davison
2c0fa6c5df More --delete-before improvements. 2005-01-28 08:01:33 +00:00
Wayne Davison
57f74bd1c2 One minor tweak to the --delete-before option-passing code. 2005-01-28 07:50:00 +00:00
Wayne Davison
598c409e63 Document --delete-before. 2005-01-28 07:39:59 +00:00
Wayne Davison
c6eb7fad68 Added back support for the --delete-before option so that future
verions of rsync can more easily change the default that --delete
implies and still support explicit --delete-before functionality
when interacting with older versions.
2005-01-28 07:39:09 +00:00
Wayne Davison
c561edaa72 Added a sanity check for the SIZEOF_INT64 define. 2005-01-28 06:51:44 +00:00
Wayne Davison
031fa9ad4d Use the new SIZEOF_INT64 define instead of INT64_IS_OFF_T. 2005-01-28 06:46:33 +00:00
Wayne Davison
d622d4bf30 - Switched the int64 code over to using the improved SIZEOF_*
macros.
- Define SIZEOF_INT64 to a value that is useable at compile time.
- Got rid of INT64_IS_OFF_T.
2005-01-28 06:45:16 +00:00
Wayne Davison
e32db5c9aa Switched the checks for "long long" and "off64_t" to use the
AC_CHECK_SIZEOF() macro since it now fully supports cross-
compiling.
2005-01-28 06:43:48 +00:00
Wayne Davison
4a6c209a13 Use SIGNED_CHAR_OK instead of HAVE_UNSIGNED_CHAR. 2005-01-28 02:01:18 +00:00
Wayne Davison
0d2aa5d9d7 - Made some of the tests work better when cross-compiling.
- Added descriptions for all config.h variables that had none.
- Changed HAVE_UNSIGNED_CHAR to SIGNED_CHAR_OK.
- Got rid of (the unused) HAVE_SHORT_INO_T.
- Changed version to 2.6.4cvs (long overdue).
2005-01-28 02:00:40 +00:00
Wayne Davison
e30b1fb8fd Added a few more details of changes since 2.6.3. 2005-01-28 01:56:50 +00:00
Wayne Davison
da1b6eeaf2 Mention the latest changes plus a few missed items. 2005-01-28 00:01:54 +00:00
Wayne Davison
01b835c237 Docment the new --delay-updates option. 2005-01-27 22:47:23 +00:00
Wayne Davison
48e1c8c69d Implement the new --delay-updates option. 2005-01-27 22:46:36 +00:00
Wayne Davison
f06e708282 Added the new --delay-updates option. 2005-01-27 22:46:14 +00:00
Wayne Davison
f0f7e760ae - Output the new flist time stats (when available).
- For protocol 29 and above, send the flist time stats to the
  client side (as needed).
2005-01-27 22:23:30 +00:00
Wayne Davison
31b4d25d10 Set the new stats.flist_buildtime and stats.flist_xfertime values. 2005-01-27 22:21:45 +00:00
Wayne Davison
d41988232e - Added a caveat to the definition of the int64 type.
- Added two time values to the stats struct.
2005-01-27 21:55:11 +00:00
Wayne Davison
880570f228 Added a missing newline to an error message. 2005-01-27 21:45:32 +00:00
Wayne Davison
72a90c750a Bumped the copyright year to 2005. 2005-01-27 21:42:56 +00:00
Wayne Davison
e1988bc744 Added .rsync-filter. 2005-01-25 18:16:34 +00:00
Wayne Davison
d6a3e37b83 If rsync is put in the background, output fewer progress-report
lines.
2005-01-25 17:16:13 +00:00
Wayne Davison
8261047b1e - Use the "--filter=._-" option instead of --exclude-from=- if the
protocol being saved is >= 29.
- Call the new get_rule_prefix() function to figure out the right
  rule prefix.
- Strip out the --filter and -f options from the cached command-line.
2005-01-25 12:13:53 +00:00
Wayne Davison
417b59997f - Moved the code that turns rule flags into chars into a new
function called get_rule_prefix().
- Don't pass the per-dir .cvsignore rule from -C for protocols < 29.
2005-01-25 12:10:31 +00:00
Wayne Davison
4366d2c428 In delete_files(), handle new DEL_NO_RECURSE flag (and use
renamed DEL_FORCE_RECURSE flag.
2005-01-25 12:07:13 +00:00
Wayne Davison
217cc3b045 - The call to delete_file() needs DEL_NO_RECURSE when handling
delete_before or delete_after or --dry-run will report too
  many deletions.
- Changed DEL_RECURSE to DEL_FORCE_RECURSE.
2005-01-25 12:05:20 +00:00
Wayne Davison
757e0a5445 Added DEL_NO_RECURSE and changed DEL_RECURSE to DEL_FORCE_RECURSE. 2005-01-25 12:02:08 +00:00
Wayne Davison
ddf6410130 Needed to call add_cvs_excludes() from one more code path. 2005-01-25 11:55:03 +00:00
Wayne Davison
7842418b7b Renamed several exclude-related functions/variables using new
filter terminology.
2005-01-25 10:39:14 +00:00
Wayne Davison
9624b86426 Mention the latest new options. 2005-01-25 04:00:31 +00:00
Wayne Davison
201a2fe5ff Added testing for --filter and merge-file features. 2005-01-25 03:18:29 +00:00
Wayne Davison
ed032a88b8 Mention that --del is a popt alias for --delete-during, so there's
no need to refuse "del" by name -- just refusing "delete-during" or
"delete*" is sufficient.
2005-01-25 03:09:06 +00:00
Wayne Davison
ae76a74043 Document the latest --delete options, including --delete-during. 2005-01-25 03:09:02 +00:00
Wayne Davison
3359acb8cb - Changed --delete to go back to defaulting to the delete-before
functionality.
- Got rid of --delete-before.
- Added --delete-during.
- Added a popt alias for --delete-during:  --del.
- Fixed a bug in the generation of the proper --delete options
  for the server.
- Generate an error if the user tries to specify both --delete-during
  and --delete-after.
2005-01-25 03:08:58 +00:00
Wayne Davison
a2b371cd52 Don't try to allocate zero bytes in push_local_excludes(). 2005-01-25 02:30:59 +00:00
Wayne Davison
dd69b3976a Document the new "filter" parameter. 2005-01-25 00:53:07 +00:00
Wayne Davison
16e5de84da Document --filter (-f) and -F, with lots of changes to the
include/exclude sections, including a little restructuring.
2005-01-25 00:53:03 +00:00
Wayne Davison
46fa602530 Some changes to support the new --filter option:
- Changed XFLG_WORDS_ONLY to XFLG_NO_PREFIXES.
- Added XFLG_DEF_EXCLUDE and XFLG_ABS_PATH.
- Added some new MATCHFLG_* values for the new merge-file support.
- Put the "slash_cnt" var (in the exclude_struct) into a union with
  the new megelist pointer.
2005-01-25 00:52:59 +00:00
Wayne Davison
aa4d3b4cc0 - Added parsing for --filter (-f) and -F.
- Changed the include/exclude calls to work with the new XFLG_* values.
2005-01-25 00:52:56 +00:00
Wayne Davison
73ed23495e Added the "filter" parameter. 2005-01-25 00:52:53 +00:00
Wayne Davison
c7d970f782 The calls into the exclude system changed a little for the new --filter
option:
- The special handling for cvs_exclude went away.
- Call push_local_excludes() and pop_local_excludes() instead of fiddling
  with the (no longer present) local_exclude_list var.
2005-01-25 00:52:50 +00:00
Wayne Davison
6dfd07d025 Implemented the core of the merge-file and per-dir merge-file support
for the --filter option.  Some noteworthy changes:
- Added push_local_excludes() and pop_local_excludes() to implement
  the changes needed as we go from directory to directory (this takes
  the place of the old local_exclude_list var that only handled the
  .cvsignore files).  These per-dir excludes are linked into the same
  exclude list as the global excludes.
- The exclude list is transferred as filter rules to an rsync that
  talks protocol 29 or above.  It limits itself to just include/exclude
  rules for older rsyncs.
2005-01-25 00:52:47 +00:00
Wayne Davison
e7bf7c0161 Some exclude changes for the new --filter option, including:
- Added module_dirlen var.
- Call set_excludes_dir() instead of setting exclude_path_prefix.
- Use the newest XFLG_* options.
2005-01-25 00:52:44 +00:00
Wayne Davison
f5a7b9e716 Improved the explanation for --omit-dir-times. 2005-01-25 00:47:35 +00:00
Wayne Davison
b951e023ec Moved the code that reads the extra byte for a modern inplace
transfer up nearer the code that reads the index.
2005-01-24 17:19:04 +00:00
Wayne Davison
3ea9bbd632 Optimized away the post-transfer directory loop in certain
circumstances.
2005-01-24 06:19:58 +00:00
Wayne Davison
aaca3daa27 Document --delete-before and --delete's new "during" behavior. 2005-01-24 01:41:57 +00:00
Wayne Davison
a51b316824 Added the delete-during handling (also selected with --delete) and
added --delete-before for the old delete logic.
2005-01-24 01:41:54 +00:00
Wayne Davison
928a00c474 Moved a call to add_cvs_exclude() from the delete code to one code-
path in this file.  This avoids a potential duplication of the
cvs-excludes that would occur in the old logic.
2005-01-24 01:41:51 +00:00
Wayne Davison
fa13f396d5 Added code to implement the delete-during handling. 2005-01-24 01:41:48 +00:00
Wayne Davison
3ab56a20ee Moved some of the delete code into flist.c since the generator now
calls it for the delete-during handling.
2005-01-24 01:41:45 +00:00
Wayne Davison
649f874292 Moved some of the delete code from receiver.c to here and implemented
the handling for delete_during (which is called from the generator).
2005-01-24 01:41:42 +00:00
Wayne Davison
90fdd89a0b Mention the --omit-dir-times option. 2005-01-24 00:56:37 +00:00
Wayne Davison
54e66f1d59 Document --omit-dir-times. 2005-01-24 00:51:38 +00:00
Wayne Davison
82471e68a8 Honor the new omit_dir_times var. 2005-01-24 00:51:34 +00:00
Wayne Davison
20fb7b9175 Added --omit-dir-times (-O). 2005-01-24 00:51:32 +00:00
Wayne Davison
859fdaad45 Mentioned the --dirs and --list-only options. 2005-01-24 00:34:53 +00:00
Wayne Davison
09ed309996 - Changed --keep-dirs (-k) into --dirs (-d).
- Document --list-only.
2005-01-24 00:17:42 +00:00
Wayne Davison
65e4cda059 - Changed --keep-dirs (-k) into --dirs (-d).
- Renamed keep_dirs to xfer_dirs.
- Mention --list-only in the --help.
2005-01-24 00:17:39 +00:00
Wayne Davison
7e037c4226 Renamed keep_dirs, "xfer_dirs". 2005-01-24 00:17:36 +00:00
Wayne Davison
f636c38440 Document the new --keep-dirs option. 2005-01-23 16:49:09 +00:00
Wayne Davison
b98f040ef2 Go back to requiring -r for deletes to happen. 2005-01-23 07:27:01 +00:00
Wayne Davison
e57211c544 When an option defined with POPT_ARG_VAL is being refused, we must
change it to POPT_ARG_NONE or it won't be refused.
2005-01-23 01:25:36 +00:00
Wayne Davison
48a1ff0d45 - Use the new delete_before var.
- Check the "keep_dirs" var instead of "recurse" to decide if
  delete is appropriate.
2005-01-22 22:48:40 +00:00
Wayne Davison
032dcf74b0 Check the "keep_dirs" var instead of "recurse" to decide if
delete-after is appropriate.
2005-01-22 22:48:37 +00:00
Wayne Davison
51d4839861 - We now set a delete_before variable for the --delete option.
- Reordered some of the options in the --help list.
- Made the popt-handling of the delete options simpler.
- Parse the new --keep-dirs option.
- Parse the new --list-only option.
- Set recurse to -1 (infinite) for the -r and -a options.
- Set keep_dirs for --list-only.
2005-01-22 22:48:34 +00:00
Wayne Davison
9f125ea7c1 - Implemented a new handling of the recurse variable: if it is
< 0, it specifies infinite recursion, otherwise it contains a
  count of how many levels of recursion we will allow.
- If the user is processing/listing a non-recursive directory/
  arg, send the contents.
2005-01-22 22:48:31 +00:00
Wayne Davison
9bcb25958d - Mustn't override a user-specified list_only value.
- Moved the computing of the options for the server down until
  after we've figured out the protocol_version for the transfer.
- If we're talking to a protocol-29 server in list-only mode,
  force the new --list-only mode (which avoids the -r with
  --exclude="/*/*" kluge).
- Output the options we sent to the daemon if verbose > 1.
2005-01-22 22:48:27 +00:00
Wayne Davison
866925bfb7 Changed the order of a few of the options in the options summary. 2005-01-22 20:32:03 +00:00
Wayne Davison
f8b3c05311 Mustn't override a user-specified list_only value. 2005-01-22 20:28:17 +00:00
Wayne Davison
353f272434 Changed a comment. 2005-01-22 20:27:22 +00:00
Wayne Davison
3d54c6ec46 Moved the /proc/mounts literal string nearer to the top. 2005-01-22 08:11:43 +00:00
Wayne Davison
71e27c463d - Changed XMIT_TOP_DIR to XMIT_DEL_START.
- Changed FLAG_TOP_DIR to FLAG_DEL_START.
2005-01-21 00:34:37 +00:00
Wayne Davison
8c48382049 Don't mention when the file-list is first allocated, just when it
expands.
2005-01-20 23:57:35 +00:00
Wayne Davison
11781089d1 In delete_file(): got rid of DEL_NO_RECURSE code and added
DEL_RECURSE code.  Improved the verbose output of a recursively
deleted directory when --dry-run is specified.
2005-01-20 23:51:57 +00:00
Wayne Davison
d97fd43a72 Decided that delete_in_dir()'s call to delete_file() would be
better using DEL_RECURSE.
2005-01-20 23:51:55 +00:00
Wayne Davison
f5ea4b3b39 Changed DEL_NO_RECURSE to DEL_RECURSE. 2005-01-20 23:51:52 +00:00
Wayne Davison
f227ffe4b9 Moved the dry_run check in set_perms() so that it only triggers if
we don't have a stat-buffer (and returns 1, not 0).
2005-01-20 23:01:34 +00:00
Wayne Davison
027428eb1d Got rid of the erroneous --dry-run short-circuit in the directory
handling.
2005-01-20 22:59:54 +00:00
Wayne Davison
15778afbdc In set_modtime(), the verbose message should be output even if
--dry-run was specified.
2005-01-20 22:58:30 +00:00
Wayne Davison
d06f63287e - Got rid of the uint64 typedef.
- Changed the dev/inode vars to use int64.
2005-01-20 22:43:32 +00:00
Wayne Davison
1490812ab2 Switched uint64 vars over to int64. 2005-01-20 22:42:47 +00:00
Wayne Davison
707415d4fc Use int64 instead of uint64. 2005-01-20 22:37:38 +00:00
Wayne Davison
9cea6ef1b6 Improved a confusing sentence in the description of subcomponent
include/exclude matching.
2005-01-20 19:31:42 +00:00
Wayne Davison
48ea74bf01 When outputting the file list created for the delete pass, identify
it as such.
2005-01-20 00:53:15 +00:00
Wayne Davison
026deaf759 Added an example of running mnt-excl remotely via ssh for a pull. 2005-01-19 21:07:09 +00:00
Wayne Davison
4c59971194 A perl script that outputs excludes for all mount points that affect
the supplied source dir (or all mount points if the arg is omitted).
The excludes are appropriately anchored relative to the supplied dir,
and honor rsync's trailing-slash idiom.
2005-01-19 21:00:26 +00:00
Wayne Davison
fd8571c2c9 Mention a change in the verbose output when deleting directories. 2005-01-19 20:32:25 +00:00
Wayne Davison
dd096ae080 - Updated delete_file() to take a flag arg that makes it more
flexible.  Optimized away a stat() call since the caller knows
  if the item to delete is a directory or not.
- Tweaked delete_file()'s "deleting ..." messages to include a
  trailing slash when we're deleting a directory.
- No need for conditional code around do_lstat() anymore.
2005-01-19 20:11:03 +00:00
Wayne Davison
eb1accaa91 Define the new DEL_* flags. 2005-01-19 20:11:00 +00:00
Wayne Davison
7e38410e47 - Moved write_sum_head() to io.c.
- Use the new delete_file() calling syntax.
2005-01-19 20:10:57 +00:00
Wayne Davison
d336388403 Got rid of delete_one() since we can (and do) use the updated
delete_file() call now.
2005-01-19 20:10:53 +00:00
Wayne Davison
c207d7ec62 Moved write_sum_head() here from generator.c. 2005-01-19 20:10:50 +00:00
Wayne Davison
018b28328c No need for conditional code around do_lstat() anymore. 2005-01-19 19:30:29 +00:00
Wayne Davison
0957a7463e When SUPPORT_LINKS is not defined, we now go ahead and provide
the do_lstat() function and just have it call do_stat().
2005-01-19 19:29:20 +00:00
Wayne Davison
c72f5bd9c4 A slight simplification to the no-implied-dirs change. 2005-01-19 00:34:13 +00:00
Wayne Davison
0f57446da7 Use the new "keep_dirs" var instead of separately checking the
"recurse" and "files_from" vars.  This also simplifies the case
where the code wants to send the implied dirs without recursing.
2005-01-19 00:24:35 +00:00
Wayne Davison
3a90ea0acd - Added new int, keep_dirs, which is set if either recurse or
files_from was specified.
- Pass the the sender the --no-implied-dirs option if --relative
  was specified (or implied) and the sender is not the client.
2005-01-19 00:23:32 +00:00
Paul Green
58af2f958c Fix typo in handling of lchown when the host operating system does
not implement it.  It should get mapped to chown.
2005-01-18 21:19:42 +00:00
Wayne Davison
a8fd4161bb Mention the latest changes. 2005-01-17 23:55:15 +00:00
Wayne Davison
53f8519a38 For --inplace over protocol-version 29 or greater, read the
type the type of basis file the generator is using from the
socket and set the new updating_basis_file var.
2005-01-17 23:11:26 +00:00
Wayne Davison
eb162f3b0a Mention the change in restrictions for --inplace. Also talk about
how --backup makes an --inplace transfer more optimal.
2005-01-17 23:11:22 +00:00
Wayne Davison
4ce838e1f1 We don't need to complain about --inplace being combined with one
of the --FOO-dest options anymore.
2005-01-17 23:11:18 +00:00
Wayne Davison
a36ffd3910 Changed the checks for --inplace to use the new updating_basis_file
variable.
2005-01-17 23:11:13 +00:00
Wayne Davison
17b5b32f75 For --inplace over protocol-version 29 or greater, tell the
sender what kind of a basis file we've selected.
2005-01-17 23:11:05 +00:00
Wayne Davison
9b919d590a - Moved read_sum_head() to io.c (because the generator uses it too).
- Tweaked the read_size var (formerly map_size) that gets passed to
  map_file().
2005-01-17 22:51:29 +00:00
Wayne Davison
80264051d8 Tweaked the read_size var (formerly map_size) that gets passed to
map_file().
2005-01-17 22:51:27 +00:00
Wayne Davison
188fed9570 Moved read_sum_head() here from sender.c (because the generator uses it
too) and improved it with better error checking.
2005-01-17 22:51:24 +00:00
Wayne Davison
eae7165c79 Make sure that we don't compute a block size larger than MAX_BLOCK_SIZE. 2005-01-17 22:51:21 +00:00
Wayne Davison
54281fe733 - Changed the map_size parameter to map_file() to be an int32 named
"read_size".
- Changed some int vars in map_ptr() needed to be int32 vars.
- All callers expect map_ptr() to return back the full "len" bytes,
  so we never shorten this value, even near EOF--the read will
  just get zero-padded, as needed.
- Die with an error if someone calls map_ptr() with a len < 0, or
  if read_size is computed as a value < 0.
2005-01-17 22:51:17 +00:00
Wayne Davison
2b2ea368aa - Incremented the PROTOCOL_VERSION to 29.
- Added define for MAX_BLOCK_SIZE.
- Reorder the variables in the structure defs to sort by size.
- Some vars in map_struct needed to be int32 instead of int.
2005-01-17 22:51:15 +00:00
Wayne Davison
67a28eb256 Got rid of an unneeded assert(). 2005-01-17 22:25:53 +00:00
Wayne Davison
f5d96a6f80 Added a commented-out RSYNC initialization that uses valgrind. 2005-01-17 22:24:08 +00:00
Wayne Davison
44ac015598 Put double-quotes around the --rsync-path arg. 2005-01-17 22:23:09 +00:00
Wayne Davison
89a9c0545e Collapsed two sed invocations into one. 2005-01-17 06:00:44 +00:00
Wayne Davison
3b26bba0c4 Fixed an off-by-one comparison against MAX_BASIS_DIRS. 2005-01-15 21:23:04 +00:00
Wayne Davison
2be2fb3ed3 Use the new FNAMECMP_BASIS_DIR_HIGH to improve a compare-dest check. 2005-01-15 21:17:39 +00:00
Wayne Davison
e341588a8a Define FNAMECMP_BASIS_DIR_LOW and FNAMECMP_BASIS_DIR_HIGH instead of
FNAMECMP_BASIS_DIR.
2005-01-15 21:17:36 +00:00
Wayne Davison
c56595d749 Make sure that the generator sent us a valid index into basis_dir[]. 2005-01-15 21:14:27 +00:00
Wayne Davison
ce0b384fa6 Made basis_dir_cnt non-static. 2005-01-15 21:12:58 +00:00
Wayne Davison
dfd7d541b0 Made compare_dest non-static. 2005-01-15 20:54:25 +00:00
Wayne Davison
ded4daf049 Some inplace-checking code should have been inside the #ifdef that
handles the case where --inplace cannot be supported.
2005-01-15 20:22:54 +00:00
Wayne Davison
361428213b Simplified the logic in allow_access() and tweaked some whitespace. 2005-01-15 20:06:48 +00:00
Wayne Davison
12a79db2f6 Simplified one "if" that checks if one of the --FOO-dest options
was specified.
2005-01-15 04:40:06 +00:00
Wayne Davison
e8b155a3be Improved the docs on --delete and --delete-after. 2005-01-14 19:49:35 +00:00
Wayne Davison
716b46c550 - We now remove the DEST~old~ dir instead of renaming it to DEST~new~.
- Improved the usage message and added an introductory comment.
2005-01-14 19:23:20 +00:00
Wayne Davison
9d954dca8c Make sure that the presence of a partial-dir file is noted, even
if --whole-file is in effect.  Also needed to force statret to 0
when using a partial-dir file.
2005-01-14 18:20:46 +00:00
Wayne Davison
7162c65df7 We also need the "name pipe" from the generator to the receiver
when --partial-dir was specified.
2005-01-14 18:18:31 +00:00
Wayne Davison
bd9fca4708 For the "unexpected tag" or "multiplexing overflow" messages, we
now output who_am_i() so we know who had the problem.
2005-01-14 18:17:32 +00:00
Wayne Davison
14d496cc8b Aid forward-compatibility in the include/exclude syntax by putting
a "- " in front of any name that starts with a '+' or a '-' and would
otherwise be unprefixed (the old code only did this if the '+' or '-'
was followed by a space).
2005-01-13 22:01:56 +00:00
Wayne Davison
106a8ad918 - Allow multiple source paths to be specified (and checked).
- Allow spaces and a few other extra chars in file names.
- For safety, disallow any option that takes an arg.  This should
  be improved in the future because it blocks options such as
  --block-size=N, but without this rule the user could specify
  something like --files-from=FILE or --backup-dir=DIR and have
  it affect files outside the desired SUBDIR restriction.
- Switched to SSH_CONNECTION from the deprecated SSH_CLIENT.
- Strip "::ffff:" from the start of an IP from SSH_CONNECTION.
2005-01-12 19:20:07 +00:00
Wayne Davison
44a82a175d This is Joe Smith's rrsync (restricted rsync) perl script. 2005-01-12 18:48:26 +00:00
Wayne Davison
99248631aa A simple Makefile. 2005-01-11 18:37:37 +00:00
Wayne Davison
2836ee9b02 A debug program to help diagnose data-transfer corruption problems. 2005-01-11 18:36:31 +00:00
Wayne Davison
d82773ffe9 Fixed the file_checksum1() function that is compiled only when
TEST_MDFOUR is defined:  it did not have the fix that the main
rsync code got back in protocol 27 to properly handle files
that are a multiple of 64-bytes long.
2005-01-10 20:52:08 +00:00
Wayne Davison
ec626b3f0e Two more fixes. 2005-01-10 10:08:59 +00:00
Wayne Davison
997d9ea67f Added a "overwriting_basis" arg to finish_transfer(). 2005-01-10 10:03:12 +00:00
Wayne Davison
aec6b9f86f - Call finish_transfer() with its new arg. This ensures that we only
create a backup file if we're about to overwrite the basis file.
- Only clear make_backups for the redo phase if partial_dir isn't set.
2005-01-10 10:03:10 +00:00
Wayne Davison
d45898df80 Call finish_transfer() with its new arg. 2005-01-10 10:03:06 +00:00
Wayne Davison
b0da4b23a0 Moved the reading of the final MSG_DONE message here from main.c
(this message comes from the receiver).  This ensures that any
redo-pass files and delete-after processing are known to be done
prior to the start of our hard-link and dir-time-munging loops.
2005-01-10 00:31:55 +00:00
Wayne Davison
bf18b7ca67 Moved the reading of the final MSG_DONE message from here to
generator.c (the message comes from the receiver).  This ensures
that any redo-pass files and delete-after processing are known to be
done prior to the start of the hard-link and dir-time-munging loops.
2005-01-10 00:31:55 +00:00
Wayne Davison
cc17fbfe7d Mention new atomic-rsync script. 2005-01-06 17:15:36 +00:00
Wayne Davison
fa170b2e5a A perl script to effect an atomic transfer of a set of files. 2005-01-06 17:13:31 +00:00
Wayne Davison
c61ba345f2 Decided that a cross-compling configure should default the
chown-follows-symlinks check to "yes".
2005-01-03 23:01:19 +00:00
Wayne Davison
ae09fb1f91 Improved the last addition. 2005-01-03 22:49:14 +00:00
Wayne Davison
70a2c84cd2 If lchown() is not available, we only skip the call to chown() for a
symlink if it will try to follow the symlink (as a normal OS should).
2005-01-03 22:47:55 +00:00
Wayne Davison
21524e3083 - Added a test to see if chown() follows symlinks.
- Check for getpgrp() and tcgetpgrp().
2005-01-03 22:42:55 +00:00
Wayne Davison
fbe2aba2e7 Mention lchown() fix. 2005-01-03 21:07:02 +00:00
Wayne Davison
a41a1e8718 If there is no lchown(), don't try to set the user & group of a symlink. 2005-01-03 21:05:39 +00:00
Wayne Davison
051547603a Moved kluged (conditional) define of lchown from rsync.h to syscall.c. 2005-01-03 21:03:33 +00:00
Wayne Davison
80a25bb880 Backed out changes to send_deflated_token() that surrounded the
call to deflate(..., Z_INSERT_ONLY) -- the underlying bug was
caused by the zlib code not handling Z_INSERT_ONLY in the case
where the server has disabled compression.
2005-01-02 09:08:59 +00:00
Wayne Davison
0301b334c7 Fixed Z_INSERT_ONLY support in deflate_stored(). 2005-01-02 09:03:44 +00:00
Wayne Davison
1492b4b2b2 The deflate_stored() function needed to support Z_INSERT_ONLY. 2005-01-02 08:49:47 +00:00
Wayne Davison
5b7bcac260 In send_deflated_token(), the section that handles "token != -2"
now breaks up the calls to deflate() into CHUNK_SIZE chunks, just
like the other sections of the code.
2005-01-02 00:55:55 +00:00
Wayne Davison
7fcbf9e43e - Use an int32 for the each block-size variable.
- Fixed a problem in send_deflated_token() where the data we are
  compressing might not finish processing in one call.
2005-01-01 21:08:20 +00:00
Wayne Davison
6c495e0da4 - Use an int32 for the each block-size variable.
- Fixed a potential overflow in the map_size calculation.
2005-01-01 21:08:17 +00:00
Wayne Davison
a06b419d42 Use an int32 for the each block-size variable. 2005-01-01 21:08:14 +00:00
Wayne Davison
a255c592e8 - Use an int32 for the each block-size variable.
- Improved the layout and error-checking of the code that
  calculates the block-size and the number of checksum bits.
2005-01-01 21:08:11 +00:00
Wayne Davison
7aac6604c4 - Use an int32 for the each block-size variable.
- Renamed the local block_size arg to blk_size (to avoid
  confusion with the global block_size variable).
2005-01-01 21:08:07 +00:00
Wayne Davison
deb5bf1dff - Use an int32 for each checksum length variable.
- Simplified some of the code, removing a useless memcpy().
2005-01-01 21:08:05 +00:00
Wayne Davison
3dfe6e97a7 Since lp_bind_address() can't return NULL, we need to check if it is
an empty string and ignore it when it is.
2004-12-31 09:41:04 +00:00
Wayne Davison
43bab4035b A minor improvement to the just-committed code. 2004-12-31 00:41:32 +00:00
Wayne Davison
ef0c03ff70 The code that tries to read an error from the socket in an abnormal-
exit situation was properly forcing the io_timeout value down to 30
seconds, but failing to set the select_timeout value.
2004-12-31 00:39:59 +00:00
Wayne Davison
ad54dcc827 Set select_timeout if the per-module timeout value was lower than
the default select_timeout value.
2004-12-31 00:35:03 +00:00
Wayne Davison
c0ab28d1d9 If we send --files-from to the remote server and relative-paths
are not enabled, we need to also send --no-relative.
2004-12-22 09:10:08 +00:00
Wayne Davison
5b2f48da27 Mention latest fix. 2004-12-16 22:48:31 +00:00
Wayne Davison
132fcf36b2 The "ignore nonreadable" daemon parameter no longer affects
symlinks that are being copied, even if they point nowhere.
2004-12-16 22:47:36 +00:00
Wayne Davison
4571df58c6 Got rid of the rare failure caused by a directory-time mismatch. 2004-12-14 19:41:19 +00:00
Wayne Davison
f6b384d41f Don't call do_lstat() unless SUPPORT_LINKS is defined. 2004-12-13 17:22:32 +00:00
Wayne Davison
c259892c3a Document the client version of the --port option. 2004-12-08 17:30:40 +00:00
Wayne Davison
b471329591 Allow --port to be used in client mode (as well as daemon mode). 2004-12-08 17:29:54 +00:00
Wayne Davison
3add5835db If rsync_port is 0, set it to RSYNC_PORT. 2004-12-08 17:11:15 +00:00
Wayne Davison
cf510ad2c5 Switching to a better rsync_port fix. 2004-12-08 17:09:59 +00:00
Wayne Davison
696a8d6191 Document the new "address" global option. 2004-12-06 22:45:10 +00:00
Wayne Davison
01f8a1155f Made --port and --address point the user at the relevant global
options in the rsyncd.conf manpage.
2004-12-06 22:45:07 +00:00
Wayne Davison
986aaaaa4b Check the global option "address" if the user didn't specify
an --address option when starting the daemon.
2004-12-06 22:45:03 +00:00
Wayne Davison
c96ee2310d Added support for the "address" option. 2004-12-06 22:45:00 +00:00
Wayne Davison
76cb2a3a4f Set default port value for a :: file-spec without a port number. 2004-12-06 17:57:06 +00:00
Wayne Davison
9bef934c76 Improved the examples for the --relative option. 2004-12-03 01:31:24 +00:00
Wayne Davison
85f14172dc Check the return value of flush_write_file() and report an error
if it reports failure.
2004-12-02 17:16:19 +00:00
Wayne Davison
4539c0d79f Improved the description of the --update option. 2004-11-30 20:43:06 +00:00
Wayne Davison
c3131af90a Improved some of the descriptions. 2004-11-30 06:07:50 +00:00
Wayne Davison
c2c14fa26e Removed some redundant words in a sentence. 2004-11-29 17:09:31 +00:00
Wayne Davison
e49f61f5fc Make some of the --*-dest comments clearer and more complete. 2004-11-27 22:09:33 +00:00
Wayne Davison
22f5bd5e35 Improved some of the items. 2004-11-27 21:55:05 +00:00
Wayne Davison
7a1b73b983 Mentioned the latest enhancements. 2004-11-27 18:26:30 +00:00
Wayne Davison
0c56b1add7 Allow "port" to be specified in the rsyncd.conf file. 2004-11-27 18:24:12 +00:00
Wayne Davison
1e60969646 Added tests for multiple --compare-dest options and --copy-dest. 2004-11-27 17:59:48 +00:00
Wayne Davison
ee29752217 Added support for multiple --*-dest options. 2004-11-27 17:56:58 +00:00
Wayne Davison
e012f858d6 - Added parsing for --copy-dest.
- Added support for multiple --*-dest options.
2004-11-27 17:52:51 +00:00
Wayne Davison
c3fad2e227 The compare_dest variable changed. 2004-11-27 17:52:49 +00:00
Wayne Davison
b7e8628c4b - Added support for --copy-dest, which behaves like --link-dest,
but it copies the identical files instead of hard-linking them.
- Added support for multiple --*-dest options.
2004-11-27 17:52:47 +00:00
Wayne Davison
e4977b0b9f - Define MAX_BASIS_DIRS.
- Renamed FNAMECMP_CMPDEST to FNAMECMP_BASIS_DIR.
2004-11-27 17:52:45 +00:00
Wayne Davison
b127c1dc58 Document --copy-dest and the support for multiple --*-dest options. 2004-11-27 17:52:42 +00:00
Wayne Davison
07bff66fb5 Fixed a socket-data conflict when verbosity is >= 2 and the
files-from list is coming from a remote receiver.
2004-11-20 17:10:54 +00:00
Wayne Davison
4a888ae6d4 Mention latest fix. 2004-11-20 07:23:20 +00:00
Wayne Davison
a0a33ee506 Call set_msg_fd_in() during the early phase of being a client sender
so that we monitor the socket for any messages that it might send to
us (and thus avoid a potential hang when verbosity is high).
2004-11-20 07:08:44 +00:00
Wayne Davison
98f8c9a5e5 Some minor improvements to read_msg_fd() made it safe to use both
set_msg_fd_in() and read_msg_fd() during the early phase of being
a client sender (up through the sending of the file list).  This
makes sure that the sender monitors the socket from the receiver
for any messages that it might send to us, and thus avoids a hang
when verbosity is high.
2004-11-20 07:07:37 +00:00
Wayne Davison
1f69bec480 Mention that the --bwlimit may now be combined with --daemon. 2004-11-17 19:41:09 +00:00
Wayne Davison
8f1b4f3642 - Mention the latest enhancements.
- Aged the 2.6.3 news into OLDNEWS.
2004-11-17 19:35:11 +00:00
Wayne Davison
ca39ebf9fb Aged the 2.6.3 release news. 2004-11-17 19:34:31 +00:00
Wayne Davison
9fb0844100 - Added the --bwlimit option to the options that are handled in
combination with --daemon.  This value is both a default bwlimit
  value and a maximum limit if the client asks for something larger.
- Enabled popt support for option aliases.
2004-11-17 19:29:20 +00:00
Wayne Davison
bdf278f7a5 Separate the daemon options from the normal client options. 2004-11-17 19:11:53 +00:00
Wayne Davison
c8f2f8572f Tweaked the error code for a pipe() failure. 2004-11-13 22:32:34 +00:00
Wayne Davison
5d54f33962 Mentioned the new fork() check. 2004-11-13 21:50:56 +00:00
Wayne Davison
ba449e444b Die with an appropriate error if do_fork() fails. 2004-11-13 21:49:26 +00:00
Wayne Davison
87ba7282f6 Mention the new --max-size option. 2004-11-11 01:45:31 +00:00
Wayne Davison
7d1bfaf7be Obey the max_size setting. 2004-11-11 01:45:28 +00:00
Wayne Davison
7d5acf1d44 Added the --max-size option. 2004-11-11 01:45:25 +00:00
Wayne Davison
3610c4583a Document --max-size. 2004-11-11 01:45:22 +00:00
Wayne Davison
41cfde6be3 Checking in the g2r-basis-filename patch that ensures that the receiver
uses the same basis file that the generator used (avoiding a duplicate
check that could cause a hang if a compare-dest file was a named pipe).
2004-11-03 20:30:31 +00:00
Wayne Davison
34bde8d54a Always include lib/snprintf.o when we include lib/compat.o. 2004-11-02 16:47:15 +00:00
Wayne Davison
1ed55e3e3e Mention latest fix. 2004-10-27 06:35:50 +00:00
Wayne Davison
f80a8520e8 Don't ever call make_backup() if we're removing a destination directory
(just remove it).
2004-10-27 06:34:13 +00:00
Wayne Davison
740bab942d Mention the latest bug-fix. 2004-10-18 20:44:09 +00:00
Wayne Davison
08b1b4860f Fixed an off-by-one error in the handling of --max-delete=N. 2004-10-18 20:41:57 +00:00
Wayne Davison
18ea5dc0d7 Mention new option parsing. 2004-10-14 17:11:28 +00:00
Wayne Davison
3ac7f5d4c1 Separate the daemon options so that the user can't mix client options
with daemon options and visa versa.
2004-10-14 17:08:15 +00:00
Wayne Davison
ad71500818 It seems that some popt releases don't define POPT_TABLEEND, so don't
use it.
2004-10-14 09:11:12 +00:00
Wayne Davison
b2ad840a6b Decided we don't need the build_gen target after all. 2004-10-12 20:08:51 +00:00
Wayne Davison
8db7cc2cff - Got rid of some awkward spacing in the long_options table.
- Use the POPT_TABLEEND macro to end the long_options table.
- Improved the count_args() function to accept a NULL pointer.
- Simplified the code that sets *argc using count_args().
2004-10-11 10:43:25 +00:00
Wayne Davison
ac1541f4b7 Mention the latest changes. 2004-10-10 20:33:07 +00:00
Wayne Davison
09e2bbce8a Call flush_write_file() in _exit_cleanup() if we are keeping a
partially-received file.
2004-10-10 20:31:54 +00:00
Wayne Davison
73496a36a1 Handle systems where the makedev() macro is named mkdev(). 2004-10-08 21:27:22 +00:00
Wayne Davison
8303cc1021 A new target, build_gen, works like gen w/o man-page generation. 2004-10-08 19:52:38 +00:00
Wayne Davison
ab759cd27b Improved an error message by using rsyserr(). 2004-10-07 17:02:39 +00:00
Wayne Davison
64444de582 Mention in -a's usage message that -H isn't implied. 2004-10-07 17:00:36 +00:00
Wayne Davison
e425fbe85d Re-enable the "!" token-handling in a .cvsignore file. 2004-10-06 00:10:08 +00:00
Wayne Davison
4f4b2f0927 The device-handling code is no longer omitted based on HAVE_MKNOD
(this is because do_mknod() might be using a different function
to handle fifos and sockets without the help of mknod().
2004-10-01 06:58:23 +00:00
Wayne Davison
da6eb9d123 Improved do_mknod() so that it handles creating a fifo file
and a socket file when mknod() itself does not.
2004-10-01 06:56:14 +00:00
Wayne Davison
1b15e07e99 Make sure that all programs that use syscall.o also include
lib/compat.o so that we can use strlcpy().
2004-10-01 06:53:26 +00:00
Wayne Davison
e49d720081 - Check if struct sockaddr_un has a sun_len member.
- Check if mknod() can make a fifo file.
- Check if mknod() can make a socket file.
2004-10-01 06:51:34 +00:00
Wayne Davison
3267d6a9ce Some systems need do_mkstemp() to use setmode() to set O_BINARY. 2004-10-01 02:34:22 +00:00
Wayne Davison
3ba2c330e1 Check for the setmode() function. 2004-10-01 02:31:10 +00:00
Wayne Davison
618c8a73db Preparing for release of 2.6.3 2004-09-30 16:36:42 +00:00
Wayne Davison
aa0ea373cd Mention the enhancement that was made (quite a while ago) to the
daemon's wildcard-expansion limit (formerly 1000 items, now memory
limited).
2004-09-30 10:46:43 +00:00
Wayne Davison
6c3fda83ba Refined the text of a few of the news items. 2004-09-30 09:58:39 +00:00
Wayne Davison
a3571c6cce - Mention the fix for lost output with 2>&1.
- Prepare the file for the 2.6.3 final release.
2004-09-30 09:37:38 +00:00
Wayne Davison
6fcedb7dbe Mention the (anticipated) 2.6.3 release date. 2004-09-30 09:36:29 +00:00
Wayne Davison
18882701d2 Set our stderr output to blocking I/O to avoid any loss of output. 2004-09-29 17:58:07 +00:00
Wayne Davison
30c041f9ad Changed the errors concerning the secrets file to output with FLOG
instead of FERROR.
2004-09-24 17:04:05 +00:00
Wayne Davison
be7cf82299 - Make sure that match_address() always restores the "tok" string,
even on error.
- Turned the various FERROR messages into (the more proper) FLOG.
2004-09-24 16:50:07 +00:00
Wayne Davison
fde045cd77 Turned the various FERROR messages into (the more proper) FLOG. 2004-09-24 16:39:41 +00:00
Wayne Davison
183150b741 Added some more --inplace info (i.e. it implies --partial and conflicts
with 3 basis-file-affecting options).
2004-09-23 21:15:04 +00:00
Wayne Davison
a2570930e8 Made the refused-option message clearer, like Paul suggested. 2004-09-23 17:39:05 +00:00
Wayne Davison
fdb6716c0f Create a FIFO using mkfifo. 2004-09-23 16:34:43 +00:00
Wayne Davison
a20a88d235 Assume that gettimeofday() takes two arguments when cross-compiling. 2004-09-23 16:00:44 +00:00
Wayne Davison
48d3ff94c9 Only output major/minor info for a character/block device, not for
a FIFO or a socket.
2004-09-23 05:33:48 +00:00
Wayne Davison
a33857da09 Mention that --partial-dir now sets an exclude that helps to avoid
losing the partial data when deleting, and avoid copying any partial
data from the sender.
2004-09-22 04:14:43 +00:00
Wayne Davison
13791b1eeb If the partial-dir value is relative, add a directory-exclude for it
to the end of the user's exclude list.
2004-09-22 04:12:13 +00:00
Wayne Davison
9a5e37fca8 In get_exclude_tok(), if XFLG_DIRECTORY was passed in the xflags,
set MATCHFLG_DIRECTORY in the mflags we return.
2004-09-22 04:11:15 +00:00
Wayne Davison
3e976df0fb Added XFLG_DIRECTORY define. 2004-09-22 04:10:10 +00:00
Wayne Davison
42afed9c1a Preparing for release of 2.6.3pre2 2004-09-21 16:10:35 +00:00
Wayne Davison
37c36e2692 Mention the daemon-socket-connection change. 2004-09-21 15:47:20 +00:00
Wayne Davison
7fbc7031f4 Mentioned a couple more changes. 2004-09-21 15:31:33 +00:00
Wayne Davison
9f004a9ea9 The delete_one() function no longer needs to handle the case where
it thinks it is removing a directory and it is really removing a
symlink.
2004-09-21 09:24:06 +00:00
Wayne Davison
23f4587f2b - Turned readlink_stat() into a static function.
- Made readlink_stat() no longer honor keep_dirlinks.
- The make_file() function now checks keep_dirlinks late in the
  function so that it only transforms a symlink to a local dir
  into a directory if the receiver also has a directory by that
  name.  This makes the use of --delete with --keep-dirlinks
  work much better.
2004-09-21 09:24:02 +00:00
Wayne Davison
4d8f5b0ae7 - Fixed a problem with the $bakdir value.
- Made the files have better contents to copy.
- Also test --backup without --backup-dir.
2004-09-20 19:50:04 +00:00
Wayne Davison
89389a29ef Output a backup message when verbose > 1 and we did a copy prior
to an --inplace update.
2004-09-20 19:47:59 +00:00
Wayne Davison
29fe3961ab Output the same backup-message prefix when verbose > 1 regardless of
the setting of --backup-dir.
2004-09-20 19:46:45 +00:00
Wayne Davison
4e8a085ac9 Use $diffopt instead of -u. 2004-09-20 05:17:57 +00:00
Wayne Davison
fb22c2774d Got rid of a superfluous static buffer. 2004-09-20 05:01:38 +00:00
Wayne Davison
7d059d4c37 A simple test of the backup functionality. 2004-09-20 04:59:01 +00:00
Wayne Davison
9715c5899a Improved a comment. 2004-09-20 04:17:42 +00:00
Wayne Davison
cc07f21211 Mention the new RSYNC_PARTIAL_DIR environment variable. 2004-09-18 17:37:54 +00:00
Wayne Davison
b4d1e854ef Document the new RSYNC_PARTIAL_DIR environment variable. 2004-09-18 17:35:20 +00:00
Wayne Davison
075aa18fd4 Look for the RSYNC_PARTIAL_DIR environment variable when --partial
was specified (and --partial-dir was not).
2004-09-18 17:34:56 +00:00
Wayne Davison
e0204f5621 Mention that older rsync versions had a problem with --link-dest and
how to work around it.
2004-09-18 01:49:19 +00:00
Wayne Davison
a9ac4411e5 Mention the latest changes. 2004-09-17 16:53:51 +00:00
Wayne Davison
50b31539c2 - Added the ability to parse a literal IPv6 address in an "rsync:" URL
(e.g. rsync://[2001:638:500:101::21]:873/module/dir).
- Improved a couple --files-from error messages.
2004-09-17 16:50:53 +00:00
Wayne Davison
56194bcd95 When outputting the flist info (in a debug-level of verbosity) we
now mention the UID of the file when we are the sender (as well as
when we are root).
2004-09-17 16:39:34 +00:00
Wayne Davison
eb8ffa9040 Actually, since the close calls shouldn't fail (now that listener
is properly set to -1 on close), we don't really need to play the
save-errno game after all.
2004-09-16 17:22:31 +00:00
Wayne Davison
a7a1cc2c75 Make sure that /etc and /bin actually are readable before we try
to list them.
2004-09-16 17:16:36 +00:00
Wayne Davison
ab217f7ffa - Set "listener" to -1 after we close it so that the error-handler
doesn't try to re-close it.
- Set blocking I/O before the second (final) connect() call.
2004-09-16 17:09:46 +00:00
Wayne Davison
a20c9893e4 Don't try to optimize-away the sending of the --delete option if
--delete-after was specified (since we don't know what the protocol
version will be yet).
2004-09-08 07:33:06 +00:00
Wayne Davison
3bb400ca14 If --backup was used with --inplace, we don't limit the basis-file
matches (as we normally would) because the receiver is using the
backup-file as the basis-file.
2004-09-07 21:45:19 +00:00
Wayne Davison
cd6aa5b5c0 When --backup is used with --inplace, we make a copy of the destination
file into its backup spot while generating the checksums.
2004-09-07 21:44:02 +00:00
Wayne Davison
dc55d7bdab If we're making backups with --inplace, use the backup file as the
basis file while still updating the real destination file inplace.
2004-09-07 21:34:26 +00:00
Wayne Davison
8b115ac8dc Turn off make_backups during the redo phase, just like the receiver. 2004-09-07 21:32:36 +00:00
Wayne Davison
c94e4afbfa Moved the code that determines the backup filename into a new function
named get_backup_name().
2004-09-07 21:29:26 +00:00
Wayne Davison
6566d205e2 Made full_write() non-static. 2004-09-07 21:26:26 +00:00
Wayne Davison
e484f0cc04 W mustn't backup an inplace file in finish_transfer(). 2004-09-07 20:37:36 +00:00
Wayne Davison
bd397b8cba Reject the use of --compare-dest or --link-dest with --inplace
(it will take extra code to suppor this).
2004-09-07 20:36:36 +00:00
Wayne Davison
f8c8ef9eac When we say we're skipping a non-regular file, actually skip it. 2004-09-07 19:49:09 +00:00
Wayne Davison
72c19bb3de A minor optimization to the partial-dir code. 2004-09-07 17:03:51 +00:00
Wayne Davison
89f7eff382 Fix the case where a partial-dir file exists but the destination
file does not.
2004-09-07 16:50:07 +00:00
Wayne Davison
b90a6d9ff6 Mention that --whole-file interferes with the reuse of a --partial-dir
file.
2004-09-07 16:49:10 +00:00
Wayne Davison
584ba4ebae Fixed a typo Paul pointed out. 2004-09-05 21:30:00 +00:00
Wayne Davison
ba3db4795e Allow the use of the --exclude*/--include* options to a server
process again, but make sure that the user didn't specify a
server-excluded file for one of the --*-from options.
2004-08-26 17:39:48 +00:00
Wayne Davison
59d73bf3d2 Some fixes & clarifications for the BATCH MODE section. 2004-08-18 07:50:36 +00:00
Wayne Davison
919ca3a3cc Few few more minor improvements to the existing change items. 2004-08-18 07:49:03 +00:00
Wayne Davison
5886edfac2 Corrected/enhanced a comment. 2004-08-18 07:00:17 +00:00
Wayne Davison
d414962af4 One more NEWS tweak. 2004-08-12 21:02:13 +00:00
Wayne Davison
8fb7db245a Mention the security fix. 2004-08-12 20:58:33 +00:00
Wayne Davison
6f0fc27e33 Got rid of one item. 2004-08-12 20:48:05 +00:00
Wayne Davison
9c54ad58f8 Preparing for release of 2.6.3pre1 2004-08-12 20:06:57 +00:00
Wayne Davison
f55c2dfc03 One last minor tweak to clean_fname(). 2004-08-12 20:04:47 +00:00
Wayne Davison
675ef1aa3a Tweaked the USAGE section a tad and added an ADVANCED USAGE section
that discusses how to request multiple names from a remote rsync.
2004-08-12 19:31:23 +00:00
Wayne Davison
ef57235623 Improved the build rule for getfsdev and added getfsdev.o to the
files we cleanup.
2004-08-12 18:59:03 +00:00
Wayne Davison
d66d07e883 If system won't let us set chmod bits, fall back to testing without
them set.
2004-08-12 18:51:35 +00:00
Wayne Davison
b92693daba - Made clean_flist()'s collapsing of ".." dirs optional by adding
a "BOOL collapse_dot_dot" arg.
- Improved some comments.
2004-08-12 18:20:14 +00:00
Wayne Davison
58b1999e08 Call clean_flist() with its new "collapse_dot_dot" arg. 2004-08-12 18:20:07 +00:00
Wayne Davison
8e5f029e02 One (hopefully) last change to the sanitize_path() code. 2004-08-12 10:13:45 +00:00
Wayne Davison
2d41264e9e Simplified sanitize_path() logic a little. 2004-08-12 09:32:16 +00:00
Wayne Davison
82c6be7edf More improvements and a couple missing items. 2004-08-12 01:27:26 +00:00
Wayne Davison
0219d4dfba Improved a comment. 2004-08-12 00:58:01 +00:00
Wayne Davison
391516da51 Got rid of a comment that became inapplicable. 2004-08-12 00:52:58 +00:00
Wayne Davison
1d6b8f9ad2 - Call sanitize_path() with updated args.
- Added count_dir_elements() function.
- Changed the args for sanitize_path() so that the caller can request
  the value for the rootdir and so that the caller tells us the current
  subdir depth instead of sending us a string that we have to figure it
  out from.
- Make sure that sanitize_path() doesn't mis-parse multiple adjacent
  slashes.
2004-08-11 23:41:06 +00:00
Wayne Davison
10796f4b6e Call sanitize_path() with updated args. 2004-08-11 23:41:03 +00:00
Wayne Davison
33ffd7c37d - Set the var lastdir_depth when setting lastdir.
- Call sanitize_path() with updated args.
2004-08-11 23:41:00 +00:00
Wayne Davison
21d1e929a0 Ignore new getfsdev executable. 2004-08-11 17:33:52 +00:00
Wayne Davison
d0bc3520de Make the text of the --times (-t) option more correct on what
happens if it is omitted.
2004-08-11 17:24:37 +00:00
Wayne Davison
9f18657889 A minor improvement in check_one_exclude(). 2004-08-10 18:15:33 +00:00
Wayne Davison
c16d69b292 Mention the early-chmod change. 2004-08-09 20:58:26 +00:00
Wayne Davison
ebeacb36fb Set each file's permissions and modtime before it gets renamed. 2004-08-09 20:57:10 +00:00
Wayne Davison
6558854dbe Do some simple tests with various read-only and set[ug]id files. 2004-08-09 20:52:35 +00:00
Wayne Davison
7d9d5d9478 Added a rule for building getfsdev and for requiring it to run "test". 2004-08-09 20:51:44 +00:00
Wayne Davison
630f548ff4 Made robust_rename() return a 1 if it had to copy the file. 2004-08-09 20:48:38 +00:00
Wayne Davison
100b62bb69 Output a device string for each file given on the command-line. 2004-08-09 20:46:54 +00:00
Wayne Davison
e012b94f21 Fixed a bug in clean_fname() that could sometimes leave a "dir/.."
sequence uncollapsed.
2004-08-07 20:56:41 +00:00
Wayne Davison
3104620cf0 Made clean_fname() return the length of the string. 2004-08-06 22:36:55 +00:00
Wayne Davison
ebdd24d6d0 An improved clean_fname() routine that is more efficient and will also
collapse ".." dirs that aren't at the start of the path.  Care was taken
to ensure that the cleaning of a name that goes over the socket is done
in the same way as the old code (because both sides call clean_fname()
on those file-list names).  This ensures compatibility with older rsync
versions.
2004-08-06 21:24:14 +00:00
Wayne Davison
7cd72c79ec Set "eob" correctly in add_exclude_file(). 2004-08-05 22:58:17 +00:00
Wayne Davison
84a6379565 Merged alloc_sanitize_path() into sanitize_path(), adding an extra arg
that indicates the destination dir for the resulting path (if the dest
is NULL, a buffer will be allocated) and having it return a value.
2004-08-05 21:57:11 +00:00
Wayne Davison
0a5f12720e Use the new sanitize_path() calling syntax. 2004-08-05 21:57:09 +00:00
Wayne Davison
73f7af0e88 If dry_run is > 1 then the destination directory was missing, so we
set stat_errno to ENOENT and statret to -1 without calling stat().
2004-08-05 18:18:36 +00:00
Wayne Davison
e5a96f0f54 In get_local_name(), if we would have created the destination dir but
were prevented by dry_run being set, increment dry_run so that the
generator knows that all the files are missing.
2004-08-05 18:17:44 +00:00
Wayne Davison
d73e7f6edd In set_refuse_options(): make sure we scan the whole list of options
and avoid complaining about a wild-card spec that actually matches
one or more options.
2004-08-04 21:20:34 +00:00
Wayne Davison
61542c41de Decided that we don't need to limit the block size after all now
that the map_file() code handles large block sizes better.
2004-08-03 15:41:16 +00:00
Wayne Davison
bd1a581bee Use MAX_MAP_SIZE in the args to map_file(). 2004-08-03 15:37:54 +00:00
Wayne Davison
6e8a1782ab - Changed the calling syntax for map_file() so that it takes both
a (possibly approximate) window size and an optional block size
  (which is used to round-up the window size if it is non-zero).
- Don't set window_start behind the supplied offset in map_ptr().
2004-08-03 08:05:29 +00:00
Wayne Davison
96d910c770 Call map_file() with its new args, including a suggested window
size.
2004-08-03 08:05:27 +00:00
Wayne Davison
7560c17adc We call map_ptr() with a data range than includes any unmatched data
(which we might need to reference again) in addition to the current
rolling-checksum block (this prevents the unmatched data from being
lost when we slide the buffer and read more data).
2004-08-03 08:05:23 +00:00
Wayne Davison
9cd339eb39 - Changed the description for --block-size in the --help text.
- Use the new MAX_BLOCK_SIZE to limit the block_size value.
2004-08-03 08:05:20 +00:00
Wayne Davison
f310029387 - Added define for MAX_BLOCK_SIZE.
- Increased the MAX_MAP_SIZE.
2004-08-03 08:05:17 +00:00
Wayne Davison
3ed8eb3f9c Updated the description of the --block-size option. 2004-08-03 07:58:48 +00:00
Wayne Davison
007351494d Mention the open64()/mkstemp64() configure change. 2004-08-02 22:06:17 +00:00
Wayne Davison
6dcb93208d Don't use mkstemp() if the OS has open64() but not mkstemp64(). 2004-08-02 21:56:07 +00:00
Wayne Davison
84e1a698bf Test for functions open64() and mkstemp64(). 2004-08-02 21:54:49 +00:00
Wayne Davison
0d7638eafd Got rid of trailing whitespace. 2004-08-02 16:49:20 +00:00
Wayne Davison
86e2f445f7 Mention the "refuse options" change. 2004-08-02 07:41:04 +00:00
Wayne Davison
093e816c37 Allow better wildcard matching against the short-option letters in
the "refuse options" handling.
2004-08-02 07:40:34 +00:00
Wayne Davison
1cb0a3edc6 Document the improved "refuse options" syntax. 2004-08-02 05:01:36 +00:00
Wayne Davison
06a5054273 - Extended the "refuse options" daemon setting to allow wildcards
and to allow single-letter option names.
- No need to send the various --delete* options or the --force option
  from the receiver to the sender.
2004-08-02 05:00:30 +00:00
Wayne Davison
acd0299243 Got rid of unused externs. 2004-08-02 04:50:33 +00:00
Wayne Davison
dca68b0aad - Changed "read so far" to "received so far".
- Output the who_am_i() information in the socket read/write errors to
  make it a little clearer who is complaining about what (for those
  familiar with rsync, at least -- e.g. it will help when users report
  errors).
2004-08-02 02:43:54 +00:00
Wayne Davison
c3ea09906d - Changed all the errors in parse_arguments() to use the err_buf so
that a client talking to a daemon server actually gets the error.
- If a daemon has a list of exclusions, apply that list to various
  options to ensure that an excluded file can't be affected.
- Fixed an arg-checking problem when --files-from got passed to a
  daemon.
2004-07-31 20:09:54 +00:00
Wayne Davison
bf4679e8a0 If we need to return an error during the startup phase and the other
side is expecting us to send them a files-from list, send the list
terminator before sending the error.
2004-07-31 19:55:42 +00:00
Wayne Davison
c4054610c8 Don't allow a --partial-dir setting to overwrite a server-excluded
file (affects a daemon receiver only).
2004-07-31 18:13:20 +00:00
Wayne Davison
f6c0d3d70b - Document the change to --copy-links.
- Improved the "OUTPUT CHANGES" section.
2004-07-31 16:20:28 +00:00
Wayne Davison
ef855d198e Document the old side-effect to --copy-links and that it no longer
happens in a modern rsync w/o --keep-dirlinks.
2004-07-31 16:19:14 +00:00
Wayne Davison
81b07870c8 One call to link_stat() (in set_perms()) needed to honor the setting
of keep_dirlinks if the current item is a directory.
2004-07-31 16:15:41 +00:00
Wayne Davison
bb6721dce6 Reset copy_links in the receiver. 2004-07-31 16:14:27 +00:00
Wayne Davison
446a2987cd Prominently mention the changes to the text that gets output. 2004-07-31 03:33:05 +00:00
Wayne Davison
4de2a17409 Changed "wrote"/"written" to "sent" and "read" to "received" in
the text that is output.
2004-07-31 03:32:42 +00:00
Wayne Davison
99d24f77ed - Mention the "list = no" change in error handling.
- Improved a few of the NEWS items.
2004-07-30 22:46:07 +00:00
Wayne Davison
c0422cea9f If someone is denied access to a "list = no" module, lie and tell them
that the module is "Unknown" (so the user can't probe to find unlisted
modules).
2004-07-30 20:07:52 +00:00
Wayne Davison
8b6ad0193d Don't ignore case in lp_number() because the rest of the daemon code
can't handle the case where the module name doesn't exactly match the
string the user provided.
2004-07-30 20:05:37 +00:00
Wayne Davison
33eff8bfd6 If we reject a name due to a server-exclude, someone is trying to hack
rsync (because the generator would not have included this file).  Respond
with an exit.
2004-07-30 07:02:37 +00:00
Wayne Davison
65af3dab03 Document the latest changes. 2004-07-29 18:08:16 +00:00
Wayne Davison
065a605270 Got rid of bogus compare_dest scan in skip_file() -- it must checksum
the same file that we used for the stat() (in the parent routine).
2004-07-29 16:45:48 +00:00
Wayne Davison
a7260c4037 Added the new --partial-dir option. 2004-07-29 16:06:38 +00:00
Wayne Davison
44cad59f2b Document the new --partial-dir option. 2004-07-29 16:06:34 +00:00
Wayne Davison
c52461f911 Check the error return of flush_write_file(). 2004-07-29 07:37:27 +00:00
Wayne Davison
7f459268d9 Added close_multiplexing_in() and renamed io_multiplexing_close()
to close_multiplexing_out().
2004-07-29 07:24:45 +00:00
Wayne Davison
9eeb3b9c88 Call the new close_multiplexing_in() function in the generator. 2004-07-29 07:24:00 +00:00
Wayne Davison
d1b31da71e If we fail writing to the socket and we're receiving error messages
from the other side via a multiplexed input, read the socket to see
if we get some errors that would explain why they went away.
2004-07-29 07:09:46 +00:00
Wayne Davison
89e540e638 One more inplace code tweak. 2004-07-29 06:59:30 +00:00
Wayne Davison
fab65a5bc2 Some minor fixes and improvements for the inplace code. 2004-07-29 06:40:26 +00:00
Wayne Davison
e7d13fe532 - Explicitly save the stat()'s errno so that we can be sure we're
testing the right thing lower down (and so that future code doesn't
  always have to remember to save it off and restore it).
- Improved a chunk of link_dest code.
- Handle the removal of a non-regular file without so much duplicated
  code.
2004-07-28 10:04:06 +00:00
Wayne Davison
ecc81fce17 Use the new safe_fname() function. 2004-07-26 16:36:59 +00:00
Wayne Davison
b4afd23c30 Allow safe_fname() to tweak up to two name at a time. 2004-07-26 16:34:36 +00:00
Wayne Davison
af1a3f9b6e Use safe_fname() in full_fname(). 2004-07-26 15:59:51 +00:00
Wayne Davison
820b6c9aa0 Added safe_fname() that converts any newlines in a name into '?'s. 2004-07-26 15:52:25 +00:00
Wayne Davison
3cb22c204c Made a comment better. 2004-07-26 05:38:02 +00:00
Wayne Davison
7432ccf4ed Some batch-mode changes. 2004-07-24 16:51:58 +00:00
Wayne Davison
6a48e792c1 Made the new option-twiddling message only output when verbose. 2004-07-24 16:51:16 +00:00
Wayne Davison
9459290ae7 Call read_stream_flags() as soon as we open the batch file for
reading.
2004-07-24 16:40:41 +00:00
Wayne Davison
741d654495 Call write_stream_flags() from start_write_batch(). 2004-07-24 16:39:53 +00:00
Wayne Davison
d3e182af09 Added write_stream_flags() to write the state of certain flags into
the batchfile and read_stream_flags() to read and twiddle the same
flags.  This ensures that the batchfile reading doesn't get confused
about what data to expect from the socket.
2004-07-24 16:38:49 +00:00
Wayne Davison
d9b4d267c7 Tweaked a compound line. 2004-07-23 16:59:38 +00:00
Wayne Davison
58c5c24555 Added a comment. 2004-07-23 16:59:22 +00:00
Wayne Davison
341c9a137f Some basic batch-mode tests. 2004-07-23 02:13:34 +00:00
Wayne Davison
871446fc98 Chris added a missing "not" to a comment. 2004-07-23 01:40:22 +00:00
Wayne Davison
0abda1b176 Fixed the opening comments. 2004-07-23 01:39:19 +00:00
Wayne Davison
394bcdb5e3 If we sucessfully renamed a file that has multiple links to it, unlink()
it to ensure that rename() didn't lie to us (which it does if you try to
rename() a file over another link to the same file).
2004-07-22 22:52:39 +00:00
Wayne Davison
28deecca55 Changed NO_INT64 to INT64_IS_OFF_T because off_t might actually be
64 bits.  The code now only complains if int64 is really too short.
2004-07-22 19:28:45 +00:00
Wayne Davison
4db88e5b8f Some --help text fixes. 2004-07-22 15:43:28 +00:00
Wayne Davison
75b243a51d Some more --inplace improvements. 2004-07-22 15:41:09 +00:00
Wayne Davison
9bccfc429c Should always call finish_transfer() for inplace handling, just like
for keep_partial handling.
2004-07-22 15:31:06 +00:00
Wayne Davison
077e59b769 The inplace handling in finish_transfer() now passes PERMS_SKIP_MTIME
to set_perms() if ok_to_set_time wasn't specified.
2004-07-22 15:30:04 +00:00
Wayne Davison
007e3c0e9a Need to output the "failed verification" error before sending the
MSG_REDO so that the output comes out in the right order.
2004-07-22 08:16:35 +00:00
Wayne Davison
e2bc412669 Added a warning message when a file fails to verify, letting the user
know if we retained it or discarded it.  Especially useful for batch-
reading mode where the old code could look like it did the update when
it really silently failed.
2004-07-22 04:15:18 +00:00
Wayne Davison
e344209582 Added even more double-quoting. 2004-07-22 03:23:04 +00:00
Wayne Davison
e76ca1458c No need to check both delete_after and delete_mode since the former
implies the latter.
2004-07-22 02:52:57 +00:00
Wayne Davison
16cc9ca2c9 In read_batch mode, we read ints from the new batch_gen_fd pipe and
only process the updates from the batch file when the generator has
indicated that it is ready (which ensures that all the necessary
dirs have been created).
2004-07-21 23:59:37 +00:00
Wayne Davison
8c90957ff5 Got rid of read_batch special case. 2004-07-21 23:59:33 +00:00
Wayne Davison
c0d8e84c9d Setup for read_batch mode a little differently:
- Avoid calling local_child().
- Create a pipe that lets the generator send us index values.
- Set batch_gen_fd for the receiver to read the pipe.
2004-07-21 23:59:31 +00:00
Wayne Davison
b0ad542928 Added batch_gen_fd. 2004-07-21 23:59:28 +00:00
Wayne Davison
727b35f665 In read_batch mode, we now let the code write out the index value
to the f_out pipe before we return from recv_generator().  This gives
the receiver something to sync with so that it doesn't rush ahead of
us (which could be bad if we didn't have a chance to create the
destination dirs yet).
2004-07-21 23:59:25 +00:00
Wayne Davison
aa4343211f Don't write out the protocol_version number in read_batch mode. 2004-07-21 23:59:22 +00:00
Wayne Davison
3611989355 Complain if the user combines --read-batch with --files-from. 2004-07-21 22:50:11 +00:00
Wayne Davison
3381b77d71 Improved the test a little. 2004-07-21 21:06:13 +00:00
Wayne Davison
dce70db374 Adding a test for the --compare-dest option. 2004-07-21 20:58:32 +00:00
Wayne Davison
2adbcdc7ea A couple am_sender checks (one negated) were not needed. 2004-07-21 20:17:02 +00:00
Wayne Davison
7e5fa372cf Call map_file() with the new block_size arg (had to delay the
call to map_file() until the block size was known).
2004-07-20 21:35:58 +00:00
Wayne Davison
6e45e1dd86 - Call map_file() with the new block_size arg (had to delay the
call to map_file() until the block size was known).
- Got rid of the setting of max_map_size.
2004-07-20 21:35:55 +00:00
Wayne Davison
7f290d5c82 - Added a new block_size arg to map_file(). Use it to set the
new def_window_size member variable.
- Got rid of max_map_size global (we use def_window_size now).
2004-07-20 21:35:52 +00:00
Wayne Davison
b6609cafae - Got rid of cleanup_buf (map-file cleanup is not needed).
- Renamed the cleanup_fd* vars.
2004-07-20 21:35:49 +00:00
Wayne Davison
efa95a1842 Call map_file() with its new block_size arg. 2004-07-20 21:35:46 +00:00
Wayne Davison
51bd4f0f3a Tweaked an error message. 2004-07-20 21:10:20 +00:00
Wayne Davison
562b61695e Added a def_window_size variable to struct map_struct. 2004-07-20 21:08:33 +00:00
Wayne Davison
98f51bfb56 - More batch-file improvements.
- A few spelling fixes.
2004-07-20 18:12:50 +00:00
Wayne Davison
73f0ce69e7 We now append the exclude list as a "here" document to the end of
the BATCH.sh file.
2004-07-20 17:07:55 +00:00
Wayne Davison
cf338ab1be Made write_sbuf() non-static. 2004-07-20 16:57:18 +00:00
Wayne Davison
66a9dc9639 Changed write_batch_argvs_file() to new write_batch_shell_file()
call (with extra arg).
2004-07-19 17:11:41 +00:00
Wayne Davison
8ed9d849dc Added new function discard_receive_data(). 2004-07-19 17:05:01 +00:00
Wayne Davison
5ebab6c10c - Don't allow some crafty user to try to force us to update a
server-excluded file.
- If get_tmpname() fails we need to discard the update using
  receive_data().
2004-07-19 16:37:30 +00:00
Wayne Davison
e7a69008e6 Do a better job of writing out the BATCH.sh file (i.e. quote special
characters and spaces in args, omit all the source args, omit the
include/exclude args if we can).
2004-07-19 08:27:17 +00:00
Wayne Davison
73e015683c Changed batch.rsync_argvs to batch.sh. 2004-07-19 03:59:35 +00:00
Wayne Davison
b462781fd0 Fixed the argv munging to work properly regardless of whether the
user specified a trailing '=VALUE' or put the value in a separate
arg.
2004-07-19 00:53:49 +00:00
Wayne Davison
93095cbe99 A very minor optimization was made to read_sbuf(), read_byte(),
write_sbuf(), and write_byte().
2004-07-17 21:17:34 +00:00
Wayne Davison
399371e7b5 - Improved the warning about --inplace.
- Fixed the sentence describing how to read standard input with
  --read-batch.
2004-07-17 16:44:16 +00:00
Wayne Davison
d7142e2328 Moved the read_batch abort check below the code that handles the
symlinks and devices.
2004-07-17 16:29:10 +00:00
Wayne Davison
1f75bb1066 Revamped some of the io variables and calls to make the various I/O
functions seemlessly work on fds that aren't for the main socket. This
involved changing some fd-variable names (to make them clearer), adding
io_set_sock_fds(), and making input buffering have a better enabled
flag (via an allocated buffer, just like the output buffering).  I also
got rid of the fd arg to some functions where the fd arg could only
specify the input or output fd for the socket (which we already know).
2004-07-17 15:20:00 +00:00
Wayne Davison
088adfacc1 Got rid of the arg to io_start_multiplex_out(). 2004-07-17 15:19:57 +00:00
Wayne Davison
da3478b2a7 - Got rid of the arg to the io_start_multiplex_{in,out}() calls.
- Call io_set_sock_fds().
2004-07-17 15:19:54 +00:00
Wayne Davison
5126ed1ef0 Changed a MIN() to a MAX() when setting max_map_size. 2004-07-17 10:59:14 +00:00
Wayne Davison
61fb21ad28 Mention the new --inplace option. 2004-07-17 00:00:27 +00:00
Wayne Davison
a3221d2ac1 My version of Mark Curtis's --inplace option. 2004-07-16 20:06:24 +00:00
Wayne Davison
2c713fcdfa Added a check for ftruncate. 2004-07-16 20:04:20 +00:00
Wayne Davison
afd8bdb907 Avoid some useless memory copying. 2004-07-16 18:08:52 +00:00
Wayne Davison
efd5ee5786 - Limit the maximum block size we compute for a file.
- Set max_map_size based on the current file's block size (so that
  map_ptr() is more efficient with large blocks).
2004-07-16 18:04:23 +00:00
Wayne Davison
510b4cd4d5 Added a max_map_size variable, initialized to MAX_MAP_SIZE. 2004-07-16 18:02:30 +00:00
Wayne Davison
de584c658c Limit the block-size that the user can specify. 2004-07-16 18:01:30 +00:00
Wayne Davison
6eb770bbcc Improved a sentence about --whole-file. 2004-07-16 17:14:55 +00:00
Wayne Davison
c7e11bfdc0 Make wf_writeBufSize based on a multiple of WRITE_SIZE instead
of the unrelated MAX_MAP_SIZE.
2004-07-16 01:32:02 +00:00
Wayne Davison
94327ff0c2 - Complain and die if --dry-run is used with a batch option.
- Improved the warning if a batch option gets sent to the server.
2004-07-15 19:06:32 +00:00
Wayne Davison
4602eafa87 Changed the batch examples to show how to do a remote read-batch
without first transferring the batch file.
2004-07-15 19:04:54 +00:00
Wayne Davison
bb3edc3b47 Expanded the comment on the new batch code. 2004-07-15 19:03:50 +00:00
Wayne Davison
c769702fe5 Mention that "-" can be used with --read-batch for reading from stdin. 2004-07-15 17:56:11 +00:00
Wayne Davison
dbbab0c4d2 Allow --read-batch=- to indicate stdin. 2004-07-15 17:01:51 +00:00
Wayne Davison
9b3318b0df We no longer refer to a batch "prefix". 2004-07-15 16:27:02 +00:00
Wayne Davison
0fac7fe8b8 Mention new batch-mode changes. 2004-07-15 03:13:09 +00:00
Wayne Davison
b9f592fbf5 My modified version of Chris Shoemaker's improved batch-file handling. 2004-07-15 02:20:08 +00:00
Wayne Davison
c7b1a56b3d Mention recent changes. 2004-07-14 17:11:53 +00:00
Wayne Davison
3896bca4d8 Tweaked some single-line ifs. 2004-07-14 16:41:10 +00:00
Wayne Davison
9774cc3344 The "len" to generate_and_send_sums() is supposed to be an OFF_T. 2004-07-14 16:40:08 +00:00
Wayne Davison
d3979b025d Committed a space-tweak from Chris Shoemaker. 2004-07-14 16:39:08 +00:00
Wayne Davison
01966df4f7 Improved the write_batch_argvs_file() routine so that it doesn't
need the character buffers and so that it properly removes the
hostname from the destination arg.
2004-07-14 07:20:18 +00:00
Wayne Davison
f38bd4a072 Got rid of the disable_deltas_p() function (the whole_file value
is now fully set before the generator forks).
2004-07-13 01:45:51 +00:00
Wayne Davison
b1df18d76f We now conditionally turn on whole_file in do_cmd() right before
calling local_child().
2004-07-13 01:44:03 +00:00
Wayne Davison
7daccb8e72 In generate_files(), changed arg "f" to "f_out", as Chris Shoemaker
suggested.
2004-07-12 20:42:48 +00:00
Wayne Davison
bb91a624f1 Made hard_link_check() compile when SUPPORT_HARD_LINKS isn't enabled. 2004-07-12 07:03:28 +00:00
Wayne Davison
a04d77bcbc Use want_i instead of last_i+1. 2004-07-07 08:38:40 +00:00
Wayne Davison
25bd99451c Make the GID_NONE define a little safer. 2004-07-07 08:25:13 +00:00
Wayne Davison
ed43d0a76d Added some missing $(srcdir) references. 2004-07-04 08:56:31 +00:00
Wayne Davison
066a844c4e Changed a "for" loop into a "do ... while" loop. 2004-07-04 08:07:23 +00:00
Wayne Davison
5e252dea4b Optimized away a loop in hash_search(). 2004-07-02 23:35:30 +00:00
Wayne Davison
d2a918b454 Some formatting tweaks. 2004-07-02 18:23:57 +00:00
Wayne Davison
da38e779ea Moved the verbose message about renaming the finished file down into
finish_transfer() so that it only gets output when we're actually going
to rename the file.
2004-07-02 18:13:53 +00:00
Wayne Davison
8186ae6bc0 Tweaked some formatting. 2004-07-02 18:12:24 +00:00
Wayne Davison
e1f67417d7 Some simple whitespace tweaks. 2004-06-30 07:27:30 +00:00
Wayne Davison
fd322eef82 Made recv_generator static. 2004-06-29 19:19:00 +00:00
Wayne Davison
d3a4375f78 Optimized away a call to cmp_modtime() for a compare-dest file. 2004-06-29 16:22:54 +00:00
Wayne Davison
78112d305b Mention the extended argv-overflow checking. 2004-06-29 15:13:18 +00:00
Wayne Davison
f7c3ee9932 Tweaked an overly-long line. 2004-06-29 15:12:01 +00:00
Wayne Davison
e7a392c77c A few more improvements to the anti-overflow args[] checking. 2004-06-28 17:45:40 +00:00
Wayne Davison
887e553f05 Make sure that do_cmd() doesn't overflow its arg-pointer array
(which was also made larger).
2004-06-28 17:25:14 +00:00
Wayne Davison
beb227ddf1 Got rid of a couple unneeded assignments. 2004-06-24 04:46:02 +00:00
Wayne Davison
84acca07ae Restoring correct skip_file() return semantics. 2004-06-23 21:21:19 +00:00
Wayne Davison
cc1e997dcd Thought skip_file() wasn't returning 1 for "skip" and 0 or "keep"
so I reversed the return.
2004-06-23 16:51:21 +00:00
Wayne Davison
a7026ba90a Fixed a newly-introduced problem in read_timeout() where FD_ZERO(&w_fds)
wasn't always called before w_fds was used.
2004-06-23 01:13:09 +00:00
Wayne Davison
3a69fad0f6 Some trivial format tweaks. 2004-06-20 21:48:06 +00:00
Wayne Davison
40564811ee Mentioned the latest socket change and fixed a few typos. 2004-06-20 20:37:06 +00:00
Wayne Davison
dcd08dc51c Restored the code in the IPV6_V6ONLY section that checks the
return value from setsockopt() with one improvement:  if the
user has used --ipv6 (-6) we don't discard the IPv6 socket.
This should help people using older Linux kernels that don't
implement IPv6 support quite right.
2004-06-20 19:51:19 +00:00
Wayne Davison
fdf57ede8c Tweaked a comment. 2004-06-20 19:47:05 +00:00
Wayne Davison
bd717af8ab Must not call check_timeout() before checking the errno value. 2004-06-19 07:09:57 +00:00
Wayne Davison
c54f5170bf Added some missing changes. 2004-06-19 06:55:58 +00:00
Wayne Davison
eae4e1f9f0 Some minor improved sentences. 2004-06-19 05:52:45 +00:00
Wayne Davison
9c513d678d Tweaked some comments. 2004-06-18 16:55:12 +00:00
Wayne Davison
d16c245fc4 Some helpful comments from Chris Shoemaker. 2004-06-18 16:50:20 +00:00
Wayne Davison
ec8290c897 Fixed some typos in a comment, moved an extern, and made a few
minor format tweaks.
2004-06-18 16:30:24 +00:00
Wayne Davison
b293a7f62c Improved a comment. 2004-06-18 16:29:21 +00:00
Wayne Davison
d67c8bdfc3 Moved the externs to the top and made a few trivial format tweaks. 2004-06-18 16:22:14 +00:00
Wayne Davison
e2ccd3578c Got rid of some trailing whitespace. 2004-06-18 16:00:33 +00:00
Wayne Davison
4e834af140 If --partial was specified, make sure that make_backup is turned
off during the second (retry) phase of the transfer to avoid
making a second backup of a file (which would lose the original).
2004-06-14 15:09:36 +00:00
Wayne Davison
7e5614383d Added a short msleep() after option_error() before we exit. This
ensures that the remote client has time to read our error message
while it is trying to write data to us before it gets a socket
error.
2004-06-13 14:18:48 +00:00
Wayne Davison
eb84a83b47 Changed the new code in delete_one() so that some compilers
don't complain about returning a value from a void function.
2004-06-12 21:30:07 +00:00
Wayne Davison
2c2898a388 Mention the bugfix in option-parsing error-reporting from a daemon. 2004-06-12 18:27:04 +00:00
Wayne Davison
1732b6c037 - Changed some FERROR log calls to FLOG.
- Improved the option-error-reporting to actually get the error back
  to the user (by getting I/O multiplexing started).
2004-06-12 18:22:39 +00:00
Wayne Davison
314f459161 - Made readlink_stat() and link_stat() optionally follow a symlink
to a dir.  This fixes deletions inside "kept" symlinked dirs.
- Call link_stat() with its new arg (for --keep-dirlinks support).
2004-06-11 07:40:57 +00:00
Wayne Davison
83926d3cae Make sure that keep_dirlinks is turned off for the sender. 2004-06-11 07:40:54 +00:00
Wayne Davison
6218c7bf42 - Moved --keep-dirlinks code over to flist.c.
- Call link_stat() with its new arg (for --keep-dirlinks support).
2004-06-11 07:40:51 +00:00
Wayne Davison
566fce3237 Made delete_one() handle a failed rmdir on a symlink when
--keep-dirlinks was specified.
2004-06-11 07:40:48 +00:00
Wayne Davison
373ef16010 Call link_stat() with its new arg (for --keep-dirlinks support). 2004-06-11 07:40:45 +00:00
Wayne Davison
ea76e76104 In set_filesystem(), call do_stat(), not link_stat() to ensure
that we get the directory behind it all.
2004-06-11 05:02:59 +00:00
Wayne Davison
9fd62d1588 The mkdir code should be using do_stat(), not do_lstat() to copy
each existing dir's mode & owner info.
2004-06-10 16:43:52 +00:00
Wayne Davison
b7061c82b4 Allow the argv list the daemon uses for globbing its args to grow. 2004-06-09 21:51:07 +00:00
Wayne Davison
6fb812f747 Removed some excessive parens. 2004-06-09 21:43:28 +00:00
Wayne Davison
40e8d11e64 Mentioned a couple more bugfixes. 2004-06-09 21:42:33 +00:00
Wayne Davison
73042aae5b Restore UNUSED() macro (the prior problems that prompted me to remove
it appear to have been a build-farm bug).
2004-06-09 21:41:21 +00:00
Wayne Davison
e5ce3bcf2c Needed to enclose the new symlink-warning code in an
"#if SUPPORT_LINKS" conditional.
2004-06-09 19:23:56 +00:00
Wayne Davison
c399d22a19 Renamed read_unbuffered() to readfd_unbuffered() so that it matches
writefd_unbuffered().
2004-06-09 03:07:50 +00:00
Wayne Davison
1ea087a794 - Made the maximum-fd computation prior to a select() use the same idiom
in both the read and write code (also use a better variable name).
- Made the bytes-available code at the end of the select() loop use the
  same flow of control in the read and the write code.
2004-06-08 22:18:04 +00:00
Wayne Davison
00bdf89977 Improved a comment in read_msg_fd() and made the byte-reading code
in read_timeout() a little better.
2004-06-08 16:23:54 +00:00
Wayne Davison
0bb4d17634 Improved rwrite() in two ways:
- We no longer assume that the buffer is null terminated (daemon
  mode would ignore the len when logging a message).
- Errors in daemon mode are now sent to both the log and the user.
2004-06-07 22:51:14 +00:00
Wayne Davison
f9c6b3e7d6 Increase the size of the message-receving buffer for error
messages sent from the receiver to the generator.
2004-06-07 22:47:01 +00:00
Wayne Davison
9e5a5ddb4c Changed a few FINFO messages to FLOG. 2004-06-07 22:33:01 +00:00
Wayne Davison
8c0d6a8432 Got rid of some am_daemon games in option_error(). 2004-06-07 22:05:22 +00:00
Wayne Davison
553f93758a Updated some exclude information that has changed. 2004-06-07 21:40:11 +00:00
Wayne Davison
a4a7e64c19 Don't report a "file vanished" error if a symlink points to nowhere
and -L was specified.
2004-06-07 19:59:20 +00:00
Wayne Davison
22832c30a0 Updated a couple things. 2004-06-06 20:41:01 +00:00
Wayne Davison
1a21666286 Tell folks to go to the bug-tracking page to report bugs. 2004-06-06 20:36:56 +00:00
Wayne Davison
4033b80b51 - Got rid of some useless calls to msg_list_push().
- Added a couple checks to ensure that the receiver doesn't mix two
  clashing kinds of writes on the msg_fd_out pipe.
- Made sure that the read code in the receiver flushes the msg_fd_out
  pipe, if needed.
2004-06-06 19:15:58 +00:00
Wayne Davison
99218d821b If the user specifies a small io_timeout value, lower select_timeout. 2004-06-06 19:02:40 +00:00
Wayne Davison
e626b29e10 Make sure our select calls don't sleep for over one minute at a time,
even when io_timeout is a longer value (though the code in options.c
might set it to a shorter value if io_timeout is small).
2004-06-06 19:02:09 +00:00
Wayne Davison
f89b936801 Don't use single-line "if (condition) statement;" idiom. 2004-06-06 18:36:22 +00:00
Wayne Davison
17f59e818d Mention changes to the patches dir. 2004-06-05 21:23:59 +00:00
Wayne Davison
b5bd5542eb Neatened up some of the glob-expand code and made a few other
minor tweaks.
2004-06-05 20:26:56 +00:00
Wayne Davison
2e94e70e2b Some superficial code tweaks. 2004-06-05 19:59:03 +00:00
Wayne Davison
4e1f385711 Mentioned new --keep-dirlinks option. 2004-06-05 16:19:02 +00:00
Wayne Davison
716e73d483 New --keep-dirlinks option. 2004-06-05 16:16:30 +00:00
Wayne Davison
5b36173d11 Mention new SSH_* vars. 2004-06-03 17:20:33 +00:00
Wayne Davison
b2ef4f6134 The daemon-over-ssh code now looks for $SSH_CONNECTION and $SSH2_CLIENT
as well as $SSH_CLIENT to figure out the remote IP address.
2004-06-03 17:20:21 +00:00
Wayne Davison
c7be6dec11 - Added older news from NEWS file.
- Added missing releases from the Partial Protocol History section.
2004-06-01 21:27:52 +00:00
Wayne Davison
bd1574b208 Moved older news to OLDNEWS. 2004-06-01 21:27:12 +00:00
Wayne Davison
f376e67420 Got rid of an unneeded character pointer in send_file_entry(). 2004-05-29 21:21:17 +00:00
Wayne Davison
ef0bc0abff Mention the --bwlimit change. 2004-05-28 19:42:06 +00:00
Wayne Davison
71e586304b Improvements to make --bwlimit work better. 2004-05-27 22:09:31 +00:00
Wayne Davison
3c74c3a358 Set a new variable, bwlimit_writemax, based on the value of the bwlimit
option.
2004-05-27 21:51:53 +00:00
Wayne Davison
edad5898f2 Got rid of a superfluous call to gettimeofday(). 2004-05-24 22:59:16 +00:00
Wayne Davison
fa0c1939ed The various include/exclude options are not used on the server side,
so if someone is trying something funny, just quit.
2004-05-24 18:38:05 +00:00
Wayne Davison
9a5ade185c Made full_fname()'s char-pointer arg const. 2004-05-24 08:10:22 +00:00
Wayne Davison
f1dd0f27cb - Properly quote the $excl references.
- Moved the creation of our .cvsignore exclude file.
2004-05-24 00:16:07 +00:00
Wayne Davison
f9e5a0cde2 Improved the depth calculation in sanitize_path() so that it properly
handles a trailing slash, a leading slash, and an empty string.
2004-05-23 23:46:56 +00:00
Wayne Davison
ead751c62b Moved a couple lines. 2004-05-22 19:29:53 +00:00
Wayne Davison
0058c58edd A few minor improvements to the existing items. 2004-05-22 19:24:24 +00:00
Wayne Davison
221ddb9456 Fixed a typo in the sending of the --checksum-seed option to the server. 2004-05-22 06:09:22 +00:00
Wayne Davison
65e2487096 Fixed the comment for get_exclude_tok(). 2004-05-22 05:32:20 +00:00
Wayne Davison
0501f36390 Tweaked the alloc/realloc code in flist_expand(). 2004-05-21 23:22:14 +00:00
Wayne Davison
96981b9cff Tell rsync to preserve permissions. 2004-05-21 10:06:09 +00:00
Wayne Davison
f51e87f5ad Another new option. 2004-05-21 10:00:21 +00:00
Wayne Davison
cb213f1c1b Got rid of a compiler warning (which was only output by certain
compilers).
2004-05-21 09:59:49 +00:00
Wayne Davison
c8d895de26 Added the --checksum-seed option. 2004-05-21 09:44:32 +00:00
Wayne Davison
e51094b721 - Improved option_error() to make sure that the user sees the error in
daemon mode.
- Got rid of some repetitious outputting of the same error-message.
2004-05-21 09:41:38 +00:00
Wayne Davison
b03bded70b Document a couple more changes. 2004-05-21 09:29:17 +00:00
Wayne Davison
ee1df1ccae If --backup was specified without a --backup-dir, don't preserve the
directory timestamps.
2004-05-21 08:43:03 +00:00
Wayne Davison
bc6ebcd248 Moved a few externs. 2004-05-21 08:40:25 +00:00
Wayne Davison
ba582f753a Changed sum_init() to take a seed value as an arg instead of always
using checksum_init.  This fixes an authentication problem in server
mode (as pointed out by Craig Barratt).
2004-05-21 08:27:04 +00:00
Wayne Davison
cbd85b472e - Mention the change to the daemon-mode's exclude handling.
- Mention the new "write only" daemon-config option.
- Fixed another entry to refer to the right files.
2004-05-19 22:20:56 +00:00
Wayne Davison
7a92ded39a Added the "write only" option to the daemon config file. 2004-05-19 22:19:19 +00:00
Wayne Davison
831f05df51 A few minor text improvements. 2004-05-18 09:54:52 +00:00
Wayne Davison
0d94a6a66c Added a little more quoting. 2004-05-18 09:47:42 +00:00
Wayne Davison
3e35c34b6b Output a message when we skip a server-excluded file. 2004-05-18 08:50:17 +00:00
Wayne Davison
03a9ca0a97 Document the latest changes. 2004-05-18 01:13:14 +00:00
Wayne Davison
6f481bb0e0 - Use fromdir, todir, and tmpdir instead of FROM, TO, and TMP.
- Added chkdir.
- Quote the dir expansions to avoid problems with spaces.
- Added "exclude = foobar.baz" the the rsync.conf file we create.
2004-05-18 00:41:55 +00:00
Wayne Davison
f98cc5685d Test that a config-file-specified exclude works right. 2004-05-18 00:41:51 +00:00
Wayne Davison
9135621ff9 Quote the dir expansions to avoid problems with spaces. 2004-05-18 00:41:49 +00:00
Wayne Davison
8624daa7f8 - Use fromdir and todir instead of FROM and TO.
- Quote the dir expansions to avoid problems with spaces.
2004-05-18 00:41:46 +00:00
Wayne Davison
3051c46dc3 - Use $suitedir to find rsync.fns.
- Use tmpdir instead of TMP.
2004-05-18 00:41:43 +00:00
Wayne Davison
e920830ec5 Use $suitedir to find rsync.fns. 2004-05-18 00:41:40 +00:00
Wayne Davison
7892e5ac77 - Use $suitedir to find rsync.fns.
- The values of fromdir, todir, and chkdir are already set.
2004-05-18 00:41:38 +00:00
Wayne Davison
b0e9bafc78 - Use $suitedir to find rsync.fns.
- The values of fromdir and todir are already set.
2004-05-18 00:41:35 +00:00
Wayne Davison
44aa070770 Removing obsoleted test.sh file (we used the runtests.sh framework for
some time now).
2004-05-18 00:32:36 +00:00
Wayne Davison
97f9dcae6a If the server has excluded a file, we now exclude it from being
uploaded as well as downloaded.
2004-05-18 00:14:10 +00:00
Wayne Davison
8cbf495a57 Renamed free_exclude_list() to clear_exclude_list(). 2004-05-16 23:54:12 +00:00
Wayne Davison
c1b29492c5 Moved the setting of ret->match_flags up a little in make_exclude(). 2004-05-16 14:08:34 +00:00
Wayne Davison
669a31924e - Save some memory in each exclude_struct item by dumping the "include"
and "directory" ints and using bits in the match_flags value instead.
- Added defines for the new match-flag values, including a new one that
  lets get_exclude_tok() properly return an indication that it parsed
  the list-clearing token.
2004-05-16 07:28:24 +00:00
Wayne Davison
5e972dcf34 - Switched the "include" and "directory" ints into bits in match_flags.
- Made some length vars unsigned.
2004-05-16 07:28:21 +00:00
Wayne Davison
8fcdc444df - Improved rsyserr() to prefix RSYNC_NAME (as the TODO requested),
to construct the string in a better manner, and to have a buffer
  big enough to hold a full MAXPATHLEN filename plus some error
  text.
- Fixed some comments referring to vsprintf() returning -1 -- our
  configuration process now ensures that we replace such a function
  with our own lib version.
2004-05-15 19:31:16 +00:00
Wayne Davison
619d21ffc9 - Complain about an exclude that was too long and then dump it
(used to be silently truncated).
- Include extra space in our exclude-reading buffers so that we
  can fit a 2-char prefix and a trailing slash and still handle
  a MAXPATHLEN name.
2004-05-15 19:31:13 +00:00
Wayne Davison
d62bcc17f3 Changed rprintf() calls that included strerror() to use rsyserr(). 2004-05-15 19:31:10 +00:00
Wayne Davison
982e05bbd5 Changed rprintf() calls that included strerror() to use rsyserr(). 2004-05-15 19:31:10 +00:00
Wayne Davison
a3c8b36863 Added rsyserr(). 2004-05-15 19:31:05 +00:00
Wayne Davison
630e3c408b Whitespace tweaks. 2004-05-15 19:09:42 +00:00
Wayne Davison
1082b52bd4 Changing if (!write_batch) in front of send_exclude_list() to
if (!read_batch) -- fixes hang.
2004-05-15 18:51:21 +00:00
Wayne Davison
914f3066bb Added a "gen" rule to remake various generated files: configure,
config.h.in, proto.h, rsync.1, and rsyncd.conf.5 .
2004-05-15 00:48:11 +00:00
Wayne Davison
de91e75724 In the debug output, distinguish between a user-requested clearing
of the exclude list and the popping of the local exclude list that
occurs when we finish each subdir.
2004-05-14 21:23:41 +00:00
Wayne Davison
384431886a Changed PERMS_SKIP_TIME to PERMS_SKIP_MTIME. 2004-05-13 18:51:22 +00:00
Wayne Davison
82b302d928 Got rid of some useless externs. 2004-05-13 18:41:17 +00:00
Wayne Davison
4ecc9e6b64 The finish_transfer() call takes an arg that specifies if we should set the
modtime or not on the finished file.  It calls set_perms(), which now takes a
flag arg that allows us to specify if we want to skip the modtime modification.
2004-05-13 07:08:25 +00:00
Wayne Davison
55e50d890b If the file did not transfer correctly, only save it if --partial was
specified.  We also skip the setting of the modtime too on a partial
copy (that way the partial file won't be confused with an up-to-date
copy of the original).
2004-05-13 07:08:22 +00:00
Wayne Davison
6e86c951d7 Call finish_transfer() with its new arg. Also put the externs
at the top and got rid of some trailing whitespace.
2004-05-13 07:08:18 +00:00
Wayne Davison
c41b52c487 Use the new PERMS_REPORT flag when calling set_perms(). 2004-05-13 06:55:01 +00:00
Wayne Davison
5c6fc4a6a3 Added PERMS_REPORT and PERMS_SKIP_TIME. 2004-05-13 06:53:23 +00:00
Wayne Davison
edecdad54d If we got a read-error on a file, make sure that the whole-file
checksum we send to the receiver is wrong (so they won't save
the bogus file).
2004-05-13 06:46:20 +00:00
Wayne Davison
5291364f1d Don't force the modtime on our backup dirs -- the dirs in the
backup hierarchy should have their own timestamps.
2004-05-13 06:34:03 +00:00
Wayne Davison
41cc97ae64 In send_files(), changed the name of the map_struct variable from
"buf" to "mbuf" (so that it wouldn't be so similar to the "buff"
variable nor use a name that is more typically a char* buffer).
2004-05-11 19:53:16 +00:00
Wayne Davison
bf2b7ddfc5 Use memset() to initialize a new map_struct. 2004-05-11 19:46:56 +00:00
Wayne Davison
eb0cbdaa90 Got rid of an unused extern. 2004-05-11 17:25:16 +00:00
Wayne Davison
0d0142e812 Got rid of unused externs. 2004-05-11 17:25:01 +00:00
Wayne Davison
a43e21e05c Let's just remove all the UNUSED() macros for now. 2004-05-08 22:49:58 +00:00
Wayne Davison
4135d091a6 Changed the non-globbing version of glob_expand_one() so that it
checks the maxargs argument instead of leaving it unused.
2004-05-08 20:03:39 +00:00
Wayne Davison
534407b1f4 One more attempt to get HP-UX's cc to build popt successfully. 2004-05-08 19:50:22 +00:00
Wayne Davison
18cc8c7ef1 Improved a comment and got rid of some trailing whitespace. 2004-05-08 19:37:28 +00:00
Wayne Davison
58c9b4b7f6 Tweaked the sizeof syntax and some multi-statement lines. 2004-05-08 19:26:53 +00:00
Wayne Davison
cde719f49f Changed the order of the msgcode enum so that new items now get added
at the start (which avoids the need for trailing-comma changes on old
entries when new ones are added).
2004-05-08 18:48:09 +00:00
Wayne Davison
38cab94d9a - Improved the get_secret()'s function comments, made it accept a line
that doesn't end with a newline, and optimized it a bit.
- Improved getpassf() to work if the line does not end with a newline.
2004-05-08 18:18:42 +00:00
Wayne Davison
6ed6d7f5a8 Improved the function comments for read_line() and slightly tweaked
its code.  Also changed "IO" to "I/O" in various comments.
2004-05-08 18:03:43 +00:00
Wayne Davison
e40a46de71 Document the -4, -6, --ipv4, --ipv6 options. 2004-05-07 00:18:37 +00:00
Wayne Davison
c5bf99a1c2 Correct a typo. 2004-05-06 21:29:36 +00:00
Wayne Davison
2c7d63c765 - Updated the comments for open_socket_in().
- Changed open_socket_in() to return an array of ints with a trailing -1
  value to indicate the end of the list.
- Use the out_of_memory() routine to complain about no memory.
- Undid the recent IPV6_V6ONLY change, as I think it would prevent the
  use of IPv6 sockets on some older systems.
- If we get an EADDRINUSE error and this is not the first socket in the
  list, suggest that the user try --ipv4 or --ipv6.
- When forking, the child now closes all the open bound sockets, not just
  one of them (I'm not talking about the fd from accept(), obviously).
2004-05-06 21:26:46 +00:00
Wayne Davison
3dd22903ac Introduced long-option names for -4 and -6. 2004-05-06 21:08:01 +00:00
Wayne Davison
d8d36af452 If we need to set IPV6_V6ONLY but setsockopt() fails, close the
socket and skip it.
2004-05-05 22:17:48 +00:00
Wayne Davison
e610e50f9c Added missing extern for read_batch. 2004-05-05 17:15:03 +00:00
Wayne Davison
935c64173f Don't force the whole-file option when using read-batch. 2004-05-05 16:23:49 +00:00
Wayne Davison
377dbd2075 Calls to make_bak_dir() should only happen when we fail to create a
file/dir/etc. with errno == ENOENT.
2004-05-04 03:10:45 +00:00
Wayne Davison
93272700d2 A slight refinement to my last patch. 2004-05-03 01:24:10 +00:00
Wayne Davison
d508258ad8 Fixed crash bug that can affect --delete in certain circumstances. 2004-05-03 01:18:07 +00:00
Wayne Davison
f57b2e6150 Got rid of a TODO comment that was fixed long ago. 2004-05-02 17:04:14 +00:00
Wayne Davison
af45f9e27e Renamed variable STRIP to INSTALL_STRIP to avoid an accidental match
with an environment variable in OpenBSD.
2004-05-02 16:52:52 +00:00
Wayne Davison
4c4d61b046 Got rid of trailing comma in an enum. 2004-05-02 16:34:33 +00:00
Wayne Davison
7561c3e132 Moved some news items under new headings. 2004-04-30 21:10:58 +00:00
Wayne Davison
1514ad2a80 Changed the order that ssh and rsh are mentioned. 2004-04-30 20:39:29 +00:00
Wayne Davison
d8195637d4 Additional testing confirmed the limited scope of the sources affected
by the -R sorting bug.
2004-04-30 19:14:52 +00:00
Wayne Davison
c8d771a0fb Preparing for release of 2.6.2 2004-04-30 18:03:33 +00:00
Wayne Davison
9130776c4e Mention the last few tweaks that made it into 2.6.2. 2004-04-30 17:53:51 +00:00
Wayne Davison
9eac94a4dd Improved the program that checks for broken large-file locking. 2004-04-30 17:38:22 +00:00
Wayne Davison
6e06d2f31a Don't rely on the local shell's wildcard expansion to make the test
work right -- it might not be quite as compatible as we need.
2004-04-30 17:24:49 +00:00
Wayne Davison
6a6d21136a Only refer to AI_NUMERICHOST if it is defined. 2004-04-30 16:10:45 +00:00
Wayne Davison
f28bd83346 Fixed a few typos. 2004-04-30 15:46:41 +00:00
Wayne Davison
96fb478eae Mention the desire to improve how a daemon returns errors. 2004-04-29 21:12:46 +00:00
Wayne Davison
8752b3fcd8 Describe the changes for 2.6.2. 2004-04-29 21:09:33 +00:00
Wayne Davison
55ffed7e42 Preparing for release of 2.6.2pre1 2004-04-29 20:36:22 +00:00
Wayne Davison
e00df64bae Got rid of unused check for sys/sysctl.h. 2004-04-29 19:40:17 +00:00
Wayne Davison
080ddf58ae Fixed a sorting problem when an entry has an empty (but not NULL)
dirname (which I had thought impossible, but it appears to occur
with --relative in some instances).
2004-04-29 19:37:15 +00:00
Wayne Davison
4ce48a5bfd Restore old behavior of logging most daemon errors instead of sending
them to the user.  This should eventually be improved to duplicate
some of these messages to the user to keep them informed about what
went wrong.
2004-04-29 19:34:31 +00:00
Wayne Davison
20bf7f847f Undefined __attribute__ in some circumstances. 2004-04-28 17:35:08 +00:00
Wayne Davison
b66d00853b Fixed the use of an uninitialized variable in map_uid() and map_gid(). 2004-04-28 17:31:31 +00:00
Wayne Davison
8b602edda4 In copy_file(), check len < 0 before checking the close() return values. 2004-04-27 19:59:37 +00:00
Wayne Davison
9f27cd8ca6 Check the return code from close() and output an error if it
fails.
2004-04-27 19:51:33 +00:00
Wayne Davison
b084f9e092 Got rid of a debug-output statement. 2004-04-27 16:41:33 +00:00
Wayne Davison
4220e1098e Preparing for release of 2.6.1 2004-04-27 03:55:37 +00:00
Wayne Davison
c30468169a - Tweaked the bullet char so that vim can auto-format the items more
easily (and then used vim to re-flow the items).
- Added a mention about the daemon security fix.
- Added the 2.6.1 release date.
2004-04-27 03:53:28 +00:00
Wayne Davison
c0d9e8c76b - Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY.
- Got rid of HP-UX kludge (since it didn't help).
2004-04-27 01:36:16 +00:00
Wayne Davison
90a973fe8a Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY. 2004-04-27 01:36:10 +00:00
Wayne Davison
7f0feb4dd6 - Changed XFLG_NO_PREFIXES to XFLG_WORDS_ONLY.
- Don't parse comment lines in add_exclude_file() when XFLG_WORD_SPLIT
  is set.
2004-04-27 01:36:06 +00:00
Wayne Davison
33a5432ea6 Got rid of HP-UX kludge (since it didn't help). 2004-04-27 01:36:00 +00:00
Wayne Davison
968ff560d2 Made a comment clearer. 2004-04-27 01:00:58 +00:00
Wayne Davison
cd59be1d5e One more try at getting the HP-UX system in the build farm to compile
popt.
2004-04-25 20:36:41 +00:00
Wayne Davison
8b2869c0d2 Don't use __attribute__((__unused__)) on HP-UX w/o gcc. 2004-04-25 16:10:09 +00:00
Wayne Davison
82a51ea53d Improved the debug string for the local_exclude_list. 2004-04-24 08:00:39 +00:00
Wayne Davison
20af605eba Improved the EXCLUDE PATTERNS section some more. 2004-04-24 06:16:04 +00:00
Wayne Davison
a6536635e3 Fixed a comment. 2004-04-23 08:09:13 +00:00
Wayne Davison
adddd075eb Mention how --update behaves when the type of the file differs on
the source and destination systems.
2004-04-23 05:14:39 +00:00
Wayne Davison
a0c823b22b Recently added caveat is no longer true. 2004-04-23 01:33:35 +00:00
Wayne Davison
9fdb334e85 Restore the old include behavior where a command-line include could
override a .cvsignore exclude.
2004-04-22 22:17:15 +00:00
Wayne Davison
f89e890b87 Got rid of a wrong paragraph. 2004-04-22 21:35:45 +00:00
Wayne Davison
1c666c3fcb Got rid of a bunch of cruft. 2004-04-22 21:17:58 +00:00
Wayne Davison
2a383be0f1 Updated the default list of cvs-excluded files and added some extra
info on how the option interacts with other include/exclude rules.
2004-04-22 18:17:30 +00:00
Wayne Davison
ac1d2d3384 Added "debug_type" to the exclude_list_struct. 2004-04-22 09:58:24 +00:00
Wayne Davison
acfcfa7053 No need to pass a debug string to check_exclude() anymore. 2004-04-22 09:58:21 +00:00
Wayne Davison
8ef81dd452 No need to pass a debug string to check_exclude() anymore. When we
free an exclude list, make sure we don't clear the debug_type string.
2004-04-22 09:58:18 +00:00
Wayne Davison
67340e9523 Initialize the new debug_type string in each exclude list and output
it in a couple extra debug messages.  When we free an exclude list,
make sure we don't clear the debug_type string.
2004-04-22 09:58:15 +00:00
Wayne Davison
a7ceddae34 Changed check_exclude()'s prototype. 2004-04-22 09:58:11 +00:00
Wayne Davison
24e1569f8b The debug output for add_exclude() now needs to limit the pattern to
print only "pat_len" chars.
2004-04-22 08:41:03 +00:00
Wayne Davison
de31639fff A couple minor text improvements. 2004-04-19 17:52:39 +00:00
Wayne Davison
8b46340924 Mentioned the better handling of option paths when a daemon is not
running with chroot enabled.
2004-04-18 06:29:06 +00:00
Wayne Davison
d008bcb5cd Made the device-changes section agree with the latest code. 2004-04-17 19:58:12 +00:00
Wayne Davison
0484b5b0b7 Preparing for release of 2.6.1pre-2 2004-04-17 18:40:16 +00:00
Wayne Davison
f01b6368a5 Mention that --from0 does not affect --cvs-exclude's reading of the
.cvsignore files.
2004-04-17 18:12:33 +00:00
Wayne Davison
40d38dc0be In add_exclude_file(), if we're word-splitting, stop reading a "line"
at any whitespace (so that we don't overflow the line buffer).
2004-04-17 17:55:45 +00:00
Wayne Davison
33a2361cc2 The inode and dev values in the idev struct are now uint64. 2004-04-17 17:14:16 +00:00
Wayne Davison
4124540d61 Changed the dev handling for -H back to using an opaque 64-bit
integer instead of trying to transfer it as separate major & minor
values.  Since the value is not interpreted by the receiving side
(just compared for equality), this is a safer way to go.
2004-04-17 17:14:12 +00:00
Wayne Davison
5f38126817 Use "uint64" instead of INO64_T (which is now gone). 2004-04-17 17:07:23 +00:00
Wayne Davison
b05b3c9b48 Fixed alloc_sanitize_path()'s handling of a rootdir == "/" (the old
code would generate a string that started with "//" instead of "/").
2004-04-17 17:06:03 +00:00
Wayne Davison
a03a9f4efe Don't say "skipped" if the file is just not being transferred (i.e.
when other updates, such as owner/permissions/etc. might be made).
2004-04-15 18:32:24 +00:00
Wayne Davison
3e55030372 Mention exclude improvements. 2004-04-15 18:23:52 +00:00
Wayne Davison
273c0420d0 Got rid of a couple useless lines. 2004-04-15 18:22:56 +00:00
Wayne Davison
5774786fa5 Moved some externs. 2004-04-15 16:55:23 +00:00
Wayne Davison
1a9ec1fd1c Got rid of zlib/dummy ("dummy" is in the zlib .cvsignore, where it
should be).
2004-04-15 06:54:14 +00:00
Wayne Davison
b2aa573b1c Our exclude lists are now comprised of a base structure with a head
and a tail pointer pointing to a linked list of items (rather than
an array of pointers that has to be reallocated all the time).
2004-04-14 23:33:40 +00:00
Wayne Davison
63d0331991 Added a "next" pointer to "exclude_struct" and added a new structure
for exclude lists, exclude_list_struct, that holds the head/tail
pointers for the list.
2004-04-14 23:33:37 +00:00
Wayne Davison
bf6dcd1713 Updated the exclude-list code to handle the new linked-list
structure format.
2004-04-14 23:33:34 +00:00
Wayne Davison
495723bb26 Updated the exclude-list code to handle the new linked-list
structure format.
2004-04-14 23:33:34 +00:00
Wayne Davison
911cb0662c Updated stub version of check_exclude(). 2004-04-14 22:49:54 +00:00
Wayne Davison
5387514eaf Added a description arg to check_exclude(). 2004-04-14 21:59:45 +00:00
Wayne Davison
61414c83ce The check_exclude() and report_exclude_result() functions now take a
description string that describes what kind of an include/exclude is
happening (which only gets output when verbose is set to 2 or more).
2004-04-14 21:59:41 +00:00
Wayne Davison
43a9d0e7c2 Improved the exclude testing by adding tests that exercise --cvs-exclude
and --delete-excluded.
2004-04-14 20:50:32 +00:00
Wayne Davison
df5cd107a5 Moved (and expanded) a verbose message from clientserver.c to socket.c
to solve an old FIXME comment.
2004-04-14 16:51:48 +00:00
Wayne Davison
abca4eba67 Fixed a potential problem parsing the "!" token from a word-split string. 2004-04-13 19:07:21 +00:00
Wayne Davison
96d3590a08 A few more improvements to get_exclude_tok() and add_exclude(). 2004-04-13 18:35:08 +00:00
Wayne Davison
8429aa9e0e Added an example for --link-dest. 2004-04-13 00:32:58 +00:00
Wayne Davison
79d4053048 Updated with latest news and some spelling mistakes corrected. 2004-04-12 18:03:08 +00:00
Wayne Davison
753b6b4692 Replaced MISSING_OK, MISSING_FATAL, ADD_INCLUDE, and ADD_EXCLUDE with
some new XFLG_* values (for the add_exclude*() function).
2004-04-12 17:42:35 +00:00
Wayne Davison
f8f726449b - add_exclude() now takes a flag int and can optionally word-split
items and/or ignore +/- prefixes.
- add_exclude_file() changed to take the same flags as add_exclude().
- add_exclude_line() was removed since add_exclude() can now do its job.
- make_exclude() now takes a size-limited string without a +/- prefix.
- add_cvs_excludes() was changed to word-split the items that come from
  a .cvsignore file, and to ignore all +/- prefixes in all the ignore
  sources.  Since CVS doesn't check if its ignore items are directories,
  the dir-names (e.g. SCCS, CVS, etc.) no longer have a trailing slash
  (making our excludes match CVS's ignores more exactly).
2004-04-12 17:42:32 +00:00
Wayne Davison
357406ecb2 Use the new XFLG_* flags to call the add_exclude*() functions. 2004-04-12 17:42:29 +00:00
Wayne Davison
3915fd7583 No need to cast st.st_rdev to DEV64_T anymore. 2004-04-12 16:52:43 +00:00
Wayne Davison
9c5e91f848 - Use dev_t instead of DEV64_T.
- Changed rdev_high to rdev_major.
- Use major(), minor(), and makedev() to manipulate device numbers.
- Send the major and minor values separately in protocol 28 and beyond.
2004-04-12 16:52:40 +00:00
Wayne Davison
af107f6c08 - Got rid of DEV64_T and changed the internal device variables to dev_t.
- Changed XMIT_SAME_HIGH_RDEV to XMIT_SAME_RDEV_MAJOR.
- Added XMIT_RDEV_MINOR_IS_SMALL.
2004-04-12 16:52:37 +00:00
Wayne Davison
a3dbb20a0e Fixed a bug where an exclude name that got sent over the wire could get
an extra "- " or "+ " parsed off the start of the name (i.e. we have to
quote excluded names that start with those strings with an extra "- "
at the start).
2004-04-10 10:31:11 +00:00
Wayne Davison
a3779426b6 UNUSED() misbehaves on HP-UX, not AIX. 2004-04-09 22:25:33 +00:00
Wayne Davison
2f5ca63d92 AIX doesn't like our UNUSED() macro, so let's eliminate it for them. 2004-04-09 21:51:34 +00:00
Wayne Davison
0e1d98ae92 Silence compiler warnings on Solaris. 2004-04-09 20:22:44 +00:00
Wayne Davison
04575bcab5 Missed one void-pointer-arithmetic case. 2004-04-09 20:17:01 +00:00
Wayne Davison
71b291d71b AIX's cc was complaining about the void* arithmetic. 2004-04-09 19:53:50 +00:00
Wayne Davison
decba3ae73 Removed debug code. 2004-04-09 19:18:34 +00:00
Wayne Davison
f8ed564c9f Changed sysmacros.h to sys/sysmacros.h. 2004-04-09 19:04:03 +00:00
Wayne Davison
47ba39bef6 Added some test code to assist in the remote debugging of the build
farm's Solaris machines.
2004-04-09 18:36:01 +00:00
Wayne Davison
71f7051489 Use MAJOR_IN_MKDEV and MAJOR_IN_SYSMACROS. 2004-04-09 18:10:03 +00:00
Wayne Davison
3c3791e8be Use AC_HEADER_MAJOR for better makedev/major/minor determination. 2004-04-09 18:09:16 +00:00
Wayne Davison
c39d6514ab Include <sys/mkdev.h> if it exists. 2004-04-09 17:59:50 +00:00
Wayne Davison
1cb6f3bf4d Added sys/mkdev.h to the searched-for headers. 2004-04-09 17:56:58 +00:00
Wayne Davison
f09dc86ab6 Added a couple extra character devices to be copied. 2004-04-09 00:36:45 +00:00
Wayne Davison
f26ac1e8cb If we're listing a device, output the major and minor device numbers. 2004-04-09 00:33:34 +00:00
Wayne Davison
84a3efa0ab Simplify the setting of rdev & rdev_high in send_file_entry(). 2004-04-08 23:15:39 +00:00
Wayne Davison
00ed4b5bf3 Fixed a bug in the sending of rdev when the high-bits match. 2004-04-08 23:05:36 +00:00
Wayne Davison
e2e053bbd7 Explicitly cast our ~0xFF mask using ~(DEV64_T)0xFF, just to be sure
(sign-extention would have probably made the former work OK).
2004-04-08 21:51:49 +00:00
Wayne Davison
f8b33ab379 Mention the rsync-daemon fix for --sufix=''. 2004-04-07 23:13:02 +00:00
Wayne Davison
5df1fcf245 If --daemon was specified, exit the option-parsing code before
adjusting various default values (the real defaults will get
set when the client's options arrive).
2004-04-07 23:09:14 +00:00
Wayne Davison
b1ad6a3260 Added a couple missing items. 2004-04-05 15:05:46 +00:00
Wayne Davison
6442ccc606 Decided against "Source root" in the exclude/include examples. 2004-04-03 20:47:54 +00:00
Wayne Davison
b21813060c Mentioned the CoW improvement and got rid of a bug-fix mention that
was for a bug introduced during the 2.6.1 developement.
2004-04-03 18:13:51 +00:00
Wayne Davison
706c75307a Use getaddrinfo() to figure out if a numeric address is IPv4 or IPv6. 2004-04-01 21:39:35 +00:00
Wayne Davison
2b284ee33d Last of the cleanup before the patching starts. 2004-04-01 21:08:24 +00:00
Wayne Davison
4cfa6156e3 A couple more minor twiddles. 2004-04-01 20:56:50 +00:00
Wayne Davison
c1e7217fcb Updated the sizeof syntax and trimmed some trailing whitespace. 2004-04-01 20:53:39 +00:00
Wayne Davison
4b2f6a7c37 Decided to use "nobody" instead of "guest". 2004-04-01 18:05:40 +00:00
Wayne Davison
a8726d2a06 Some more IOERR_VANISHED support. 2004-04-01 18:04:59 +00:00
Wayne Davison
b5ebe6d9c7 Improved the include/exclude example section some more. Document
the new username default of "guest" if neither USER or LOGNAME is
set in the environment.
2004-03-31 18:53:57 +00:00
Wayne Davison
ef383c0d32 The auth_client function must not return without outputting something
on the socket, so a NULL or empty username now defaults to "guest".
2004-03-31 18:52:38 +00:00
Wayne Davison
8dcf93356e Don't complain about a null --suffix if we're the server/sender (since
we might not have received the --backup-dir path from the client).
2004-03-31 17:02:22 +00:00
Martin Pool
ce5f2732e4 I'm no longer maintaining this. Tell people to use the lists instead. 2004-03-31 02:48:47 +00:00
Wayne Davison
3e89da86df The --files-from option needs to allow a server-sender to sometimes
have just 1 arg on the command-line.
2004-03-30 02:08:07 +00:00
Wayne Davison
f5450e791d Try to avoid running on a system that allows us to create devices
without being root (like cygwin) because rsync won't copy the
devices if it is not root.
2004-03-29 17:02:31 +00:00
Wayne Davison
cb984e620e In sigchild_handler(), finish with waitpid() before reinitializing
the SIGCHLD handling.
2004-03-29 16:30:53 +00:00
Wayne Davison
be92ac6c36 Added one more example to the new include/exclude section to show how
--relative works with a non-absolute path.
2004-03-27 20:04:04 +00:00
Wayne Davison
5dc6e9c9ca Mention that certain options treat an absolute path as relative to the
module's "path" dir, even when chroot is off.
2004-03-27 19:47:27 +00:00
Wayne Davison
0b79c324ca Improved the "relative to the destination dir" description for
several options.
2004-03-27 19:46:28 +00:00
Wayne Davison
f39b6638f6 Got rid of debug-output statement. 2004-03-27 19:42:13 +00:00
Wayne Davison
a4b6f30579 Try to make the complexities of includes/excludes a little more clear. 2004-03-27 18:25:41 +00:00
Wayne Davison
7be73df4e7 Optionally sanitize the args in parse_arguments() using the new
alloc_sanitize_path() function.
2004-03-27 09:46:42 +00:00
Wayne Davison
14b61c63f0 Added alloc_sanitize_path(). 2004-03-27 09:44:49 +00:00
Wayne Davison
75a64762c2 The args are now sanitized in parse_arguments() instead of here. 2004-03-27 09:44:01 +00:00
Wayne Davison
028fdddb49 Fixed a crash bug when hlink_list is NULL and a link_u.links
pointer in one of the file_struct nodes is not.
2004-03-26 16:46:20 +00:00
Wayne Davison
f86b0f2e7b Fixed a typo and made a sentence read better. 2004-03-26 15:51:51 +00:00
Wayne Davison
285fba0759 Preparing for release of 2.6.1pre-1 2004-03-24 21:59:07 +00:00
Wayne Davison
92b9eb978e Moved a few externs and made a couple formatting tweaks. 2004-03-23 16:50:40 +00:00
Wayne Davison
1e82e2cea6 Got rid of an ancient (and no longer relevant) comment. 2004-03-23 16:36:00 +00:00
Wayne Davison
a7ed6ca618 A few formatting tweaks in delete_file(). 2004-03-23 16:16:15 +00:00
Wayne Davison
b4b90120ff Fixed the test for sin_len as noted by Shinichi Maruyama. Changed
the define name generated for this test and the sa_len test.
2004-03-16 01:26:39 +00:00
Wayne Davison
16f72adc49 Changed HAVE_SOCKADDR_SIN_LEN to HAVE_SOCKADDR_IN_LEN. 2004-03-16 01:26:31 +00:00
Wayne Davison
3d06165389 Check robust_rename()'s return value using < 0. 2004-03-13 20:18:03 +00:00
Wayne Davison
fd4893155d Mention the changes in the "patches" dir. 2004-03-10 08:32:38 +00:00
Wayne Davison
67e78a8231 Use CHMOD_BITS instead of ~_S_IFMT. 2004-03-07 20:29:59 +00:00
Wayne Davison
6b320e4045 Improved an entry. 2004-03-06 20:07:24 +00:00
Wayne Davison
7e5cb90983 Other files use S_IWUSR instead of S_IWRITE, so use S_IWUSR and S_IRUSR. 2004-03-06 07:45:52 +00:00
Wayne Davison
8120a98f47 Define S_IRUSR if it doesn't already exist. 2004-03-06 07:43:55 +00:00
Wayne Davison
8f3f8eec08 Updated to version from autoconf 2.59 (2003-10-03). 2004-03-06 07:00:47 +00:00
Wayne Davison
386b93dc60 Updated to version from autoconf 2.59 (2003-08-18). 2004-03-06 07:00:16 +00:00
Wayne Davison
b3bc31102c Moved out the old news and improved the new. 2004-03-04 19:36:28 +00:00
Wayne Davison
0f1aa0d3e5 Moved the previous release's NEWS here. 2004-03-04 19:35:57 +00:00
Wayne Davison
7a08ae31d2 Progress improvement. 2004-02-28 02:02:37 +00:00
Wayne Davison
304f127f56 Improved the progress reporting/E.T.A. using a (slightly modifed)
patch from Timo Sirainen.
2004-02-28 02:00:57 +00:00
Wayne Davison
c338460d66 Got rid of some superfluous parens. 2004-02-27 08:03:49 +00:00
Wayne Davison
48d704af52 Tru64 fix. 2004-02-27 07:37:43 +00:00
Wayne Davison
ac7aa92290 Use new HAVE_SOCKADDR_SIN_LEN define (replaces HAVE_SOCKADDR_LEN). 2004-02-27 07:22:40 +00:00
Wayne Davison
0042f81894 We now set HAVE_SOCKADDR_SA_LEN and HAVE_SOCKADDR_SIN_LEN based on
sockaddr.sa_len and sockaddr.sin_len, respectively (replacing
HAVE_SOCKADDR_LEN).
2004-02-27 07:22:39 +00:00
Wayne Davison
2c836acb37 No longer needed. 2004-02-26 04:03:44 +00:00
Wayne Davison
a1d8f29a3d A couple AC_DEFINE() changes so that we can do without acconfig.h. 2004-02-26 04:03:35 +00:00
Wayne Davison
a174e1ed0f Tweaked some comments and some whitespace. 2004-02-25 21:20:59 +00:00
Wayne Davison
530adb7625 Configure addition. 2004-02-23 20:09:14 +00:00
Wayne Davison
cd3fe9fb03 Allow the default (system) rsyncd.conf file to be specified via configure. 2004-02-23 20:00:20 +00:00
Wayne Davison
a8edfd53d1 Trivial whitespace tweak. 2004-02-23 19:23:53 +00:00
Wayne Davison
dbb665180c Shouldn't ignore .cvsignore. 2004-02-23 18:19:13 +00:00
Wayne Davison
9d78ed31a7 A couple fixes from Shinichi Maruyama. 2004-02-23 07:03:03 +00:00
Wayne Davison
89afe532d7 Mentioned the recent change in slash handling. 2004-02-23 02:28:04 +00:00
Wayne Davison
c67d13866b Changed the literal 9000 into "OPT_REFUSED_BASE". 2004-02-22 08:56:43 +00:00
Wayne Davison
3b98b08c4d Another bug fix. 2004-02-21 21:39:54 +00:00
Wayne Davison
9c15534511 Got rid of the "refuse options" section. 2004-02-21 21:37:14 +00:00
Wayne Davison
55afbb522c Complain in the daemon log file if there is an unknown option in the
"refuse options" value.  Also changed the idiom used to mark refused
options in the popt struct.
2004-02-21 21:36:55 +00:00
Wayne Davison
27ed20f7a0 Fixed the "refuse options" setting in the daemon after Fabrice Bellet
identified what was wrong.
2004-02-21 21:12:49 +00:00
Wayne Davison
f567e9b3d7 - Guard against and out-of-memory condition.
- Don't use the NGROUPS_MAX define.
2004-02-20 17:09:30 +00:00
Wayne Davison
40ae4f93a0 Don't use NGROUPS_MAX define. 2004-02-20 17:01:33 +00:00
Wayne Davison
7a27e9b599 Don't use ENOMSG -- it's not portable. 2004-02-18 22:33:21 +00:00
Wayne Davison
62c9e6b3a5 Moved the EXDEV handling into robust_rename(). 2004-02-17 23:13:10 +00:00
Wayne Davison
cfeed4da95 - If we return an error because of dry_run being set, we now set errno.
- The do_mkstemp() routine now preserves the errno value from fchmod()
  if that call fails.
- Improved the CHECK_RO macro stuff.
2004-02-17 23:00:00 +00:00
Wayne Davison
4068d8617d We no longer munge a double-leading slash in do_open() because we
shouldn't generate a path with a double-leading slash anymore.
2004-02-17 22:49:19 +00:00
Wayne Davison
421c2a2448 Don't create a pathname that has two leading slashes (which we used
to do when the root of the transfer was "/").
2004-02-17 21:57:44 +00:00
J.W. Schultz
d1e7726460 Remove "Conditional -z for old protocols" because those old
protocols are no longer supported.
2004-02-14 01:43:24 +00:00
Wayne Davison
0596df00b3 Reordered the items inside the file_struct so that alignment padding
should be minimized.
2004-02-11 08:01:21 +00:00
Wayne Davison
417c99f637 If --backup was specified, the links we remove are backed up. 2004-02-11 05:03:04 +00:00
Wayne Davison
de0e225076 - Revised and optimized the directory-making code.
- Optimized the keep_backup() code.
2004-02-11 05:02:21 +00:00
Wayne Davison
e0391f8149 Added backup_dir_buf and backup_dir_remainder. 2004-02-11 04:30:41 +00:00
Wayne Davison
7de2483fbd Fixed a crash bug when keep_backup() calls make_file() and the lastdir
pointer is no longer valid.
2004-02-11 02:48:58 +00:00
Wayne Davison
65d6212d03 Got rid of hard-link message (since I don't think it was ever
output in older rsync versions).
2004-02-11 02:33:17 +00:00
Wayne Davison
4d4df3cd2b Another attempt at measuring the minimum alignment for a system. 2004-02-10 23:35:12 +00:00
J.W. Schultz
62125b10c9 Simplified test for hardlink in make_backup debug message to
avoid core-dump.
2004-02-10 23:23:09 +00:00
Wayne Davison
81c3a3a86e Got rid of useless extern. 2004-02-10 22:56:16 +00:00
Wayne Davison
61d35e1844 Trying a different MINALIGN because of core dumps on the sparc-64
build-farm machines.
2004-02-10 22:28:36 +00:00
J.W. Schultz
15f85b1f63 Revert pool_alloc's use of bomb if pool == NULL. 2004-02-10 21:11:24 +00:00
J.W. Schultz
5bf63a11f4 Keep in sync with protocol if idev data on stream but no hlink_pool. 2004-02-10 21:11:24 +00:00
Wayne Davison
97a67bdfa9 If XMIT_HAS_IDEV_DATA is set in receive_file_entry(), we now bomb out
if flist->hlink_pool isn't set (instead of neglecting to read the idev
info).
2004-02-10 17:53:52 +00:00
Wayne Davison
aa0b9ca174 If we call pool_alloc() on a NULL pool, bomb out with an error. 2004-02-10 17:52:31 +00:00
Wayne Davison
b96efc2f67 Empty-line tweaks. 2004-02-10 17:35:04 +00:00
Wayne Davison
be20dc3448 Changed a while loop to a for loop. 2004-02-10 17:34:05 +00:00
Wayne Davison
cb869c26d9 Tweaked an if. 2004-02-10 17:28:59 +00:00
Wayne Davison
7cf8e8d05d Changed flist_init() to use offsetof(). 2004-02-10 17:28:31 +00:00
Wayne Davison
54fd3e5020 Added lib/pool_alloc.h to the HEADERS. 2004-02-10 17:06:11 +00:00
J.W. Schultz
3e4916822d Dropped support for protocol versions less than 20 (2.3.0
released 15 Mar 1999) and activated warnings for protocols
less than 25 (2.5.0 released 23 Aug 2001)
2004-02-10 03:54:47 +00:00
J.W. Schultz
7efdcf3218 Added allocation pool code. 2004-02-10 03:26:41 +00:00
J.W. Schultz
9935066b70 Make idev, hlink and file_struct + strings use allocation
pools.
2004-02-10 03:23:37 +00:00
Wayne Davison
6c2e5b56e4 Die if we overflowed the args[] array when building up the remote
command in do_cmd().
2004-02-09 21:22:59 +00:00
Wayne Davison
2289bf64cc The batch-options now set checksum_seed to the appropriate fixed value. 2004-02-09 18:32:54 +00:00
Wayne Davison
b1bf649cba Set checksum_seed only if it is still zero. 2004-02-09 18:32:53 +00:00
Wayne Davison
8ee6eb7134 Made checksum_seed an extern. 2004-02-09 18:32:52 +00:00
Wayne Davison
f98c60bfa8 Use asprintf() in server_options() (plus a few more whitespace tweaks). 2004-02-09 18:10:57 +00:00
Wayne Davison
a5c1113971 Updated the sizeof syntax and tweaked some whitespace. 2004-02-09 17:45:22 +00:00
Wayne Davison
736f46d1d9 Got rid of unused true/false defines. 2004-02-07 18:40:52 +00:00
Wayne Davison
a8f7e4b835 Made a couple comments a little clearer. 2004-02-07 00:12:40 +00:00
Wayne Davison
9352b0649b Got rid of unused string_area struct. 2004-02-06 15:33:15 +00:00
J.W. Schultz
a85906c756 Start flist with a more reasonable size, grow it linearly
once it reaches a largish size (16 million files) and make it
actually match the comments so it may be used to initialize
flists of known size (create_flist_from_batch()).
2004-02-06 10:00:33 +00:00
J.W. Schultz
8aa81e06e6 Update TODO to reflect recent changes.
Hardlink handling is improved.

	String area code is gone for other reasons.
2004-02-06 07:26:15 +00:00
Wayne Davison
1f9ae80a3e Fixed the indentation in init_flist(). 2004-02-06 07:19:57 +00:00
J.W. Schultz
71020fc3aa Correct sizeof usage and other whitespace. 2004-02-06 04:51:09 +00:00
J.W. Schultz
7b74bba15e Added a total memory allocated (allmem) line to
show_malloc_stats.
2004-02-06 01:56:25 +00:00
J.W. Schultz
e5fbaa713a Cause all three processes to report memory stats when -vv --stats 2004-02-05 03:27:54 +00:00
Wayne Davison
6609a9f17e Mention a couple more changes. 2004-02-05 02:56:57 +00:00
Wayne Davison
5204e853e1 Now that the long-standing chgrp bug is fixed, go back to -vvv from -vvvv. 2004-02-05 01:37:08 +00:00
Wayne Davison
01363a24e2 Fixed a problem handling GID_NONE in match_gid(). 2004-02-05 01:32:38 +00:00
Wayne Davison
d49def4832 - Fixed a bug using --numeric-ids as non-root when the receiver
does not have permissions to set one or more of the gids.
- If the add_[ug]id() routine couldn't find a name for an ID, we
  still note the ID in our list of IDs so that we don't try to
  look it up again (and again).  (The name-less IDs are stripped
  when sending the IDs from the sender to the receiver.)
- Created a better add_to_list() function that handles the linking
  of the new node into the list (rather than the caller doing it).
- Added new internal functions for some receiver-side work that
  needed to be done in multiple places (the recv_add_[ug]id()
  functions).
- We output debug info even for ID mappings that have no names.
  This make the list complete and also notes which gids get
  mapped to -1 (GID_NONE).
- Turned several while loops into for loops.
2004-02-05 01:07:23 +00:00
Wayne Davison
4836c3eece Added new extern. 2004-02-05 00:46:32 +00:00
Wayne Davison
9f7b8c3b8f Only call add_uid() or add_gid() if numeric_ids is not set. 2004-02-05 00:44:11 +00:00
Wayne Davison
ade7292aee Moved a function. 2004-02-04 20:09:21 +00:00
Wayne Davison
dbd8811b85 If a gid doesn't have a name on the originating system, the receiver
won't see it in the list of IDs to remap.  That means that we need to
call the is_in_group() function from inside match_gid() to know if we
can set the group or not (if we're not root).
2004-02-04 19:25:11 +00:00
Wayne Davison
05118158f4 Improved the trailing comment. 2004-02-04 18:24:41 +00:00
Wayne Davison
1df395f7c2 Use the new HAVE_GETGROUPS define. 2004-02-04 17:49:36 +00:00
Wayne Davison
5fdf2e7063 Added function check for getgroups. 2004-02-04 17:21:48 +00:00
Wayne Davison
6fe05820ff Use MY_UID() instead of getuid(). 2004-02-04 17:06:07 +00:00
Wayne Davison
670d8abf80 Use MY_GID() instead of getgid(). 2004-02-04 17:05:44 +00:00
Wayne Davison
b2bffbb2ca Added two defines: MY_UID() and MY_GID(). 2004-02-04 17:04:58 +00:00
Wayne Davison
13a6d667d2 Added getegid to the functions we check. 2004-02-04 16:45:26 +00:00
Wayne Davison
1be77f8336 Added geteuid to the functions to check. 2004-02-04 16:33:34 +00:00
Wayne Davison
187e9c24f1 Another improvement to the debug info we output. 2004-02-04 16:27:47 +00:00
Wayne Davison
eddeaf76f8 Set the "max verbosity" global to 9. 2004-02-04 07:32:48 +00:00
Wayne Davison
33e9d10d2a Use the new lp_max_verbosity() value to limit the server's "verbose"
value.
2004-02-04 07:32:12 +00:00
Wayne Davison
46f7dc3bf6 Added "max verbosity" global parameter that allows you to configure
a higher debug level instead of the default of level-l verbosity.
2004-02-04 07:31:29 +00:00
Wayne Davison
555b0e20f7 Tweaked the new debug-logging strings. 2004-02-04 07:24:13 +00:00
Wayne Davison
a57dfe710d Turned on 4 -v options for some build-farm testing. 2004-02-04 06:15:24 +00:00
Wayne Davison
53adbd7a3d If we encounter an error, output the rsyncd.log file, if it exists. 2004-02-04 05:34:29 +00:00
Wayne Davison
17f033b725 Temporarily switch to 4 -v options. 2004-02-04 03:58:19 +00:00
Wayne Davison
cefed3e8dc Delay the output the (verbose > 3) list of files until we've had a
chance to map the uid/gid info in the receiver.
2004-02-04 03:52:51 +00:00
Wayne Davison
84fa865c0c Output some debug info if verbose > 3. 2004-02-04 03:50:16 +00:00
Wayne Davison
f05f993eb7 If we're dumping the file list (i.e. verbose > 3), mention the uid and/or
gid (depending on applicability).
2004-02-04 03:28:22 +00:00
Wayne Davison
e90cdb8adf Changed the -x code to allow -L to copy a file on another filesystem
that is pointed to by a symlink on our exclusive filesystem.
2004-02-04 03:25:18 +00:00
Wayne Davison
4250941710 Fixed a dropped '-'. 2004-02-04 03:01:32 +00:00
Wayne Davison
a2687b64a2 Added a little more compatibility code for non-standard systems. 2004-02-03 23:28:19 +00:00
Wayne Davison
c284f34a49 Some indentation fixes and the removal of some superfluous parens. 2004-02-03 23:04:25 +00:00
Wayne Davison
5f5be796b0 Changed a couple sizeof calls and improved some string handling in
the {send,recv}_exclude_list() calls.
2004-02-03 23:01:58 +00:00
Wayne Davison
5cb374364b Modified sizeof usage and eliminated trailing whitespace. 2004-02-03 22:48:32 +00:00
Wayne Davison
f15256e156 Added some temporary code to try to figure out what is going wrong
on one NetBSD box in our build farm.
2004-02-03 20:01:26 +00:00
Wayne Davison
ce37eb2d83 If verbose > 2, mention it if we're setting the uid or the gid. 2004-02-03 20:00:35 +00:00
J.W. Schultz
0d6e308b51 correct sizeof usage. 2004-02-03 06:21:56 +00:00
Wayne Davison
b1dab2363a Made hard-link sending compatible with pre-28 protocols again. 2004-02-03 04:21:15 +00:00
J.W. Schultz
bd6abc4939 Corrected sizeof usage:
sizeof obj
	sizeof (type)
2004-02-03 03:42:49 +00:00
Wayne Davison
96eeda0324 Fix for memset bug found by buildfarm. 2004-02-02 22:35:07 +00:00
Wayne Davison
4c4266d9c9 Change to try to debug a failure on the build farm. 2004-02-02 22:18:23 +00:00
Wayne Davison
54e87b4b06 Don't warn about lack of -l support if we're the sender -- we just won't
send the receiver any symlinks.
2004-02-02 21:33:10 +00:00
Wayne Davison
44e9e221f3 - Call init_flist().
- Got rid of the symbolic-links-warning code (it was not right, and it is
  now handled in options.c).
2004-02-02 21:33:06 +00:00
Wayne Davison
61dec11ae0 - Use as little memory as possible for the file_struct (saves another 3
bytes per file).
- Made the idev struct allocated by the group-malloc again (J.W. suggested
  the proper way to align it for all systems).
- Added init_flist().
2004-02-02 21:33:03 +00:00
Wayne Davison
5009de7d2d Added comment about the position of file_list's "flags" var. 2004-02-02 21:32:56 +00:00
Wayne Davison
67f3feebcb Don't free link_u.idev. 2004-02-02 21:32:52 +00:00
Wayne Davison
b22260749f Use "%H:%M:%S" instead of "%T" in strftime() call since it looks to be
more portable.
2004-02-02 21:02:13 +00:00
Wayne Davison
06d76beb28 Clarify the safe/unsafe symlink options in the usage text. 2004-02-02 18:25:37 +00:00
Wayne Davison
7af4227ac2 Clarify the various safe/unsafe symlink options. 2004-02-02 18:23:09 +00:00
Wayne Davison
9312b7325e Go back to using malloc() for the hard-link data structure (for now
at least).
2004-02-02 07:06:54 +00:00
Wayne Davison
c6edb381f5 Free the hlink data again. 2004-02-02 07:06:50 +00:00
Wayne Davison
a1d55ad095 Make sure that the idev struct's data is 4-byte aligned. 2004-02-02 06:52:49 +00:00
Wayne Davison
a289addd96 - Changed the file-list allocation to alloc all the memory we need
with one call, not with several mallocs and strdups.
- Got rid of string_area() stuff (as suggested in the "@todo").
- Enhanced free_file() to optionally free the whole struct or to
  clear it (since we don't need to do both).
- Don't zero out the other flist data when we're about to free it.
2004-02-02 05:06:36 +00:00
Wayne Davison
13c5b46361 Don't free the hlink data (it is not separately allocated anymore). 2004-02-02 05:06:35 +00:00
Wayne Davison
f3af206d8d Changed args to make_file() and free_file(). 2004-02-02 05:06:34 +00:00
Wayne Davison
df0054ab13 Added CLEAR_STRUCT and FREE_STRUCT defines. 2004-02-02 05:06:33 +00:00
Wayne Davison
0d162bd17c Added some missing #if SUPPORT_HARD_LINK and #if SUPPORT_LINK directives. 2004-02-01 17:37:14 +00:00
Wayne Davison
e1add89334 - Fixed the bug where the --daemon option would squelch all option errors
for later parameters.
- Complain if someone passes us -l and we don't support symlinks.
2004-02-01 17:29:41 +00:00
Wayne Davison
22d49dc429 Changed the rdev code to have both an "rdev" variable (which always
has the full device value) and an "rdev_high" variable (which zeros
the lower byte in the last rdev value).
2004-02-01 16:28:31 +00:00
Wayne Davison
1aa4caf318 One more improvement to the 0-flag-byte avoidance algorithm. 2004-01-31 22:40:55 +00:00
Wayne Davison
306ffb8c71 A small optimization to the symlink-send code, and an extra sanity
check to the symlink-receive code.
2004-01-31 21:01:01 +00:00
Wayne Davison
0a98201164 Fixed the test to ensure that we don't send a flag-byte of 0 to the
receiver when transferring the file list.
2004-01-31 20:24:52 +00:00
Wayne Davison
e0870f1d7a One more minor variable-name change. 2004-01-31 11:36:03 +00:00
Wayne Davison
1923b1fce4 Switched a buffer name in make_file() to make the code a little more
similar to what is in receive_file_entry().
2004-01-31 11:32:30 +00:00
Wayne Davison
5dc4003e63 Fixed the optional sanitization of the files_from arg. 2004-01-30 16:14:46 +00:00
Wayne Davison
37c817eb81 OK, "find ... -print0 | xargs -0 ..." wasn't portable. This is. 2004-01-28 01:39:29 +00:00
Wayne Davison
284d628a7c Got rid of indeterminacy in the overlapping-files. 2004-01-28 00:37:55 +00:00
Wayne Davison
ff3184ca1e A couple more unsigned char changes to silence compiler warnings
on signed-char systems (like Solaris).
2004-01-28 00:04:57 +00:00
Wayne Davison
12865a9762 New test to make sure that merging files from multiple directories
continues to work.
2004-01-27 23:56:00 +00:00
Wayne Davison
ea847c6232 Use who_am_i() to qualify some debug messages. 2004-01-27 23:13:15 +00:00
Wayne Davison
b695f2423d Set the am_generator flag. Use who_am_i(). 2004-01-27 23:13:14 +00:00
Wayne Davison
c3e5e5851b New function: who_am_i() returns "sender", "receiver", or "generator". 2004-01-27 23:13:13 +00:00
Wayne Davison
4337c8f856 Added "am_generator". 2004-01-27 23:13:12 +00:00
Wayne Davison
4c7e46079d Don't free lastdir! It is still needed by the flist basedir pointers.
Also, output the basedir pointer when dumping the flist for debugging.
2004-01-27 23:00:47 +00:00
Wayne Davison
72a6e63136 Relocated the externs. 2004-01-27 22:35:15 +00:00
Wayne Davison
37101856a6 Silenced some compiler warnings. 2004-01-27 16:27:05 +00:00
Wayne Davison
65fc84b32e Better pid handling. 2004-01-27 08:14:33 +00:00
Wayne Davison
45e08edb08 Cast getpid() to a long for output. 2004-01-27 08:02:31 +00:00
Wayne Davison
05b7bab8e1 Better pid handling. 2004-01-27 07:57:12 +00:00
Wayne Davison
904817552d Fixed a comment. 2004-01-27 07:48:57 +00:00
Wayne Davison
6e195fe975 Tweaked the externs. 2004-01-27 07:48:19 +00:00
Wayne Davison
3eaf615f40 Percentage of file-count output was off by one. 2004-01-27 06:51:39 +00:00
J.W. Schultz
6156e72f85 EXCLUDE PATTERNS is not just about syntax. 2004-01-27 05:00:43 +00:00
Wayne Davison
73a4bdfd77 Mention the latest -x improvement. Also improved the description of
one of my previous fixes.
2004-01-27 03:49:54 +00:00
Wayne Davison
4844449a5d Optimized the -x option by removing the skip_filesystem() call and using the
new FLAG_MOUNT_POINT flag.
2004-01-27 01:47:41 +00:00
Wayne Davison
ae289aec1e Added FLAG_MOUNT_POINT. 2004-01-27 01:47:40 +00:00
Wayne Davison
9e4c32ea54 Tweaked a comment. 2004-01-27 01:27:37 +00:00
Wayne Davison
a5f9cff256 Improved the differentiation of the transmit flags from the live flags
by naming the transmit flags with an XMIT_ prefix.  Improved the names
of two other flags, got rid of the LIVE_FLAGS mask, and shortened the
flag storage in the flist struct (to save memory).
2004-01-27 01:05:14 +00:00
Wayne Davison
d01d15e096 Use the new names for the transmit-flag defines. We also make sure
that the FLAG_TOP_DIR flag doesn't get set in the live data for a
non-directory (when it's used as a kluge to prevent a 0x00 byte being
sent over the wire for the flag data).
2004-01-27 01:05:13 +00:00
Wayne Davison
a53426441b Use the new names for the transmit-flag defines. 2004-01-27 01:05:12 +00:00
Wayne Davison
5d1966948e Fixed reference to -u that should have been -o. 2004-01-26 22:35:04 +00:00
J.W. Schultz
f673ea84b2 Back out bad refactor (thanks Wayne) 2004-01-26 20:54:02 +00:00
Wayne Davison
64f21c31bf Mention new hard-link optimization. 2004-01-26 04:21:59 +00:00
Wayne Davison
520cf41711 Added defines (FLAG_HLINK_EOL, HL_CHECK_MASTER, and HL_SKIP) and changed
the struct hlink to have an index into the hlink_list[] array instead of
a head pointer.
2004-01-25 22:32:11 +00:00
Wayne Davison
d38fc30563 We now link the hard-linked flist entries into a circular list, mark
the last item with FLAG_HLINK_EOL, and save off an index for our
master entry in the hlink_list[] array.  Added the hard_link_check()
function.
2004-01-25 22:32:10 +00:00
Wayne Davison
6dff599288 Use the new hard_link_check() function to figure out which one of the
hard-linked files to send (when -H was specified, of course).  Moved
the call to do_hard_links() and the final directory-permissions scan
into generate_files() from recv_files().
2004-01-25 22:32:09 +00:00
Wayne Davison
f746dda0a0 Moved the call to do_hard_links() and the final directory-permissions
scan from recv_files() into generate_files().
2004-01-25 22:32:08 +00:00
Wayne Davison
91a1e147ae Changed F_HEAD to F_HLINDEX. 2004-01-25 22:32:07 +00:00
Wayne Davison
40da904230 Tweaked a comment. 2004-01-25 22:32:05 +00:00
J.W. Schultz
34fada3012 Tightened up code in skip_filesystem() 2004-01-25 22:11:09 +00:00
Wayne Davison
f91e01d9a5 Replaced an snprintf() call with pathjoin(). 2004-01-24 22:12:58 +00:00
Wayne Davison
3048b0a8ea The static last_in value in match_gid() needed to default to -2 so
that we don't accidentally return a GID of 0 when we don't have the
permissions to set it.
2004-01-24 18:36:36 +00:00
Wayne Davison
d99b4ccf93 Another improvement in the "use chroot" section. 2004-01-24 01:48:12 +00:00
Wayne Davison
58811a0a38 Refer to I/O (not IO), ID (not id), and "an rsync" (not "a rsync"). 2004-01-23 16:58:24 +00:00
Wayne Davison
cb290916be Improved the "use chroot" discussion on ID mapping. 2004-01-23 16:55:40 +00:00
Wayne Davison
a2b0471f1d More changes to make the --owner and --group items clearer. 2004-01-23 16:40:17 +00:00
Wayne Davison
bb18e7550c Use "an" in front of rsync, not "a". 2004-01-23 09:34:04 +00:00
Wayne Davison
db2b5cb75f Tweaked the --help text to refer to I/O (not IO) and use "an" in
front of rsync (not "a").
2004-01-23 09:32:50 +00:00
Wayne Davison
fa8c787d8b Improved the "use chroot" section to mention how to get user/group
preservation by name (getting rid of the erroneous bit about the
--numeric-ids option being implied).
2004-01-23 09:30:45 +00:00
Wayne Davison
ec40899bb9 Improved comments on --owner and --groups, and removed misinformation
on a chroot daemon (it does not imply --numeric-ids).
2004-01-23 09:29:16 +00:00
Wayne Davison
b5accabaa7 Properly punctuate "etc." and changed all occurrences of "IO" to "I/O". 2004-01-23 08:59:19 +00:00
Wayne Davison
4e308a9526 Fixed two more misspelled words. 2004-01-23 02:02:51 +00:00
Wayne Davison
4d88810810 Some spelling corrections and other simple fixes. 2004-01-23 01:36:59 +00:00
Wayne Davison
f321922214 When setting an flist entry's flags, mask it with LIVE_FLAGS. 2004-01-22 18:39:32 +00:00
Wayne Davison
cab13afe8d A couple comment tweaks. 2004-01-22 18:37:26 +00:00
Wayne Davison
72fc7ec59b Made the getgroups() code a little more portable. This will hopefully
make the chgrp test work on the NetBSD and OpenBSD systems where it is
failing.
2004-01-22 09:16:21 +00:00
Wayne Davison
58743a87b8 Improved to add the default gid if it is missing from the list. 2004-01-22 09:13:36 +00:00
Wayne Davison
54bf456e85 Removed an obsolete comment. 2004-01-22 09:05:09 +00:00
Wayne Davison
a24639bb36 Tweaked an argv-type variable so that it's a little clearer what
the code is doing.  Also added a comment.
2004-01-22 04:40:33 +00:00
Wayne Davison
3fef53645d Use the new f_name_to() calling syntax. 2004-01-22 04:38:18 +00:00
Wayne Davison
882e689312 - Ensure in make_file() that we can't make a name that overflows
our buffers (note that receive_file_entry() already does this).
- Changed f_name_to() to not do any length checking since it is
  now redundant.
2004-01-22 04:38:17 +00:00
Wayne Davison
b0a93231cf Added more missing news. 2004-01-22 02:02:00 +00:00
Wayne Davison
0c819b76d6 New news. 2004-01-22 01:23:43 +00:00
Wayne Davison
ce58b1b479 Size-check the --temp-dir string so we don't have to worry about it
overflowing elsewhere in the code.
2004-01-22 01:20:24 +00:00
Wayne Davison
a16d8f2b25 Improved a couple comments. 2004-01-21 02:45:10 +00:00
Wayne Davison
59187666b9 Use new push_dir() syntax. 2004-01-20 17:46:31 +00:00
Wayne Davison
808c57c343 - Use the new push_dir() and pop_dir() calling syntax.
- The "olddir" handling changed to accommodate the above, and to
  avoid using malloc()/free().
2004-01-20 17:46:30 +00:00
Wayne Davison
4af8fe4e78 - Changed push_dir() to not take a "save" arg and to return 1 or 0
for success or failure instead of a string pointer.  The function
  also ensures that we don't overflow the curr_dir[] buffer.
- Changed pop_dir() to not free() anything and to return 1 or 0
  for success or failure.
2004-01-20 17:46:29 +00:00
Wayne Davison
4034cb3f71 Use new stringjoin() function. 2004-01-20 05:35:57 +00:00
Wayne Davison
6fc048f438 Find last '@' in the user@site string, just in case the username has
a '@' in it.
2004-01-20 05:27:09 +00:00
Wayne Davison
5d2a707139 Use new stringjoin() and pathjoin() functions. 2004-01-20 05:24:07 +00:00
Wayne Davison
81d2b0ef9d Use new pathjoin() function. 2004-01-20 05:15:14 +00:00
Wayne Davison
248ed45fc6 Use new pathjoin() function. 2004-01-20 05:09:36 +00:00
Wayne Davison
893c4cc056 Use new stringjoin() function. 2004-01-20 04:56:20 +00:00
Wayne Davison
a7725e6df9 Use new pathjoin() function. 2004-01-20 04:53:59 +00:00
Wayne Davison
368ad70e05 Added stringjoin() and pathjoin(). 2004-01-20 04:43:49 +00:00
J.W. Schultz
b7cee9498b Eliminate unneeded strlen after strlcpy. 2004-01-20 03:37:04 +00:00
Wayne Davison
72d45525d2 Make sure that strlcpy() returns the right value when the bufsize is 0. 2004-01-20 00:59:26 +00:00
Wayne Davison
1fb8ec4b0d Fixed a bug in strlcat() where it would not properly detect a no-change
condition if called with an initial string longer than the specified
size limit (due to an unsigned var's inability to go negative).
2004-01-20 00:29:49 +00:00
Wayne Davison
beb9368481 Make sure that the batch-prefix string isn't overly long (avoiding
a potential problem in the batch-filename code).
2004-01-19 23:33:02 +00:00
Wayne Davison
981555bddb Actually, let's avoid snprintf() where possible. 2004-01-19 23:28:57 +00:00
Wayne Davison
9c7527085c Use snprintf() instead of strlcpy()+strlcat(). 2004-01-18 21:22:49 +00:00
Wayne Davison
eddd5d129e A few minor string optimizations and a new complaint if we try to
send a truncated filename.
2004-01-17 19:45:26 +00:00
Wayne Davison
26f76b7912 Got rid of an extra call to io_start_buffering_out(). 2004-01-17 05:04:04 +00:00
Wayne Davison
32eda0961e Unified the externs. 2004-01-17 04:58:24 +00:00
Wayne Davison
66964002df A fix for --cvs-exclude. 2004-01-17 01:23:41 +00:00
Wayne Davison
57469f6c31 Items read from a per-directory .cvsignore file should be added to the
local_exclude_list, not the exclude_list.
2004-01-17 01:16:49 +00:00
Wayne Davison
13c7bcbb2b Output an error before we die if we get a wacko message from the receiver. 2004-01-16 16:31:47 +00:00
Wayne Davison
d48c806560 Clarified the --delete-after descriptions. 2004-01-15 17:45:53 +00:00
Wayne Davison
ad1a09a509 Clarified the --delete-after help text. 2004-01-15 17:43:34 +00:00
Wayne Davison
d6631cf3a5 If we're a daemon talking with a pre-28 protocol, use FERROR for a
vanished-file message (not FINFO).
2004-01-15 08:56:33 +00:00
Wayne Davison
5a8543b8b8 In two places: needed to use protocol_version, not PROTOCOL_VERSION. 2004-01-15 08:39:25 +00:00
Wayne Davison
19119cbd35 Changed version to "2.6.1cvs". 2004-01-15 08:16:40 +00:00
Wayne Davison
442743b83c Improved receiver/generator communications. 2004-01-15 07:51:37 +00:00
Wayne Davison
419896af47 - Define FULL_FLUSH and NORMAL_FLUSH.
- Got rid of FNONE from logcode enum.
- Created msgcode enum with MSG_DATA, MSG_REDO, MSG_DONE, etc.
2004-01-15 07:42:27 +00:00
Wayne Davison
0569a1339d - Got rid of the f_gen pipe.
- Use new send_msg() call with MSG_DONE or MSG_REDO.
2004-01-15 07:42:25 +00:00
Wayne Davison
f1e3656ee2 - Call io_flush() with its new FULL_FLUSH/NORMAL_FLUSH arg.
- Got rid of the recv_pipe between the receiver and the generator.
- Use new send_msg(MSG_DONE,...) call to signal the generator
  when the receiver is done.
- Use the new get_redo_num() call in the generator to read the
  final -1 from the receiver.
2004-01-15 07:42:21 +00:00
Wayne Davison
a644fc3cc4 - Moved err_list* stuff to io.c and renamed them to msg_list*.
- Call the new send_msg() function to send a remote log message.
2004-01-15 07:42:19 +00:00
Wayne Davison
d17e1dd2da - Moved the err_list* stuff here from log.c and renamed them msg_list*.
- Renamed log_error_fd to msg_fd_out, and io_error_fd to msg_fd_in.
- Added a redo_list* to keep track of any redo items that come over
  the message channel from the receiver to the generator.
- The io_flush() and msg_list_push() functions now take an arg:
  NORMAL_FLUSH or FULL_FLUSH.  The latter ensures that we don't lose
  any log messages that haven't gotten written from the msg_list.
- Added a send_msg() function that log.c calls to send any remote
  log messages.  It is also called to send the new MSG_REDO and
  MSG_DONE messages.
2004-01-15 07:42:17 +00:00
Wayne Davison
b9b15fb165 We now call get_redo_num() instead of reading f_recv (which was removed). 2004-01-15 07:42:15 +00:00
Wayne Davison
ef732c3b54 Call io_flush() with its new FULL_FLUSH option. 2004-01-15 07:42:12 +00:00
Wayne Davison
baa4212ae1 If the do_lchown() fails and we weren't trying to change the user,
the error now says that chgrp failed, not chown.
2004-01-15 07:08:00 +00:00
Wayne Davison
0be976ec0a Fixed a bug when a non-root user copies a GID=0 file with -g set
and no permissions to set group 0.
2004-01-15 07:06:45 +00:00
Wayne Davison
f7f10340d6 The HAS_INODE_DATA flag is no longer a part of the LIVE_FLAGS define. 2004-01-15 02:25:38 +00:00
Wayne Davison
68f9910d94 Explain the --progress output. 2004-01-13 18:50:40 +00:00
Wayne Davison
fb6e0ea120 Give the user an idea of how far along in the transfer we are
when using --progress.
2004-01-13 18:25:03 +00:00
Wayne Davison
97feb557ed Set stats.current_file_index. 2004-01-13 18:22:43 +00:00
Wayne Davison
dc8293ff73 Added current_file_index. 2004-01-13 18:22:13 +00:00
Wayne Davison
785db4ced0 Merged a couple more f != -1 if sections. 2004-01-13 06:27:30 +00:00
Wayne Davison
5562deb169 Moved a couple externs. 2004-01-13 05:13:57 +00:00
Wayne Davison
983b1ed321 Merged some "if (f != -1)" checks, put the clean_flist() call in the
right spot, and moved some externs.
2004-01-13 05:11:56 +00:00
Wayne Davison
548abf96ce Relocated some externs. 2004-01-13 04:50:45 +00:00
Wayne Davison
f8ebdf9265 More hard-link stuff. 2004-01-12 03:59:53 +00:00
Wayne Davison
aa23c22004 Changed the hard-link check. 2004-01-12 03:50:07 +00:00
Wayne Davison
1d5cda2265 Updated to perform a much more efficient hlink algorithm that doesn't
require any binary searching of hlink data.
2004-01-12 03:49:47 +00:00
Wayne Davison
fe70ad26d3 Added F_HEAD and F_NEXT defines. 2004-01-12 03:48:43 +00:00
Wayne Davison
0a00748901 Mention more of the latest changes. 2004-01-11 22:39:34 +00:00
Wayne Davison
03979352b4 More cleanup, fixing an error in the fatal-message strings that tried
to output the "filename" value when it might not be initialized.
2004-01-11 22:11:25 +00:00
Wayne Davison
cb7fb45e42 Updated a questioning comment. 2004-01-11 08:17:19 +00:00
Wayne Davison
92cc9dd7c2 Use the new dev+inode union in the flist_struct. 2004-01-11 07:56:14 +00:00
Wayne Davison
88a7fb3edd Moved the inode & dev items out of the flist_struct. Based on a
preliminary patch by J.W.
2004-01-11 07:55:53 +00:00
Wayne Davison
728d092201 Use the new union-ified flist_struct values. 2004-01-11 07:28:45 +00:00
Wayne Davison
80707c983c Put 3 flist_struct items into a union: rdev, sum, and link (all
mutually exclusive based on mode).  Based on an idea by J.W.
2004-01-11 07:28:23 +00:00
Wayne Davison
5911fee567 A slightly better reset mechanism for send_file_entry() and
receive_file_entry().
2004-01-10 22:13:19 +00:00
Wayne Davison
a09f6f55da Use the new LIVE_FLAGS define to fix a potential flag problem. 2004-01-10 21:10:04 +00:00
Wayne Davison
caf5cc9152 Added LIVE_FLAGS define. 2004-01-10 21:09:06 +00:00
Wayne Davison
58422e8393 Changed the call to write_batch_csum_info() to the latest syntax. 2004-01-10 20:16:18 +00:00
Wayne Davison
e8d3168e3a Massive rewrite to replace the file-list read/write code with calls to
send_file_entry() and receive_file_entry().  Other cleanups too.
2004-01-10 20:16:13 +00:00
Wayne Davison
7b1a0c19b8 Allow the send_file_entry() and receive_file_entry() routines to be
called by the batch processor.
2004-01-10 20:15:55 +00:00
Wayne Davison
536492752b Support the recent changes in the flist_struct. 2004-01-10 08:39:57 +00:00
Wayne Davison
7c4f063b13 Got rid of tmpsum[]. 2004-01-09 18:35:41 +00:00
Wayne Davison
1a62c49d31 Note latest changes. 2004-01-09 18:27:15 +00:00
Wayne Davison
fea4db62bd - Never allocate a useless sum array for a non-regular flist item.
- Don't transmit the sum array for non-regular files (p28 onward).
- Tweaked a couple comments.
2004-01-09 18:19:32 +00:00
Wayne Davison
4499c0eebd A couple minor code improvements. 2004-01-09 18:10:31 +00:00
Wayne Davison
0c42946536 Added an extra comment. 2004-01-09 16:53:55 +00:00
J.W. Schultz
ab264c9e79 Added a few more devices to the devices.test to hopefully
test same, same high and different device numbers.
2004-01-09 14:02:00 +00:00
J.W. Schultz
dd7fb70f6e Finished the last_* renameing and fixed a cast.. 2004-01-09 13:55:56 +00:00
Wayne Davison
30f337c9ef Updated the send_file_name() and receive_file_entry() functions to make
some of the variable names more logical in the new program flow.  Also
improved the setting of the new last_rdev value that only remembers the
high 3 bytes.
2004-01-08 22:45:12 +00:00
Wayne Davison
9d35271938 Changed the OLD_SAME_RDEV define to SAME_RDEV_pre28. 2004-01-08 22:45:07 +00:00
Wayne Davison
bbfb1d016b Added explicit call to AC_PROG_EGREP. 2004-01-08 18:33:38 +00:00
Wayne Davison
c4b4df4fb4 Optimized the sending of dev+inode data for hard-linking support
(but only when speaking protocol 28).
2004-01-08 11:29:50 +00:00
Wayne Davison
a6d89d18bf - Added flags HAS_INODE_DATA and SAME_DEV.
- Changed PROTOCOL_VERSION to 28 now.
2004-01-08 11:28:07 +00:00
Wayne Davison
75bc860093 Implemented an extended-flag-byte in the transfer protocol by moving
the SAME_RDEV bit into the next 8 bits and adding an EXTENDED_FLAG
bit.  Also modified the meaning of this bit for protocol 28 and above:
SAME_HIGH_RDEV indicates that all but the lowest byte matches.  The
older protocols get OLD_SAME_RDEV set (with the old semantics) for
compatibility.  Note also that protocol 28 isn't turned on yet.
2004-01-08 11:08:30 +00:00
Wayne Davison
02a279a75f Added EXTENDED_FLAGS and SAME_HIGH_RDEV. Changed SAME_RDEV to OLD_SAME_RDEV. 2004-01-08 11:08:30 +00:00
Wayne Davison
584c7bf76d Pass the $srcdir/wildtest.txt file on the command-line to wildtest. 2004-01-08 09:00:14 +00:00
Wayne Davison
c4cd2ca6bf We now take a TESTFILE arg on the command-line. 2004-01-08 08:59:52 +00:00
Wayne Davison
1ef00d2072 Improved the code in send_file_entry() and receive_file_entry() to
make it a little easier to read and a little more optimized.  Also
made the flag size in our function calls match the size of the flags
in the flist_struct.  These changes will make it easier for me to
optimize the sending of the hard-link data in a future commit.
2004-01-08 04:56:27 +00:00
Wayne Davison
4dd4c72790 Made the flags in the file_struct a little smaller. 2004-01-08 04:53:16 +00:00
Wayne Davison
6aae748ea7 - No need to check S_ISREG() on files already in the hlink_list.
- The realloc in init_hard_links() might fail if the list is empty
  (which can happen if there are no regular files in the transfer).
  I changed the code to free the list in that case.
2004-01-08 03:17:07 +00:00
Wayne Davison
aa953c3201 Old-protocols. 2004-01-08 00:47:17 +00:00
Wayne Davison
3f55bd5dad Got rid of support for protocols 17 and 18. 2004-01-08 00:45:41 +00:00
J.W. Schultz
279b1c1ebb Noted hardlink memory footprint reduction. 2004-01-07 11:38:23 +00:00
J.W. Schultz
fa45cda1aa Cosmetic changes to file_compare() for readability and to
match hlink_compare()
2004-01-07 09:11:56 +00:00
J.W. Schultz
11dc274054 Change hlink_list so we only have a list of pointers to
file_struct instead of a copy of the file_struct list.
2004-01-07 09:06:37 +00:00
Wayne Davison
e7bef92205 Batch-mode fix. 2004-01-06 05:35:55 +00:00
Wayne Davison
4a1991d7c5 Fixed a byte-order problem for batch-file processing on big-endian
systems (reported by Jay Fenlason).
2004-01-06 05:33:02 +00:00
Wayne Davison
13aefa1365 Some whitespace tweaks. 2004-01-05 03:57:15 +00:00
Wayne Davison
addf0c4a1c A few formatting tweaks. 2004-01-05 03:56:19 +00:00
Wayne Davison
25bfc8cea1 Use new recv_generator() calling syntax. 2004-01-04 19:18:37 +00:00
Wayne Davison
dfd5ba6ab7 Changed recv_generator() to take a "struct file_struct *" instead of
a "struct file_list *", which allows us to call it with a copy of the
current file_struct entry that we've modified.  This is better than
modifying the entry directly because the latter causes the shared
memory between the generator and the receiver to slowly vanish as
the in-memory changes happen.
2004-01-04 18:43:18 +00:00
Wayne Davison
393ba2214d Try using "id -un" before "whoami" since the latter doesn't exist on
SunOS systems (and I hope the former works -- we'll see).
2004-01-04 07:07:08 +00:00
Wayne Davison
f358487f8e Silence a compiler warning on Sun OS systems. 2004-01-04 07:06:05 +00:00
Wayne Davison
a18381aca6 Improved the text. 2004-01-03 20:50:51 +00:00
Wayne Davison
f6e54812b7 Fixed autom4te*.cache entry. 2004-01-03 19:49:52 +00:00
Wayne Davison
31e7451aa5 Mention more INTERNALS work. 2004-01-03 19:28:17 +00:00
Wayne Davison
0e36d9da42 More variable-size cleanup. 2004-01-03 19:28:03 +00:00
Wayne Davison
da9d12f5d9 Made the types used in the sum_buf and sum_struct structures consistent
with the variables in the code that manipulates these values.
2004-01-03 18:37:41 +00:00
J.W. Schultz
a60e2dca6b Create GID_NONE for use gid test readability. 2004-01-03 13:17:32 +00:00
Wayne Davison
86c4601e12 Fixed a name. 2004-01-03 09:48:52 +00:00
Wayne Davison
173f5bf8cf Fixed a size check in the new code. 2004-01-03 09:44:20 +00:00
Wayne Davison
823edc686f Document the latest changes. 2004-01-03 09:36:30 +00:00
Wayne Davison
a3a841073e Added support for "Basic" authentication to our proxy, based on a
patch by Bardur Arantsson.
2004-01-03 09:19:06 +00:00
Wayne Davison
57385128c3 Made base64_encode() non-static. 2004-01-03 08:53:36 +00:00
Wayne Davison
2990e06f29 Silence a compiler warning. 2004-01-03 01:12:10 +00:00
Wayne Davison
2ef2e822d1 Added missing '[]'s to AC_CHECK_FUNCS() calls so that this works
with autoconf 2.58 and above.
2004-01-03 00:40:55 +00:00
Wayne Davison
b7736c797c Some cosmetic tweaks. 2004-01-02 23:41:32 +00:00
Wayne Davison
9b9c8aaf4d Improved flush_write_file(). 2004-01-02 18:42:33 +00:00
Wayne Davison
b0fd253afc Applied a slightly-tweaked version of Oliver Braun's patch that
implements listening on multiple addresses and a fix for IPv6-only
systems.
2004-01-02 18:05:51 +00:00
Wayne Davison
e028b9ff53 Call bind() with the right ai_addr/ai_addrlen info. 2004-01-02 17:47:44 +00:00
Wayne Davison
9c07d25345 Tidied up a few things in preparation for changes. 2004-01-02 17:20:21 +00:00
Wayne Davison
7352b8736b Moved the is_in_group() function to uidlist.c. 2004-01-02 16:52:29 +00:00
Wayne Davison
5b540e86a4 Set the file's gid to -1 if we don't have permissions to set it. 2004-01-02 16:51:54 +00:00
Wayne Davison
6744b62ddd Fixed --link-dest's check for identicalness to ignore the uid if
non-root, and to ignore a gid of -1.
2004-01-02 16:50:06 +00:00
Wayne Davison
e90b8acec3 Silence some compiler warnings. 2004-01-02 08:50:25 +00:00
Wayne Davison
925c517f19 Improved the setting of cleanup_got_literal so that we know if the
current file received some literal data yet or not.
2004-01-02 08:38:35 +00:00
Wayne Davison
cc964a518c Use the new f_name_to() call instead of strlcat() an f_name(). 2004-01-02 08:36:58 +00:00
Wayne Davison
3309507dd3 Some minor changes to some if statements. 2004-01-02 08:33:57 +00:00
Wayne Davison
5e7dbaca50 Use buffered I/O to read the exclude list. 2004-01-02 08:31:12 +00:00
Wayne Davison
76c2194714 Applying my updated version of Craig Barratt's buffered I/O patch. 2004-01-02 08:29:49 +00:00
Wayne Davison
968c8030cf Some name tweaks. 2004-01-02 08:19:26 +00:00
Wayne Davison
446e239e2c Use the f_name_to() function to avoid having to strdup() the name that
f_name() returns.  Also used in a call to recv_generator() to keep the
name safe for the duration of the call.
2004-01-02 08:18:53 +00:00
Wayne Davison
e7bc9b64a3 Use f_name_to() when producing a name for the recv_generator() call.
This prevents things like the hard-link code from losing the name
before we're finished with it.
2004-01-02 08:05:20 +00:00
Wayne Davison
8018edd3aa Optimized f_name(), generating: (1) f_name_cmp(), which optimizes
comparing two file_struct elements without copying them first, and
(2) f_name_to() which lets us supply the destination buffer for a
f_name() call (to allow it to persist without an extra copy).
2004-01-02 07:57:02 +00:00
Wayne Davison
64c3523a6f Got rid of /* dw */ comments. 2004-01-02 07:42:20 +00:00
Wayne Davison
310c9f30f0 Optimized hard_link_one() to not call f_name() so many times. 2004-01-02 07:34:49 +00:00
Wayne Davison
5c1b7bfd2a No need to conditionally-compile EINTR code -- no other files do this. 2004-01-02 07:31:02 +00:00
Wayne Davison
faf11086d8 More twiddling of the wildcard verbage. 2004-01-02 07:11:32 +00:00
Wayne Davison
52fa4d7893 Improved the itemized discussion under the wildcard changes. 2004-01-01 22:37:13 +00:00
Wayne Davison
de0551020b Allow function return values to start with "const". 2004-01-01 21:10:50 +00:00
Wayne Davison
c1456d83a7 Tweaked the date. 2004-01-01 19:00:11 +00:00
Wayne Davison
1cbbaea957 Preparing for release of 2.6.0 2004-01-01 11:36:16 +00:00
Wayne Davison
f6aeaa74d1 One more tweak to --modify-window verbage. 2003-12-30 18:17:16 +00:00
Wayne Davison
6839140eb5 Shorten some of the lines in the --help output. 2003-12-30 18:16:25 +00:00
Wayne Davison
915dd20705 Shortened a few lines, plus a couple minor tweaks. 2003-12-30 17:44:01 +00:00
Wayne Davison
c53217a2b8 Changed the VERSION section to refer to 2.x instead of 2.0. 2003-12-29 09:58:06 +00:00
Wayne Davison
b2ac00eb16 Preparing for release of 2.6.0pre2 2003-12-28 21:11:38 +00:00
Wayne Davison
45ddbf6204 Make the upper copyright year "2004". 2003-12-28 20:48:06 +00:00
Wayne Davison
276877cf77 Aged news from NEWS to OLDNEWS. 2003-12-27 00:14:21 +00:00
Wayne Davison
6b45fcf160 Undid previous change. 2003-12-26 23:04:01 +00:00
Wayne Davison
49c24eccd4 A change that wasn't needed. 2003-12-26 22:59:53 +00:00
Wayne Davison
0d7d3763f2 Use %{version} to refer to the current version. 2003-12-24 17:48:25 +00:00
Wayne Davison
241dc65eee Getting rid of klunky *.tmpl files. 2003-12-24 17:46:46 +00:00
Wayne Davison
860bdd4571 Mention the new-backup-dir mode change. 2003-12-24 01:46:38 +00:00
Wayne Davison
55bf051bbc Getting rid of an extra newline that accidentally crept into the code. 2003-12-24 01:46:07 +00:00
Wayne Davison
423dba8ea1 Simplified an internal function's name to remove a potentially
cryptic suffix.
2003-12-24 01:14:16 +00:00
Wayne Davison
517c7b4dee Updated the copyright year. 2003-12-20 18:00:13 +00:00
Wayne Davison
18ced14631 Output a warning about the new remote-shell default if the --with-rsh
option wasn't used.
2003-12-20 17:57:47 +00:00
Wayne Davison
ce67256218 Output a newline before the heap statistics. 2003-12-20 16:57:24 +00:00
Wayne Davison
9e83fa99fe - Mention the extra newlines in the verbose/stats output.
- Made some spelling corrections.
2003-12-20 16:56:51 +00:00
Wayne Davison
256a9e376c Added a couple missing items from John Van Essen. 2003-12-20 16:51:13 +00:00
Wayne Davison
ef5075e092 Quiet a compiler warning. 2003-12-19 22:19:54 +00:00
Wayne Davison
65653a6596 Mention the change we made to help ssh cleanup the tty on Ctrl-C. 2003-12-19 20:21:17 +00:00
Wayne Davison
d5a0b48379 Do a small msleep() in the sig_int() handler before shutting down.
This kluge allows things like SIGINT to find our children before
we go throwing around SIGUSR1's at them.
2003-12-19 06:52:02 +00:00
Wayne Davison
314a74d731 Got rid of the RSYNC_RSH_IO stuff for now. 2003-12-17 09:29:35 +00:00
Wayne Davison
90e22f4b51 Backed out the RSYNC_RSH_IO support for now. 2003-12-17 09:28:45 +00:00
J.W. Schultz
ab304c268c Removed hardlink reporting bug from TODO list -- seems to be
fixed.
2003-12-17 00:52:01 +00:00
J.W. Schultz
16a3fec02d Added keword base reporting to TODO features list. 2003-12-17 00:49:50 +00:00
J.W. Schultz
abb0b532f8 Reorganized and cleaned up TODO list. 2003-12-17 00:47:39 +00:00
Wayne Davison
43cd760fc1 - Changed the places that talked about rsh being the default shell.
- Document the new RSYNC_RSH_IO environment variable.
2003-12-16 23:07:19 +00:00
Wayne Davison
9af87151ec We now support an environment variable named RSYNC_RSH_IO which lets the
user set the blocking-IO value for the shell specified by RSYNC_RSH.
2003-12-16 23:06:25 +00:00
Wayne Davison
8dd99390f5 Added RSYNC_RSH_IO_ENV. 2003-12-16 23:04:59 +00:00
Wayne Davison
e636af6b23 Mention change to ssh. 2003-12-16 19:48:25 +00:00
Wayne Davison
e3217f1448 Tweaked an obsolete comment. 2003-12-16 18:02:15 +00:00
Wayne Davison
66b711633f Improved the default-blocking-I/O code to discern rsh from ssh
properly.
2003-12-16 18:02:03 +00:00
Wayne Davison
f40f2fc8ce Made the default remote-shell be "ssh" (override with --with-rsh=FOO). 2003-12-16 18:01:06 +00:00
Wayne Davison
e6f9e388cf Moved the information on the single-use ssh key so that the --server
option wasn't being mentioned early in the rsync manpage (which has
confused at least one user trying to figure out the --daemon mode
command-line syntax).
2003-12-15 20:10:21 +00:00
Wayne Davison
3c1e2ad956 Document new error code 24. 2003-12-15 19:49:38 +00:00
Wayne Davison
e6d2799170 Updated version. 2003-12-15 19:04:04 +00:00
Wayne Davison
2cfbf4bc0e Changed the version to 2.6.0pre1. 2003-12-15 19:00:20 +00:00
Wayne Davison
f7731f1fc2 Removed some obsolete items. 2003-12-15 18:45:27 +00:00
Wayne Davison
7d3f8ae2df Make sure we only use blocking-I/O if blocking_io is > 0. 2003-12-15 18:45:07 +00:00
Wayne Davison
a60fdd63f4 Changed version to 2.6.0. 2003-12-15 18:25:10 +00:00
Wayne Davison
3a7dec59bc Changed version to 2.6.0 in preparation for new release. 2003-12-15 18:22:12 +00:00
Wayne Davison
880ae34190 Got rid of setgroups() caveat for OSX -- we fixed that a while back. 2003-12-15 18:20:06 +00:00
Wayne Davison
d00daf1f3f Mentioned the vanished-file warning enhancement. 2003-12-15 08:44:55 +00:00
Wayne Davison
17fadf7d40 Twiddled some whitespace and multi-line comments. 2003-12-15 08:14:27 +00:00
Wayne Davison
06c28400fa New "io_error" variable handling for RERR_VANISHED support. 2003-12-15 08:10:31 +00:00
Wayne Davison
6e35c72fdb Return new RERR_VANISHED code, as appropriate. 2003-12-15 08:08:44 +00:00
Wayne Davison
e2d22fee53 Added new IOERR_* defines. 2003-12-15 08:07:38 +00:00
Wayne Davison
1bca1de6cc Handle new RERR_VANISHED error. 2003-12-15 08:06:52 +00:00
Wayne Davison
e0ed4e4087 Added RERR_VANISHED. 2003-12-15 08:04:14 +00:00
Wayne Davison
4a7319be12 Neatened up some whitespace issues and made multi-line comments more
consistent.
2003-12-15 01:45:01 +00:00
Wayne Davison
55d5937dd6 Simplified the setting of the reading_remotely variable in function
read_filesfrom_line() now that remote_filesfrom_file is set more
often.
2003-12-15 00:54:44 +00:00
Wayne Davison
63596e1c4a If we're the server and --files-from is "-", set remote_filesfrom_file
to "-" as well (since the data is coming over the socket from the remote
side).
2003-12-15 00:53:07 +00:00
Wayne Davison
603e6b05c7 Neatened up the indentation. 2003-12-12 17:13:22 +00:00
J.W. Schultz
dfad66a838 Sanity check s2length on recept. 2003-12-06 21:35:34 +00:00
Wayne Davison
58cadc8608 Merged in the security fixes from 2.5.7. 2003-12-06 21:07:27 +00:00
J.W. Schultz
b11b50bcd0 Added reminder to update rsync.yo manpage when adding to
exit codes.
2003-10-25 20:02:45 +00:00
Wayne Davison
a73de5f3ba Added exit code 0. 2003-10-25 17:53:57 +00:00
Wayne Davison
84c3645cea Updated exit codes as Jon Jensen and J.W. suggested. 2003-10-25 16:21:41 +00:00
Wayne Davison
2a88a8cd30 Fixed an operator-precedence problem in the batch-mode code. 2003-10-13 23:46:08 +00:00
Wayne Davison
8a97fc2e1b Tried to improve the documentation surrounding a trailing-slash
source-dir transfer.
2003-10-07 20:33:08 +00:00
Wayne Davison
7a2fd68b96 Tweaked the just-added error message to use my new full_fname()
function.  Also removed some trailing whitespace from lines.
2003-09-16 05:33:09 +00:00
J.W. Schultz
6a7cc46cb2 Detect and report when open or opendir succeed but read and
readdir fail caused by network filesystems issues and
truncated files.
			Thanks to David Norwood and Michael Brown
2003-09-16 02:49:59 +00:00
Wayne Davison
aa6dc37ccb Mention my recent changes. 2003-09-11 05:00:52 +00:00
Wayne Davison
ea42541fe0 Improved file-related error messages by using the new
full_fname() function.
2003-09-11 04:53:05 +00:00
Wayne Davison
b7b2741f3a Tweaked an error message. 2003-09-11 04:53:01 +00:00
Wayne Davison
eb61be192d Added a new function, full_fname(), that makes a filename more complete
for error messages.  If the path is in a module, we ensure that the
"path" setting (from the config file) is not revealed, while still
reminding the user that the path is relative to the module's root.
2003-09-11 04:48:15 +00:00
Wayne Davison
9b9114e8cd Include a few new stubs to handle the new full_fname() function. 2003-09-11 04:48:13 +00:00
Wayne Davison
857e38bb45 Got rid of some "/* dw */" comments and fixed some line's indentation. 2003-09-11 04:48:09 +00:00
Wayne Davison
4ea812445d Got rid of some "/* dw */" comments. 2003-09-11 04:48:07 +00:00
Wayne Davison
e80a765412 If lp_path() returns "/", set exclude_path_prefix to "" (because the
exclude code doesn't want any trailing slashes).
2003-09-11 04:00:19 +00:00
Wayne Davison
15089022d4 Make sure that the new slash-stripping P_PATH code doesn't turn
a "/" into an empty string.
2003-09-11 03:49:53 +00:00
Wayne Davison
f69204adad Changed main() definition to avoid an extra prototype being put
into the proto.h file.
2003-09-10 08:27:34 +00:00
Wayne Davison
459a83c9cc Make sure that the "path" value has any trailing slashes removed. 2003-09-10 08:08:14 +00:00
Wayne Davison
6464bdbe13 Got rid of trailing whitespace. 2003-09-10 07:31:58 +00:00
Wayne Davison
4f3e9a0fba Added the new --protocol option. 2003-09-09 15:58:56 +00:00
Wayne Davison
8a9709dee5 Changed most instances of "remote_version" to "protocol_version", and
others to "remote_protocol".  Downgrade the protocol_version if the
remote_protocol" is lower.  Output the protocol values if the verbose
level is large enough.  Exit if the user tried to force a protocol
value that is not within the range that we can handle.  Fixed the
output of the "very old version of rsync" message to output the right
Client/Server string.
2003-09-09 15:58:53 +00:00
Wayne Davison
daa598df11 Changed most instances of "remote_version" to "protocol_version", and
others to "remote_protocol".  Downgrade the protocol_version if the
remote_protocol is lower.
2003-09-09 15:58:50 +00:00
Wayne Davison
d04e9c51b4 Changed "remote_version" to "protocol_version". 2003-09-09 15:58:48 +00:00
J.W. Schultz
d89a3a313a *** empty log message *** 2003-09-04 05:54:20 +00:00
J.W. Schultz
350e4e4dec Allow non-dir special files to be replaced with regular
files and fix error that caused directories in link-dest or
compare-dest to prevent the creation of files of same path.
2003-09-04 05:49:50 +00:00
Wayne Davison
c95dcb3935 Cast various s->blength references inside of MIN() macros to OFF_T
so that compilers don't warn about signed/unsigned comparisons.
2003-08-22 21:26:08 +00:00
Wayne Davison
1e4f48d6c4 Whitespace tweaks. 2003-08-22 05:51:42 +00:00
Wayne Davison
fb55e28d83 Fixed the multiplying of blength*blength so that it can't overflow
before it gets cast to a uint64.
2003-08-22 05:42:13 +00:00
Wayne Davison
067669dac7 Made the UNUSED(parameter) macro calls read a little nicer. 2003-08-22 05:04:13 +00:00
Wayne Davison
24c906d3f7 Mark unused vars. 2003-08-22 00:31:46 +00:00
Wayne Davison
14820f635d Make extra backup dirs mode 0700, not 0755. 2003-08-22 00:30:46 +00:00
Wayne Davison
59192f5650 Got rid of a duplicate include for malloc.h and improved the "do we
need malloc.h" logic a bit more.  (Trying to prevent #warning and
#error problems on *BSD systems.)
2003-08-21 23:54:20 +00:00
Wayne Davison
365346ca30 Got rid of signed/unsigned-comparison warning if st_rdev is signed. 2003-08-21 23:46:10 +00:00
Wayne Davison
d01350a881 Got rid of signed/unsigned-comparison warning if st_dev is signed. 2003-08-21 23:45:49 +00:00
Wayne Davison
38b02c13d0 Let's try only including malloc.h if stdlib.h isn't around (and it
exists).
2003-08-21 23:32:35 +00:00
Wayne Davison
b017ec4e13 Silenced a couple compiler warnings. 2003-08-21 23:28:24 +00:00
Wayne Davison
2c873122b3 Mention some more bug fixes. 2003-08-20 23:36:45 +00:00
Wayne Davison
6969ebcfcf Call setgroups(1, &gid) after setting the gid (rather than calling
setgroups(0, NULL) before).
2003-08-20 23:25:52 +00:00
Wayne Davison
1dbb94cadf Use the AVAIL_OUT_SIZE() macro in a few more places to ensure
that the avail_out buffer is big enough to uncompress all the
compressed data.
2003-08-20 10:37:53 +00:00
Wayne Davison
8a78bb963d Fixed a couple option-name typos (that had '_' instead of '-'). 2003-08-18 23:52:43 +00:00
Wayne Davison
6931c13800 - Made special exclusion-handling of '.' work in -R mode (so that we
can't accidentally lose the '.' dir and not transfer anything at all).
- Add a trailing '.' onto all '/'-trailing names, even '/' (fixes
  skipped deletions in -R mode from '/').
- Fixed loss of FLAG_DELETE on user-specified dir when unduplicating '.'
  (could happen on "./." or similar).
2003-08-17 21:29:11 +00:00
J.W. Schultz
e6e3f12ffc Whitespace and indentation cleanup. There is a lot of deep
indentation mostly due to read_batch but at least it is now
consistant.
2003-08-15 00:57:27 +00:00
J.W. Schultz
e2559dbedc Make --progress imply --verbose without incrementing verbosity. 2003-08-06 06:45:14 +00:00
Wayne Davison
1f3d6cdd86 Got rid of unused OPT_* enums. 2003-08-05 17:56:54 +00:00
Wayne Davison
4a7ee79d4d Improved the mkstemp error message. 2003-08-04 21:03:07 +00:00
Wayne Davison
0c2ef5f42d Make sure that the error message for mkstemp() includes the full
path of where we're trying to create the temp file.
2003-08-04 21:00:57 +00:00
Wayne Davison
ca20c7fd62 Instead of ignoring SIG_CHLD, reap zombies in the signal handler. 2003-08-04 18:27:27 +00:00
Wayne Davison
191e40da17 Change the way we pass the --suffix option to the remote process so
that a string that starts with ~ doesn't get modified.
2003-08-01 20:19:51 +00:00
Wayne Davison
80ddadb7e8 Complain if the --suffix value contains slashes (which is all too easy
to accidentally have happen if you try to specify "~" with --backup-dir).
2003-08-01 19:40:31 +00:00
Wayne Davison
31f3b68a97 We should bump the deletion_count for backed-up deleted files too. 2003-08-01 08:20:53 +00:00
Wayne Davison
d594399c6a Mention the --backup fix. 2003-08-01 08:01:15 +00:00
Wayne Davison
d74a2e3ed5 Properly handle the backup_suffix/backup_dir settings when deleting
files.  Also optimized the code that calls delete_one().  Don't
neglect to mention a file being deleted with --backup set.
2003-08-01 07:58:47 +00:00
Wayne Davison
d175d7e13e Got rid of suffix_specified and instead set backup_suffix to the
correct default value for the current backup_dir mode.  Added two
new values: backup_suffix_len and backup_dir_len.  Improved some
error-message code to not output duplicate errors.
2003-08-01 07:58:44 +00:00
Wayne Davison
daa8ce838b Use the new backup_suffix_len and backup_dir_len variables. Got rid
of the suffix_specified kludge.
2003-08-01 07:58:41 +00:00
Wayne Davison
b19fd07c02 Clarify some --backup/--backup-dir/--suffix issues. 2003-08-01 00:50:23 +00:00
J.W. Schultz
47d6a60c2f Whitespace and indentation fixes. 2003-07-31 09:32:15 +00:00
Wayne Davison
980821ebab No longer needed (replaced by wildmatch). 2003-07-30 06:13:47 +00:00
Wayne Davison
592f4696dc Updated the exclude/include section to mention the "**" vs "*" change. 2003-07-30 06:12:41 +00:00
Wayne Davison
8a7846f97e Changed the "**" description to reflect its no-longer-buggy behavior. 2003-07-30 06:12:33 +00:00
Wayne Davison
87f18b6289 Include "lib/wildmatch.h", not "lib/fnmatch.h" or <fnmatch.h>. 2003-07-30 06:12:31 +00:00
Wayne Davison
28063ba5b2 Got rid of test for fnmatch. 2003-07-30 06:12:29 +00:00
Wayne Davison
fe332038c6 Call wildmatch(), not fnmatch(). 2003-07-30 06:12:27 +00:00
Wayne Davison
3c0b1ebf78 Changed lib/fnmatch.o to lib/wildmatch.o. 2003-07-30 06:12:25 +00:00
Wayne Davison
f2fe4903c9 Made the list of exclude/include changes more prominent and clear. 2003-07-26 18:13:38 +00:00
Wayne Davison
3151cbae89 Some superficial tweaks I made while reading through the io.c code. 2003-07-26 17:55:07 +00:00
Wayne Davison
3c30b99059 Added one more test. 2003-07-14 15:46:34 +00:00
Wayne Davison
a7735ba085 Updated for latest character-class change. 2003-07-14 15:13:31 +00:00
Wayne Davison
d811b68901 Make sure that no character class can match a '/'. 2003-07-14 15:12:59 +00:00
Wayne Davison
1c8162a921 Optimized show_progress() to reduce the calls to gettimeofday() when
am_server is set.  No need to check do_progress here anymore, since
we aren't called if do_progress isn't set.
2003-07-08 16:54:53 +00:00
Wayne Davison
16417f8b9d Only call show_progress() and end_progress() if do_progress is set. 2003-07-08 16:49:10 +00:00
Wayne Davison
b49d381d05 Changed "./0123456789" to just ".0123456789". 2003-07-07 19:37:58 +00:00
Wayne Davison
7da9a16d10 I decided to go with the slightly simpler logic Thorild Selen suggested
in a subsequent email.
2003-07-07 18:37:38 +00:00
Wayne Davison
32f60a6e7b Improved deficiencies in the hostname-vs-address check (reintroduced in the
last revision) based on the suggestions of Thorild Selen.
2003-07-07 18:25:01 +00:00
Wayne Davison
b7db090661 Commented-out a test that wasn't consistent across all platforms. 2003-07-07 07:28:02 +00:00
Wayne Davison
136c5c5ec3 Silence some compiler warnings on HP-UX. 2003-07-07 07:22:08 +00:00
Wayne Davison
85b80fbc73 A few more tests. 2003-07-07 07:10:40 +00:00
Wayne Davison
16859cdbdc Improved the summary output to use correct English for all counts. 2003-07-07 07:08:24 +00:00
Wayne Davison
fc96552d26 Don't treat "[:" as the start of a named set if there's no ":]". 2003-07-07 07:07:16 +00:00
Wayne Davison
15bb997d0a Added a few more items to the tests. 2003-07-06 18:54:08 +00:00
Wayne Davison
b6b42c892c Improve the format of the --iterations output. 2003-07-06 18:29:24 +00:00
Wayne Davison
5bb920003e - Return ABORT_ALL for a syntax error in the pattern (not FALSE).
- Abort if the [:class:] name is not known.
2003-07-06 18:26:34 +00:00
Wayne Davison
37ff0e344d Added match for new "no errors" line from wildtest. 2003-07-06 17:41:37 +00:00
Wayne Davison
97d53f8c75 Switch to using an input file so that backslashes are specified
normally, and so that test additions and changes are easier.
2003-07-06 17:41:01 +00:00
Wayne Davison
f2ac84c36d Added some portability code for the ctype functions. 2003-07-06 16:29:32 +00:00
Wayne Davison
c21eeef5bc Updated for latest wildmatch.c changes. 2003-07-06 04:34:19 +00:00
Wayne Davison
e11c425119 - Added [:class:] handling to the character-class code.
- Use explicit unsigned characters for proper set checks.
- Made the character-class code honor backslash escapes.
- Accept '^' as a class-negation character in addition to '!'.
2003-07-06 04:33:54 +00:00
Wayne Davison
84229c7ac9 We now figure out if diff accepts -u and we'll use it instead of -c,
if possible.
2003-07-05 22:57:08 +00:00
Wayne Davison
c9a59880f0 Simplified the character-class code a bit. 2003-07-05 22:40:27 +00:00
Wayne Davison
9a17dddbc5 Fixed the output of popt errors and changed our one option to be
--iterations (-i).
2003-07-05 19:21:41 +00:00
Wayne Davison
277d99e8c9 A wildtest change to handle someone using the included popt lib. 2003-07-05 19:14:10 +00:00
Wayne Davison
2a1874cc82 Added dependencies for wildtest.o. 2003-07-05 19:06:49 +00:00
Wayne Davison
d5c973ccb7 Changed some names since "depth" wasn't really the right term. 2003-07-05 19:03:42 +00:00
Wayne Davison
37f3ce61bb Another change to the wildtest rule to make it more portable. 2003-07-05 18:55:09 +00:00
Wayne Davison
076f60eed0 Added a --depth option to report recursion depth values. 2003-07-05 18:49:38 +00:00
Wayne Davison
20b2e9cef7 Improved the ABORT logic to allow aborting consecutive "*" wildcards
back to a "**" wildcard.  Added optional debug code for recursion stats.
2003-07-05 18:48:34 +00:00
Wayne Davison
e37d8229f5 Changed the build rule for wildtest. 2003-07-05 18:46:02 +00:00
Wayne Davison
710faea9a4 Added in the ABORT optimization logic from a newer wildmat release,
adapted for our code that distinguishes "**" from "*".
2003-07-05 17:30:53 +00:00
Wayne Davison
70a6051cf1 Restored an isdigit() check in the match_address() function, but check
the last character in the hostname, not the first.
2003-07-05 07:39:57 +00:00
Wayne Davison
7a1f46b6ac A couple comment tweaks. 2003-07-05 07:22:13 +00:00
Wayne Davison
7ca9250db0 Changed "diff -u" back to "diff -c" (for portability). 2003-07-05 07:09:31 +00:00
Wayne Davison
af7086c63f Change most SAME-AS-FNMATCH "false" values to "true" (since we _should_
work the same as fnmatch in most cases, if fnmatch was actually working
right).
2003-07-05 07:03:56 +00:00
Wayne Davison
8808589277 Get rid of a couple compiler warnings. 2003-07-05 06:56:16 +00:00
Wayne Davison
6cd5096063 Don't define COMPARE_WITH_FNMATCH by default. 2003-07-05 06:53:41 +00:00
Wayne Davison
677cd34acd Include lib/wildmatch.h directly for now (until we make rsync.h include
it for us).
2003-07-05 00:13:38 +00:00
Wayne Davison
08c5385e65 Test the new wildmatch() routine using the wildtest executable. 2003-07-05 00:08:11 +00:00
Wayne Davison
d7bf70f196 Build "wildtest" for "make check". 2003-07-05 00:07:35 +00:00
Wayne Davison
6f3cff41dd Ignore "wildtest". 2003-07-05 00:05:33 +00:00
Wayne Davison
5de45bcadc A testbed to stress the new wildmatch() routine. 2003-07-05 00:05:02 +00:00
Wayne Davison
446ee5b110 A new wildcard-matching routine to replace the fnmatch code. 2003-07-05 00:03:36 +00:00
Wayne Davison
d3e6fd3910 Changed "diff -c" to "diff -u". 2003-07-04 23:56:59 +00:00
Wayne Davison
6813fa7eac Attempting to fix the snprintf() conflict on a gcc-using HPUX 11.11. 2003-07-04 15:36:39 +00:00
Wayne Davison
0f5a04e3ff Use "return" at the end of main() to silence some compilers. 2003-07-04 15:11:46 +00:00
Wayne Davison
8801138b47 Made rprintf() of size_t value portable. 2003-07-04 15:11:44 +00:00
Wayne Davison
2473391971 Improved upon my last patch to make it clearer and cleaner. 2003-07-04 07:47:09 +00:00
Wayne Davison
7d6879328a Changed the syntax of a comment. 2003-07-03 18:33:53 +00:00
Wayne Davison
900454132e Mention the compression (-z) fix. 2003-07-03 17:41:08 +00:00
Wayne Davison
92b8abfe80 Fixed a problem where we might not have enough room to compress
unsent tokens into the obuf in a single call.
2003-07-03 17:38:12 +00:00
Wayne Davison
52e628a861 Mention the exclude changes. 2003-07-01 22:01:48 +00:00
Wayne Davison
4791825d49 Modified the glob_expand_one() function to check the args against the
server's config-specified exclude list.  This prevents the user from
going around directory exclusions.  Fixed push_dir() to not append
"/." onto the end of the current path if it is called with "." as the
"dir" arg.  Made curr_dir[] exported so the exclude code can use it
(for the daemon-config absolute-path excludes).
2003-07-01 21:45:31 +00:00
Wayne Davison
d542c20c5f New stubs to get the test setup to compile with the exclude changes. 2003-07-01 21:45:29 +00:00
Wayne Davison
4762db4fc9 Added some defines for the various exclude-function arg literals.
Added MATCHFLG_ABS_PATH flag for absolute-path patterns.
2003-07-01 21:45:27 +00:00
Wayne Davison
8645af1d8c Changed add_exclude*() calls to use the revised arg syntax. 2003-07-01 21:45:23 +00:00
Wayne Davison
429f98283f Modifications to handle the new server_exclude_list, and to use the
revised calling syntax and new defines for the various exclude
functions.
2003-07-01 21:45:18 +00:00
Wayne Davison
5be7fa93fc Made make_exclude() store anchored config-file excludes with the full
path (clear to the root).  Changed several functions to make the args
more general (to support separated lists), more consistent, and easier
to understand.
2003-07-01 21:45:16 +00:00
Wayne Davison
837cbad97f We now put the excludes from the config file into a "server_exclude_list"
using the revised add_exclude_line() arg syntax.
2003-07-01 21:45:13 +00:00
Wayne Davison
af1d91c562 Call make_file() using the revised arg syntax and new defines. 2003-07-01 21:45:07 +00:00
Martin Pool
908f5a9f9f Add a comment about using getpassphrase() or readpassphrase() rather
than getpass().  No code change.
2003-06-17 04:46:32 +00:00
J.W. Schultz
9b74643315 Credit where due. 2003-06-10 00:21:34 +00:00
J.W. Schultz
986066873e Clarified EXCLUDE PATTERNS to enforce the relativity of
paths.  Replaced undefined "base dir" with a defined "top
dir".
2003-06-10 00:11:24 +00:00
J.W. Schultz
9533e15a79 Changed write file to cope with partial writes by looping
until complete or errno is set.
					(John Van Essen)
2003-05-22 23:24:44 +00:00
Wayne Davison
8dc74608a3 Updated the long description for the --perms option. 2003-05-16 04:23:34 +00:00
J.W. Schultz
3e85237e5f Added AIX and OSX build workaround notes. 2003-05-14 12:54:15 +00:00
Wayne Davison
9d0523ef4c Another MD4 fix for protocol 27 (from Christoph Bartelmus). 2003-05-12 20:38:07 +00:00
Wayne Davison
4a7144ee7e Cleaned up whitespace/indentation. 2003-05-10 08:33:08 +00:00
Wayne Davison
c120ff37f5 Optimized away 3 calls to strcmp(). 2003-05-10 00:56:08 +00:00
J.W. Schultz
83fd337d8e Modified the (in|ex)clude [from] option descriptions to
better highlight the non-equivalence with client-side
--exclude.
2003-05-09 12:04:24 +00:00
Jos Backus
707c1a3085 Remove generated file config.log. 2003-05-04 19:59:47 +00:00
J.W. Schultz
8294b00c11 Added --link-dest to the --help output. 2003-05-02 23:36:10 +00:00
Wayne Davison
da2bcdd1c2 Exclude/include bug fixes. 2003-05-01 19:39:20 +00:00
Wayne Davison
093acc5dad Changed the expected results to match the new bug-fixed behavior. 2003-05-01 19:34:01 +00:00
Wayne Davison
fd73b94d31 Tweaked the exclude_struct for our improved matching code. 2003-05-01 19:33:59 +00:00
Wayne Davison
38499c1a49 Mention that a pattern with "**" is matched against the entire path, even
if the pattern doesn't contain a slash.
2003-05-01 19:33:57 +00:00
Wayne Davison
170381c052 Fixed some matching bugs; made the logic of the matching code a little
clearer by using defined flags; added several comments; optimized the
matching of an anchored literal string.
2003-05-01 19:33:54 +00:00
Wayne Davison
8113a033dd Mention the improved trailing-slash-in-destination handling. 2003-04-24 16:26:53 +00:00
Wayne Davison
87cc45e136 Made my last change a little better. 2003-04-24 16:26:09 +00:00
Wayne Davison
f6b8d591f7 If the user specifies a trailing slash on the destination, make sure
that we treat it as a directory reference.
2003-04-24 16:14:33 +00:00
J.W. Schultz
d31c09c872 Copy relative path caviat from --compare-dest to
--link-dest.
2003-04-23 23:17:41 +00:00
Wayne Davison
337a1a86a7 Changed one part of the exclude-test setup to test the --existing
option.  Also tweaked a few comment lines.
2003-04-23 02:15:59 +00:00
Wayne Davison
b7dc46c0f6 Fixed a typo and added a couple clarifying phrases to the exclude
descriptions.
2003-04-22 18:09:22 +00:00
Wayne Davison
ff57065957 Test various exclude/include patterns. 2003-04-22 17:53:53 +00:00
Wayne Davison
0406a3a7a4 Changed test_xfail to test_fail. 2003-04-22 16:45:24 +00:00
Wayne Davison
bc3b5b2558 Fixed a problem with the test code and enabled it (since rsync's
duplicate-elimination code is now fixed).
2003-04-22 00:25:05 +00:00
J.W. Schultz
d1cce1dd92 Make explicit that (in|ex)clude patterns are for relative
paths and that the leading / is the equivalent of ^ in
regex.
2003-04-21 08:44:25 +00:00
Wayne Davison
7bb7058e8d Made a slight tweak to the previous --stats change. 2003-04-18 20:03:41 +00:00
Wayne Davison
727fa3688f Mention the change to the --stats output. 2003-04-17 23:46:01 +00:00
Wayne Davison
577ab12ce5 Only display the malloc stats if we're at least double-verbose (and
--stats was specified, of course).  Also made the output of the short
(2-line) transfer summary get prefixed with an empty line in all
cases (not just with --stats).
2003-04-17 23:44:25 +00:00
Wayne Davison
0f2ac85576 Some whitespace/indentation cleanup. 2003-04-17 01:44:33 +00:00
J.W. Schultz
fab1f8898e document bug fix for --link-dest and lack of -pgo. 2003-04-11 03:15:53 +00:00
restrict
f63d68be97 (Really mbp)
Test commit from restricted CVS account.  No changes.
2003-04-10 04:35:12 +00:00
Wayne Davison
58665d23b4 Fixed a weird line corruption in the last check-in and tweaked the
format to be the same as in older releases.
2003-04-10 03:06:28 +00:00
J.W. Schultz
195bd906a2 - Per-file dynamic block size is now sqrt(file length).
-	The per-file checksum size is determined according
	to an algorythm provided by Donovan Baarda which
	reduces the probability of rsync algorithm
	corrupting data and falling back using the whole md4
	checksums.
2003-04-10 02:04:58 +00:00
J.W. Schultz
fc1ae6582f - for protocol version >= 27, mdfour_tail() is called when the block size
(including checksum_seed) is a multiple of 64.  Previously it was not
   called, giving the wrong MD4 checksum.

 - for protocol version >= 27, a 64 bit bit counter is used in mdfour.c as
   required by the RFC.  Previously only a 32 bit bit counter was used,
   causing incorrect MD4 file checksums for file sizes >= 512MB - 4.
						-- Craig Barratt
2003-04-10 01:50:12 +00:00
J.W. Schultz
fc0257c9fd Now support dynamic per-file checksum2 size.
This pushes protocol version to 27
2003-04-10 01:13:30 +00:00
J.W. Schultz
91c4da3fda versions prior to 1.7.0 (protcol version 17) cannot talk to
protocol versions > 20 so bumping up the minimum protocol
version and excising the pre-17 cruft.
2003-04-10 00:13:48 +00:00
Paul Green
990ff150ef Fix bug reported by engard.ferenc at innomed.hu whereby using the %f format
in sprintf with a value like 0.025 produced 0.250.  We were dropping the
leading zeros before the fractional digits.
2003-04-09 21:10:18 +00:00
J.W. Schultz
e72b18a9bd Remove tempname length problem and files-from from TODO. 2003-04-01 03:44:50 +00:00
J.W. Schultz
bc63ae3f13 Removing vestigial support for protocol versions prior to 15. 2003-03-31 17:28:34 +00:00
J.W. Schultz
6e12886393 Logic error in preserve_perms + link_dest 2003-03-31 08:09:41 +00:00
Wayne Davison
b5ca91ae4b Fixed a typo. 2003-03-30 23:19:22 +00:00
Wayne Davison
89855e78ab Started a new section for the next release. 2003-03-30 23:15:01 +00:00
Wayne Davison
e106de49c8 Tweaked the O_BINARY code to the latest idiom. 2003-03-30 23:00:51 +00:00
Wayne Davison
afbcc8f216 Define O_BINARY as "0" if it isn't defined. 2003-03-30 23:00:49 +00:00
Wayne Davison
f177b7cca2 Documented --files-from, --no-relative, --no-implied-dirs, and --from0. 2003-03-30 23:00:47 +00:00
Wayne Davison
ea5164d181 Support the new --files-from, --no-relative, --no-implied-dirs, and --from0
options.  Moved the find_colon() routine here from main.c.
2003-03-30 23:00:42 +00:00
Wayne Davison
ccdff3ebbf Open the file in BINARY fd mode, handle the normal line-ending characters
better than before, and add support for the new --from0 option (which changes
the line separator to a null).
2003-03-30 23:00:40 +00:00
Wayne Davison
24d0fcde7f Support the new --files-from and --no-implied-dirs options. 2003-03-30 23:00:37 +00:00
Wayne Davison
56014c8c0a Support the new --files-from and --from0 options. 2003-03-30 23:00:35 +00:00
Wayne Davison
7c2a9e766c Support the new --files-from option. 2003-03-30 23:00:33 +00:00
J.W. Schultz
bb24028f51 Make link-dest aware of --perms, --owner and --group.
---- Chris Darroch
2003-03-26 20:26:06 +00:00
J.W. Schultz
52d3e10613 Prevent tempfile names from overflowing.
Debian BUG# 183667
2003-03-26 11:04:14 +00:00
J.W. Schultz
67863f46e3 Warn if 64bit value sent or received on system that doesn't
support 64bit integers.
2003-03-25 07:13:40 +00:00
J.W. Schultz
9c28e52628 Seperate the uint64_t macros from int64_t 2003-03-25 05:46:52 +00:00
J.W. Schultz
1b2f167546 Frustration mounting. I'll get it right eventually.
Thank goodness for the build farm.
2003-03-25 04:18:10 +00:00
J.W. Schultz
702d0c4529 earlier problem was a typo. 2003-03-25 04:09:43 +00:00
J.W. Schultz
51106bafc6 Another stab at uint64 because some platforms seem to have
problem with the unsigned off64_t
2003-03-25 03:14:27 +00:00
J.W. Schultz
42d4edc067 removed log_transfer() It was no more than a conditional
rprintf() with an unused param.
2003-03-25 02:28:54 +00:00
J.W. Schultz
fbc0bc4d53 Create uint64 for INO64_T and DEV64_T eliminating type mismatches. 2003-03-25 02:02:22 +00:00
J.W. Schultz
1b2db7aecb Increased maximum protocol version.
Added warning for deprecated protocol versions.
2003-03-24 22:42:46 +00:00
J.W. Schultz
1ce29566e7 Minor correction to protocol annotation. 2003-03-24 22:32:47 +00:00
J.W. Schultz
3742bf3ac3 Annotated each release with protocol version and
added protocol version history from rsync.h log.
2003-03-24 22:13:16 +00:00
Wayne Davison
18d6b679af The close_all() function was missing its "void" prototype. 2003-03-21 23:43:50 +00:00
Wayne Davison
dbda5fbf06 Get rid of eol whitespace. 2003-03-21 22:53:46 +00:00
Wayne Davison
2154309a54 Optimized the implied-directory code to avoid putting so many duplicate
dirs into the file list.
2003-03-21 22:10:44 +00:00
Wayne Davison
afb6e9450d - Use popt to better effect for the two options that can be both
set and unset by the user.
- Even more whitespace cleanup.
2003-03-21 19:17:23 +00:00
Wayne Davison
dfa3248380 - Simplified the whole-file option handling.
- Fixed some whitespace issues.
2003-03-21 18:58:50 +00:00
Wayne Davison
2cda256088 - Simplified the whole-file option handling.
- Cleaned up some whitespace issues.
2003-03-21 18:53:00 +00:00
Wayne Davison
d9c7edf63f - Fixed lots of line-indentation problems, including a really huge section
of non-batch-mode code that was indented at the same level as its
  surrounding "if" statement.
- Moved the heavily-used am_* flags into global extern vars instead of
  externing them again and again in individual functions.
- Got rid of line-ending whitespace.
2003-03-21 18:33:48 +00:00
J.W. Schultz
a151343943 Cleanup: Added header files to dependancies. 2003-03-21 07:42:19 +00:00
J.W. Schultz
85ed0aa396 Typo corrections.
Thanks to Paul Slootman <paul@debian.org>
2003-03-21 07:27:31 +00:00
J.W. Schultz
3019f95f37 Removing --csum-length option documentation since there is
no such option.
2003-03-21 04:39:11 +00:00
Paul Green
5702bc12b3 Apply patch from Steve Bonds to repair this test. 2003-02-19 16:22:50 +00:00
Paul Green
b0d791bb35 Patch from Roderick Schertler (roderick at argon.org) to ignore
non-POSIX directory mode bits that are used by AIX.
2003-02-18 18:07:36 +00:00
Paul Green
3903928ca0 Remove RedHat-specific .spec files in favor of the .spec files
maintained under packaging/lsb.
2003-02-18 16:50:25 +00:00
Wayne Davison
827c37f631 The sender no longer removes the duplicate names from the file list -- we
let the receiver do that, since they are the one that requests names and
we want to be sure the sender has any name the receiver may ask for.
2003-02-12 09:15:23 +00:00
David Dykstra
b45b059a3d Back out one of the changes in log.c revision 1.62, and always send errors
to the client after multiplexing is enabled.
2003-02-11 19:13:51 +00:00
Paul Green
f39281ae56 Patch from jw schultz to reword "link" to "connection" in a couple of
spots.
2003-02-10 14:51:09 +00:00
Paul Green
e2bea9eb8d Update packaging spec files per patch submitted by Horst von Brand.
In the future, we need to be sure to keep *.spec and *.spec.tmpl
identical...the release macro produces *.spec from *.spec.tmpl.
2003-02-05 18:41:53 +00:00
Paul Green
931a979904 Restored changes accidentally backed out by Dave Dykstra in previous revision. 2003-01-29 21:04:28 +00:00
Paul Green
3fccfafd30 Apply fix from Horst von Brand. See comments in rsync.spec. 2003-01-29 20:52:59 +00:00
David Dykstra
7a6fd4c1c7 preparing for release of 2.5.6 2003-01-28 05:28:42 +00:00
David Dykstra
8395d24616 Add header for 2.5.6 release. 2003-01-28 05:13:16 +00:00
David Dykstra
7d085960eb Remove the Cygwin msleep(100) before the generator kills the receiver,
because it caused the testsuite/unsafe-links test to hang.
2003-01-28 05:05:53 +00:00
David Dykstra
3884317181 Change the default of --modify-window back to 0 on Cygwin. 2003-01-28 03:11:57 +00:00
David Dykstra
089a2435f8 Ack! I had accidentally ifdefed out the kill from the generator to the
receiver process for every platform except Cygwin.
2003-01-28 03:03:55 +00:00
David Dykstra
8ed16deb24 Change so the delay before generator signals receiver is only done on Cygwin. 2003-01-28 02:51:03 +00:00
Paul Green
a577af9067 Added a TODO item about temporary file names bumping up against the
maximum name length.  (I have an unfinished patch that will address
this).
2003-01-27 16:33:47 +00:00
David Dykstra
59af13651b Move the sleep to workaround the default modify-window of 1 on Cygwin to
the beginning of "checkit" rather than the end of "hands_setup" because
sometimes files are modified just before checkit is called and the copy
finishes within one second so they're considered to be the same time.
I don't think this would be a problem in real life, so just change the
test.
2003-01-27 04:41:30 +00:00
David Dykstra
787568f371 Insert a 100ms sleep just before sending the USR2 signal to the
child receiver process to prevent some hangs on Cygwin.  Anthony
Heading discovered the workaround first and suggested 30ms, and
Greger Cronquist had better luck with 100ms.
2003-01-27 03:52:42 +00:00
David Dykstra
f0019fc506 Remove the "Connection reset by peer" from TODO 2003-01-27 03:36:54 +00:00
David Dykstra
9f639210ca Prevent the "Connection reset by peer" messages often seen from Cygwin.
Result of a lot of discussion over the last year and a half.  Based on
a patch from Randy O'Meara, cleaned up a bit by Max Bowsher.
2003-01-27 03:35:08 +00:00
David Dykstra
deec574421 Update date on man page. 2003-01-27 03:13:46 +00:00
David Dykstra
04657e42d5 Update rsyncd.conf documentation to be right for rsync server mode over a
remote shell.
2003-01-27 03:07:18 +00:00
David Dykstra
1b88775534 Change erroneous references to a --config-file option to the correct --config
option.
2003-01-27 02:48:14 +00:00
David Dykstra
7f6537557d Change news item about handling of text mode in files to just permitting
any of the standard line termination styles.
2003-01-26 20:49:24 +00:00
Wayne Davison
518233ca79 Got rid of recent O_TEXT* and O_BINARY* changes. 2003-01-26 20:11:16 +00:00
Wayne Davison
bc72130d71 Got rid of O_TEXT_STR and added code to strip '\r' from the end of the
lines we read.
2003-01-26 20:10:23 +00:00
Wayne Davison
855decd3a7 Added back the O_BINARY #ifdef. 2003-01-26 20:09:02 +00:00
Wayne Davison
0090cbdba6 Got rid of O_TEXT_STR change. 2003-01-26 20:07:55 +00:00
Wayne Davison
73ff720972 File I/O already handles '\r', so we can remove the O_TEXT flags. 2003-01-26 19:37:54 +00:00
David Dykstra
c561e1378d Remove a couple items I know are no longer needed. 2003-01-26 04:04:47 +00:00
David Dykstra
aa2c47d835 Better fix for infinite recursion; don't return from exit_cleanup
unless the nesting is already pretty deep, because there are normal
cases where exit_cleanup is nested shallowly.  Patch from Marc Espie,
posted by Brian Poole.
2003-01-26 03:53:34 +00:00
David Dykstra
536b84680b Open config files in text mode when O_TEXT is defined. This helps on
Cygwin when the config files are on a filesystem that is mounted in
binary mode.  Patch from Ville Herva.
2003-01-26 03:46:54 +00:00
David Dykstra
7508b795bf Tests that use hands_setup to make a test file directory and right
afterward make a copy were failing on cygwin because the default
--modify-windows now 1 on Cygwin.  Adding a 2 second sleep at the end of
hands_setup so that hopefully the tests will succeed because the copy
will be made more than 1 second away from the original.
2003-01-26 03:34:19 +00:00
Wayne Davison
76ee1d18bf Don't try to run daemon tests as "nobody". 2003-01-25 03:46:57 +00:00
Wayne Davison
379bc86547 Getting rid of recent "chown" since we decided to forego trying to run
the daemon tests as "nobody".
2003-01-25 03:45:40 +00:00
David Dykstra
066696644f Change default of --modify-window on Cygwin from 2 to 1 because that's all
that's needed on FAT filesystems.  NTFS filesystems can do with a window of
0, but it shouldn't hurt because it's highly unlikely that any given file
will be modified within one second of the time that rsync last copied it.
2003-01-24 22:07:22 +00:00
Paul Green
755bcd3722 Restore trailing newline character at the end of the file. 2003-01-23 17:18:20 +00:00
Paul Green
1985aa9666 Mentioned the fact that config.sub and config.guess got updated. 2003-01-22 22:59:35 +00:00
Paul Green
f4663a36da Updated config.sub and config.guess to latest revision. 2003-01-22 22:24:53 +00:00
Wayne Davison
521e6fdcfc Mention test-case fixes. 2003-01-21 20:25:44 +00:00
Wayne Davison
61ab574e38 Moved the chown from the download test to the upload test. 2003-01-21 20:19:53 +00:00
Wayne Davison
660cb6a085 Chown the $TO and $FROM directories to $RSYNCD_UID:$RSYNCD_GID (if we
can, and don't fail if we can't).
2003-01-21 20:19:53 +00:00
Wayne Davison
4274208833 Chown the $TO and $FROM directories to $RSYNCD_UID:$RSYNCD_GID (if we
can, and don't fail if we can't).
2003-01-21 19:30:51 +00:00
Wayne Davison
34db05b421 Put the UID and GID that rsyncd will run as into variables. 2003-01-21 19:28:29 +00:00
Wayne Davison
1657be22a3 Separated a cat "..." command out from inside a double-quoted string
so that we don't run afoul of some shells quoting quirks.  (As Brian
Poole suggested.)
2003-01-21 19:27:11 +00:00
David Dykstra
3636b9ffaa Change the name on the --modify-window default for Cygwin to Lapo Luchini. 2003-01-21 14:22:49 +00:00
David Dykstra
e3cd264571 Change version to working version 2.5.6pre3cvs 2003-01-21 04:23:43 +00:00
David Dykstra
69555b0943 Change version to 2.5.6pre2 2003-01-21 04:00:56 +00:00
Wayne Davison
522c05cf9a Declare preserve_perms for latest syscall.o. 2003-01-21 01:35:23 +00:00
David Dykstra
f0b4fdaf5e Ignore errors from chmod when --preserve-perms/-p/-a are not set.
Gnu cp behaves the same way.
2003-01-21 00:58:50 +00:00
Wayne Davison
ac6ce98375 Added a couple missing NEWS items. 2003-01-20 23:49:22 +00:00
David Dykstra
1b3cadaa39 Re-activate the piece of code that creates intervening directories
when --relative-paths is used.  The code was accidentally skipped starting
in CVS version 1.32 of receiver.c.  Noticed by Craig Barratt.
2003-01-20 23:32:17 +00:00
David Dykstra
61ca7d596c Update description of hosts allow for IPv6. From Bert Vermeulen. 2003-01-20 23:10:22 +00:00
David Dykstra
688d573295 Make the default for --modify-window be 2 on cygwin. 2003-01-20 23:09:24 +00:00
Wayne Davison
ec6e0bf0c0 Backed out Paul Green's IRIX patch since it didn't seem to be a part of
the Makefile fix and I like the old EXE syntax better.
2003-01-20 18:26:14 +00:00
David Dykstra
184dede92f Save the value of the test for getaddrinfo defines in the config cache. 2003-01-20 17:25:26 +00:00
David Dykstra
d2cc0323fb Also need to include lib/getnameinfo when the getaddrinfo defines don't exist. 2003-01-20 16:59:18 +00:00
David Dykstra
3a1eefd331 Oops, lib/getaddrinfo wasn't pulled in when the system doesn't define
AI_PASSIVE.
2003-01-20 16:27:34 +00:00
David Dykstra
824f1c7944 Only look for a system getaddrinfo/getnameinfo if AI_PASSIVE is defined
by system headers.  This fixes compile errors on Irix 6.5.
2003-01-20 15:04:16 +00:00
David Dykstra
7bc8218d81 Fix bug that causes messages like
rsync: stack overflow in function match_address
on openbsd.  Patch from Brian Poole <raj@cerias.purdue.edu>.
2003-01-20 13:46:28 +00:00
David Dykstra
a405cda63c Add unsafe-byname tests with symlink destinations ending in '..'. 2003-01-20 12:42:42 +00:00
Wayne Davison
7afa3a4a48 Optimized unsafe_symlink() to avoid malloc/free calls. 2003-01-19 21:37:11 +00:00
Wayne Davison
c80b3d8c3f Added "extern" to io_{read,write}_phase line (they were being
multiply defined).
2003-01-19 05:53:07 +00:00
Wayne Davison
ef6122c622 Got rid of trailing whitespace and tweaked a few things that might
possibly be affecting the IRIX build (but probably not).
2003-01-18 19:11:55 +00:00
Wayne Davison
75fb17b891 Define DBL_EPSILON if it doesn't exist. 2003-01-18 19:00:07 +00:00
Wayne Davison
2abbf2498f Trying out Paul Green's IRIX patch to see if it fixes the syntax
error in the Makefile.
2003-01-18 18:52:50 +00:00
Wayne Davison
b91b50c01f Fixed the bug in clean_flist() where it did not get rid of all duplicate
names if there were more than 2 identical names in a row.
2003-01-18 18:00:23 +00:00
David Dykstra
06891710f2 Change rsync help for -a to show that it is equivalent to -rlptgoD.
I've had to go to the man page many times for that information and I
finally got sick of it.
2003-01-16 21:02:43 +00:00
David Dykstra
b765ec32b9 Prevent infinite recursion in exit_cleanup(). Patch from Sviatoslav Sviridov. 2003-01-16 20:09:31 +00:00
Wayne Davison
a70d070cc5 Make unsafe_symlink() take const args so that we don't get any
compiler warnings when calling it with a const char *.
2003-01-15 17:49:44 +00:00
David Dykstra
1f1fbe187e Add news item about fix of --copy-unsafe-links 2003-01-15 16:41:51 +00:00
David Dykstra
fc63847406 Fix bug in --copy-unsafe that made it totally broken, and re-enable
the tests that tested it.  As far as I can tell, it was always broken
since the day I put it in years ago.  In my investigation into this I
was unable to figure out what in the world I was thinking back then,
to introduce a global variable with the wrong information in it rather
than using a parameter that was already available in readlink_stat
function.  That still bothers me a bit but I decided to stop worrying
about it.
2003-01-15 16:14:07 +00:00
David Dykstra
f58677d123 Don't use the return value from sprintf because it doesn't work on Sunos4. 2003-01-14 21:37:08 +00:00
David Dykstra
7ab1538861 Now that the 2.5.6pre1 snapshot has been made, change the version to
2.5.6pre2cvs.
2003-01-13 17:21:12 +00:00
David Dykstra
7ad0f94de9 Change version to 2.5.6pre1 2003-01-13 16:40:15 +00:00
Wayne Davison
8af534a52c Changed the alloca warning message. 2003-01-12 22:45:47 +00:00
Wayne Davison
7447419266 Use the old kludge of using malloc() if alloca() is missing. 2003-01-12 21:49:44 +00:00
David Dykstra
5216de37a4 Reduced the severity of the warning about missing alloca to a warning, and
changed the test to the common form of prefixing an x to both sides of
an equivalence because it didn't even notice a problem on the cray when
it was instead using test -n.
Also noticed an error in the test for ANSI c, doing a "$xac..." = xno"
when it should have been "x$ac..." = xno, so I fixed that too.
2003-01-12 04:02:25 +00:00
David Dykstra
ccc0d1eb1d Oops, had the sense of the test for the existence of alloca() backwards. 2003-01-12 03:28:13 +00:00
David Dykstra
7fc0890881 Make configure bomb if the included popt is needed but alloca is not
available, as apparently is the case on Cray UNICOS.  The AC_FUNC_ALLOCA
autoconf documentation talks about having an included alloca.c and
periodically calling alloca(0) to garbage collect when C_ALLOCA is defined,
but I don't know where to get the code or if there's anybody that cares
enough about the UNICOS port for it to be worth the trouble.
2003-01-12 03:11:38 +00:00
David Dykstra
b17f1d76c0 Cast the return from alloca to work better on UNICOS. 2003-01-11 19:01:31 +00:00
David Dykstra
451b5fc969 Cast the return of alloca to remove a fatal error on Cray UNICOS. 2003-01-11 14:39:41 +00:00
Wayne Davison
1e678fcab1 Yet another try at getting this to skip on cygwin. 2003-01-11 08:19:24 +00:00
Wayne Davison
48bcc6ee2b Hopefully this version will skip correctly on cygwin. 2003-01-11 07:39:49 +00:00
Wayne Davison
32734c7c3c Try a different tact to get cygwin to skip this test. 2003-01-11 07:22:40 +00:00
Wayne Davison
aaf375d0a5 The inet_pton() man page says we need to pass in a pointer to a
struct in_addr, which means passing &sin.sin_addr instead of
&sin.sin_addr.s_addr.  Also changed the AF_INET6 version to pass
&sin6.sin6_addr.  Hopefully this will fix UNICOS and not break
anyone else.
2003-01-11 02:05:56 +00:00
Wayne Davison
9680f811f6 Cast poptGetOptArg() to remove a compiler warning. 2003-01-11 01:29:30 +00:00
Wayne Davison
bda41fa509 + The prototype for isc_net_pton() should have been inet_pton().
+ Define IN_LOOPBACKNET if it is not already defined.
2003-01-10 20:09:58 +00:00
Wayne Davison
7ea84b6890 Only refer to S_ISVTX if S_ISVTX is defined. 2003-01-10 20:08:43 +00:00
Wayne Davison
cc234d944a + Fixed a comment that referred to isc_net_pton() instead of inet_pton().
+ Only prototype inet_pton6() if INET6 is defined.
2003-01-10 20:08:12 +00:00
Wayne Davison
ac84096d1f Don't use '#' in the dsttmp filename. 2003-01-10 19:58:51 +00:00
Wayne Davison
a1cc591b29 Paul Green's changes to add $(EXEEXT) and $(CPPFLAGS) as appropriate. 2003-01-10 19:58:16 +00:00
David Dykstra
da0405080e The call to test_skipped if makepath failed didn't work, presumably because
makepath is builtin and there's some problem with it causing /bin/sh to
exit on cygwin.  Parens around the call to makepath should help.
2003-01-10 18:32:59 +00:00
David Dykstra
0c0a3e2dd3 Clean up better after the testsuite check programs. Patch from J.W. Schultz. 2003-01-10 15:16:23 +00:00
David Dykstra
ad301e487c Skip the longdir test if the long directory can't even be created, such as
on cygwin (maybe only on certain filesystems?).
2003-01-10 15:06:10 +00:00
Wayne Davison
b5ae4aba38 Reset the io_error_fd right before the generator kills off the receiver
(because the death of the receiver will close the fd and cause the
generator to fail in any subsequent IO).
2003-01-10 08:32:09 +00:00
David Dykstra
8d2aad49e3 AI_NUMERICHOST is not defined on AIX. 2003-01-09 21:30:24 +00:00
David Dykstra
bc2b4963a0 Support IPv6 addresses with "hosts allow" and "hosts deny". Patch from
Hideaki Yoshifuji.
2003-01-09 21:14:10 +00:00
David Dykstra
ee7118a816 Fixed bug that caused rsync to lose exit status of its child processes.
Based on patch submited by David R. Staples.  Todd Vander Does contributed
the following test which showed the problem:
  > mkdir /tmp/nowrite
  > chmod -w /tmp/nowrite
  > rsync /etc/group /tmp/nowrite || echo $status
  mkstemp .group.cUaaeY failed
  rsync error: partial transfer (code 23) at main.c(518)
  23
  > rsync -e ssh loki:/etc/group /tmp/nowrite || echo $status
  mkstemp .group.1rayeY failed
  > rsync -e ssh loki:/etc/group /tmp/nowrite && echo $status
  mkstemp .group.fbaGiY failed
  0
The remote copy should have returned non-zero exit code like the local copy.
2003-01-09 19:04:06 +00:00
Wayne Davison
95dd949c09 Added .svn/ to the cvs_ignore_list and some trailing slashes to the
other dirs in the list.
2003-01-09 03:55:57 +00:00
Wayne Davison
9326552e66 Added .svn/ to the --cvs-exclude list and some trailing slashes to the
other dirs in the list.
2003-01-09 03:53:24 +00:00
Jos Backus
1e34e4b7cd Add "void" to some function definitions so that all declarations in proto.h
have full parameter lists. This helps unbreaking compilation on SCO UNIXWare.

Submitted by: Stephen Friedl
2002-12-24 07:42:04 +00:00
Jos Backus
06464f55e2 Change all relevant occurrences of `rsync'' and `$rsync_bin'' to the
canonical form ``$RSYNC'' (set in testsuite/rsync.fns). This prevents any
stray rsync binaries in the user's PATH from being picked up by the test
scripts and ensures that the newly built rsync binary is used always.
2002-12-24 07:25:25 +00:00
David Dykstra
1b85e3f1a0 When a file shows up as not existent during an rsync run, always check
to see if it excluded before reporting an error.  Previously it was only
checking for the exclusion if copy_links was enabled, but the error can
also occur if a file disappears during an rsync run.  Suggested by Eugene
V. Chupriyanov and Bo Kersey.
2002-12-11 18:48:27 +00:00
Jos Backus
eac9dc63e3 Fix the chgrp and hardlinks tests by running $RSYNC instead of relying on the
new rsync being in $PATH; it may pick up an old version, invalidating the
result of the tests. This is what the other tests do already.

Submitted by: Joel Shprentz <ShprentzJ@nima.mil>
2002-11-05 18:35:59 +00:00
David Dykstra
30e8c8e1e4 When using daemon mode over a remote shell program and not running as root,
default the config file to just "rsyncd.conf" in the current directory
instead of /etc/rsyncd.conf.  Also, fix problems with logging messages when
running daemon mode over a remote shell program: it was pretty much doing
the opposite of what it should have, sending early error messages to the
log and later messages to the client.  Switched it around so the very early
error messages go to the client and the later ones go to the log.
2002-08-30 23:27:26 +00:00
David Dykstra
d53d7795ee Change wording of --compare-dest option to refer to the --link-dest option. 2002-08-30 15:12:47 +00:00
David Dykstra
59c95e4243 Add --link-dest option from J.W. Schultz. 2002-08-29 14:44:55 +00:00
David Dykstra
f8a94f0de8 Patch from J.W. Schultz to have --include-from and --exclude-from on
filename "-" read from standard input.
2002-08-29 14:37:20 +00:00
Wayne Davison
3b5f6214a6 * Don't call getnameinfo() if we've already populated the addr_buf.
* Moved some structures in client_name() so that they remain in-scope for
  the entire function (since we set pointers to their storage location).
* Allow the dot-counting loop to increment to 4 instead of stopping at 3.
2002-08-02 17:11:39 +00:00
David Dykstra
542ad675b9 Put in better method of checking whether or not daemon over --rsh mode is
in place: simply check the "am_server" global variable, which is not set
true when the daemon is listening for connections (daemon_main is not
called in main.c if am_server is set).
2002-08-02 15:39:43 +00:00
David Dykstra
1e736b8ff7 Fix client_name to work on when INET6 is enabled but using a 4-part IPv4
IP address.  Tested on Linux, but only with an IPv4 ssh.  Somebody who has
IPv6 enabled on ssh needs to test it yet.
2002-08-02 15:05:03 +00:00
David Dykstra
a6d8c3f336 Fix last change to use correct IPv6 structure names when using INET6.
Doesn't yet look up names correctly on Linux with INET6 enabled, however;
needs further work but I don't have time right now.
2002-08-01 21:57:23 +00:00
Wayne Davison
bb4aa89c10 Don't pass "-l user" to the remote shell if we're starting a server-daemon
and the command already has a "-l user" option.
2002-08-01 20:46:59 +00:00
David Dykstra
09021eabb5 Fix to correctly identify remote IP address and host name when using
-e ssh and :: together.  Uses $SSH_CLIENT to locate the IP address
(was attempting to before but it didn't always work) and then uses
inet_pton() on that and getnameinfo() to find the name.
2002-08-01 19:17:00 +00:00
Wayne Davison
8d69d57113 Documented that the rsync:// URL syntax is now legal in the destination. 2002-08-01 17:55:40 +00:00
Wayne Davison
eaa4c150ab Mention the new rsync:// URL-in-the-destination syntax. 2002-08-01 17:55:11 +00:00
Wayne Davison
a125c82ad2 Allow the rsync:// URL syntax in the destination field. 2002-08-01 17:53:38 +00:00
Wayne Davison
93eff16a6a Document more recent changes. 2002-08-01 17:53:07 +00:00
Wayne Davison
d2d9fe184d Mention the recent commits. 2002-08-01 16:50:46 +00:00
David Dykstra
2d4ca358db Slight change to refer to the section CONNECTING TO AN RSYNC SERVER OVER A
REMOTE SHELL PROGRAM from within the --rsh option.
2002-08-01 16:21:20 +00:00
Wayne Davison
39993af514 The function passed to start_accept_loop() now takes 2 fd ints (for
the daemon via remote-shell support).
2002-08-01 00:37:08 +00:00
Wayne Davison
bef4934045 Document the new server-daemon via remote-shell mode. 2002-08-01 00:37:06 +00:00
Wayne Davison
1312d9fc47 If daemon_over_rsh is set, we limit the generated options to just
--server and --daemon.
2002-08-01 00:37:01 +00:00
Wayne Davison
75aeac44e8 Handle the new server-daemon via remote-shell mode. 2002-08-01 00:36:59 +00:00
Wayne Davison
68f40ebba9 Moved the end of start_socket_client() into a new function called
start_inband_exchange() and made several functions take two fds
(for the daemon via remote-shell support).  The start_daemon()
function is no longer static and now works on non-socket fds.
2002-08-01 00:36:56 +00:00
Wayne Davison
973007daac Changed auth_server() to take two fds (for the daemon via remote-shell
support).
2002-08-01 00:36:54 +00:00
Wayne Davison
8060514230 Stefan Nehlsen's fix of a timeout problem on large files.
(Modified to work with the latest CVS source.)
2002-07-31 21:20:07 +00:00
Wayne Davison
b1a2f37a6e Mention the popt upgrade. 2002-07-27 18:33:54 +00:00
Wayne Davison
7c66b86028 Check for the float.h header file (for popt). 2002-07-27 18:33:30 +00:00
Wayne Davison
cc248aae9b Updated to version 1.6.4. 2002-07-27 18:32:25 +00:00
Wayne Davison
ca23c51aeb - Fixed a crash in flist_find() when the last item in the flist has
been removed as a duplicate.
- Got rid of a compiler warning about mixed signed/unsigned types in a
  conditional expression.
2002-07-27 18:01:21 +00:00
David Dykstra
fca9a9b0f0 Document in --owner and "use chroot" that --numeric-ids is implied when
use chroot is yes.
2002-06-27 17:51:25 +00:00
John H Terpstra
1ea15dbe05 Added Solaris PkgInfo build script from Jens Apel <jens.apel@web.de> 2002-06-22 16:52:15 +00:00
David Dykstra
8e34cd41f0 Close previously opened file descriptor when mkstemp fails in recv_files().
Every other failure condition in that function was alreadying doing this,
and I saw a case with a lot of "mkstemp...No space left on device" messages
started becoming "mkstemp...Too many open files" messages because of this
bug.  Not that it makes a whole lot of difference, since nothing gets copied
because the disk was out of space.
2002-05-28 15:42:51 +00:00
David Dykstra
9ef1cc7cdf Clarify the relationship of max connections and lock file. 2002-05-16 21:07:23 +00:00
Martin Pool
411acbbc2a Better notes about handling IPv6 on old machines 2002-05-14 05:44:51 +00:00
Martin Pool
32e83406c4 Fix little mistake 2002-05-14 05:31:11 +00:00
Martin Pool
7e28fca126 Note about lchmod. 2002-05-14 05:25:46 +00:00
David Dykstra
e4ffb53900 Fix the rsync home page URL to drop a trailing "/rsync". 2002-05-13 18:34:37 +00:00
David Dykstra
7c2d381c28 Clarify that exclude/include options in rsyncd.conf apply only to files
sent from the server or deleted on the server.
2002-05-13 18:22:28 +00:00
Martin Pool
bde47ca7c5 Note that using the old sockets API probably will not work
sufficiently on some ipv6 systems.
2002-05-13 07:54:47 +00:00
Wayne Davison
ea7f8108b0 Make the -e text a little less chatty, and mention the legality of
command-line options in the RSYNC_RSH section.
2002-05-11 08:31:55 +00:00
Wayne Davison
98393ae2e2 Mention that the -e COMMAND can contain options. 2002-05-10 19:56:23 +00:00
David Dykstra
759ac87019 Submit enhancement from Michael Zimmerman to allow --suffix to be used
with --backup-dir.
2002-05-09 21:44:46 +00:00
David Dykstra
a1e0e45e01 Indicate that the exclude options in rsyncd.conf only apply when receiving
files to a server and not when sending files to it.
2002-05-09 19:03:40 +00:00
Wayne Davison
54170a084d Tweaked the --rsh option's description. 2002-05-06 19:05:05 +00:00
Wayne Davison
1bbf83c07d - Improved the references to rsh to better indicate that rsync may be
configured to use some other remote shell by default.
- Fixed the mention of ssh's preferred IO-blocking mode.
2002-05-06 19:02:44 +00:00
Wayne Davison
ccd2b499ed Mention that --delete-after now implies --delete. 2002-05-06 18:47:57 +00:00
Wayne Davison
1de50993a7 Made the --delete-after option imply --delete. 2002-05-03 22:59:17 +00:00
Wayne Davison
786c36876b Mentioned that --delete-after and --delete-excluded imply --delete. 2002-05-03 22:58:01 +00:00
Martin Pool
8bd1a73e14 Add note about resolving Debian gid problem. 2002-04-26 00:55:34 +00:00
Martin Pool
c7d692c3c3 Notes about handling machines lacking getaddrinfo(). 2002-04-24 01:13:26 +00:00
Martin Pool
f9b9e2f067 Note from Alberto Accomazzi that rsync urls are broken for upload 2002-04-19 05:33:36 +00:00
Martin Pool
dafe63ca98 Doc. 2002-04-16 01:38:21 +00:00
Martin Pool
f49a7b227f When -e is specified along with an rsyncd url, the client should get a
warning but it should not be treated as an error.  (Bill Nottingham)

  http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=62489
2002-04-15 07:50:18 +00:00
Martin Pool
f5e4eadb74 --no-blocking-io might be broken in the same way as --no-whole-file;
somebody needs to check.
2002-04-15 05:05:57 +00:00
Martin Pool
717eb9b883 Note about testing "refuse options" 2002-04-13 12:17:47 +00:00
Martin Pool
5ba268efa8 *** empty log message *** 2002-04-13 03:52:48 +00:00
Martin Pool
25ff30e804 Notes on testing, release, and todo items from the Debian paper. 2002-04-12 05:05:44 +00:00
Martin Pool
bdae761ee1 reformat 2002-04-12 04:22:52 +00:00
Martin Pool
5af50297be Note about manual revision. 2002-04-11 02:35:25 +00:00
Martin Pool
32f761755e Try to fix ctype issues by always calling these functions as
if (!isdigit(* (unsigned char *) p)) {

so that the argument is always in the range of unsigned char when
coerced to an int.

(See digit 1.)
2002-04-11 02:25:53 +00:00
Martin Pool
c4fea82ff9 Doc. 2002-04-11 02:21:41 +00:00
Martin Pool
6ded1170ac Doxygen 2002-04-11 02:18:51 +00:00
Martin Pool
991f90f296 Receiving an @ERROR line from the server is (I think) always fatal, so
the client should exit upon receiving one and not be surprised that
the socket closes.
2002-04-11 02:16:34 +00:00
Martin Pool
c979dad54a Fix old typo. 2002-04-11 02:11:50 +00:00
Martin Pool
136ac7ecec Receiving an @ERROR line from the server is (I think) always fatal, so
the client should exit upon receiving one and not be surprised that
the socket closes.
2002-04-11 01:56:35 +00:00
Martin Pool
3e8369b6dc Correction from Nelson Beebe: argument to functions such as isspace()
must be an int, not a char.  This could cause sign-extension problems.
2002-04-09 06:32:07 +00:00
Martin Pool
a7dc44d27d Doc.
Correction from Nelson Beebe: argument to functions such as isspace()
must be an int, not a char.  This could cause sign-extension problems.
2002-04-09 06:18:13 +00:00
Martin Pool
07a874fd9b Correction from Nelson Beebe: argument to functions such as isspace()
must be an int, not a char.  This could cause sign-extension problems.
2002-04-09 06:15:13 +00:00
Martin Pool
e35080cede long int and signedness fix from Nelson Beebe 2002-04-09 06:11:06 +00:00
Martin Pool
ce8149b6fe long int fix from Nelson Beebe 2002-04-09 06:03:50 +00:00
Martin Pool
a86179f429 Fix type error. 2002-04-09 05:32:52 +00:00
Martin Pool
56cf38ac98 Add RERR_OK == 0 2002-04-09 05:29:26 +00:00
Martin Pool
b0f451eb3b Doc _exit_cleanup. 2002-04-09 05:26:46 +00:00
Martin Pool
d0829892c6 Doc start_socket_client 2002-04-09 05:23:07 +00:00
Martin Pool
fdf88d7574 Doc start_socket_client 2002-04-09 05:20:30 +00:00
Martin Pool
595f2d4d97 Notes about supplementary groups and -z. 2002-04-09 05:14:59 +00:00
Martin Pool
cae95647a4 Doc. 2002-04-09 05:07:15 +00:00
Martin Pool
a254fd9798 Doc. 2002-04-09 05:03:45 +00:00
Martin Pool
805edf9d7d A bit more support for IO phase names. 2002-04-09 05:00:03 +00:00
Martin Pool
eca2adb4b3 OK, we can now get phase messages if we fail in send_file_entry 2002-04-09 04:50:25 +00:00
Martin Pool
4eea7793ea Doc
Try symlinks with an empty target
2002-04-09 04:49:42 +00:00
Martin Pool
67684d038d long int fix from Nelson Beebe 2002-04-09 04:49:23 +00:00
Martin Pool
98b332edea Fix typo.
Show io phase name in error message.
2002-04-09 04:41:03 +00:00
Martin Pool
e681e82066 Rather than a loop subtracting 1e6 to convert usecs to secs/usecs, just
use div/mod.
2002-04-09 04:33:32 +00:00
Martin Pool
08571358b1 Factor out bwlimit sleep code from writefd_unbuffered into its own function. 2002-04-09 04:29:46 +00:00
Martin Pool
8901a07fdb Clarify "error writing %d bytes" message. 2002-04-09 04:23:18 +00:00
Martin Pool
880da0072e Clean up docs. 2002-04-09 04:20:36 +00:00
Martin Pool
a83600cc82 Change error message "partial transfer" to "some files could not be
transferred".

I don't generally like changing that sort of thing, but I think this
one was a persistent source of confusion.
2002-04-08 09:10:50 +00:00
Martin Pool
dd0628f85f Note code cleanups 2002-04-08 09:09:03 +00:00
Martin Pool
e66dfd1879 Doc and indent only. 2002-04-08 09:05:26 +00:00
Martin Pool
bf2daeaf2d Remove redundant list of options. It might be nice to summarise the
most frequently-used ones in here.

Nelson Beebe pointed out that the information about bug tracking was
out of date.
2002-04-08 08:58:26 +00:00
Martin Pool
bd0ad74f4b Notes on MD4 performance. This quite unnecessarily takes up 90% of
CPU on a local transfer, without achieving anything useful.
2002-04-08 08:39:03 +00:00
Martin Pool
79f671cc7c Doc 2002-04-08 08:35:30 +00:00
Martin Pool
0f9c48b1d2 Doc file 2002-04-08 08:34:03 +00:00
Martin Pool
538ba24fd7 Doc match_sums. 2002-04-08 08:33:13 +00:00
Martin Pool
d37d8d7b69 Doc sum_update 2002-04-08 08:29:04 +00:00
Martin Pool
f4a0483ab8 Add manual prototype for maintainer-mode function 2002-04-08 08:24:59 +00:00
Martin Pool
f5f95a38c4 Document the perversely-named matched() function, which is called even
if we have not matched!
2002-04-08 08:23:50 +00:00
Martin Pool
3e7053ac59 With -vv, show state of --whole-file once at the start of the transfer. 2002-04-08 08:06:18 +00:00
Martin Pool
420ef2c419 Doc. 2002-04-08 08:02:08 +00:00
Martin Pool
9fb3f7a9ab Doc rsync_panic_handler() 2002-04-08 07:46:34 +00:00
Martin Pool
734a94a20c Clean up prototype.
Drop unused variables.
2002-04-08 07:42:54 +00:00
Martin Pool
b44be3e944 Fix prototype. 2002-04-08 07:39:56 +00:00
Martin Pool
fc0302cf07 Show panic_action in --version. 2002-04-08 07:36:05 +00:00
Martin Pool
4fdc39dde8 Allow panic_action to be configured through environment variable RSYNC_PANIC_ACTION. 2002-04-08 07:34:17 +00:00
Martin Pool
9a933bc2ce t_unsafe needs asnprintf on some platforms. 2002-04-08 06:23:34 +00:00
Martin Pool
524dc9afd6 correct behaviour is unclear 2002-04-08 06:18:03 +00:00
Martin Pool
e4d709cbf8 Cleanup 2002-04-08 06:01:26 +00:00
Martin Pool
48c1586cd1 handle yodl and vpath 2002-04-08 05:38:51 +00:00
Martin Pool
7bd0cf5b8f Clarify meaning of unsafe symlinks 2002-04-08 05:30:28 +00:00
Martin Pool
fcb69e5cdc Fix copyright. 2002-04-08 05:28:31 +00:00
Martin Pool
96557d23a3 Add more test cases.
Turn off -x.
2002-04-08 05:22:50 +00:00
Martin Pool
4e5db0ad4a Doc. 2002-04-08 05:21:51 +00:00
Martin Pool
c81a32f071 Add more test cases. 2002-04-08 05:19:41 +00:00
Martin Pool
6f2623fd69 Formatting cleanup. 2002-04-08 04:59:34 +00:00
Martin Pool
b4235b3165 Doc. 2002-04-08 04:48:51 +00:00
Martin Pool
d25c0e42c7 A test suite that calls unsafe_symlink() directly to see how it
handles different strings.
2002-04-08 04:47:01 +00:00
Martin Pool
0ecfbf27c3 Split code out into separate files and remove some global variables to
reduce symbol dependencies between files and therefore make it easier
to write unit tests.  The diff is large, but the actual code changes
are pretty small.
2002-04-08 04:16:46 +00:00
Martin Pool
fb4c98c2c8 Test harness for unsafe_symlink: just passes in argv[]. 2002-04-08 04:13:43 +00:00
Martin Pool
cd8e38b13f Little stub module that replaces functions such as rprintf called from
many places with a redirector to stderr.  If you just want to test a
particular routine you can link to this rather than the whole framework.
2002-04-08 04:12:31 +00:00
Martin Pool
b35d0d8e9a Split code out into separate files and remove some global variables to
reduce symbol dependencies between files and therefore make it easier
to write unit tests.  The diff is large, but the actual code changes
are pretty small.
2002-04-08 04:10:20 +00:00
Martin Pool
c948e309f2 Don't generate code for zlib and popt. 2002-04-08 04:00:24 +00:00
Martin Pool
d1f83bcc81 Doc. 2002-04-08 03:43:54 +00:00
Martin Pool
e0fde757fd Doc. 2002-04-08 03:38:36 +00:00
Martin Pool
25d34a5c80 Rearrange code slightly to avoid util.c depending on main.c. 2002-04-08 03:37:19 +00:00
Martin Pool
610364e3a6 Tune doxygen output, remove warning. 2002-04-08 03:13:11 +00:00
Martin Pool
036e70b024 Document unsafe_symlink(). 2002-04-08 03:10:01 +00:00
Martin Pool
ac13ad106a Clean up comments for Doxygen. 2002-04-08 03:03:04 +00:00
Martin Pool
bd9e9eccbd Doc. 2002-04-08 02:41:23 +00:00
Martin Pool
8ff9d697c9 Note on debugging daemon 2002-04-08 02:39:00 +00:00
Martin Pool
62b68c8046 Notes about logging. 2002-04-08 01:59:21 +00:00
Martin Pool
e4724e5c1c Note about two small bugs. 2002-04-05 07:25:06 +00:00
Martin Pool
559e727bf7 Test more permutations. 2002-04-05 07:13:01 +00:00
Martin Pool
126642b633 Fix filenames. 2002-04-05 07:04:23 +00:00
Martin Pool
cca4e06786 Get rid of testlink after use. 2002-04-05 07:00:53 +00:00
Martin Pool
2f1faea89b Test case for --copy-unsafe-links, contributed by Vladimír Michl,
converted to the test suite.  Thankyou!

It fails at the moment; I don't know if that's a test bug or an rsync bug.
2002-04-05 06:57:47 +00:00
Martin Pool
3d90ec146f Doc 2002-04-05 06:17:50 +00:00
Martin Pool
1bc209b441 Fix completely braindead previous patch. Thanks Jos. 2002-04-03 06:55:24 +00:00
Martin Pool
1433e6da69 Patch from Zoong Pham and Albert Chin to improve detection of
getaddrinfo on Tru64.

Also configure.in test for mkfifo and sys/un.h, although we don't
actually use that yet.
2002-04-03 06:03:27 +00:00
Martin Pool
f8f4c862e8 Change code that writes s_count to a batch file to squish it into an
int first -- a stopgap for compilers that reasonably complain about a
ternary that returns either a size_t or an int.

Really we should not write an int, but rather a larger type.  Somebody
more familiar with the batch code should look at it.
2002-04-03 05:55:54 +00:00
Martin Pool
226df8e717 Support Doxygen pretty-printer 2002-04-03 04:29:19 +00:00
Martin Pool
6c92af2067 Commit patch based on one from John L. Allen to fix "forward name
lookup failed" on AIX 4.3.3.

When doing an name->addr lookup on the client address, there's no
point including the service name, because it can't be spoofed and it
apparently causes trouble when not present in /etc/services.
2002-04-03 02:33:42 +00:00
Martin Pool
54c7298ce4 Roll over version and news. 2002-04-03 02:13:42 +00:00
Martin Pool
642a979a27 Note about --dry-run. 2002-04-03 00:10:11 +00:00
Martin Pool
e733c93423 Remove warning about "run autoconf". It tends to break too much with
CVS.
2002-04-02 02:00:29 +00:00
Martin Pool
ffdb58a51a Bump to 2.5.5. 2002-04-02 01:41:58 +00:00
Martin Pool
c053133207 If configured with --enable-maintainer-mode, then on receipt of a
fatal signal rsync will try to open an xterm running gdb, similarly to
Samba's "panic action" or GNOME's bug-buddy.
2002-03-27 05:10:44 +00:00
Martin Pool
9098bbf3b3 Improved network error handling. (Greg A. Woods) 2002-03-27 01:03:13 +00:00
Martin Pool
68618b8810 Shell scripts should explicitly "exit 0" for portability. Thanks Jos. 2002-03-26 10:36:45 +00:00
Martin Pool
e553d27f41 Fix suggested by Jos for hands.test. Some of the functionality
previously built into Phil's test was clashing with the runtests.sh
framework.  I think one of the core problems might be that scripts
which don't explicitly "exit 0" have return codes which vary depending
on the particular shell.  (c.f. the autoconf portability guide.)

This might break the Debian test suite but I'm afraid I don't know
enough about how it works yet.  Hopefully eventually it can become
just a wrapper around our 'make check'.
2002-03-26 10:28:57 +00:00
Martin Pool
d092924c63 Updated spec file from Jason Haar. Seems to mostly just change the
path for manuals, and bumps the version.
2002-03-26 05:15:09 +00:00
Martin Pool
34027489e0 Ignore autoconf cache. (??) 2002-03-26 01:27:24 +00:00
Martin Pool
d1239eae92 Jos points out that test -L is still broken on Solaris. Now we try up
front to detect a command that will work properly, and use that
consistently.

Also, in test report, show setting of $preserve_scratch.

Reset version.
2002-03-26 01:25:47 +00:00
Martin Pool
331050969b Bump version to 2.5.5rc1. 2002-03-25 23:22:08 +00:00
Martin Pool
259c3e72b0 Add note about possible hardlink bug. 2002-03-25 23:09:31 +00:00
Martin Pool
8f7a38336d Make the situation w.r.t. dynamically linking zlib and libpopt clear. 2002-03-25 09:42:36 +00:00
Martin Pool
999dfffc9b Add link to Apple bug. 2002-03-25 07:29:43 +00:00
Martin Pool
527a51cec5 Doc 2002-03-25 07:07:03 +00:00
Martin Pool
20c15aead5 Hm, strange off-by-one bug. 2002-03-25 06:59:17 +00:00
Martin Pool
fb859e5674 Apparently the OS X port of gcc gags on __attribute__. 2002-03-25 06:49:08 +00:00
Martin Pool
4f2dcb1714 If we discover a hardlink with -vv say what it's a link to. 2002-03-25 06:27:44 +00:00
Martin Pool
64e74631e0 Fix from Jos for batch mode on Solaris. 2002-03-25 06:06:29 +00:00
Martin Pool
fba31efb74 Disambiguate hard link messages. 2002-03-25 05:54:31 +00:00
Martin Pool
435f1ed70d Apparently SGI make doesn't like $< in non-implicit rules. 2002-03-25 04:36:56 +00:00
Martin Pool
94f34ca10a Doc. 2002-03-25 04:04:23 +00:00
Martin Pool
b0633744fa Note about mkdir bug. 2002-03-25 03:56:38 +00:00
Martin Pool
c127e8aaec Add a test case for trim_trailing_slashes, and make it handle other cases. 2002-03-25 03:51:17 +00:00
Martin Pool
bf4e725d5d Code that was meant to trim trailing slashes from mkdir() paths
actually did not; fix it.
2002-03-25 03:29:47 +00:00
Martin Pool
663717f465 Need to also delete getgroups when cleaning. 2002-03-25 03:26:28 +00:00
Martin Pool
12b159ac41 Define NGROUPS if not already done. 2002-03-25 03:18:36 +00:00
Martin Pool
9299c8f0b4 Clean testtmp*, because we now put tests in their own directories.
Add "make cleantests"
2002-03-25 03:16:35 +00:00
Martin Pool
dfef3f1099 Change chgrp.test to use our getgroups rather than the system's. 2002-03-25 03:01:37 +00:00
Martin Pool
fa3690f488 Initial revision. 2002-03-25 02:58:59 +00:00
Martin Pool
4acbfa2ade Add our own little tool to call getgroups(2) because it's too hard to
find a portable shell command that does it.
2002-03-25 02:55:52 +00:00
Martin Pool
ef86d74736 Clean up text. 2002-03-22 22:36:22 +00:00
Martin Pool
118f39d45b Clean up text. 2002-03-22 22:33:49 +00:00
Martin Pool
77867907ed Doc permissions while testing. 2002-03-22 06:22:53 +00:00
Martin Pool
98c1b32565 Rather than literally "nobody", try using uid/gid = 65534 as
"nobody".  The existing code kind-of assumes this.
2002-03-22 06:12:51 +00:00
Martin Pool
7a176e87d5 Better messages. 2002-03-22 06:09:09 +00:00
Martin Pool
79c9d8a180 Proper messages for skipped tests. 2002-03-22 06:07:50 +00:00
Martin Pool
7d8219327b If tests are skipped, explain why. 2002-03-22 06:03:46 +00:00
Martin Pool
4ac4bdbb38 More sgml cleanups. 2002-03-22 06:02:28 +00:00
Martin Pool
f494f2864c Doc about checkit. 2002-03-22 05:59:12 +00:00
Martin Pool
017f22b47f Add /usr/xpg4/bin/ to PATH to help solaris. 2002-03-22 05:52:09 +00:00
Martin Pool
dec41b556b Cope on systems without the whoami command. 2002-03-22 05:20:47 +00:00
Martin Pool
be2961da2c If there's an error in start_socket_client, print an explanation as
well as failing.

Doc.

Trying to work out why daemon-gzip-download.test fails on SCO with

  rsync error: unexplained error (code 190) at main.c(886)
2002-03-22 05:19:19 +00:00
Martin Pool
914cc65c9d Doc. 2002-03-22 05:14:44 +00:00
Martin Pool
6479c2ed3f Notes on logging etc 2002-03-22 05:11:39 +00:00
Martin Pool
c1a04ecbfd Doc. 2002-03-22 05:08:53 +00:00
Martin Pool
69b06c50c4 Use id -G rather than groups to get a list of groups for this
user, so that we can cope on systems like Cygwin that tend to have
group names containing spaces.
2002-03-22 05:06:36 +00:00
Martin Pool
6aaf8d8c10 * Make "make install-strip" works properly, and "make install"
accepts a DESTDIR variable for help in building binary packages.
      (Peter Breitenlohner)
2002-03-20 05:53:40 +00:00
Martin Pool
4cf64834ed Patch from Paul Haas:
* Fix situation where failure to fork (e.g. because out of process
      slots) would cause rsync to kill all processes owned by the
      current user.  Yes, really!  (Paul Haas, Martin Pool)

Also, add a little more documentation and paranoia to make sure we
never call kill(2) with a negative pid.
2002-03-20 01:09:49 +00:00
David Dykstra
b8709f5046 Now that whole_file and no_whole_file are separate variables, have the
--whole-file and --no-whole-file options set/reset both variables so if
more than one option is specified the last one will be the one honored.
2002-03-19 20:16:42 +00:00
Martin Pool
24448f741f Clean up sgml.
Add note about building with gcc.
2002-03-19 05:52:34 +00:00
Martin Pool
76533c52dc todo: Versions of read() and write() that corrupt the stream, or abruptly fail 2002-03-19 05:23:04 +00:00
Martin Pool
3ff984d7a7 Fix --help layout. 2002-03-19 05:09:19 +00:00
Martin Pool
7a52790b50 Fix overly long line in version. 2002-03-19 05:01:36 +00:00
Martin Pool
7b329a2d79 Follow advice from GPL to insert a disclaimer of warranty in the
version and help information.
2002-03-19 05:00:05 +00:00
Martin Pool
599dc93c64 Doc: Pipe program that makes slow/jerky connections. 2002-03-19 04:14:30 +00:00
Martin Pool
8b54f00466 Include all fields in the options table to quieten gcc warnings about
missing initializers.
2002-03-19 04:10:07 +00:00
Martin Pool
8469faef03 Intentional test of assert :_) 2002-03-19 03:59:51 +00:00
Martin Pool
bceec82f35 Previous solution for --no-whole-file would probably break when
connecting to old servers that don't have --no-whole-file.

Instead, we handle no_whole_file and whole_file separately, without
the magic -1 value.  We don't modify no_whole_file after
initialization.
2002-03-19 03:39:42 +00:00
Martin Pool
ed521de525 Sending --no-whole-file is no good because it will not work with old
versions of rsync.
2002-03-19 03:27:33 +00:00
Martin Pool
d157de203a Typo. 2002-03-19 03:23:08 +00:00
Martin Pool
1bfbf40bd5 Fix --whole-file problem that caused it to be the default even for
remote connections.  (Frank Schulz)

<http://lists.samba.org/pipermail/rsync/2002-March/006526.html>

Also, add documentation for whole_file and add assertions that the
value is valid.
2002-03-19 03:21:53 +00:00
Martin Pool
6d19c6742c Need a test for "refuse options" 2002-03-16 09:26:33 +00:00
Martin Pool
a628b06977 Note about 100295@bugs.debian.org 2002-03-16 09:11:56 +00:00
Martin Pool
6b2d24de2c Make sure that freeaddrinfo is called on all code paths leading away
from a call to getaddrinfo.  (Dave Dykstra)
<20011219085021.A23107@lucent.com>
2002-03-16 09:00:44 +00:00
Martin Pool
e23d790fa7 Doc: Note from Dave Dykstra that getaddrinfo calls must be paired with
freeaddrinfo().
2002-03-16 08:23:08 +00:00
Martin Pool
2a5904a580 Add more rules for make distclean. 2002-03-16 08:21:15 +00:00
Martin Pool
4610ac79c2 "make distclean": We try to delete built files from both the source
and build directories, just in case somebody previously configured
things in the source directory.
2002-03-16 08:18:19 +00:00
Martin Pool
142f5be922 Note about --progress patch. 2002-03-16 00:00:43 +00:00
Martin Pool
b17dd0c435 Note about debian #28416 2002-03-15 14:01:43 +00:00
Martin Pool
3669201179 Add debian bug # 2002-03-15 13:42:42 +00:00
Martin Pool
a5c48193c7 Keep stderr and stdout properly separated (Debian #23626) 2002-03-15 13:38:12 +00:00
Martin Pool
4366275bab Doc: Debian uses "nogroup" instead of group "nobody", so our defaults
are not so good.
2002-03-15 12:53:21 +00:00
Martin Pool
c579310a00 If we've finished transferring a file, show the time taken; otherwise
show expected time to complete.  That's kind of inconsistent, but
people can probably cope.  Hopefully we'll get more consistent and
complete progress reporting soon. (Cameron Simpson)
2002-03-15 12:45:10 +00:00
Martin Pool
96553aa7ef Typo. 2002-03-15 06:29:22 +00:00
Martin Pool
2094283b80 On Solaris, put /usr/ucb/bin at the end of the path to help find
utilities we might need.  (Like 'whoami' in this case.)
2002-03-15 06:28:58 +00:00
Martin Pool
4c631ac621 Try to handle 'test -L' on Sun. 2002-03-15 01:22:09 +00:00
Martin Pool
d96d3893dd Try to handle 'test -L' on Sun. 2002-03-15 01:08:53 +00:00
Martin Pool
b73b51a9e4 More notes 2002-03-15 01:04:25 +00:00
Martin Pool
3c1edccb7b Suggestion from david.e.sewell to add --diff. 2002-03-15 01:03:24 +00:00
David Dykstra
b23c290630 Eliminate extraneous "done" messages in verbose mode. Problem reported by
Lee Eakin.
2002-03-14 21:20:20 +00:00
Martin Pool
c7b562becf Correct the plural in "1 file to consider." (Greg Louis) 2002-03-14 12:00:12 +00:00
Martin Pool
5648a81936 Add phony target to run Splint. 2002-03-14 10:42:52 +00:00
Martin Pool
daa3d0e2da "make install-strip" works. (Greg Louis) 2002-03-14 10:38:55 +00:00
Martin Pool
c9a66d41fe Roll over news file; put in page markers. 2002-03-14 10:33:59 +00:00
Martin Pool
0ee1bd82c5 Bump version to 2.5.5cvs 2002-03-14 03:10:23 +00:00
Martin Pool
53e1f937bc Show user name and uname -a in the test output header, to aid in bug
reports.  (We mostly want to know if they're root or not.)
2002-03-14 03:04:36 +00:00
Martin Pool
604f343c49 Doc: "opening tcp connection to %s port %d" is kind of misleading when
running the test case.
2002-03-14 02:55:11 +00:00
Martin Pool
e9c4c3018b More notes on testing. 2002-03-13 04:25:10 +00:00
Martin Pool
db1babe6a9 If a child of the rsync daemon dies with a signal, we should notice
that when we reap it and log a message.
2002-03-13 00:25:00 +00:00
Martin Pool
f1abcc7a4c Bump version to 2.5.4. 2002-03-13 00:03:34 +00:00
Martin Pool
97e1254a2d Notes on chmod. 2002-03-12 23:55:33 +00:00
Martin Pool
89b0a3d963 If we get an error writing to a socket, then we should perhaps
continue trying to read to see if an error message comes across
  explaining why the socket is closed.  I'm not sure if this would
  work, but it would certainly make our messages more helpful.
2002-03-12 06:08:36 +00:00
Martin Pool
3a79260d3a Add link to purify replacement. 2002-03-12 05:48:57 +00:00
Martin Pool
43a4dc1053 Add link to purify replacement. 2002-03-12 05:47:45 +00:00
Martin Pool
e53fe9a278 Note about TDB. 2002-03-12 05:41:25 +00:00
Martin Pool
f5a95bb50b Notes on testing. 2002-03-12 05:39:29 +00:00
Martin Pool
0e23e41d48 Note about splint. 2002-03-12 05:33:39 +00:00
Martin Pool
ac69049ec2 Additional trivial merge patch from Jos 2002-03-12 02:07:36 +00:00
Martin Pool
b2a2dd1154 Get ready for new release. 2002-03-12 01:26:01 +00:00
Martin Pool
31837783c0 Update NEWS. 2002-03-12 01:22:56 +00:00
Martin Pool
d40fb72395 Get ready for new release. 2002-03-12 01:18:20 +00:00
Martin Pool
1c548d5e59 Bump version to 2.5.4pre1. 2002-03-12 01:15:49 +00:00
Martin Pool
be59d0ec23 Patch from Jos Backus to merge zlib-1.1.4. 2002-03-12 01:14:58 +00:00
Martin Pool
0bc467516a Merge the zlib fix properly; back out tridge's bandaid. 2002-03-12 00:33:51 +00:00
Martin Pool
844f11f284 Clarify behaviour of installcheck. 2002-03-12 00:22:22 +00:00
Martin Pool
1cf1e7b3b4 Rename to README.testsuite, and bring it up to date. 2002-03-12 00:20:16 +00:00
Martin Pool
18b72cc829 Try to download a tree over a compressed connection to a daemon. 2002-03-12 00:11:35 +00:00
Martin Pool
271f87e5d4 This test tries to upload a file over a compressed connection to the
server.  This ought to exercise (exorcise? :-) a bug in 2.5.3.  It
ought to fail there and pass with later versions.
2002-03-12 00:09:09 +00:00
Martin Pool
2e6c7f4549 Fix generated rsyncd.conf file for testing. 2002-03-12 00:04:03 +00:00
Andrew Tridgell
6819304740 a quick fix for a segmentation fault in zlib I am getting whenever I
try to upload a file from rsync 2.5.2 to rsync 2.5.3
2002-03-11 18:54:51 +00:00
Martin Pool
a795ab99c7 Set version to 2.5.3. 2002-03-11 05:58:31 +00:00
Martin Pool
567e56313a Merge zlib double-free bug forwarded by Mark J Cox. 2002-03-11 05:55:33 +00:00
Martin Pool
9e95e92bdf Note on zlib patch merge. 2002-03-11 05:52:22 +00:00
Martin Pool
be60c7b9d1 Try to merge across changes in zlib from 1.1.2 to 1.1.3. 2002-03-11 03:56:35 +00:00
Martin Pool
7d81641065 Note about merging zlib 1.1.3. 2002-03-11 03:44:44 +00:00
Martin Pool
17d8573ef0 Bump version to 2.5.3pre3. 2002-03-11 03:40:23 +00:00
Martin Pool
e2dd78f744 Add CVE number. 2002-03-11 03:39:49 +00:00
Martin Pool
06b91d8eb9 Try to merge across changes in zlib from 1.1.2 to 1.1.3. 2002-03-11 03:35:35 +00:00
Martin Pool
9ec5422c37 Try adding some FAQs from the FoM 2002-03-11 00:58:36 +00:00
Martin Pool
1935e11c3c Use SGML rather than texinfo. 2002-03-11 00:38:03 +00:00
Martin Pool
ec14031abd More merges into SGML. 2002-03-11 00:36:47 +00:00
Martin Pool
024a9bafbd Notes on processing the SGML stuff. 2002-03-11 00:27:42 +00:00
Martin Pool
27741d9fd9 Notes from Rasmus about statistics. 2002-03-08 04:41:11 +00:00
David Dykstra
e3bdb76326 Cygwin doesn't have setgroups() so probe for the function in configure
and don't try to call it if it doesn't exist.
2002-02-27 23:15:55 +00:00
David Dykstra
9369576459 I had accidentally deleted the case for --include-from when I added
the --no-blocking-io and --no-whole-file options.  This adds it back in.
2002-02-27 22:49:57 +00:00
Martin Pool
8a405c6ca1 Try out DocBook SGML to see if it's easier than Texinfo. 2002-02-25 20:07:11 +00:00
Martin Pool
94ad1c6477 Start of Python code to generate likely-looking pseudo random file
trees to reproducibly test performance on specified size sets.
2002-02-25 18:54:27 +00:00
Martin Pool
6f039cc2ac Merge Texinfo onto head. 2002-02-25 18:52:02 +00:00
Martin Pool
6216ca2c70 Add targets to build documentation from Texinfo. 2002-02-25 18:48:25 +00:00
Martin Pool
c6e27b608e More discussion about zlib. 2002-02-25 18:28:37 +00:00
Martin Pool
f76584a57c Scrappy notes on hot functions that should be fixed 2002-02-25 18:06:33 +00:00
Martin Pool
7bea78ced6 With -vv, client shows a message when opening a daemon connection via
an HTTP proxy.  This parallels the recent addition of a log message
for opening ssh connections.
2002-02-23 01:00:33 +00:00
Martin Pool
1264288cb5 With -vv, client shows a message when opening a daemon connection.
This parallels the recent addition of a log message for opening ssh
connections.
2002-02-23 00:57:30 +00:00
Martin Pool
0f0ea7f779 Add UNUSED macro that expands to a parameter attribute annotation on
gcc, to quieten its worries about parameters that must always be
unused.
2002-02-23 00:17:50 +00:00
Martin Pool
0b4af330ce Doc. 2002-02-23 00:12:11 +00:00
Martin Pool
6dd41b67fb print_child_argv can be static. 2002-02-23 00:05:06 +00:00
Martin Pool
1521eefb62 Make "make proto" work for VPATH builds. 2002-02-23 00:02:07 +00:00
Martin Pool
a036a0e818 Revert 1.134 -- this breaks Net/Free BSD. 2002-02-21 00:56:11 +00:00
Martin Pool
7583ded808 Make setgroups(0,0) unconditional -- accidentally thinking we have
don't it on a machine that does have supplementary groups would be a
security hole.  If this breaks anything we'll fix it later.
2002-02-21 00:45:48 +00:00
Martin Pool
78818f4465 Add bug # for #132272 2002-02-21 00:26:06 +00:00
Martin Pool
7a49cb5667 Patch from Albert Chin to fix getaddrinfo on Tru64 UNIX 5.x. 2002-02-19 23:40:47 +00:00
Martin Pool
23212669ac Bump version to 2.5.3pre1 2002-02-19 02:16:37 +00:00
Martin Pool
3ce0f9a653 Clean up error message 2002-02-19 01:41:20 +00:00
Martin Pool
d834adc14f Doc 2002-02-19 01:39:11 +00:00
Martin Pool
b84ba8967a rsync prefix on mkdir and pushdir error messages. 2002-02-19 01:07:24 +00:00
Martin Pool
79845f2834 Doc. 2002-02-18 23:36:10 +00:00
Martin Pool
78ece130a4 Change shell syntax to try to please Solaris 2002-02-18 23:09:50 +00:00
Martin Pool
bd37c66630 Fix error handling for failing to fork after accepting a connection --
close fd, sleep, then try again.
2002-02-18 22:58:49 +00:00
Martin Pool
371d1c36b3 Solaris does not have diff -u. 2002-02-18 22:55:21 +00:00
Martin Pool
d0f821ad3d Must use STRUCT_STAT not "struct stat" to be compatible with other
rsync functions.
2002-02-18 22:49:00 +00:00
Martin Pool
ded8347d6b Cope with BSD systems on which mkdir() will not accept a trailing
slash.

<http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2734739.html>
2002-02-18 22:44:23 +00:00
Martin Pool
c4a5c57dc3 If the daemon is unable to fork a child to accept a connection, print
an error message.  (Colin Walters)
2002-02-18 22:38:03 +00:00
Martin Pool
404e813c52 Add -vvv trace statement to set_modtime to help with Debian bug
#100295.
2002-02-18 22:25:55 +00:00
Martin Pool
90d0a8db38 This test must specify --times because it compares listings that
include mtimes.
2002-02-18 22:14:46 +00:00
Martin Pool
956ff9ff72 Fix bug that made tls.o not be removed by 'make clean'. 2002-02-18 22:07:44 +00:00
Martin Pool
1eca49c6ed Doc:
#defiine lchown chown

could be bad on systems which have no lchown and where chown
follows symbollic links.  On such systems it might be better not to
try to chown symlinks at all.
2002-02-18 21:46:49 +00:00
Martin Pool
34758d5c15 Ignore SIGPIPE and allow EPIPE to get through to the program so that
we don't get stuck in a recursive loop trying to report a broken pipe
across that same broken pipe.  Debian bug #128632 (Colin Walters)
2002-02-18 20:06:57 +00:00
Martin Pool
befbfe6115 Fix for rsync server processes hanging around after the client
unexpectedly disconnects.  (Colin Walters) (Debian bug #128632)
2002-02-18 19:54:00 +00:00
Martin Pool
900748fca1 rwrite: Doc. 2002-02-18 19:51:12 +00:00
Martin Pool
87ee248169 Document multiplex stuff. 2002-02-18 19:44:04 +00:00
Martin Pool
bb7c4fa361 Doc. 2002-02-18 19:10:28 +00:00
David Dykstra
c613d37048 If a daemon prints an error message of @ERROR, have the client treat the
message as an FERROR rather than an FINFO.
2002-02-18 18:29:48 +00:00
David Dykstra
d52a22e4db Add item about fixing "out of memory in flist_expand" on Sunos4. 2002-02-14 15:27:55 +00:00
David Dykstra
6dfb45bcdf Added the two most important bug fixes to NEWS to make sure they're not
forgotten for the next release.
2002-02-13 18:57:06 +00:00
David Dykstra
145794936f Patch from Jos Backus <josb@cncdsl.com> to use HAVE_SOCKADDR_LEN rather
than HAVE_SOCK_SIN_LEN around use of sin_len.  Correct usage was already
in place in clientname.c.
2002-02-13 18:45:17 +00:00
David Dykstra
301c680fd7 Suggested patch from Jim Ogilvie <jogilvie@us.ibm.com> to print out the
system error message when mkstemp fails.
2002-02-13 18:42:20 +00:00
David Dykstra
d27cbec598 Reversing the order of maybe_emit_filelist_progress() and
emit_filelist_progress() makes the native compilers on systems
including Solaris and Irix happier.
2002-02-13 18:30:27 +00:00
David Dykstra
f5be54d6ab Some systems, notably Sunos4, do not support realloc(NULL, n), so if
nothing has yet been malloced in flist_expand(), call malloc instead of
realloc.  Problem introduced in revision 1.106 of flist.c on January 25.
2002-02-13 18:06:36 +00:00
Martin Pool
1e19f7ba5f At least change INO64_T and DEV64_T back to just 'int64', not
'unsigned int64'.  This should fix some compile problems on machines
where int64 is not a simple integer type, but I'm not convinced it is
the ideal fix.
2002-02-13 02:57:55 +00:00
Martin Pool
db719fb0d7 Factor out code for filelist progress. Copy&paste considered harmful.
Add a little doc about potential optimization of stat() calls.
2002-02-13 02:44:31 +00:00
Martin Pool
b0d4f4c10e Add a test that --owner correctly propagates ownership of files for a
local transfer as root.
2002-02-09 07:43:13 +00:00
Martin Pool
238d23d775 Add a test that --group correctly propagates groups of which the local
user is a member.
2002-02-09 07:42:37 +00:00
Martin Pool
c019068f06 Add $preserve_scratch and $always_log so if you want to see details
about successful tests, you can.
2002-02-09 03:36:33 +00:00
Martin Pool
715d1f4504 Oops -- have to call setgroups() before giving up root.
Doc some of the peculiarities about starting rsyncd as root vs
non-root.
2002-02-09 03:30:22 +00:00
Martin Pool
4f092bee9f Make sure we call setgroups() after setuid(). (Ethan Benson) 2002-02-09 02:18:42 +00:00
David Dykstra
1bbd10fe07 Remove the "rsync:" prefixes on FINFO messages. Return the "building file
list ... done" to the way it was in 2.5.1 and before when not using -P.
Apply the file list progress messages when receiving files in addition to
sending files.
2002-02-07 16:36:12 +00:00
David Dykstra
088aac8597 Make batch mode actually work and add man page documentation. From Jos Backus. 2002-02-06 21:20:48 +00:00
Martin Pool
81c652d5d2 Merge modified --with-rsh patch: we now determine the default
remote-execution command as follows:

 1) if --with-rsh is specified, use that.

 2) otherwise if remsh is in the path, use that.

 3) otherwise use rsh

If remsh is present, we always modify the order of parameters to suit
it.  This is a bit strange.
2002-02-06 04:37:09 +00:00
Martin Pool
d7761c1480 Doc: Rusty's /*/* exclude hack produces spurious output with -vv. 2002-02-06 04:34:40 +00:00
David Dykstra
93689aa51a Add --no-whole-file and --no-blocking-io options 2002-02-05 23:05:31 +00:00
Martin Pool
46e6ad492a Only print the command used to open connections with -vv, not just -v. 2002-02-05 00:37:53 +00:00
Martin Pool
97efa5c36c Roll over NEWS 2002-02-05 00:35:31 +00:00
Martin Pool
0b1ffe2755 Only print the command used to open connections with -vv, not just -v.
<Pine.LNX.4.33L2.0201301015260.11155-100000@phong.blorf.net>
2002-02-05 00:34:03 +00:00
Martin Pool
8c35542d1f Patch from wayned so that add_exclude_list produces clearer debugging
output with -vvv.
2002-02-05 00:25:52 +00:00
Andrew Tridgell
0e9480317d the signed/unsigned change seems to have caused a logic bug on some
systems (only those without large file support perhaps?)

this fixes it
2002-02-03 01:38:39 +00:00
David Dykstra
b695d088cf Better explanation of --force. It is applicable whenever --delete is
not in effect.
2002-01-29 21:52:57 +00:00
David Dykstra
81dc5750ca A more accurate description of --force as I know it. 2002-01-28 21:09:03 +00:00
David Dykstra
d82434cf27 Clarify the --force entry in the rsync man page. 2002-01-28 17:06:04 +00:00
Martin Pool
cd6058f3d4 Oops, version should be just 2.5.2. 2002-01-25 23:19:21 +00:00
Martin Pool
9be3ba223c Bump version to 2.5.3. 2002-01-25 23:16:18 +00:00
Martin Pool
a261989cda More signedness fixes; should be harmless. 2002-01-25 23:07:33 +00:00
Martin Pool
7b5c3eb05e io_end_buffering doesn't need (or use) it's fd parameter: there's only
one multiplexed stream.
2002-01-25 23:01:50 +00:00
Martin Pool
0feec72eee DEV64_t and INO64_T should probably be unsigned 2002-01-25 23:00:21 +00:00
Martin Pool
be8bd99aa4 check_name doesn't need a socklen_t, because it knows what is inside
each sockaddr type.
2002-01-25 22:59:37 +00:00
Martin Pool
355b8bcd73 Add test case for device nodes. This test will be skipped unless you
run "make check" as root.
2002-01-25 10:56:43 +00:00
Martin Pool
d58e4c273c When comparing directories, use find . to call diff, rather than
diff -r.  Two reasons: diff -r might not work everywhere, and it also
might complain about nonregular files.
2002-01-25 10:55:59 +00:00
Martin Pool
a217ad3095 Add test_skipped function. 2002-01-25 10:47:47 +00:00
Martin Pool
3d6feada8a New --ignore-existing option, patch previously distributed with
Vipul's Razor.  (Debian #124286)
2002-01-25 10:42:23 +00:00
Martin Pool
5f78da2025 Fix for device nodes. (dann frazier) (Debian #129135) 2002-01-25 10:39:08 +00:00
Martin Pool
a05e4fa512 Fix for device nodes. (dann frazier) (Debian #129135) 2002-01-25 10:28:13 +00:00
Martin Pool
2119a4c462 Another DEV64_T change. 2002-01-25 10:16:11 +00:00
Martin Pool
1d5a1da9f8 With -vv, when the file list grows, show a message. 2002-01-25 10:12:36 +00:00
Martin Pool
2e7d19945c With -vv, when the file list grows, show a message. 2002-01-25 10:12:02 +00:00
Martin Pool
5d2c5c4c73 Undo overzealous deletion. 2002-01-25 10:09:00 +00:00
Martin Pool
8694312695 Add dummy show_flist_stats(). 2002-01-25 10:06:36 +00:00
Martin Pool
d9d6bc5278 Factor out code to grow the file list into a common location. 2002-01-25 10:05:49 +00:00
Martin Pool
ebed4c3af0 indent -kr -i8 2002-01-25 09:59:00 +00:00
Martin Pool
172875cf15 Add link to the message that introduced string_area. 2002-01-25 09:54:21 +00:00
Martin Pool
4d26e9e4f4 mallinfo is implemented. 2002-01-25 09:45:45 +00:00
Martin Pool
8f4455f296 Notes about flist. 2002-01-25 09:44:17 +00:00
Martin Pool
2e1d43deb2 Ignore autoconf fluff. 2002-01-25 02:53:48 +00:00
Martin Pool
6780f72000 Add code to compare sin6_addrs. 2002-01-25 02:45:09 +00:00
Martin Pool
39e01d2d4b Back out last change -- to see whether an address is spoofed, we don't
want to look at the whole sockaddr, but rather just at the sin_addr
that it contains.

Also fix silly bug where ai_flags was set incorrectly for getaddrinfo.
2002-01-25 02:43:35 +00:00
Martin Pool
f75502950b compare_addrinfo_sockaddr: Add code to compare AF_INET6 addresses. 2002-01-25 02:37:20 +00:00
Martin Pool
974f27e7e9 Split out code to compare addrinfo and sockaddr into it's own
function.  The comparison cannot be done just byte-by-byte, because
different parts of the sockaddr will be meaningful depending on the
protocol.  It looks like on some systems the library sets the unused
parts to 0, but this is not reliable.  IPv6 not implemented yet.
2002-01-25 02:29:53 +00:00
Martin Pool
af32f69eb0 Doc. 2002-01-25 02:15:58 +00:00
Martin Pool
0cd2f40764 The name resolution stuff is getting complicated -- split it out into
its own file.
2002-01-25 02:13:04 +00:00
Martin Pool
0d95824995 Verbose messages for spoof check... doesn't work on old linux libc? 2002-01-24 09:42:52 +00:00
Martin Pool
bbc09ffba9 When doing a name->addr translation to check for spoofing, give the
resolver the address family of the original address as a hint, so that
we're more likely to find the correct A or AAAA record.,
2002-01-24 08:52:28 +00:00
Martin Pool
a4677968cf Message on successful configuration. 2002-01-24 08:50:35 +00:00
Martin Pool
03b1cddc31 Fix comment.
Bump version to 2.5.2pre3
2002-01-24 08:42:21 +00:00
Martin Pool
9c2dd04993 Name resolution on machines supporting IPv6 is improved. 2002-01-24 08:20:51 +00:00
Martin Pool
a84a93fafe ignore gmon.out 2002-01-24 08:19:28 +00:00
Martin Pool
5fdcc397b1 Fix getpeername call. 2002-01-24 08:16:27 +00:00
Martin Pool
5664871e5f size_t fix. 2002-01-24 08:09:46 +00:00
Martin Pool
55d9e0fada write_batch_csums_file: Opaque IO buffers should be void*. 2002-01-24 08:08:56 +00:00
Martin Pool
929e3011c6 Fix cast that was breaking HP/UX. 2002-01-24 08:07:35 +00:00
Martin Pool
07d70ff560 Move both calls to getpeername into a common wrapper function that
handles IPV4_MAPPED addresses.
2002-01-24 08:05:22 +00:00
Martin Pool
58c2960960 Must get declarations from addrinfo.h before prototypes. 2002-01-24 07:22:38 +00:00
Martin Pool
00d943d513 Another size_t warning 2002-01-24 05:57:49 +00:00
Martin Pool
71c780da06 check_name: Print out name *before* clobbering it. 2002-01-24 05:57:22 +00:00
Martin Pool
3b18cba889 Try to fix error on Solaris:
+ [ -f /export/home/build/build_farm/rsync/testtmp.symlink-ignore/to/referent ]
+ [ -d /export/home/build/build_farm/rsync/testtmp.symlink-ignore/to/from ]
+ [ -L /export/home/build/build_farm/rsync/testtmp.symlink-ignore/to/dangling ]
./testsuite/symlink-ignore.test: test: argument expected

Solaris says it supports -L, so I'm not sure what's happening...
2002-01-24 05:54:47 +00:00
Martin Pool
2974e20550 If name lookup fails, then show the relevant IP address in the error message. 2002-01-24 05:41:46 +00:00
Martin Pool
430d841a2c At the connections that just get a list of modules are not logged,
but they should be.
2002-01-24 04:49:07 +00:00
Martin Pool
31ec50d7da rsync_module: If host-based access fails, show the exact name/address
used for the check in the error message.  (Just in case...)
2002-01-24 04:41:09 +00:00
Martin Pool
5ad0e46f08 Show command used to start connection child. 2002-01-24 04:36:00 +00:00
Martin Pool
1b5814e338 indent -kr -i8 2002-01-24 04:26:55 +00:00
Martin Pool
255810c0d6 Doc.
Oops, connection program message was in the wrong place.
2002-01-24 04:24:12 +00:00
Martin Pool
5d2640376e Show helper program with -v when opening connection.
Doc.
2002-01-24 04:21:42 +00:00
Martin Pool
d02984bbb7 Doc. 2002-01-24 04:19:41 +00:00
Martin Pool
0f9555207a Fix const 2002-01-24 04:07:07 +00:00
Martin Pool
885448d74c Unbreak the old behavior of using UNKNOWN as a hostname if any of the
addr->name->addr translations fail, because people might count on this
in "hosts deny" lines.
2002-01-24 04:03:06 +00:00
Martin Pool
b14545b3ff Fix inverted sense of error check. 2002-01-24 03:31:28 +00:00
Martin Pool
9a5a86734f Refactor client_name() into smaller functions.
Better messages for DNS failure.

If we can get a reverse name for an IP address, but not confirm that
it is correct using a forward lookup then we still proceed to use the
name, but also emit a warning.
2002-01-24 03:28:20 +00:00
Martin Pool
d1d1505045 Doc. 2002-01-24 03:03:20 +00:00
Martin Pool
144ce1dc21 Bump version to 2.5.2pre2. 2002-01-24 03:01:42 +00:00
Martin Pool
aa126974ba log_formatted: Fill the log buffer with nuls to make sure we cannot
accidentally leave the string unterminated.
2002-01-24 02:41:38 +00:00
Martin Pool
707de53457 Another harmless size_t warning. 2002-01-24 02:33:45 +00:00
Martin Pool
10f83cf43d Doc. 2002-01-23 08:08:48 +00:00
Martin Pool
59ee743c5f More size_t fixes. 2002-01-23 08:04:54 +00:00
Martin Pool
d54765c442 Just for variety we have some socklen_t fixes too. 2002-01-23 07:57:43 +00:00
Martin Pool
91262d5d3e Refactor code in send_sums to remove repeated ternaries. 2002-01-23 07:54:13 +00:00
Martin Pool
1c09c743b1 indent -kr -i8 2002-01-23 07:52:52 +00:00
Martin Pool
06ce139fcc Fix more ints that ought to be size_t's. 2002-01-23 07:48:35 +00:00
Martin Pool
fae5bb3183 Doc.
do_hard_links() actually only looks at the global hardlink table, so
it can be a (void) fn.  (Another gcc warning...)
2002-01-23 07:42:30 +00:00
Martin Pool
6fe25398d6 Fix another int that ought to be a size_t. 2002-01-23 07:36:23 +00:00
Martin Pool
909ce14fc4 indent -kr -i8 2002-01-23 07:34:26 +00:00
Martin Pool
935b920120 Another signedness fix to quieten Sun cc warning. 2002-01-23 07:32:29 +00:00
Martin Pool
b31427cd4a Skip this for now; it's a known bug 2002-01-23 07:28:38 +00:00
Martin Pool
e2e3379d79 Bump version to 2.5.2pre1. 2002-01-23 07:22:03 +00:00
Martin Pool
6b1ef85dd8 Note batch-mode changes. 2002-01-23 07:18:58 +00:00
Martin Pool
92325ada0c Note about proxy authentication and SOCKS. 2002-01-23 07:12:57 +00:00
Martin Pool
1707e0f9e2 Indent. 2002-01-23 06:48:13 +00:00
Martin Pool
7ff701e816 Update thankyou list.
Clarify email addresses.
2002-01-23 05:59:10 +00:00
Martin Pool
2e3c141795 Note that batch mode is currently experimental. 2002-01-23 05:53:58 +00:00
Martin Pool
76f79ba748 Patch from Jos Backus -- Fix breakage from dev_t to DEV64_T in batch
mode.

Also, drop -f and -F for batch mode: these should be reserved for
options that are more commonly used.

It also appends a newline to the argvs file and skips adding the
source directory to the command line.
2002-01-23 05:51:06 +00:00
Martin Pool
9dd891bb28 Signedness security patch from Sebastian Krahmer <krahmer@suse.de> --
in some cases we were not sufficiently careful about reading integers
from the network.

Also, make sure log messages are always nul-terminated.
2002-01-23 04:57:18 +00:00
Martin Pool
99f106d1cf If using gcc, then also turn on -W to get even more warnings.
Remove obsolete message.
2002-01-23 03:52:06 +00:00
Martin Pool
3816cae745 Don't need to reread configuration on SIGHUP because we always do that
on new connections.
2002-01-21 01:57:13 +00:00
David Dykstra
759c0627e1 Aack! Since released version 2.5.0, the --whole-file option was accidentally
changed to --whole.  Change it back.  Anybody who wants to use this option
with any version of rsync will have to switch to using -W.
2002-01-15 21:25:55 +00:00
Martin Pool
e03dfae507 Change gratuituous strlcat's into strlcpy, since we already know the
length of the existing string.
2002-01-15 11:50:32 +00:00
Martin Pool
c7677b892a Clearer doc. 2002-01-15 11:32:30 +00:00
Martin Pool
da7b63972d Add --enable-profile to turn on gprof. This is not perfect, because
it seems to only write to ./gmon.out, and that causes trouble when
there are several rsync processes in the same directory.  But you can
make it work.
2002-01-15 11:20:26 +00:00
Martin Pool
499957d9ba Update 2002-01-15 10:47:59 +00:00
Martin Pool
582250008b The Ted T'so school of program optimization: make progress visible and
people will think it's faster.

So now with --progress rsync will show you how many files it has seen
as it builds the file_list.
2002-01-15 10:43:51 +00:00
Martin Pool
a9b31409d5 Remove unused variable. 2002-01-15 10:04:48 +00:00
Martin Pool
98355b8086 Oops, getaddrinfo returns an error code (not -1) for error. -Wall is
good.
2002-01-15 10:04:11 +00:00
Martin Pool
70ed474b38 Define _GNU_SOURCE so that we get all necessary prototypes. 2002-01-15 09:53:27 +00:00
Martin Pool
4775934364 If using GCC, try to turn on -Wall. I want to be clean with respect
to -Wall.
2002-01-15 09:43:21 +00:00
Martin Pool
25f2cb3d6b Fix for <http://rsync.samba.org/cgi-bin/rsync/incoming?id=3750>
temp files must be opened through do_open so that binary modes is used
on cygwin.  (Chris Boucher)
2002-01-14 00:16:51 +00:00
Martin Pool
154f9a3aca Ignore testtmp directories. 2002-01-13 23:57:13 +00:00
Martin Pool
b9df3bf20c DOc. 2002-01-11 08:37:42 +00:00
Martin Pool
6abd193fe3 Always use 64-bit ino_t and dev_t internally, so that we can detect
hardlinks if coming from a larger platform.  Add heaps of comments
explaining why this is so.
2002-01-11 08:25:32 +00:00
Martin Pool
362099a512 More comments about IPv6 stuff.
If a reverse name lookup fails, show the name that we were trying to
look up.
2002-01-11 08:24:34 +00:00
Martin Pool
fdfc3dc9f3 When checking what was copied, use specific -d -f -L flags to test
rather than -e.  (Perhaps Solaris doesn't have test -e?)
2002-01-11 08:08:34 +00:00
Martin Pool
4937459225 The current version of rsync is expected to fail to eliminate all
duplicates from list.
2002-01-11 08:02:43 +00:00
Martin Pool
be2f866b4c Add concept of expected-failure. 2002-01-11 08:01:05 +00:00
Martin Pool
f08aacf7d6 Give cleaner output from "make check" 2002-01-11 07:41:50 +00:00
Martin Pool
4fa6112efe Bump version number.
Now finished merging across work from experimental BK repository.
2002-01-11 07:30:50 +00:00
Martin Pool
1623ba6889 Improved duplicates test: check that each file is
copied once and exactly once.
2002-01-11 07:29:53 +00:00
Martin Pool
766526c791 Check whether code to eliminate duplicate filenames works
(hint: it does not.)
2002-01-11 07:29:02 +00:00
Martin Pool
5c15e29f2b Better mallinfo() output in --stats 2002-01-11 07:26:39 +00:00
Martin Pool
0413e1605f Update copyright 2002-01-11 07:25:54 +00:00
Martin Pool
0e5a1f8352 Doc 2002-01-11 07:24:31 +00:00
Martin Pool
e5a2b8544d Look for mallinfo() and use it to display
heap usage information in --stats
2002-01-11 07:16:11 +00:00
Martin Pool
736a6a291c In protocol version 26, always
send 64-bit ino_t and dev_t.  We also need to try to use 64-bit
ino_t internally *even if* this platform does not have 64-bit
inums itself, because we need to find duplicate inums when
coming from a larger platform with --hardlinks.
2002-01-11 07:15:16 +00:00
Martin Pool
6e69cff118 Autoindent
Add copyright
2002-01-11 07:11:43 +00:00
Martin Pool
cf72f20426 Improved test framework and test for hardlink handling 2002-01-11 07:11:23 +00:00
Martin Pool
d479210cee Bump version 2002-01-11 07:10:25 +00:00
Martin Pool
b781537597 Merge ChangeSet@1.12: Add test case for -H 2002-01-11 07:09:53 +00:00
Martin Pool
ea1438dad8 Merge ChangeSet@1.12: tls now shows number of links to a file to aid in testing -H 2002-01-11 07:09:22 +00:00
Martin Pool
d2e9d069b4 Merge ChangeSet@1.10: Documentation about flist scalabilityTODO 2002-01-11 07:07:49 +00:00
Martin Pool
58379559cc Merge ChangeSet@1.9: Documentation about flist scalability 2002-01-11 07:07:30 +00:00
Martin Pool
b3e6c81565 Merge ChangeSet@1.4: Documentation about flist scalability 2002-01-11 07:05:30 +00:00
Martin Pool
a6a3c3df45 Merge ChangeSet@1.4: Documentation about future development. 2002-01-11 07:04:37 +00:00
Martin Pool
6e3d4c4045 Oops, fix date. 2002-01-03 07:18:17 +00:00
rsync-bugs
ca60b701ee preparing for release of 2.5.1 2002-01-03 07:11:10 +00:00
Martin Pool
e24c0b98d7 Cleanup. 2002-01-03 07:08:35 +00:00
David Dykstra
f389ac80a9 Removed debugging statement that was added to sig_int() by the rsync+ patch
integration.  It was causing the format of the daemon log to be messed up
because of the leading \n.
2001-12-20 15:33:13 +00:00
Martin Pool
50f2f002d9 Suggestion from David Stein
verbose output

  Indicate whether files are new, updated, or deleted
2001-12-20 01:23:28 +00:00
Martin Pool
9ec7528475 Typo 2001-12-18 06:48:56 +00:00
Martin Pool
a8e2a43a09 Get rid of global_opts struct as suggested by Dave -- too many
problems with initialization.
2001-12-18 06:47:40 +00:00
Martin Pool
eb06fa95e4 Documentation fixes based on mail from Edward Welbourne, and an
attempted explanation of rsync's symbolic-link handling.
2001-12-18 06:45:28 +00:00
Martin Pool
1db8b61de7 Add an "unsafe" symlink to the symlink test case so we can see what happens. 2001-12-18 06:26:26 +00:00
Martin Pool
38c66db8d6 Note about hardlink performance. 2001-12-18 06:25:31 +00:00
Martin Pool
f8be7d4219 Refactor code for setting local address on outgoing connections. If a
local address is specified, then try all addrinfo records for it.
2001-12-18 06:21:33 +00:00
Martin Pool
13e29995f5 Get rid of global_opts struct as suggested by Dave -- too many
problems with initialization.

Change the algorithm from trying to open an inbound socket with
getaddrinfo: keep trying suggested addresses until we find one on
which we can both get a socket and bind.  Not convinced this is the
best, but it's probably better.
2001-12-18 05:54:57 +00:00
Martin Pool
7c583c7316 Note rsyncd-over-ssh and documentation TODOs. 2001-12-18 01:33:56 +00:00
Martin Pool
9fecec5e85 Fix from Jeff Garzik for inet_ntop prototype errors on some Linux
distributions: we were failing to define HAVE_INET_NTOP, so our
prototype in rsync.h came through.

Also rerun autoheader, and have comment for HAVE_SOCKADDR_STORAGE.
2001-12-18 01:32:27 +00:00
Martin Pool
9e696bd468 Update README so that Paulus doesn't get bug reports anymore :-)
I think this document needs to be reworked to better explain how to
use rsync, but not right now.
2001-12-18 01:07:20 +00:00
David Dykstra
6ab6d4bfc1 When INET6 is not defined, meaning that IPv6 is not supported, need to
initalize the global_opts.af_hint to AF_INET or systems such as Linux that
have a native getaddrinfo() because they support IPv6 will attempt to
create IPv6 sockets.  This brings up a problem with the new global_opts
structure; in order to initialize them to a value other than 0, we need to
explicitly initialize them all in an order that matches the order in
rsync.h.  I think that's more inconvenient & error prone than keeping
global variables.
2001-12-14 18:25:51 +00:00
David Dykstra
cb1bcc7ebb open_socket_in was attempting to try all the protocols returned from
getaddrinfo(), but only if a corresponding call to socket() returned one of
three *NOSUPPORT errno codes.  A Redhat 6.2 system was observed returning
EINVAL instead so it never went on to try IPv4.  This update adds EINVAL to
the list.  Question: why not always continue through the list regardless of
what errno is?
2001-12-14 18:00:54 +00:00
Martin Pool
19ba7d6318 Verbose. 2001-12-14 05:55:21 +00:00
Martin Pool
7753ca1f49 Only show test output if it failed. 2001-12-14 05:54:24 +00:00
Martin Pool
d52a796c39 Be less verbose. 2001-12-14 05:52:25 +00:00
Martin Pool
60514d457c Fix quoting. 2001-12-14 05:44:04 +00:00
Martin Pool
5bc00efe42 Perhaps Solaris sh wants us to explicitly exit 0, rather than just
using the last return code?
2001-12-14 05:27:42 +00:00
Martin Pool
c45f3133bc More error messages. 2001-12-14 05:19:15 +00:00
Martin Pool
fb47591de0 Typo. 2001-12-14 05:17:52 +00:00
Martin Pool
514d129c49 Make scratch directory properly. 2001-12-14 05:01:48 +00:00
Martin Pool
db843fc12d Doc. 2001-12-14 02:18:31 +00:00
Martin Pool
63787382d8 Clearer error messages. 2001-12-14 02:16:20 +00:00
Martin Pool
85d4d142d8 Clearer error messages. 2001-12-14 02:14:58 +00:00
Martin Pool
3cd2af41e4 Add a test that when none of -l, -L, -a are specified symlinks are not
copied at all.
2001-12-14 02:01:46 +00:00
Martin Pool
b214eda4f0 Clean scratch directory between each test run. 2001-12-14 01:52:43 +00:00
Martin Pool
0771727d41 Readlink(2) does not nul-terminate the output buffer, so we were
getting corrupt output when listing more than one symlink.
2001-12-14 01:48:48 +00:00
Martin Pool
a5d74a1876 Fix contact details. 2001-12-14 01:09:23 +00:00
Martin Pool
23bf32f767 Don't define DEBUG with --enable-debug, because that makes zlib emit strange messages 2001-12-09 21:48:13 +00:00
Martin Pool
87a819edee IRIX cc cares that the operands to the ternary have the same type. 2001-12-05 13:48:41 +00:00
Martin Pool
27a1234874 Be more strict about 'enum logcode' rather than int. IRIX compiler
picked this up -- quite neat.
2001-12-05 13:45:51 +00:00
Martin Pool
51f289d1e6 Some platforms don't have sa_family_t. 2001-12-05 13:44:37 +00:00
Martin Pool
d0d6dc61e8 Bump version 2001-12-05 13:41:38 +00:00
Martin Pool
d91c8c50d2 RFC2553 just says that sockaddr_storage has to have initial fields
isomorphic to sa_family etc from a struct sockaddr, not what they're
called.  On some platforms they seem not to be called ss_family.
Rather than guess, we will try casting to a sockaddr and looking
through that -- I think this is what the RFC intends.
2001-12-05 13:25:29 +00:00
Martin Pool
e20a4f84d6 Some platforms may have getaddrinfo() but not sockaddr_storage. 2001-12-05 13:19:16 +00:00
Martin Pool
bbd6f4ba8e Document --no-detach. 2001-12-05 13:10:24 +00:00
Martin Pool
2a951cd2f9 Fix help message for --address option 2001-12-05 13:06:26 +00:00
Martin Pool
a538066d5a Add --no-detach option for W32, daemontools, etc. 2001-12-05 13:03:16 +00:00
Martin Pool
c10b0bdd50 Doc 2001-12-05 13:02:11 +00:00
Martin Pool
431efc8979 Doc. 2001-12-05 12:56:06 +00:00
Martin Pool
2d6dbe290c Change back to using sockaddr_storage rather than sockaddr_in. If
sockaddr_storage is not defined, then supply our own definition that
will hopefully satisfy RFC2553 but also compile on all supported
platforms.

Thankyou to YOSHIFUJI Hideaki, SUMIKAWA Munechika and Jun-ichiro
"itojun" Hagino.
2001-12-05 12:48:46 +00:00
Martin Pool
c33e3e3967 Suggestions from KAME IPv6 newsletter. 2001-12-05 12:25:36 +00:00
Martin Pool
71b3374bd5 Note from tpot that sighup should have standard behaviour of reinitializing. 2001-12-05 00:58:20 +00:00
David Dykstra
de343e3cce Don't print out the directory name twice in verbose mode; it was being
printed a second time when the modification time of the directory was
being set, and that time around recv_files() calls recv_generator() with
an f_out of -1 so check that before printing the directory name.
2001-12-03 18:37:33 +00:00
Martin Pool
384958ed3d Note about crash from Ayamura KIKUCHI 2001-12-02 22:47:30 +00:00
Martin Pool
1cd5beeb06 batch reindent 2001-12-02 22:28:50 +00:00
Martin Pool
4c70e359d0 Bump version 2001-12-02 22:26:09 +00:00
Martin Pool
f9c3005bff Fix FP usage. 2001-12-02 14:12:03 +00:00
Martin Pool
9147074d8b Oops, units bug. 2001-12-02 13:58:03 +00:00
Martin Pool
7007bddaef Show time-remaining as hh:mm:ss. 2001-12-02 13:45:38 +00:00
Martin Pool
2f8dc29182 Update notes 2001-12-02 13:22:55 +00:00
Martin Pool
6066594bbe Improved estimation algorithm for time-to-complete. 2001-12-02 13:07:07 +00:00
Martin Pool
40c0289176 Typo fix by Tom Schmidt 2001-12-02 13:02:17 +00:00
Martin Pool
acf1af0cd9 const-cast required for silly UNICOS headers 2001-12-02 12:37:48 +00:00
Martin Pool
62791bdfa2 Also estimate time remaining. 2001-12-02 08:56:25 +00:00
Martin Pool
47f1218d69 Progress indicator now shows estimated rate of transfer (e.g. kB/s).
Based on a patch from Rik Faith, but modified to make sure we do only
one rprintf call, and that we never end up with two copies of the line
printed out.
2001-12-02 08:38:51 +00:00
Martin Pool
1179355dab Revert change from 1.39, because it causes a crash because of
attempting to free a static string.  (Thankyou to Paul Mackerras.)
There's still a small leak here.
2001-12-02 08:16:15 +00:00
Martin Pool
3d807132e4 Fix test suite breakage in calling tls.
Clean up test directory on completion.
2001-12-02 07:22:54 +00:00
Martin Pool
42d0b4c280 Bump version 2001-12-02 07:21:55 +00:00
Martin Pool
d313ae7d23 Move old news from release 2.5.0. 2001-12-02 07:17:50 +00:00
Martin Pool
28a69e25ea More notes from email. 2001-12-02 07:07:43 +00:00
Martin Pool
ad911a7ac3 Typo fix from Matt Kraai <kraai@debian.org> 2001-12-02 06:17:33 +00:00
Martin Pool
5575de140d Add note about device major/minor numbers, and about ACLs 2001-12-02 05:12:39 +00:00
David Dykstra
a5ce1eb1af Add "$(OBJS): config.h" so everything will rebuild if config.h changes. 2001-11-30 22:21:20 +00:00
Martin Pool
76a78cd8bc Add message to ignore warnings about mktemp 2001-11-30 22:06:29 +00:00
rsync-bugs
0b25efc12a Modified file stored as well 2001-11-30 00:31:06 +00:00
rsync-bugs
64cae087b6 preparing for release of 2.5.0 2001-11-30 00:29:46 +00:00
Martin Pool
b7cc59c503 Spec file needs to be generated from a template to include the version
number.
2001-11-30 00:29:20 +00:00
rsync-bugs
7eb8d18a99 preparing for release of 2.5.0 2001-11-30 00:23:11 +00:00
Martin Pool
e7bf3e5e87 Last bug fix for 2.5.0? Make the documentation for -a point out that
it does not in fact propagate hardlinsk.
2001-11-30 00:17:53 +00:00
Martin Pool
5aafd07b37 Note error cases that we ought to improve. 2001-11-30 00:16:14 +00:00
Martin Pool
053f3a831d Note other supported platforms 2001-11-30 00:15:32 +00:00
Martin Pool
a2d2e5c047 Add notes on things to do mentioned on the list in the last few months. 2001-11-29 01:31:31 +00:00
Martin Pool
dd3a922035 IPv6 support is now merged. 2001-11-29 00:23:29 +00:00
Martin Pool
0e916c6038 Just include rsync.h rather than all the individual headers.
(Suggestion from Dave Dykstra.)
2001-11-29 00:15:20 +00:00
Martin Pool
87fcb63975 No need to test for memcmp, because even broken ones are good enough
for our purposes.  (Patch from Dave Dykstra.)
2001-11-29 00:08:36 +00:00
Martin Pool
68b2cc5538 Show version when configuring.
If we don't seem to have an ANSI compiler, then omit a warning as soon
as that is discovered, because it is likely to break later configure
tests.  This doesn't seem to catch the particular HP-UX compiler I was
after, which is non-ANSI but only emits a warning on this configure
test.  Nevertheless probably better to have it in.
2001-11-29 00:04:48 +00:00
Martin Pool
4dcf3697ff Add list of platforms that build. 2001-11-28 07:49:32 +00:00
Martin Pool
ea77525546 Note half-baked Darwin IPv6 support. 2001-11-28 07:12:09 +00:00
Martin Pool
17d5a07ec2 Put back the --disable-ipv6 option. This should only be needed if
your platform seems to support ipv6, but actually it breaks.  This
seems to be the case for "powerpc-apple-darwin1.4".
2001-11-28 06:52:04 +00:00
Martin Pool
3966b9c609 Call this 2.4.7pre4 2001-11-28 04:32:33 +00:00
Martin Pool
1c47fbd96b Note on HP-UX's bundled so-called C compiler. 2001-11-28 04:10:39 +00:00
Martin Pool
1691bdcafc HP's cpp apparently can't handle whitespace before #include 2001-11-28 03:12:20 +00:00
Martin Pool
6a5ef41fb3 HP's cpp chokes on preprocessor directives that have whitespace before
the '#'.  Off to the Implant Office with you!
2001-11-28 02:55:20 +00:00
Martin Pool
09b6f4b00d Fix inet_ntop/pton names 2001-11-28 01:29:41 +00:00
Martin Pool
7067b0aa28 Protect AF_INET6 references with #ifdef INET6 2001-11-28 00:36:32 +00:00
Martin Pool
112e731150 Fix sh 2001-11-27 07:59:34 +00:00
Martin Pool
1336e41460 Show symlink targets 2001-11-27 07:56:33 +00:00
Martin Pool
7c1b7890d3 Be a bit more verbose 2001-11-27 07:54:48 +00:00
Martin Pool
dd0700b025 mtime and ownership of symlinks can be random, so don't print them. 2001-11-27 07:54:03 +00:00
Martin Pool
04d8e8b25f Be a bit more verbose 2001-11-27 07:32:42 +00:00
Martin Pool
3723efcb1d Try to fix headers for UNICOS 2001-11-27 07:23:58 +00:00
Martin Pool
054b40b6fa Unbreak recursive ls test 2001-11-27 07:19:37 +00:00
Martin Pool
6773a7798f Oops, fix bash syntax 2001-11-27 07:09:47 +00:00
Martin Pool
2d4c8e5945 The size of anything but a regular file is probably not worth thinking
about.
2001-11-27 07:07:36 +00:00
Martin Pool
087173c887 When producing a ls-style permissions string, also handle
sticky/setuid/setgid bits the same way as GNU ls.
2001-11-27 07:05:33 +00:00
Martin Pool
57835c00ad Use tls rather than the OS's ls(1) so that we have more chance of
reproducible results.
2001-11-27 06:51:51 +00:00
Martin Pool
4ed886ae6e Also list permissions, ownership, size, and mtime. 2001-11-27 06:45:47 +00:00
Martin Pool
740819ef7b Split code to generate "rwx-----" strings into lib/permstring.c so it
can be reused in tls.
2001-11-27 06:43:17 +00:00
Martin Pool
829230689e Build getaddr/nameinfo into lib/. 2001-11-27 06:41:38 +00:00
Martin Pool
77ba4cc2f9 make clean can rm config.cache but not config.h, or it wil jam.
Build getaddr/nameinfo into lib/.

Split code to generate "rwx-----" strings into lib/permstring.c so it
can be reused in tls.
2001-11-27 06:39:02 +00:00
Martin Pool
e94989fe4d Try to fix LIBOBJ detection of ntop/pton. 2001-11-27 06:17:33 +00:00
Martin Pool
c11b88061f Fix missing parameter in log call. 2001-11-27 06:01:05 +00:00
Martin Pool
647c5433f8 Make clean should also remove the autoconf cache etc. 2001-11-27 05:35:14 +00:00
Martin Pool
8f694072a5 Add Paul Vixie's implementation of inet_ntop and inet_pton for
platforms that don't have them.
2001-11-27 05:22:23 +00:00
Martin Pool
9a689986c6 Look in -lresolv for inet_ntop 2001-11-27 04:53:08 +00:00
Martin Pool
3174b31d96 Check for inet_ntop and inet_pton, which may be missing. 2001-11-27 03:49:53 +00:00
Martin Pool
4eb61975b7 Explain IPv6 merge. 2001-11-27 02:28:36 +00:00
David Dykstra
76e26e1042 Better fix for case of excluded symlinks that point nowhere when using
--copy-links.  The readlink_stat() does need to be done in the normal case
before checking the exclude patterns because it needs to know whether or
not a file is a directory in order to properly handle a trailing slash
in an exclude pattern.  This fix makes make_file() go ahead and call
readlink_stat() but then if the latter returns an ENOENT and copy_links is
on then it will only print an error if the path is not excluded.
2001-11-26 19:15:53 +00:00
Martin Pool
9069dfd005 Fix rename of global option 2001-11-26 08:21:30 +00:00
Martin Pool
2be5d2daad Remove kame cruft 2001-11-26 08:21:14 +00:00
Martin Pool
22cd0063e5 Attempted clean up some of the IPv6 tests. 2001-11-26 08:20:13 +00:00
Martin Pool
3d2e458a4d Fix a small memory leak that was causing an Insure warning. 2001-11-26 07:58:47 +00:00
Martin Pool
a57568d716 Oops, no C++ comments. 2001-11-26 07:47:59 +00:00
Martin Pool
61f543cade Kill a function for jra. 2001-11-26 07:11:55 +00:00
Martin Pool
b8771f9615 Try to be better about handling the results of getaddrinfo(): when
opening an inbound socket, we might get several address results,
e.g. for the machine's ipv4 and ipv6 name.

If binding a wildcard, then any one of them should do.  If an address
was specified but it's insufficiently specific then that's not our
fault.

However, some of the advertized addresses may not work because e.g. we
don't have IPv6 support in the kernel.  In that case go on and try all
addresses until one succeeds.
2001-11-26 07:10:06 +00:00
Martin Pool
d5d4b28220 Put the new address family option into an options struct. We have too
many globals already.

Better error messages for network-related failures.
2001-11-26 04:52:19 +00:00
Martin Pool
a037edaccd Silly autoconf 2001-11-26 01:49:33 +00:00
Martin Pool
356bbb8351 Check for -lnsl, -lsocket, etc, *before* looking for getaddrinfo,
because on Solaris (for one) it's not in libc.
2001-11-26 01:15:12 +00:00
Martin Pool
1f0fa9318a Remove highly suspicious redefinition of sockaddr structure -- there
seems no point using anything but the platform's native definition,
and if we can't get that from the system headers we're hosed anyhow.
2001-11-26 00:41:11 +00:00
Martin Pool
15c1707887 Remove check for buggy getaddrinfo for the time being -- it's unclear
how this is supposed to help.

Check for netdb.h
2001-11-26 00:23:29 +00:00
Martin Pool
9dec7aa9c1 Make some of the headers used by the KAME getaddrinfo implementation
be conditional -- they are missing on e.g. Solaris.  Not sure if this
will fix it.
2001-11-25 09:30:36 +00:00
Martin Pool
bc3d7454e0 Fix KAME patch to use proper autoconf AC_MSG macros rather than just echo/exit. 2001-11-24 05:38:35 +00:00
Martin Pool
56901bc7c3 Call this pre3. 2001-11-24 05:33:35 +00:00
Martin Pool
5c7f570b16 IPv6 is off by default. 2001-11-24 05:31:40 +00:00
Martin Pool
4f6e5fe323 IPv6 is off by default -- it seems to break header files on too many systems. 2001-11-24 05:30:27 +00:00
Martin Pool
7d682ffea7 Note IPv6 and nohang patches. 2001-11-24 05:13:12 +00:00
Martin Pool
cef40af209 Get rid of rule disliked by Sun Make. 2001-11-24 05:06:07 +00:00
Martin Pool
a358449ab1 Set rsync version in configure.in
Show IPv6 availability in --version.
2001-11-24 04:57:41 +00:00
Martin Pool
8ef6b72514 Fix Makefile syntax problem when LIBOBJS is defined. 2001-11-24 04:33:07 +00:00
Martin Pool
620bbabc61 Try to get IPv6 support, unless --disable-ipv6 is explicitly specified. 2001-11-24 04:29:37 +00:00
Martin Pool
7ef6aa6405 Improved error messages. 2001-11-24 04:22:20 +00:00
Martin Pool
7ad1d4fd66 Rebuild if headers changed. 2001-11-24 04:16:18 +00:00
Martin Pool
bf5c2bf604 More autoconf fixes. 2001-11-24 04:12:54 +00:00
Martin Pool
b8fe70a516 Ignore trash 2001-11-23 07:37:26 +00:00
Martin Pool
06963d0fca Merge KAME.net IPv6 patch: you can now (in theory) pass IPv6 hostnames
or literal IP addresses to rsync, and if your platform supports them
they will be used.  Also there are -4 and -6 command-line options to
choose the default address type.  Thankyou!
2001-11-23 07:35:49 +00:00
David Dykstra
b964901f7d Fix to make_file() to exit earlier if a file is excluded, because doing
readlink_stat() on an excluded file can be a problem when using the
--copy-links option (also known as -L) and the excluded file is a symlink
that points nowhere.
2001-11-16 19:19:44 +00:00
Martin Pool
b52c1d9d3a Document chroot confusion. 2001-11-09 06:58:39 +00:00
Martin Pool
a24e12e6dd More notes. 2001-09-12 14:35:39 +00:00
Martin Pool
3c6cd53b23 Think think. 2001-09-12 14:20:44 +00:00
Martin Pool
4f69fe59c7 Start to wrap up all thoughts on what should happen for rsync 3. 2001-09-12 08:51:24 +00:00
Martin Pool
d2e02b7d96 Fix from Marc Espie to make included-popt work with VPATH builds. 2001-09-12 08:46:29 +00:00
Andrew Tridgell
a57873b710 fixed check for timeout in generator
the generator can easily make no progress for a long time, so don't do
timeout processing checks
2001-09-09 04:42:09 +00:00
Andrew Tridgell
30ce7e8a64 64-bit files depends on the size of OFF_T, not off64_t 2001-09-09 04:41:14 +00:00
Andrew Tridgell
f0af1e5ec6 debian stable screws up largefile support for fcntl locking. This adds
a test for the screwup and disables largefile support
2001-09-08 12:48:50 +00:00
Martin Pool
f7ca98bdc4 Doc. 2001-09-07 07:57:10 +00:00
Martin Pool
7df0935a51 Add a little implementation of ls(1) so that we can look at all and
only the attributes of files that rsync is meant to synchronize.

Test cases should depend on testing tools.
2001-09-07 07:52:34 +00:00
Martin Pool
f22ee86517 Add a little implementation of ls(1) so that we can look at all and
only the attributes of files that rsync is meant to synchronize.
2001-09-07 07:52:09 +00:00
Martin Pool
8f98c608b9 Remove test trace stuff. 2001-09-07 07:50:31 +00:00
Martin Pool
32c58f06e0 Try to exit 0 if nothing fails. 2001-09-07 07:49:34 +00:00
Martin Pool
040f7b6595 Update copyright notice. 2001-09-07 07:35:08 +00:00
Martin Pool
d2476f0db3 Debug exit status -- on Sun1/cc all the tests pass, but make sees an
exit status of 1. ???
2001-09-06 13:12:28 +00:00
Martin Pool
952cf8f4f3 Oops, some machines don't have which. 2001-09-06 13:07:52 +00:00
Martin Pool
a138e47560 Oops, some machines don't have which. 2001-09-06 13:04:48 +00:00
Martin Pool
7d6916547f See if head(1) works -- broken on some systems? 2001-09-06 06:34:24 +00:00
Martin Pool
6cd7888e46 You cannot do "export VAR=VALUE" all on one line; the export must be
separate from the assignment.  (SCO SysV)
2001-09-06 06:30:09 +00:00
Martin Pool
1d54358e52 Fix selective definition of *snprintf. (Welcome to mbp's breakage world.) 2001-09-06 06:27:02 +00:00
Martin Pool
4c80c473ed More testsuite cleanups. Now I hope we cope without 'cp -a', though
we still need 'cp -p'.
2001-09-06 06:21:15 +00:00
Martin Pool
571a4b2654 BSD machines don't seem to have head(1). 2001-09-06 06:06:13 +00:00
Martin Pool
501972bf72 Split the 'longdir' test into its own script, and make it work without
'mkdir -p'.
2001-09-06 05:57:27 +00:00
Martin Pool
99cdaff70d Add a makepath() function to cope with machines that do not have
'mkdir -p'.  (Stone knives and bearskins...)
2001-09-06 05:52:40 +00:00
Martin Pool
c36b5017b8 Doc.
Look at $whichtests to run just a subset -- good for calling from Make.
2001-09-06 05:50:48 +00:00
Martin Pool
a4cf6bec19 Fix comment. 2001-09-06 04:56:55 +00:00
Martin Pool
0154b302ce Fiddle umask again. 2001-09-06 04:56:02 +00:00
Martin Pool
ec99e9da81 Clean up output a little. 2001-09-06 02:30:06 +00:00
Martin Pool
e052b21f32 Set umask so that symlinks will have the right permissions on BSD. 2001-09-06 02:26:21 +00:00
Martin Pool
b2f0246498 For log messages containing ridiculously long strings that might
overflow a buffer rsync no longer aborts, but rather prints an
ellipsis at the end of the string.  (Patch from Ed Santiago.)
2001-09-04 03:12:55 +00:00
Martin Pool
c1659c79ef Clean up from rsync+ patch; fix compiler warning. 2001-08-31 09:27:35 +00:00
Martin Pool
4a7cb3e8a8 Fix sh syntax for FreeBSD. 2001-08-31 09:26:34 +00:00
Martin Pool
0de40240bb If we're using built-in *printf functions, then provide prototypes. 2001-08-31 09:23:06 +00:00
Martin Pool
d79c77caca Cope on machines without INADDR_LOOPBACK. 2001-08-31 08:22:00 +00:00
Martin Pool
2b106d0b3a Ignore test tmp dir. 2001-08-31 08:16:23 +00:00
Martin Pool
8fef024528 Run the daemon test using faked tcp connections. 2001-08-31 08:13:57 +00:00
Martin Pool
6963e540db Grammar fix. 2001-08-31 08:12:35 +00:00
Martin Pool
3ef526f5fa Add comment about handling of 'use chroot' 2001-08-31 08:08:42 +00:00
Martin Pool
eecd22ff7b Merge in the LIBSMB_PROG idea from samba, so that you can do
RSYNC_CONNECT_PROG='./rsync --daemon' ./rsync -vvvvvv  localhost::

to test as a daemon without actually having to listen on a port.
2001-08-31 07:06:13 +00:00
Martin Pool
add7e8fb6b Doc.
Try to give a better error message when there is a remote option error.
2001-08-31 06:48:35 +00:00
Martin Pool
f6e09367a7 Option should be --recursive, not --recurse. (This is what it was in
--help and 2.4.6.)
2001-08-31 06:29:45 +00:00
Martin Pool
3aae15ecfb Fix rsyncd.conf generation. 2001-08-31 05:49:16 +00:00
Martin Pool
f5ad6eb18d Fix message. 2001-08-31 05:48:19 +00:00
Martin Pool
7f1b717ac7 Show rsync version before doing anything else. 2001-08-31 05:45:49 +00:00
Martin Pool
55bdb41632 Skip SSH tests if $rsync_enable_ssh_tests is not set 2001-08-31 05:41:45 +00:00
David Dykstra
7c06e407ec The --compare-dest option was not listed as accepting a string parameter
like it was supposed to.  There should probably be a testsuite test for
--compare-dest.
2001-08-30 16:24:03 +00:00
Martin Pool
c13ad7ec47 fix bashism 2001-08-30 08:28:53 +00:00
Martin Pool
d2094cc33d Split out generic functions for starting rsyncd. 2001-08-30 07:14:57 +00:00
Martin Pool
c3469aed19 Notes on an interactive shell for rsync. 2001-08-30 07:11:46 +00:00
Martin Pool
232ce2b2c8 Start testing daemon functionality 2001-08-30 07:10:45 +00:00
Martin Pool
882582b307 Run all scripts in the testsuite/ directory, not just named ones. I'd
like to make this script not rsync-specific if possible.
2001-08-30 07:10:20 +00:00
Martin Pool
ebaa0489b4 Abandoned 2001-08-30 06:56:57 +00:00
Martin Pool
1a1c244dc3 Obsolete 2001-08-30 06:54:59 +00:00
Martin Pool
320989b05d On BSD, this seemed to always exit after test failure. Try different
shell syntax.
2001-08-30 06:54:15 +00:00
Martin Pool
9d682a8dc1 More debug output for testing SSH. 2001-08-30 06:51:58 +00:00
Martin Pool
37c3cf430d Try using diff -c' not diff -u' because the latter seems to be
broken on SCO2.
2001-08-30 06:35:48 +00:00
Martin Pool
751411c40d Use rsync source rather than /etc for files because things in /etc
might be protected or missing on some systems.
2001-08-29 09:38:28 +00:00
Martin Pool
6a46226b3a BSD doesn't have /etc/resolv.conf or /etc/inittab, and hands.test was
trying to use them as a source of noise.
2001-08-29 09:27:43 +00:00
Martin Pool
42e66aa24c Apparently `set -x' in the shell works on some Bourne shells, but not SCO. 2001-08-29 09:24:35 +00:00
Martin Pool
5cb1f5c795 Apparently '!' to invert a pipeline result doesn't work on UnixWare. 2001-08-29 09:23:19 +00:00
Martin Pool
12b9c8409e Return the *number of tests that failed*, so that it will show up
nicely in the overall summary.
2001-08-29 09:20:35 +00:00
Martin Pool
e8ca590142 Cleanup check_logs feature.
`ps ax' is not portable -- don't use it to generate random text.  Use
`ls -lR' instead.
2001-08-29 09:18:45 +00:00
Martin Pool
863dff5179 Cleanup check_logs feature. 2001-08-29 09:15:17 +00:00
Martin Pool
3fedd74ba2 Clean up Phil's test more.
Make the checkit() routine more generic.

Split out ssh tests.
2001-08-29 09:13:01 +00:00
Martin Pool
78ffe4787f $RSYNC and similar variables must be set to absolute path so that it
can be passed to --rsync-path.

Add a nopersist=yes option that makes runtests bomb out as soon as one
test fails -- this is good if you're watching the trace output.
2001-08-29 09:12:05 +00:00
Martin Pool
a4b4af889b $RSYNC must be set to absolute path so that it can be passed to --rsync-path 2001-08-29 09:11:14 +00:00
Martin Pool
d286ee98b9 Count overall failure if some expected scripts were missing. 2001-08-29 08:48:00 +00:00
Martin Pool
42be591878 Remove testtmp directory on 'clean'.
Run test scripts in POSIX mode to try to catch portability problems.
2001-08-29 08:46:18 +00:00
Martin Pool
3a4c683f04 More test case work:
* make sure to build rsync before running 'make check'

 * Put back in the loglevel concept from the samba scripts.  If >8,
   then turn on shell tracing.

 * Allow tests to return 77 if they want to count as 'skipped'.

 * Add more docs.

 * Mangle Phil's script to get ready to run on non-Linux systems: we
   need to not use shell functions, cp -a, etc.  Not there yet.
2001-08-29 08:13:19 +00:00
Martin Pool
e7d29902a6 Redraft testsuite driver script to unify 'make check', 'make
installcheck' and buildfarm tests.

Add note from discussion with Tim about finding files/directories
under different circumstances.  Now works (?) with VPATH build.
2001-08-29 07:33:27 +00:00
Martin Pool
64bd756832 Add comment: cyeoh says that getpass is deprecated, because it may
return a truncated password on some systems, and it is not in the LSB.
2001-08-29 07:23:30 +00:00
David Dykstra
8642efd0d6 The --with-rsync-path configure option was using the wrong configure
variable "$with_rsync_name" instead of "$with_rsync_path".
2001-08-27 16:23:41 +00:00
Martin Pool
063393d62d Only use the "@RSYNC EXIT" tag if we're talking to a client about
version 25.  This prevents it appearing and messing up the module list
when an old client connects to a 2.4.7 server.
2001-08-23 06:14:54 +00:00
Martin Pool
7a55d06e0d Allow the server to terminate the module list by just closing the
socket, rather than sending a proper EXIT command.  Keep the
global-variable hack to do this, but try to make it only apply in the
specific case where that occurs, not on all lines we read.
2001-08-22 04:15:50 +00:00
Martin Pool
6f82f7a6f6 Add a little more protocol documentation. 2001-08-22 04:14:05 +00:00
Martin Pool
33d213bb37 Note about cross-testing different versions. 2001-08-22 04:09:07 +00:00
Martin Pool
a426e396c4 Return 1 if any tests failed so that the build farm can pick it up. 2001-08-21 14:06:52 +00:00
Martin Pool
fafeb69cb6 Change test directory again. 2001-08-21 13:44:08 +00:00
Martin Pool
b9277bdb6a Don't look at $srcdir if it's not set. (Why isn't it set??) 2001-08-21 13:26:30 +00:00
Martin Pool
b53713d322 Show trace while testing. 2001-08-21 13:20:53 +00:00
Martin Pool
2f22174f21 Try again to find the right directory on both local and farm builds. 2001-08-21 13:10:18 +00:00
Martin Pool
d820215b35 More test suite stuff 2001-08-21 13:00:55 +00:00
Martin Pool
ea4a03762a Print source directory. 2001-08-21 12:49:23 +00:00
Martin Pool
46ef7d1dc8 Update notes; add idea about rsyncsh 2001-08-18 23:50:27 +00:00
Martin Pool
e340a8203e Export autoconf settings to test scripts. Use this to cope with
systems that don't use "echo -n".
2001-08-17 01:57:42 +00:00
Martin Pool
3459d319d1 Set up scratch directory for tests. 2001-08-17 01:44:13 +00:00
Martin Pool
09ec75a629 Don't pause at end of tests. 2001-08-17 01:43:13 +00:00
Martin Pool
4df7868d39 Try to fix "make check" directory path.
Don't wait for input at end of tests.
2001-08-17 01:34:31 +00:00
Martin Pool
bc888e05da Find the right directory to run the test components. 2001-08-17 00:58:21 +00:00
Martin Pool
26c7f120e6 Try to get test scripts to run properly. 2001-08-17 00:51:20 +00:00
Martin Pool
5b7be6ee4a Show number of passed/failed/skipped tests. 2001-08-16 09:37:54 +00:00
Martin Pool
951351a537 Don't print test headers unless the test is about to run. 2001-08-16 09:35:21 +00:00
Martin Pool
0b21c485ec Note test suite.
Note autoconf2.52 is required.
2001-08-16 09:16:08 +00:00
Martin Pool
068a7221ce Move Phil Hand's test under the control of the master test suite. 2001-08-16 09:13:37 +00:00
Martin Pool
a4772a4dbc Start to unify the "make check" and build farm test suites 2001-08-16 09:08:29 +00:00
Martin Pool
2ee91aedb1 Use set -x until this script works properly. 2001-08-16 08:13:13 +00:00
Martin Pool
d95447229b Fix typo. 2001-08-16 08:12:55 +00:00
Martin Pool
40ec33b604 Gave directory its proper name 2001-08-16 07:08:26 +00:00
Martin Pool
35e3b2d555 fix filename 2001-08-16 06:27:51 +00:00
Martin Pool
aa9c2df9d9 Updated directory name for rsync tests 2001-08-16 06:24:56 +00:00
Martin Pool
f472cdf017 Try to execute rsync --version as part of the test suite -- see if
this works on the farm.
2001-08-16 05:44:17 +00:00
Martin Pool
1dc587af1b Fix cast warning. 2001-08-15 08:52:10 +00:00
Martin Pool
aeb6292d0d Try to get tests to run with old buildfarm clients 2001-08-15 08:06:26 +00:00
Martin Pool
7d91d5a619 Check that gethostbyname does actually return AF_INET addresses, since
that's all we can handle.

Also, try a new method of handling in_addr and hostent that will
hopefully work on Cray machines without 32-bit types.
2001-08-15 07:52:28 +00:00
Martin Pool
7169bb4aa9 Fix a bug introduced in 1.119, whereby strings like
"mirror.aarnet.edu.au::" were not properly digested.

It wasn't even my bug! :-)
2001-08-15 07:50:07 +00:00
Martin Pool
2db52650fc Fix another format cast. 2001-08-15 06:50:46 +00:00
Martin Pool
c1f62a573a Use socklen_t for getpeername, since we hopefully now have it defined
on all platforms.
2001-08-15 06:47:40 +00:00
Martin Pool
08a740ff43 Fix casts when some variables are printed out. 2001-08-15 06:41:24 +00:00
Martin Pool
b67381d0dc Drop dead variables introduced in rsync+ patch. 2001-08-15 06:38:23 +00:00
Martin Pool
07e9500818 Fix trace message which was missing a parameter.
Drop dead variable introduced in rsync+ patch.
2001-08-15 06:34:28 +00:00
Martin Pool
c77cf82206 Add the start of a buildfarm test suite for rsync. It doesn't do much
yet -- I just want to see if it runs.
2001-08-15 05:47:57 +00:00
Martin Pool
f8014b864e Typo. Shouldn't depend on assert(). 2001-08-15 05:47:29 +00:00
Martin Pool
d58911fb37 Better error messages for DNS. 2001-08-15 05:08:07 +00:00
Martin Pool
b335d74565 Fix bug in --address handling. 2001-08-15 05:07:29 +00:00
Martin Pool
3405fe45f4 Note UNICOS works again 2001-08-14 02:28:12 +00:00
Martin Pool
095efec1d6 Spec file from Jason Haar that works on RedHat 7.1. Not tested by me yet. 2001-08-14 02:24:09 +00:00
Martin Pool
7ca6e85649 Commit getconf/socklen_t/largefile patch suggested by Albert Chin.
This is tested on
  Solaris 2.5.2, 2.6, 7, 8/SPARC, HP-UX 10.20, 11.00,
  Tru64 UNIX 4.0D, 5.0A, IRIX 6.2, 6.5, AIX 4.3.2
and it works ok.

This patch *requires* autoconf 2.52.
2001-08-14 02:18:04 +00:00
Martin Pool
74be4fc399 Remove incorrect news message 2001-08-14 02:14:09 +00:00
Martin Pool
3b4b1984ef Update version message to mention batch files. 2001-08-14 02:08:17 +00:00
Martin Pool
6902ed178b Merge across rsync+ patch; add a little documentation to the manpage. More documentation would be better. 2001-08-14 02:04:47 +00:00
Martin Pool
fab9a9c547 Another try at socklen_t: just check for it, and otherwise use int.
The HP manual says this will work on old HP/UX versions; I'm not sure
about other systems.  Possibly it will break on old BSD-derived
systems with 32-bit int, 64-bit size_t and no socklen_t, if there are
any such.
2001-08-08 10:04:40 +00:00
Andrew Tridgell
376acbfad5 don't need to lookup our own name in open_socket_in() 2001-08-08 08:55:24 +00:00
Martin Pool
12458878c2 Try various different types as replacements for socklen_t until we
find one that works.  This helps on platforms like HP/UX and UNICOS
where the argument to getsockopt is neither socklen_t nor int.
2001-08-08 08:11:50 +00:00
Martin Pool
546434f867 Two more instances of socklen_t. 2001-08-06 12:31:23 +00:00
Martin Pool
ac2a1a449d Use socklen_t if defined, or otherwise int. This tries to fix
warnings on platforms (e.g. AIX) where this type is defined and not
int.
2001-08-06 12:27:04 +00:00
Martin Pool
e1bd49d6f3 Try to fix "infinite loop" warning on AIX and other compilers. (We
exit on a signal.)
2001-08-06 12:25:45 +00:00
Martin Pool
ab94af5c6f Correct over-zealous edit for UNICOS. 2001-08-06 12:23:50 +00:00
Martin Pool
c88ca682ef Fix for UNICOS CC: first argument to readlink must not be const, or we
get an error.
2001-08-06 12:16:20 +00:00
Martin Pool
fc990e81cb Document autoconf updates. 2001-08-06 08:51:48 +00:00
Martin Pool
e2ba16ccea Fix check for ino_t to work with both autoconf2.50 and autoconf2.13. 2001-08-06 08:49:19 +00:00
Martin Pool
76d4988d06 Fix m4 quoting to make autoconf2.50 happy. I checked it still works
on 2.13.  See "info:(autoconf)New Macros".
2001-08-06 08:41:13 +00:00
Martin Pool
25ea348bd1 Summarize all the changes since 2.4.6 so we have them in one place. 2001-08-06 04:31:05 +00:00
Andrew Tridgell
8ca5756339 updated config scripts from subversion 2001-07-22 02:39:06 +00:00
Andrew Tridgell
029c171330 reap children in sigchld handler 2001-07-17 10:48:31 +00:00
Andrew Tridgell
8f04bb36e7 prevent nasty error msgs when listing shares 2001-07-17 10:45:54 +00:00
Andrew Tridgell
b7334b4c31 removed remnant test code for cray 2001-06-28 05:07:15 +00:00
Andrew Tridgell
a7f8404ecd fixed md4 on 64 bit boxes 2001-06-26 03:09:14 +00:00
Andrew Tridgell
6c65e14634 applied simple nohang patch from Wayne Davison 2001-06-26 01:20:42 +00:00
David Dykstra
ddd491d45e Improve the description of --with-default-rsync. 2001-06-22 20:36:43 +00:00
Andrew Tridgell
5d78a10232 allow shell wildcards in auth users lines 2001-06-22 10:16:04 +00:00
Martin Pool
4d66e00afa If binding to a low-numbered port fails with EACCES, then the error
message should explain that you probably need to be root.

(Why leave off the final S?  Kernighan must have been a *really* slow
typist.)
2001-06-21 06:19:00 +00:00
Martin Pool
531d06b824 Fix from Wayne Davison:
The --cvs-exclude option is broken in the CVS version of rsync
  because of a cut-and-paste-induced bug in exclude.c:

  This bug could cause the sending rsync to crash when it dereferenced
  a NULL pointer.
2001-06-21 06:15:34 +00:00
David Dykstra
c6a7f2f48a Simplify the --with-rsync-path option implementation. Can directly pass
the double-quotes to AC_DEFINE_UNQUOTED instead of having a separate step.
2001-06-13 16:47:22 +00:00
David Dykstra
d4e4cbe105 Use 3rd parameter in AC_DEFINE and AC_DEFINE_UNQUOTED to avoid having to
manually put the defines into acconfig.h.
2001-06-12 21:35:26 +00:00
David Dykstra
41bd28fee3 Add --with-rsync-path option. 2001-06-12 19:33:41 +00:00
David Dykstra
a1a440c23e Make --whole-file the default when source and target are on the local machine. 2001-05-29 14:37:54 +00:00
David Dykstra
089e73f8d6 Ran rsync.yo through yodl2man to produce rsync.1. I found that the string
"file(s)" in rsync.yo was being improperly translated by yodl2man so I
changed it to just "files".
2001-05-24 18:01:56 +00:00
David Dykstra
2c5548d25e Add --ignore-errors documentation. 2001-05-22 14:33:38 +00:00
Andrew Tridgell
65c2a918d4 forgot 1 place that used slprintf 2001-05-07 08:59:48 +00:00
Andrew Tridgell
8950ac03f8 imported new snprintf.c from samba, got rid of slprintf 2001-05-07 06:59:37 +00:00
Andrew Tridgell
26ef00bd3c no space after -I or Tru64 barfs 2001-05-06 13:25:11 +00:00
Andrew Tridgell
efe3037cf5 use _S_IFLNK not S_IFLNK 2001-05-02 11:13:21 +00:00
Andrew Tridgell
f62c17e378 use mkstemp on systems where it is secure 2001-05-02 08:33:18 +00:00
Andrew Tridgell
0f62178580 better pid file location 2001-05-02 05:05:12 +00:00
Andrew Tridgell
81c99202d3 use %.0f instead of %ld 2001-04-13 12:25:19 +00:00
David Dykstra
3473b5b4d8 Add the words "on destination machine" to the --compare-dist description
in rsync.yo.  Re-ran yodl2man which I see pulled in a few other changes
from rsync.yo that hadn't yet made it into rsync.1.
2001-03-23 15:12:52 +00:00
Andrew Tridgell
ba35824322 "rsync error" is better than "transfer error", especially for -h 2001-03-23 03:46:56 +00:00
Andrew Tridgell
6afe7f23b0 got rid of dependency on alloca in popt 2001-03-23 03:44:50 +00:00
Andrew Tridgell
19b27a485e improved error handling again. Now we report messages for the remote
shell failing and propogate errors in a better fashion
2001-03-23 01:26:04 +00:00
Andrew Tridgell
ff81e809f4 new error handling system
we now give a non-0 exit code if *any* of the files we have been asked
to transfer fail to transfer
2001-03-22 07:36:51 +00:00
Andrew Tridgell
fd2dd2aa23 better error msg for "invalid uid" and "invalid gid" 2001-03-21 23:44:48 +00:00
Andrew Tridgell
82ed910630 i hate makefiles that automatically run configure
:)
2001-03-21 23:36:23 +00:00
Andrew Tridgell
90ba34e27c I came up with a new way of avoiding the error handling lockup bug in
rsync. It isn't pretty, but it does work and should completely avoid
that class of lockup.
2001-03-21 13:12:44 +00:00
Martin Pool
8ee3d639b2 Check for alloca.h and mcheck.h, as included popt needs to know about
them.
2001-03-20 05:26:27 +00:00
Martin Pool
0c5a792ac7 Oops, fix edit mistake. 2001-03-19 08:19:11 +00:00
Martin Pool
2af27ad9aa More accurately, the uid/gid is set to -2, not "nobody". 2001-03-17 01:35:59 +00:00
Martin Pool
3b2b534567 Add some todo comments. 2001-03-17 01:34:22 +00:00
Martin Pool
3fa64fd008 Don't unconditionally define _LARGEFILE_SOURCE, but instead include
some autoconf-2.13 macros that make the appropriate settings.  Thanks
to Albert Chin <china@thewrittenword.com> and Paul Eggert
<eggert@twinsun.com>.
2001-03-17 01:06:34 +00:00
Martin Pool
b557c4c7eb Define _LARGE_FILES to turn on LFS support on AIX (and some others?).
See http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/genprogc/prg_lrg_files.htm

Thanks to Todd Willeat <TWilleat@MHP.SMHS.com>
2001-03-16 05:23:33 +00:00
Martin Pool
0882faa2b2 Doc. 2001-03-16 02:11:53 +00:00
Martin Pool
3cd5eb3b3b Add my name and a suggestion to read the FAQ for unanswered questions. 2001-02-27 01:49:19 +00:00
Martin Pool
4ff3d9d6b4 Explain that the mktemp warning is harmless.
If the autoconf inputs are changed, then try to reconfigure.  Don't
worry if we can't do it, though.
2001-02-27 01:46:34 +00:00
Martin Pool
26c08b6c21 Add some brief notes on how to install. 2001-02-24 01:45:21 +00:00
Martin Pool
4db4149283 popt-1.5 is const-correct. 2001-02-24 01:39:19 +00:00
Martin Pool
1ac15cd8ad Upgrade from including popt1.2 to a version of popt1.5 trimmed down to
include only source and build from our Makefile.
Don't scan for libpopt if we're using our own; this makes
autoconf confused.
2001-02-24 01:37:48 +00:00
Martin Pool
b348deae3d Upgrade from popt 1.2 to a cut-down 1.5 2001-02-24 01:32:22 +00:00
Martin Pool
18c71e96f8 Doc. 2001-02-23 01:45:46 +00:00
Martin Pool
f0f5767f15 Change from getopt to popt -- requires const-correctness on arguments. 2001-02-23 01:44:56 +00:00
Martin Pool
15b7b73d7d Change from getopt to popt.
Add comments.
Show listening port number in startup log message.
2001-02-23 01:44:04 +00:00
Martin Pool
e420b9d854 Change from getopt to popt.
Add comment.
2001-02-23 01:02:55 +00:00
Martin Pool
2855f61f4a Change from getopt to popt.
Include more details in --version output: say whether symlinks and
hardlinks are supported.
When hardlink support is missing, explain whether the problem is on
the client or server.
When a bad option is encountered, don't just print it to stderr but
send it to the rsync log mechanism.  (However, server errors currently
seem to get lost in transit because of bugs in logging.)
2001-02-23 01:02:31 +00:00
Martin Pool
2d1ebe9c72 Change from getopt to popt.
Automatically build included libpopt if there is none on the system,
or if --with-included-popt is specified.
Add --enable-debug.
2001-02-23 00:48:11 +00:00
Martin Pool
c485a357cc Change from getopt to popt.
Automatically build included libpopt if there is none on the system.
2001-02-23 00:47:09 +00:00
Martin Pool
5013576705 Change from getopt to popt. 2001-02-23 00:45:07 +00:00
Martin Pool
8886f8d0e6 Add comments.
Better error message in the case of eof on read_timeout.
2001-02-22 13:02:39 +00:00
Martin Pool
fcb6d28d0b Note about multiplexing. 2001-02-22 13:01:27 +00:00
Martin Pool
62402cb14b Check in built-in copy of libpopt in preparation for switching
from getopt
2001-02-22 13:01:09 +00:00
Martin Pool
305ab1331b Doc. 2001-02-21 08:25:07 +00:00
Martin Pool
8212336aaa More explanation of return values. 2001-02-21 08:16:45 +00:00
Martin Pool
3e3dcd624f Better message grammar. 2001-02-21 07:18:50 +00:00
Martin Pool
b30b3bb899 Call this 2.4.6dev so that we don't get bug reports claiming to be
about 2.4.6.
2001-02-14 22:59:03 +00:00
Martin Pool
55b64e4b5e Add table of exit values, from errcode.h. 2001-02-14 22:47:28 +00:00
Martin Pool
e411463442 Document shortcoming of "unrecognised option" message. 2001-02-08 03:28:19 +00:00
Martin Pool
660c6fbdaa Include strerror message when there's a socket error. 2001-01-08 10:25:00 +00:00
Martin Pool
ce6c7c6318 Improved error message. 2001-01-08 03:39:53 +00:00
Martin Pool
fa994de488 Ignore generated files that are not stored in CVS. 2001-01-08 03:39:32 +00:00
Martin Pool
2348926995 Typo fix from Jim Meyering 2001-01-08 01:10:58 +00:00
David Dykstra
735a816e54 Better explain how the --blocking-io option works. 2001-01-05 17:57:11 +00:00
Martin Pool
a1b1b1da46 Add comments. 2000-11-15 05:53:45 +00:00
Martin Pool
c3563c46ed Doc. 2000-11-15 03:16:06 +00:00
Martin Pool
0c80cd8ee9 In --version, say whether we have socketpair() or not 2000-11-10 03:41:47 +00:00
Martin Pool
b79f79e3aa Ignore dummy output file 2000-11-10 03:41:17 +00:00
Martin Pool
af642a61b3 If an error occurs, print an explanatory string rather
than just an RERR code.
2000-11-10 03:28:15 +00:00
Martin Pool
ef1aa91039 Doc. 2000-11-10 03:17:08 +00:00
Martin Pool
1960e2280c Drop dead variable. 2000-11-09 09:45:19 +00:00
Martin Pool
7c1b4daa6f Document getsockopt POSIX confusion. 2000-11-09 09:27:34 +00:00
Martin Pool
7a24c346b0 Print a warning message in the version if the platform cannot support 32-bit ints 2000-11-09 09:05:14 +00:00
Martin Pool
64c2cf8fea Better error messages 2000-11-09 09:02:16 +00:00
Martin Pool
81d538ce23 Better error messages when unlink fails 2000-11-08 09:45:16 +00:00
Martin Pool
e327acece4 Better error messages when unlink fails 2000-11-08 09:32:11 +00:00
Martin Pool
4e40377ac2 Better error messages when unlink fails 2000-11-08 09:32:10 +00:00
Martin Pool
eeb1568fd5 Correct license name. Note new address of pserver. Correct documentation. 2000-11-02 11:38:13 +00:00
Martin Pool
0ba481368c Add some comments. 2000-11-02 11:37:34 +00:00
Andrew Tridgell
38bf526fc5 fix bug in handling of : 2000-10-31 10:59:50 +00:00
Martin Pool
bc363ea983 Display a warning about pointlessly using --rsh with clientserver mode. 2000-10-31 01:05:42 +00:00
Martin Pool
84f69dad19 Draft documentation of the client-server protocol. 2000-10-26 08:05:36 +00:00
Martin Pool
4a13b9d57a Print strerror when a system error occurs; add a new function rsyserr
to do this.  This is not used in every case yet -- I've just changed a
few cases that were causing trouble.  Please convert others as you see them.
2000-10-26 07:31:29 +00:00
Martin Pool
a039749b4c Print strerror when a system error occurs; add a new function rsyserr
to do this.  This is not used in every case yet -- I've just changed a
few cases that were causing trouble.  Please convert others as you see them.
2000-10-26 07:24:18 +00:00
David Dykstra
15b84e142a Make sure the log file is always opened before root privileges (if any)
are given up.
2000-10-25 19:57:42 +00:00
David Dykstra
45a8354004 When running as --daemon in the background and using a "log file" rsyncd.conf
directive, close the log file every time it is open when going to sleep on
the socket.  This allows the log file to get cleaned out by another process.
2000-10-24 18:50:08 +00:00
Andrew Tridgell
c32d024071 don't clobber argv[0], so ps shows the right thing 2000-10-19 00:47:48 +00:00
David Dykstra
205c27ac67 Add note in "secrets file" section to see "strict modes". 2000-10-13 13:49:31 +00:00
Martin Pool
f5c2081302 Clear up conditions for running as root. 2000-10-13 03:28:12 +00:00
Martin Pool
e6c64e7933 Oops: manpage updates should go into the yodl source. 2000-10-13 03:25:07 +00:00
Martin Pool
a036580649 Quick list of things to do. 2000-10-11 00:57:27 +00:00
Martin Pool
796d484b44 Clearer "nothing to do" message. 2000-10-10 01:26:55 +00:00
Martin Pool
1f52f4c407 Get rid of const modifiers; they're problematic with old compilers. 2000-10-09 03:48:47 +00:00
Martin Pool
d567322fbc include/exclude cluestick: with -vv, print out whether files are
included or excluded and why.
2000-10-09 03:46:38 +00:00
John H Terpstra
3ff1e677a1 Added provision for packaging for Linux Standards Base compliant Linux systems. 2000-09-11 18:04:35 +00:00
Andrew Tridgell
ef325f0cf4 neater getconf test 2000-09-06 07:15:37 +00:00
rsync-bugs
3d8810c928 preparing for release of 2.4.6 2000-09-06 02:47:00 +00:00
Andrew Tridgell
d153974ee2 README update 2000-09-06 02:39:45 +00:00
Andrew Tridgell
5b56cc19fb added --modify-window option from David Bolen <db3l@fitlinxx.com> 2000-09-06 02:12:13 +00:00
Andrew Tridgell
c48b22c858 minor man page update 2000-09-06 01:27:46 +00:00
Andrew Tridgell
65d0a49f5c removed spurious error message 2000-09-06 00:48:52 +00:00
Andrew Tridgell
6a48ca56eb added LFS support for Solaris 8 2000-09-05 23:21:27 +00:00
Andrew Tridgell
a20aa42ac4 a simple fix to the memory problems with the string pool patch. The
string pools conflict with the lastdir memory saving tricks.
2000-08-31 23:01:28 +00:00
Andrew Tridgell
e92ee12893 make sure we don't chew too much CPU when the outgoing fd is full 2000-08-29 05:07:08 +00:00
Andrew Tridgell
5c66303ad6 some string_area cleanups 2000-08-29 04:47:39 +00:00
Andrew Tridgell
27e3e9c906 detect list_only a bit earlier 2000-08-29 04:46:50 +00:00
Andrew Tridgell
f0b36a48c8 the 2nd half of the hack 2000-08-29 04:46:27 +00:00
Andrew Tridgell
25cf88936f a hack to make listing remote sites (by leaving off a target) more
useful
2000-08-29 04:45:49 +00:00
Andrew Tridgell
ae682c3e11 got rid of some unused variables 2000-08-19 15:25:05 +00:00
rsync-bugs
99994aef3e preparing for release of 2.4.5 2000-08-19 13:10:57 +00:00
Andrew Tridgell
78043d1969 man page updates 2000-08-19 13:04:48 +00:00
Andrew Tridgell
43e46b4cf6 allow 0.0.0.0/0 syntax in hosts allow/deny
patch from Charles Levert <charles@comm.polymtl.ca>
2000-08-19 13:04:29 +00:00
Andrew Tridgell
9ec16c83be added msleep() function 2000-08-19 12:53:51 +00:00
Andrew Tridgell
a24c687094 sleep for a smaller time while waiting for a process to exit 2000-08-19 12:53:24 +00:00
Andrew Tridgell
60cb2f9016 added "ignore nonreadable" option (useful for hiding files in public archives) 2000-08-19 12:53:00 +00:00
Andrew Tridgell
ac1a0994b6 added an explicit noexcludes flag to make_file()
this fixes a bug with --backup-dir and -x

added "ignore nonreadable" option (useful for hiding files in public archives)
2000-08-19 12:52:39 +00:00
Andrew Tridgell
f2cbf44ba5 added an explicit noexcludes flag to make_file() 2000-08-19 12:51:26 +00:00
Andrew Tridgell
dab552237e I don't like automatic header dependencies 2000-08-19 12:51:00 +00:00
Andrew Tridgell
2201ba580e added MacOS support to config.guess (from wsanchez@apple.com) 2000-08-19 12:09:52 +00:00
Andrew Tridgell
b7c33e3bde fixed backup_dir bug introduced with recent memory handling patches 2000-08-19 11:06:04 +00:00
Andrew Tridgell
82980a2384 fixed timing problem with cleanup and io_flush() by using non-blocking
waitpid()
2000-08-16 08:34:18 +00:00
David Dykstra
b6a30afc98 Undo last setting of blocking_io. I hadn't reviewed the code well enough;
turns out that when client is talking to a server daemon it never executes
this leg of code.  Oops.  The people who said it made a difference when
they changed the code must have been wrong.
2000-08-04 21:26:17 +00:00
David Dykstra
ed91f3e418 Turn on blocking_io when starting client of rsync server daemon. 2000-08-04 21:18:23 +00:00
David Dykstra
60c8d7bc7f Enable --compare-dest to work in combination with --always-checksum.
Problem and suggested patch from Dean Scothern dino@cricinfo.com (although
I re-wrote the patch).
2000-08-04 21:11:46 +00:00
rsync-bugs
5783c065ba preparing for release of 2.4.4 2000-07-29 05:05:38 +00:00
Andrew Tridgell
adc19c987b fix from T.J.Adye@rl.ac.uk for final goodbye message with new protocol 2000-07-29 04:58:24 +00:00
Andrew Tridgell
3d38277706 optimisations from Rich Salz <rsalz@caveosystems.com> 2000-07-29 04:52:05 +00:00
Andrew Tridgell
64c704f0b9 added blocking-io docs 2000-07-29 04:41:19 +00:00
Andrew Tridgell
69c6522734 added *.bz2 and *.tbz to default dont compress list 2000-06-24 13:20:21 +00:00
Andrew Tridgell
0f8f98c8ff added insure debug support 2000-06-24 13:19:53 +00:00
Andrew Tridgell
e384bfbdcb if the remote shell is rsh then use blocking IO 2000-06-24 13:19:25 +00:00
Andrew Tridgell
08e5094d7f added some comments on blocking-io 2000-06-23 13:54:29 +00:00
Andrew Tridgell
4b3977bf00 get rid of annoying symlink error messages 2000-06-23 13:54:08 +00:00
Andrew Tridgell
c80ccabb0c added --blocking-io option 2000-06-23 13:50:18 +00:00
David Dykstra
ef5d23ebcd Add --bwlimit option contributed by Matthew Demicco and Jamie Gritton. 2000-06-06 21:13:05 +00:00
David Dykstra
27b9a19be0 Do better job at describing exclude/include in man page. Based on suggestions
from Harry Putnam <reader@newsguy.com>.
2000-05-19 14:58:28 +00:00
Andrew Tridgell
14175f1e77 fixed bug in replacement inet_aton() 2000-04-19 05:49:15 +00:00
Andrew Tridgell
269833af78 test was the wrong way around 2000-04-19 05:44:43 +00:00
Andrew Tridgell
fca3ef06cd autoconf test for broken solaris inet_aton() 2000-04-19 05:33:39 +00:00
Andrew Tridgell
07a14ef8b2 by default don't gzip .iso images 2000-04-19 05:33:06 +00:00
rsync-bugs
21cde2888c preparing for release of 2.4.3 2000-04-09 02:53:57 +00:00
Andrew Tridgell
4a7481889c use 1 second sleeps in the sleep loop as some OSes (NT for example)
don't get interrupted during a sleep.
2000-04-09 02:32:57 +00:00
Andrew Tridgell
0adb99b9dc don't pprint the IO timeout message if we are a server or daemon (can
cause recursive error messages)
2000-04-09 02:32:18 +00:00
Andrew Tridgell
36349ea0be a very simple fix - if I'd only thought if it last week :)
rsh relies on stdin being blocking
ssh relies on stdout being non-blocking

what we've done before is to set both stdin and stdout to either
blocking or non-blocking. Now I set stdin to blocking and stdout to
non-blocking. This seems to fix all cases I've tested.
2000-04-09 02:16:42 +00:00
rsync-bugs
ec3f7d1b61 preparing for release of 2.4.2 2000-03-30 14:24:37 +00:00
Andrew Tridgell
f0359dd00d went back to non-blokcing IO
it looks like ssh is willing to accept a non-blocking fd when used as
a transport, this seems to avoid the Solaris socketpair bug
2000-03-30 14:15:00 +00:00
Andrew Tridgell
ef55c686bc add a --ignore-errors option 2000-03-21 04:06:04 +00:00
David Dykstra
5f7ce2041c Describe symbolic link handling when writing to a "use chroot = no" module. 2000-02-25 17:02:45 +00:00
David Dykstra
328fcf113a Somebody was confused into thinking that "Here are some examples" in the
section on exclude/include was supposed to be about "+/-" so I changed
the statement to "Here are some exclude/include examples".
2000-02-22 19:47:44 +00:00
David Dykstra
24c857f1de Change socketpair test to verify that it works rather than just exists,
because I have an obscure system (Amdahl's UTS 2.1.2) in which socketpair()
exists but is broken.
2000-02-22 15:55:40 +00:00
David Dykstra
a784e10d00 Move the checking for -lsocket -lnsl ahead of the checking for most of
the functions, especially "socketpair" so that socket-related functions will
be properly discovered on SVR4-based systems such as Solaris.  Problem
discovered by Kenji Miyake <kenji@miyake.org>
2000-02-15 22:44:18 +00:00
rsync-bugs
7eb6bf0397 preparing for release of 2.4.1 2000-01-30 01:02:59 +00:00
Andrew Tridgell
49d6fdc036 patch from Jim Delahanty <mail_us@swbell.net> to ensure files are
deleted after being backed up in a rename operation
2000-01-30 00:56:43 +00:00
Andrew Tridgell
8b35435f7c another hang-at-end fix. It looks like we are more sensiitive to
these with socketpairs. The receiver now sleeps until it gets a signal
to tell it to exit

also fixed test.sh to use the current version remotely
2000-01-30 00:50:19 +00:00
Andrew Tridgell
8ada751890 damn.
with the new error handling code it is possible for rsync to get stuck
on the final transaction, leaving it hung.

looks like 2.4.1 will be pretty soon
2000-01-29 23:49:36 +00:00
rsync-bugs
1a52e84874 preparing for release of 2.4.0 2000-01-29 11:35:39 +00:00
Andrew Tridgell
53c5cbed23 change version to 2.4.0pre2 2000-01-29 05:25:53 +00:00
Andrew Tridgell
4a81463880 use full buffer length, not strlen 2000-01-29 05:16:13 +00:00
Andrew Tridgell
09b7f5dbb1 move the read only daemon test to after the protocol setup 2000-01-29 05:02:23 +00:00
Andrew Tridgell
6d7b6081ac damn!
the last pre-release had a bug that didn't setup the multiplexing
correctly. This means that pre-release will get "unexpected tag -7"
whenm talking to the fixed code.
2000-01-29 04:50:01 +00:00
Andrew Tridgell
31b7d79afe I've decided that this release will be 2.4.0, updated version to 2.4.0pre1 2000-01-29 03:11:07 +00:00
Andrew Tridgell
b2999e457f don't need PIPE_BUF any more 2000-01-29 02:56:36 +00:00
Andrew Tridgell
0f3203c312 fixed some logcode warnings 2000-01-29 02:49:03 +00:00
Andrew Tridgell
a2edb26cd6 fixed a bug in test suite that I introduced yesterday 2000-01-29 02:39:52 +00:00
Andrew Tridgell
9bec528606 runtime detect fnmatch() bug if ** is used.
its all too common to compile with a working libc and run on a broken
one.
2000-01-29 02:35:01 +00:00
Andrew Tridgell
2f0e3b30a9 changed version to 2.3.3pre2 2000-01-28 15:35:08 +00:00
Andrew Tridgell
ff41a59f58 - switched on multiplexing for all connections, not just daemon
connections (this fixes the stderr/stdout problem). Upped
  protocol version for backward compat
- use multiplexing on error fd
- upped minimal protocol version
- got rid of some ugly code in the write buffering
2000-01-28 15:29:59 +00:00
Andrew Tridgell
08f15335b5 switch to using socketpair instead of pipe if possible. This fixes the
ssh clag problems as long as you also fix the same problem in sshd

removed all the old read buffering code from io.c as this was only
there to try to reduce the chance of clagging up sshd.
2000-01-28 12:37:58 +00:00
Andrew Tridgell
bd36966bed report exit code when failing a test 2000-01-27 04:54:02 +00:00
Andrew Tridgell
f76933b149 fixed the error code problem with test.sh
(was a minor bug in send_file_list)
2000-01-27 04:53:39 +00:00
Andrew Tridgell
378a074c82 patch from James Delahanty <jimd@gie.com> to make --backup-dir work
cross-filesystem
2000-01-27 02:45:56 +00:00
Andrew Tridgell
c36cd31713 the convoluted nest of #ifdefs that is fnmatch.c caught us again. On
my system the LIBC tests meant it never compiled and we used the
broken system one.

hacked it so it does compile
2000-01-25 14:17:21 +00:00
Andrew Tridgell
5e12ce1186 fix segv bug in --progress handling 2000-01-25 13:16:42 +00:00
Andrew Tridgell
166aa72332 patch from David Murn to make sure the final 100% is always printed
when using --progress
2000-01-25 06:39:33 +00:00
Andrew Tridgell
f9f6184f38 updated version.h 2000-01-25 01:33:05 +00:00
Andrew Tridgell
f625af9400 updated config.guess from latest autoconf CVS tree 2000-01-24 13:12:20 +00:00
Andrew Tridgell
fc7952e7f3 updated --password-file docs 2000-01-24 12:28:45 +00:00
Andrew Tridgell
cbce490e13 reinstated the MAX_READ_BUFFER code. Its a nasty tradeoff - using lots
of memory vs. ssh bugs. uggh.
2000-01-24 12:23:39 +00:00
Andrew Tridgell
74a7f81d57 updated a debug message 2000-01-24 12:22:58 +00:00
Andrew Tridgell
5b5591d8a8 make the replacement inet_aton() function independent of
inet_addr(). Some systems were detecting a missing inet_aton(), but
actually had it and inet_addr() called it, causing infinite recursion
2000-01-24 12:02:44 +00:00
Andrew Tridgell
c55f70218c fixed a rare SEGV that can happen when a file disappears (due to
another program) during an update
2000-01-24 11:41:08 +00:00
Andrew Tridgell
6957ae33a9 moved file deletion to before the fork() to prevent a race condition
pointed out by byrnes@curl.com
2000-01-24 11:20:25 +00:00
Andrew Tridgell
8a5d6bba09 don't use stderr after we become a daemon 2000-01-24 09:19:44 +00:00
Andrew Tridgell
1d2c275fff I can't believe it - solaris allows unlink of a non-empty directory as
root, leaving a corrupt filesystem. Are those guys on drugs?

try to avoid the problem as best we can.
2000-01-24 09:13:39 +00:00
Andrew Tridgell
d0fd26aa16 added some more debug info to the "buffer overflow in
receive_file_entry" message
2000-01-24 08:16:57 +00:00
Andrew Tridgell
e20c5e9521 -a now implies -o and -D whether you are root or not 2000-01-24 05:52:44 +00:00
Andrew Tridgell
66203a982b added --backup-dir option from Bob Edwards
this is very useful for incremental backups
2000-01-24 04:58:53 +00:00
Andrew Tridgell
b315601ce0 removed Daves include-only optimisation. One of the bug reports turned
out to be caused by it and it seems rather a lot of extra effort for
what must really be a minor optimisation in most cases
2000-01-23 13:16:30 +00:00
Andrew Tridgell
5f808dfbd7 fix a problem with files > 2GB
(thanks to T.J.Adye@rl.ac.uk)
2000-01-23 12:30:34 +00:00
Andrew Tridgell
0b73ca12fa added --max-delete option 2000-01-23 11:43:04 +00:00
Andrew Tridgell
03e2d0e329 fixed mdfour code on Cray (64 bit problems)
Thanks to roebel@kgw.tu-berlin.de
2000-01-23 11:26:10 +00:00
Andrew Tridgell
182517e692 removed u_sleep() as it is no longer used anywhere 2000-01-23 07:38:20 +00:00
Andrew Tridgell
554e0a8dd0 added some really ugly code to allow errors to propogate to
clients when writing to a rsync server

it works like this:

- we have an extra pipe from the receiver to the generator
- the server always runs with multiplexing on
- errors from the generator go down the multiplexed connection
- errors from the receiver go over the pipe, and from there to
  the multiplexed conn

it required some incredibly ugly code. damn.
2000-01-23 07:36:56 +00:00
Andrew Tridgell
b0f3f5784c open on paths starting with // fails on win32 2000-01-23 03:00:27 +00:00
Andrew Tridgell
3060d4aa1d handle systems that don't take a 2nd argument to gettimeofday() 2000-01-23 02:16:51 +00:00
Andrew Tridgell
1347d5126a added --existing option, similar to one suggested by Gildas Quiniou <gildas@stip.fr> 2000-01-23 01:53:18 +00:00
Andrew Tridgell
5d1e1dcf4b don't try to write errors to a dead socket 2000-01-23 01:11:43 +00:00
David Dykstra
74f5442401 Make all the rsync objects dependent on all the header files except the
zlib header fiels in Makefile.in.  I've been burned several times because
objects did not get rebuilt when header files changed.
2000-01-10 22:39:45 +00:00
David Dykstra
c08bb0fb73 Needed to comment out the inclusion of headers in fnmatch.c because it
couldn't find some of them (especially <fnmatch.h>, because it wasn't
looking in the current directory).  The header files are included better
from ../rsync.h.
2000-01-10 20:36:20 +00:00
Andrew Tridgell
e30f065766 make --address work for a client connecting to a server 2000-01-10 04:49:51 +00:00
David Dykstra
9dce9b45b3 Upgrade lib/fnmatch.[ch] to the latest from glibc-2.1.2 because the
FNM_PATHNAME flag (to stop at slashes in path names) was not working.

Ironically, the bug in glibc's fnmatch was reported on the rsync mailing
list in late October, and rsync's configure.in was changed to detect the
bad glibc and use the internal fnmatch, but the internal fnmatch was based
on the same buggy glibc!
2000-01-07 17:58:44 +00:00
David Dykstra
60be6acf46 If a destination file cannot be opened, pretend it doesn't exist rather
than skipping it and thus not updating it.  For example, the ownership or
mode on a file may prevent opening it, but the directory may still be
writable so the file could be completely replaced.
2000-01-06 16:15:36 +00:00
Andrew Tridgell
a5827a28d2 when we do a lchown() on a file we have to flush the cached perms on
the file if the file has the setuid or setgid bits set as the chown
has a side effect of removing the setuid and setgid bits.
we re-do the stat in this case
2000-01-06 00:26:00 +00:00
David Dykstra
dcc875e41e Define the WEXITSTATUS macro for systems that don't have it. 1999-12-29 21:11:57 +00:00
David Dykstra
128cf58433 When writing to a daemon with read only = false and uid = root and -g,
was not preserving group permisions.  Bug was introduced March 1 in
version 1.100 of rsync.c with an error in re-ordering of the boolean
expressions.  In order to completely preserve the earlier semantics,
change_gid should depend on "(am_root || !am_daemon)", but I don't see why
group ownership should behave differently in a non-root daemon.
1999-12-29 20:50:48 +00:00
David Dykstra
7e0ca8e2f0 When not using -p and file being copied to already existed, was mistakenly
using all the mode bits of the existing file rather than just the permissions,
including the file type.
1999-12-29 20:45:23 +00:00
Andrew Tridgell
d79d1c69f7 fixed a bug with waitpid() - I'd forgotten about WEXITSTATUS ! 1999-12-09 06:46:11 +00:00
Andrew Tridgell
a7d068abff fixed man page typo 1999-12-03 04:24:25 +00:00
Andrew Tridgell
7f931a0002 fixed a segv bug when handling symlinks.
thanks to taver@otenet.gr
1999-12-02 05:50:09 +00:00
Andrew Tridgell
07b7c86c06 don't write more than PIPE_BUF bytes in any one write() in io.c
this makes sure that the write never blocks.
1999-11-23 08:43:16 +00:00
Andrew Tridgell
1f5c6343e6 removed old non-blocking fd code (a hangover from a earlier version of
io.c). Thanks to Theo for pointing out this brokenness.
1999-11-15 01:32:20 +00:00
rsync-bugs
290b615a16 preparing for release of 2.3.2 1999-11-08 13:15:48 +00:00
Andrew Tridgell
57df171bc0 added --delete-after option (suggested by Jason) 1999-11-08 13:03:05 +00:00
Andrew Tridgell
f08baea3dd removed ACCESSPERMS mask when transferring a file without perms
copy. This makes us match GNU cp more closely.
1999-11-08 10:47:14 +00:00
Andrew Tridgell
2fb139c11b fixed passing of directory exclude options to remote side (thanks to
andrewdagger@xerox.gbr.com)

added note about multiple excludes per exclude option
1999-11-08 09:12:42 +00:00
David Dykstra
3420c8e6e0 Fixed bug introduced by calling do_open() for O_RDONLY files. Changed it
so the check for dry_run and CHECK_RO are not done when flags is O_RDONLY.
Only do the adding of O_BINARY, which was the intention.
1999-11-04 15:43:38 +00:00
Andrew Tridgell
b17bc22bb3 added a replacement inet_aton() for systems that don't have it.
thanks to Dave for pointing this out.
1999-11-01 21:35:15 +00:00
Andrew Tridgell
3adffb52e6 forgot to commit the fnmatch.h changes 1999-11-01 21:25:39 +00:00
Andrew Tridgell
4df9f36841 solved the problem of not using the right permissions when
preserve_perms is off.
1999-10-31 04:28:03 +00:00
Andrew Tridgell
5c9730a46c added --address option for virtual hosting 1999-10-31 03:21:02 +00:00
Andrew Tridgell
d9fcc198cf added -P option
it is equivalent to --partial --progress
1999-10-31 02:47:30 +00:00
Andrew Tridgell
c831379436 updated test suite from Phil. 1999-10-31 02:39:34 +00:00
Andrew Tridgell
d73ee7b70e updated rsync-path man page entry 1999-10-31 02:37:21 +00:00
Andrew Tridgell
cda2ae84b3 added "ignore errors" option in rsyncd.conf 1999-10-31 02:19:24 +00:00
Andrew Tridgell
e7d6e0aa0c updated the configure test for fnmatch() to see if FNM_PATHNAME is
working correctly.
1999-10-27 13:17:16 +00:00
Andrew Tridgell
8c9fd200f9 use do_open() instead of open() in several places to help the WinXX port
and O_BINARY
1999-10-25 22:04:09 +00:00
David Dykstra
79f118d859 Minor change suggesting people put in the right path in inetd.conf.
Suggested by Roger Price <rprice@cs.uml.edu>
1999-10-19 17:50:39 +00:00
Andrew Tridgell
7b10f91d8f added a note about using -v with --progress 1999-09-06 02:04:20 +00:00
Andrew Tridgell
3d19b4c83e separated out the make_backup code in preparation for some patches
from Bob Edwards
1999-08-30 08:19:47 +00:00
David Dykstra
79452d4693 Add a couple clarifying points to the sanitize_path() comments.
One is a note that a leading "/" in a symlink target will not behave
exactly as if a chroot had occurred, but I decided it wasn't worth the
making it the same.

The other is note about an extra harmless trailing "." that is added under
some rare circumstances.
1999-07-09 17:07:59 +00:00
David Dykstra
cb13abfed0 Fix significant security holes with "use chroot = no" in an rsync daemon:
1. The file paths being sent and received were not "sanitized" to
	ensure that there weren't any ".." components that would escape the
	top level directory.  This can't happen with the standard rsync
	client, but it could be exploited on both read and write if someone
	modified an rsync client.  This fix sanitizes all incoming and
	outgoing paths when "use chroot = no".

    2. If a module is also "read only = no", clients could have created
	symbolic links with ".." components that would allow writing
	outside of the module.  This could happen with the standard rsync
	client.  This fix sanitizes all incoming symbolic link targets
	when "use chroot = no".

Previously, only top-level paths (anything passed in command line arguments)
were sanitized.  Sorry, I didn't think about the individual file paths
before now.
1999-07-09 15:49:46 +00:00
Andrew Tridgell
0503f06089 continue calling waitpid() while still reapingchildren (patch from
Matti Aarnio)
1999-06-27 04:12:12 +00:00
Andrew Tridgell
f855a7d01a fixed a bug that made us use only 16 bits of the file checksum when
comparing checksums for the --checksum (-c) option.
1999-06-26 01:06:38 +00:00
Andrew Tridgell
4c3b4b2557 added RSYNC_PROXY support from Stephen Rothwell. This allows access to
rsync servers via a web proxy (useful for getting through firewalls)
1999-04-13 03:53:30 +00:00
rsync-bugs
79b5aa09a0 preparing for release of 2.3.1 1999-04-06 15:09:28 +00:00
Andrew Tridgell
9bd6597666 set the exit code to RERR_FILEIO is io_error is set when we exit. This
catches most sorts of io errors and ensures we report a error in our
exit status.
1999-04-06 14:52:32 +00:00
Andrew Tridgell
6fe076b3d7 these aren't used any more 1999-04-06 14:17:44 +00:00
Andrew Tridgell
cec8aa7724 handle the case of an empty file list in get_local_name 1999-04-06 12:30:36 +00:00
Andrew Tridgell
4c36a13ef2 don't abort the server side if the file list is empty (perhaps because
all files have been excluded).
1999-04-06 12:28:54 +00:00
Andrew Tridgell
24986abd07 note in the man page that:
1) rsync won't copy directories at all if recursion isn't selected
2) --delete won't do anything if recursion isn't selected
1999-04-06 11:52:45 +00:00
Andrew Tridgell
8dfac376b5 fix the man page to reflect the fact that exclude options in
rsyncd.conf are not passed to the client and thus only affect the file
lists on the server.
1999-04-06 11:34:06 +00:00
Andrew Tridgell
e78733d975 fixed a nasty bug in the handling of "local_name" when setting the
permissions on directories after a transfer.
1999-04-06 10:56:18 +00:00
Andrew Tridgell
dffba35e01 quote RPM_OPT_FLAGS
patch from racke@linuxia.de
1999-04-06 10:27:34 +00:00
David Dykstra
bd4ed7f719 Small bug fix for the --compare-dest option: when a file's contents
hadn't changed but its permissions had, the file wasn't copied but
its permissions were attempted to be set anyway.  Made a change to
skip setting the permissions in that case.
1999-04-02 18:24:27 +00:00
David Dykstra
752eaba41f Backed out the change to create missing parent directories when using
--compare-dest.  It was due to an incomplete analysis of the problem,
sorry.  I left a comment in its place indicating that normally the
parent directories should already have been created.

It turned out to actually be a bug in nsbd in which it was not always
including all the parent directories in the include list like it was
supposed to.  The files themselves were still being sent but that was only
because my exclude_the_rest optimization was kicking in; if it weren't,
excluding the parent directories would have had the side effect of
excluding the files too.  So it really had nothing to do with the
--compare-dest option after all, just with the requirement that if you use
--exclude '*' you need to explicitly include all parent directories of
files you include.
1999-03-24 19:28:03 +00:00
David Dykstra
ad517ce5b3 The "pid file" was getting created mode 666, not applying the umask
because at that point in the program the umask is set to 0.  Now creating
the file with mode (666 & ~orig_umask).
1999-03-24 16:39:07 +00:00
David Dykstra
1f8413449d Fix bug with --compare-dest option where missing parent directories in the
target destination were not getting created.  There was a case in
receiver.c to do that but it was only getting invoked when the -R option is
specified, although I don't know why it was limited to that.

It's too bad I didn't get a chance to more fully test the use of
--compare-dest by my nsbd program before releasing rsync 2.3.0.  I'll
probably need to put a workaround in nsbd too until the next release
of rsync.
1999-03-23 22:20:10 +00:00
rsync-bugs
d0a7c8a487 preparing for release of 2.3.0 1999-03-15 21:23:26 +00:00
David Dykstra
ebb00c8e29 Changed the protocol version to 20 so that --stats will work without -v in
both directions.
1999-03-15 21:17:58 +00:00
David Dykstra
6543dc0c4c Fix typo in comment in rsync.h, suggested by bje@cygnus.com 1999-03-15 17:04:22 +00:00
David Dykstra
e459239d27 Make a special version number 2.3.0-beta for a short period because
I'll be encouraging extra testing before the release.
1999-03-12 21:45:37 +00:00
David Dykstra
651443a7ff Allow + and - in the "include" and "exclude" directives in rsyncd.conf.
Patch submitted by Damian A Ivereigh <damian@cisco.com>
1999-03-12 21:42:51 +00:00
David Dykstra
79fc6bdb45 Include a test for a working getopt_long because the one on some versions
of cygwin doesn't work.  Thanks to Martin Krumpolec <krumpo@pobox.sk> for
the patch.  At the same time, include cache checks in configure.in for a few
items that were missing the checks.
1999-03-12 18:21:53 +00:00
David Dykstra
245fbb5129 When -R is used, send the permissions of the original top directories to
the receiver even when not combined with -r.  Without this, the directories
were getting created mode 777 because the default umask on receivers is
often 00.
1999-03-12 17:36:52 +00:00
David Dykstra
c7c11a0d4c When a file cannot be deleted because of ETXTBSY (in particular, when an
executable is busy on HPUX), rename it instead to .rsyncNNN.  Most of
the code was submitted by Ketil Kristiansen <ketil-k@osc.no>
1999-03-11 22:17:42 +00:00
David Dykstra
c27f25922e Check for EINVAL from a rename error call in addition to ENOENT because
David Campbell <david@pastornet.net.au> reported that that helps data
be received onto a windows box running cygwin b19.
1999-03-09 21:55:16 +00:00
David Dykstra
af21c12fbc Add distclean target to Makefile.in. 1999-03-09 21:47:18 +00:00
David Dykstra
32b1f1de0e Update config.sub to the latest from automake in addition to config.guess. 1999-03-09 21:46:15 +00:00
David Dykstra
529e60864f Update config.guess from a new official GNU version.
I believe this is the latest, which comes with automake 1.4 (somebody
else is in charge of installing the GNU stuff on my system so I'm not
100% sure it's the absolute latest, but it was updated just a couple
weeks ago).
1999-03-05 16:37:44 +00:00
David Dykstra
972a3619c4 The change a couple days ago to create files initially without group and
other access resulted in group and other access being left off when the
'-p' option was not used.  This fixes it by reintroducing the ACCESSPERMS
mask and setting permissions to (file->mode & ACCESSPERMS) if preserve_perms
is off.  I decided to change the mask INITPERMMASK to INITACCESSPERMS at
the same time.  When preserve_perms is off, rsync is restored to the
previous behavior of having the permissions of the original file with the
umask and setuid/setgid bits shut off.

Also, I decided that a check for "(updated && (file->mode & ~ACCESSPERMS))"
is no longer needed since as far as I can tell that would have only affected
permissions when not running as root and when a chgrp was done to a group
the user was not a member of, using system V chgrp semantics.  This is no
longer allowed.
1999-03-04 21:48:52 +00:00
David Dykstra
8458724d25 Disable the optimization that treats include-only files as a special case
whenever delete_mode is on.  People reported problems when it kicked in
while using --delete and while using --delete-excluded.
1999-03-02 20:56:17 +00:00
David Dykstra
9422bb3fdf Change getgroups to use GETGROUPS_T as the type of the group array returned,
as calculated by the configure macro AC_TYPE_GETGROUPS.  Without that, it
doesn't work properly on systems like sunos 4 where gid_t is defined to
be an unsigned short but getgroups is defined to return an array of integers.
1999-03-02 16:42:46 +00:00
David Dykstra
5afd8aedce Change the mask used when creating temporary files from 777 to 700, to prevent
an obscure race-condition security hole where a file may for a short time
have the wrong group.  Could have used 707 instead but that's just too weird
of a permission.  The define name used to be ACCESSPERMS but that is defined
as 777 on Linux, so changed the name to INITPERMMASK.
1999-03-01 21:22:54 +00:00
David Dykstra
86692050b5 When comparing -1 to a group id, cast -1 with gid_t because on some systems
such as sunos4 gid_t is an unsigned short.  This prevented the just-added
non-mapped group test from working on sunos4.
1999-03-01 21:16:49 +00:00
David Dykstra
460f6b990a Prevent the -g option from preserving groups that a non-root receiver
does not belong to, in these two ways:
    1. If a group mapping doesn't exist for a group name, do not preserve
	it for a non-root receiver.  This is especially evident with the
	sender is a daemon using chroot because then no mappings are
	available.
    2. Before setting the group on a file make sure that it is in the list
	of groups returned by getgroups().  The same thing is done by chgrp
	on systems that support bsd-style chown/chgrp, and this enforces
	that it happens the same way on all systems.  Overhead is very
	little, especially since most systems don't allow more then 16
	groups per user.
1999-03-01 19:24:39 +00:00
David Dykstra
896bd482c0 Removed am_client variable. It was being set in one place, when a client
of a socket (that is, a --daemon) server, but never looked at.  The way to
test whether or not on a client is (!am_server).
1999-02-25 17:58:31 +00:00
David Dykstra
53f821f1e6 Fix a bug with rsync -R --delete from ./ as reported in PR#1532 1999-02-24 22:38:36 +00:00
David Dykstra
b33b791e6b Add --delete-excluded option to delete files on the receiving side that
are excluded.  Implies --delete.
1999-02-22 19:55:57 +00:00
David Dykstra
17d31b380b Changed --stats implementation to work without -v in only these two
situations:
    1. the client is the receiver of files.  Can't do it otherwise yet
	because without -v the bytes written from the sender's generator
	process will not be counted.
    2. both the remote and local protocol versions are >=20.  I did not
	change the protocol version yet because it is such a minor change
	that it isn't worth it, although I did test it with the protocol
	version set to 20.
If neither of the situations hold, it prints a message saying to use -v.
1999-02-18 17:23:44 +00:00
David Dykstra
a8b9d4edec Changed exclude/include matching so that normally wildcards will stop at
slashes.  The old behavior of crossing slashes can be achieved by using a
double-asterisk ('**') anywhere in a pattern.  Note that this can change
some existing exclude patterns in a subtle way.  Also note that if the
remote side is an older release the processing on the two sides might not
be exactly the same when there's no double-asterisk, which can affect which
files are excluded from deletion, but they're close enough that people will
probably not notice.  I considered changing the protocol version and
checking the remote_version number to ensure the same processing on both
sides, but the exclude patterns are pre-processed before the remote version
number is known and it's just not worth going through extraordinary efforts.
Suggested by Cameron Simpson <cs@zip.com.au>
1999-02-18 16:27:36 +00:00
Andrew Tridgell
f83f054875 added --size-only option. Useful when starting to use rsync after a
ftp based mirror system so that timestamps may not be right.
1999-02-18 03:48:24 +00:00
David Dykstra
15800c7e89 Changed man page documentation of --force to say it is hardly ever needed
any more except in very obscure cases.
1999-02-17 21:39:45 +00:00
David Dykstra
b531360763 Added --copy-unsafe-links option which is like --copy-links except it is
only for symlinks that point outside the source tree.  Suggested by Charles
Hines <chuck_hines@VNET.IBM.COM> in PR#1376.  Also apply the option to any
symbolic links in the source portion of a path when --relative is used,
as suggested by Francis Montagnac <Francis.Montagnac@sophia.inria.fr> on
the rsync mailing list in a message titled "New option: --copy-parent-links".
1999-02-17 19:34:40 +00:00
David Dykstra
b567933566 Be consistent on use of '=' on options that take a parameter. 1999-02-15 17:48:06 +00:00
David Dykstra
52d7d78865 Change the implementation of memmove in lib/compat.c to call bcopy instead
of memcpy because bcopy is guaranteed to work with overlapping memory and
memcpy is not.  Bug fix for PR#1584 in which log entries in the rsync
daemon log on Sunos 4.1.4 were garbled.
1999-02-12 17:27:22 +00:00
David Dykstra
23c5aef18e A slight compensation I had just added for total bytes read when using -v
was incorrect.  It's hard to tell how many bytes are actually read because
transferring the value changes it and depending on its value it may
transfer 4 or 12 bytes so instead change the sender side to not include the
length of the counters it sends at all (it had been including one but three
are sent).
1999-02-10 22:16:32 +00:00
David Dykstra
e19452a96c Allow --stats to work without -v. 1999-02-10 21:54:12 +00:00
David Dykstra
9ef5390714 Changed Usage in the rsync --help message to indicate how there can be
multiple SRCs.  Also moved the --suffix option to show up right after
--backup and included the default backup suffix and block size along with
their corresponding options rather than at the end.  Copied the new help
message to rsync.yo and README and used the Usage also in the SYNOPSIS
section at the top of rsync.yo rather than the different one that used
"path" instead of SRC and DEST.  That last change was inspired by a
suggestion from Michael Bleyer in PR #1523.
1999-02-10 19:33:05 +00:00
David Dykstra
fd0abefa43 Changed error message that just said "open %s: %s" to "cannot create %s: %s"
in receiver.c because it confuses people when they do something like
    rsync /etc/passwd /tmp/nonexistentdir/passwd
and it printed out something like
    open /tmp/noniexistentdir/.passwd.a004d5 : No such file or directory
Reported by kurt_granroth@pobox.com in PR #1253.
1999-02-10 18:44:25 +00:00
David Dykstra
19c14f987e Changed the optimized include mode (which kicks in when there are a series
of non-wildcard includes followed by an exclude of *) so that it will silently
ignore included files that don't exist rather than saying "No such file or
directory".  This is more like the behavior of the non-optimized include mode.
1999-02-10 18:03:59 +00:00
David Dykstra
122f19a615 Support '#' and ';' comments in exclude files. It would actually not
probably cause any harm if they were treated as normal exclude or include
patterns because they just wouldn't match anything, but it's better to
explicitly ignore them.  Suggested by David Holland <uholld1@lexis-nexis.com>
1999-02-09 22:31:52 +00:00
David Dykstra
3ca8e68f58 Added "strict modes" option. When set false (default is true), it allows
the secrets file to be readable by other users.  Added to support the Windows
port under cygwin.  Problem reported by Martin Krumpolec krumpo@pobox.sk
1999-02-09 19:27:15 +00:00
David Dykstra
d41c7d025c Use MAXHOSTNAMELEN (256) for the array holding the host_name in socket.c
instead of 200.  Move the defines of True and False to rsync.h.  Eliminate
the defines of BOOL in loadparm.c and params.c because it is already
defined in rsync.h.  Changes suggested by Roman Gollent roman.gollent@wdr.com
1999-02-09 18:35:29 +00:00
David Dykstra
b86f0cefa2 Add --quiet/-q option. Contributed by Rich Salz salzr@certco.com. 1999-02-09 17:25:35 +00:00
David Dykstra
c226b7c2fd Move the initialization of push_dir, which calls getcwd, to early in main.
The reason for that is that on SVR2-based UTS 2.1.2 (which along with many
other old systems implements getcwd by forking "pwd") getcwd hangs when
called when other child processes are running.

I also added a quick return from push_dir if name == NULL so it doesn't
actually have to chdir anywhere when just initializing.

An initializing call to push_dir("/",0) had previously been put in at the
beginning of daemon_main() to avoid calling getcwd after a chroot, but
since that is no longer I needed I removed it and changed the call to
chdir("/") after chroot into a push_dir("/",0) so it will remember the
correct current directory.
1999-02-03 15:38:06 +00:00
David Dykstra
5865fcdd63 When calling lchown, pass the current known uid and gid rather than -1
to not change it, since the old SVR2-based UTS 2.1.2 does not support
leaving uid and gid alone when the value is -1.
1999-02-03 15:15:56 +00:00
David Dykstra
e68f34816f Add alternate implementation of waitpid() for systems that have wait4 but
not wait3, in particular Amdahl's SVR2-based UTS 2.1.2.  The code comes
from apache, but I contributed it to apache in the first place.
1999-02-03 15:11:40 +00:00
David Dykstra
716baed7ff Fix serious bug with "use chroot = no" option which caused "uid =" and "gid ="
to be ignored.  At the same time, change the "uid =" and "gid =" options to
be ignored when not running the daemon as super-user, to make it more
convenient for those people and to make it portable to systems such as
cygwin which don't support the uid/gid notions.
1999-01-21 17:10:32 +00:00
David Dykstra
b882b49747 Document the fact that the %t log format option includes the date, and
that the "log file" option always prepends "%t [%p] ".
1999-01-20 21:32:46 +00:00
David Dykstra
1f0610ef82 Fix segmentation fault when using -vvv. Suggested by assar@sics.se. 1999-01-11 17:07:27 +00:00
Andrew Tridgell
379e689dac fixed bug where strtok() could return NULL in getpassf(). 1999-01-08 10:42:29 +00:00
Andrew Tridgell
65575e9670 added --password-file patch from Alex Schlessinger <alex@inconnect.com>
(yes, I know I'm not supposed to be doing rsync work at the moment!
only four weeks to go ...)
1999-01-08 10:32:56 +00:00
Andrew Tridgell
5e71c4446e made the "max connections" and "lock file" local rather than global
options so you can set them on a per-module basis (requested by
kernel.org mirror maintiner)
1999-01-08 07:51:25 +00:00
David Dykstra
94a7fce217 Ran yodl2man on rsync.yo, and updated modification date. 1999-01-07 16:27:38 +00:00
Andrew Tridgell
3bc67f0c4f add warning about using RSYNC_PASSWORD on systems where env varibables
are visible to all users.
1999-01-07 07:19:03 +00:00
David Dykstra
117af10225 Change the receive log message from "send" to "recv". Fix from
Rick Smith <rick@rbsmith.com>.
1999-01-05 20:08:45 +00:00
Andrew Tridgell
536541d52b moved the block length mismatch code to another part of the loop. 1999-01-05 06:43:59 +00:00
Andrew Tridgell
496d9272c1 don't try to match checksums of two blocks which are of unequal
size. This explains the high false_alarms rate that I saw for one of
the sample data files used in my thesis.

The bug was harmless as the strong checksum easily caught all the
false matches but it's been bugging me as I couldn't explain it :)
1999-01-05 06:31:58 +00:00
Andrew Tridgell
34d3eed462 fixed a bug in the adjacent target optimisation 1999-01-05 01:57:13 +00:00
Andrew Tridgell
923fa97808 an optimization that tries to make rsync choose adjacent matches if
multiple matching blocks are available. This make the run-length
coding of the output more efficient.
1999-01-05 01:15:32 +00:00
Andrew Tridgell
4440b8aa3f no longer use mmap() in rsync because of the risk of a SIGBUS when
another program (such as a mailer) truncates a file.

To offset the speed loss I have rewritten the map_ptr() code to make
much better use of read().
1998-12-30 14:48:45 +00:00
David Dykstra
5a554d5b14 steve.ingram@icl-gis.com noticed several mistakes in rsync.1. Some of
them had already been fixed but yodl2man hadn't been run, and a couple
others were new.
1998-12-07 18:48:46 +00:00
David Dykstra
2cfeab21ce Fix minor man page typo, suggested by jbm@jbm.org. 1998-12-07 14:51:32 +00:00
Andrew Tridgell
2b086e033c paranoia change - treat list_only like read_only and refuse all
syscalls that might change the filesystem. This shouldn't be needed,
but I like paranoid coding :)
1998-12-05 01:56:45 +00:00
Andrew Tridgell
241fc706a9 - slprintf() takes sizeof(buf) not sizeof(buf)-1
- fixed incorrect format string in rename error
1998-12-05 01:55:37 +00:00
David Dykstra
7fadb4bc58 Support newer rpm's which define $RPM_OPT_FLAGS as a set of options
separated by spaces.  Suggested by pavel_roskin@geocities.com.
1998-12-01 16:13:25 +00:00
David Dykstra
6c7c2ef372 Minor documentation change suggested by pavel_roskin@geocities.com. 1998-12-01 16:11:40 +00:00
rsync-bugs
86a2dd0a0a preparing for release of 2.2.1 1998-11-25 16:24:56 +00:00
David Dykstra
63f0774f75 Back out change that treated "refuse options = compress" the same as
"dont compress = *", by request of Tridge.  Instead, mention the difference
in the man page.  Also, put in a shortcut in set_compression() to recognize
"*" earlier instead of going through malloc/strtok/fnmatch/free cycle.
1998-11-25 15:37:50 +00:00
David Dykstra
d47741cac6 When "refuse options = compress" is set in rsyncd.conf, silently send files
at compression level 0 instead of printing an error and exitting.  This is
the same effect as "dont compress = *".
1998-11-24 22:03:16 +00:00
David Dykstra
5d5811f7d9 Always include "." when processing exclude lists. This avoids confusion
when people do --exclude "*".  Also, add an example to the man page that
shows explicitly including parent directories when itemizing specific
paths to include followed by --exclude "*".
1998-11-24 21:26:38 +00:00
David Dykstra
dcc3a131d1 Update the README file to reflect current usage options. 1998-11-24 20:54:56 +00:00
David Dykstra
7212be9237 Don't list cleaned-out duplicate file names as "<NULL>" when doing
list_only mode; skip them instead.
1998-11-24 20:51:45 +00:00
David Dykstra
44e2e57837 Change sanitize_path() function to not malloc a copy since it only shrinks
paths and it is only used in places that have already just done a copy.
1998-11-24 20:18:11 +00:00
David Dykstra
d1be231290 Make sure secrets file is not other-accessible, and owned by root if the
daemon is running as root.  Suggested by
    Mike Richardson <mike@quaking.demon.co.uk>
1998-11-24 19:52:35 +00:00
David Dykstra
a926daecbf Always add the O_BINARY flag in do_open if it is defined, for Windows.
Suggestion from Mart.Laak@hansa.ee
1998-11-24 19:10:21 +00:00
David Dykstra
53dd3135f1 Backup deleted files when using --delete and --backup. Based on a
suggested patch from Kanai Makoto (kanai@hallab.co.jp).
1998-11-24 19:01:24 +00:00
David Dykstra
cd64343a7a Add "include" and "include from" rsyncd.conf options. Contributed
by Dennis Gilbert <dennis@oit.pdx.edu>.
1998-11-23 21:54:01 +00:00
Andrew Tridgell
9e3c856a39 updates to reflect new samba.org domain
the main web site is now http://rsync.samba.org/
1998-11-23 00:30:27 +00:00
Andrew Tridgell
1e8ae5ede6 changed an example slightly 1998-11-20 22:46:42 +00:00
Andrew Tridgell
83fff1aa60 added "dont compress" option with the default setting of
*.gz *.tgz *.zip *.z *.rpm *.deb
1998-11-20 22:26:29 +00:00
Andrew Tridgell
055af77666 improved the "refuse options" code a bit 1998-11-19 06:45:21 +00:00
Andrew Tridgell
cd8185f2bd added "refuse options" option 1998-11-19 06:35:49 +00:00
David Dykstra
6bd98f0617 Look for strcasecmp in -lresolv for Unixware. 1998-11-18 17:53:22 +00:00
David Dykstra
14d43f1fcf Minor documentation patches, due mostly to
Jason Henry Parker <henry@freezer.humbug.org.au>
1998-11-18 17:36:36 +00:00
David Dykstra
3a64ad1fd0 Change --log-format documentation to make it clear that it is for the client
logging to stdout.
1998-11-18 16:20:22 +00:00
David Dykstra
5557c8e3e0 Remove a debugging statement I accidentally included in the last commit. 1998-11-18 16:02:23 +00:00
David Dykstra
baf3e5049e Change documentation to explain that a lack of -t in effect causes -I to be
assumed on the next transfer.
1998-11-18 15:54:50 +00:00
David Dykstra
b389939f87 Apply sanitize_paths() to glob expansions when use chroot = no. 1998-11-17 21:56:18 +00:00
Andrew Tridgell
af77cc6b57 don't interpret %h and %a when using --log-format locally 1998-11-16 23:50:28 +00:00
Andrew Tridgell
1309d90dde fixed a bug handling files larger than 2GB 1998-11-16 03:53:43 +00:00
Andrew Tridgell
a9766ef147 log filename(line) in exit_cleanup() to make tracking down problems
easier in rsync daemons.
1998-11-15 01:21:42 +00:00
Andrew Tridgell
5a788adec1 use native strlcat() and strlcpy() if available 1998-11-15 01:04:16 +00:00
Andrew Tridgell
50abd20bb3 compile with optimisation by default on all compilers
(the mdfour code really needs it)
1998-11-14 23:49:08 +00:00
Andrew Tridgell
37f9805dab changed strlcat() and strlcpy() to have the same semantics as the
OpenBSD functions of the same name.

changed slprintf() to take buffer length rather than buffer length -1
1998-11-14 23:31:58 +00:00
David Dykstra
b5f9e67d57 Change sanitize_path() to not use clean_fname() because it removes the
trailing slash.  This caused a problem when using "use chroot" and sources
that contained a trailing slash (which prevents the last filename component
of the source from being included in the destination).  Instead, have
sanitize_path() remove "." components and duplicated slashes ("//") itself.
1998-11-06 17:07:07 +00:00
Andrew Tridgell
ed06894a01 fixed typo 1998-11-06 10:37:10 +00:00
David Dykstra
d532c0f569 Add comment before call to mktemp saying it is deliberately chosen over
mkstemp.
1998-11-05 14:33:38 +00:00
David Dykstra
ec9df38086 Fix confusion between RERR_NOSUPPORT and RERR_UNSUPPORTED for exit codes
that indicate a feature is not supported.  Two places that are normally
ifdefed out used RERR_UNSUPPORTED whereas one other place and errcode.h
used RERR_NOSUPPORT.  Changed them all to consistently use RERR_UNSUPPORTED.
The two things that had the bad values were #ifndef SUPPORT_LINKS and
#ifdef NO_INT64.  The former is probably for non-Unix operating systems
and the latter was at least on the default Unixware compiler.
1998-11-04 16:47:33 +00:00
Andrew Tridgell
81791cfccb added timeout option in rsyncd.conf 1998-11-04 03:14:22 +00:00
Andrew Tridgell
2fb27e9146 use macros to make mdfour faster on systems that don't do inlining
well. Also helps when optimisation level is low.
1998-11-04 02:35:18 +00:00
David Dykstra
946347b8ff Remove statement in rsync.1 that a rsync:// URL can only be used if
a username is not needed.
1998-11-03 22:30:52 +00:00
277 changed files with 81981 additions and 16659 deletions

23
.cirrus.yml Normal file
View File

@@ -0,0 +1,23 @@
freebsd_task:
name: FreeBSD
freebsd_instance:
image_family: freebsd-13-0
env:
PATH: /usr/local/bin:$PATH
prep_script:
- dd if=/dev/zero of=/tmp/zpool bs=1M count=1024
- zpool create -m `pwd`/testtmp zpool /tmp/zpool
- pkg install -y bash autotools m4 xxhash zstd liblz4 wget
- wget -O git-version.h https://gist.githubusercontent.com/WayneD/c11243fa374fc64d4e42f2855c8e3827/raw/rsync-git-version.h
configure_script:
- CPPFLAGS=-I/usr/local/include/ LDFLAGS=-L/usr/local/lib/ ./configure --disable-md2man
make_script:
- make
install_script:
- make install
info_script:
- rsync --version
test_script:
- RSYNC_EXPECT_SKIPPED=acls-default,acls,crtimes,protected-regular make check
ssl_file_list_script:
- rsync-ssl --no-motd download.samba.org::rsyncftp/ || true

View File

@@ -1,21 +0,0 @@
.ignore
.cvsignore
Makefile
a
b
config.cache
config.h
config.log
config.status
dist.tar.gz
rsync
rsync-*
rsync.aux
rsync.dvi
rsync.log
tech_report.aux
tech_report.dvi
tech_report.log
tech_report.ps
test

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto eol=lf

125
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,125 @@
name: build
on:
push:
branches: [ master ]
paths-ignore: [ .cirrus.yml ]
pull_request:
branches: [ master ]
paths-ignore: [ .cirrus.yml ]
schedule:
- cron: '42 8 * * *'
jobs:
ubuntu-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: prep
run: |
sudo apt-get install acl libacl1-dev attr libattr1-dev liblz4-dev libzstd-dev libxxhash-dev python3-cmarkgfm openssl wget
wget -O git-version.h https://gist.githubusercontent.com/WayneD/c11243fa374fc64d4e42f2855c8e3827/raw/rsync-git-version.h
echo "/usr/local/bin" >>$GITHUB_PATH
- name: configure
run: ./configure --with-rrsync
- name: make
run: make
- name: install
run: sudo make install
- name: info
run: rsync --version
- name: check
run: sudo RSYNC_EXPECT_SKIPPED=crtimes make check
- name: check30
run: sudo RSYNC_EXPECT_SKIPPED=crtimes make check30
- name: check29
run: sudo RSYNC_EXPECT_SKIPPED=crtimes make check29
- name: ssl file list
run: rsync-ssl --no-motd download.samba.org::rsyncftp/ || true
- name: save artifact
uses: actions/upload-artifact@v2
with:
name: ubuntu-bin
path: |
rsync
rsync-ssl
rsync.1
rsync-ssl.1
rsyncd.conf.5
rrsync.1
rrsync
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: prep
run: |
brew install automake openssl xxhash zstd lz4 wget
sudo pip3 install commonmark
wget -O git-version.h https://gist.githubusercontent.com/WayneD/c11243fa374fc64d4e42f2855c8e3827/raw/rsync-git-version.h
echo "/usr/local/bin" >>$GITHUB_PATH
- name: configure
run: CPPFLAGS=-I/usr/local/opt/openssl/include/ LDFLAGS=-L/usr/local/opt/openssl/lib/ ./configure --with-rrsync
- name: make
run: make
- name: install
run: sudo make install
- name: info
run: rsync --version
- name: check
run: sudo RSYNC_EXPECT_SKIPPED=acls-default,chmod-temp-dir,chown-fake,devices-fake,dir-sgid,protected-regular,xattrs-hlink,xattrs make check
- name: ssl file list
run: rsync-ssl --no-motd download.samba.org::rsyncftp/ || true
- name: save artifact
uses: actions/upload-artifact@v2
with:
name: macos-bin
path: |
rsync
rsync-ssl
rsync.1
rsync-ssl.1
rsyncd.conf.5
rrsync.1
rrsync
cygwin-build:
runs-on: windows-2022
if: (github.event_name == 'schedule' || contains(github.event.head_commit.message, '[buildall]'))
steps:
- uses: actions/checkout@v2
- name: cygwin
run: choco install -y --no-progress cygwin cyg-get
- name: prep
run: |
cyg-get make autoconf automake gcc-core attr libattr-devel python39 python39-pip libzstd-devel liblz4-devel libssl-devel libxxhash0 libxxhash-devel
curl.exe -o git-version.h https://gist.githubusercontent.com/WayneD/c11243fa374fc64d4e42f2855c8e3827/raw/rsync-git-version.h
echo "C:/tools/cygwin/bin" >>$Env:GITHUB_PATH
- name: commonmark
run: bash -c 'python3 -mpip install --user commonmark'
- name: configure
run: bash -c './configure --with-rrsync'
- name: make
run: bash -c 'make'
- name: install
run: bash -c 'make install'
- name: info
run: bash -c '/usr/local/bin/rsync --version'
- name: check
run: bash -c 'RSYNC_EXPECT_SKIPPED=acls-default,acls,chown,devices,dir-sgid,protected-regular make check'
- name: ssl file list
run: bash -c 'PATH="/usr/local/bin:$PATH" rsync-ssl --no-motd download.samba.org::rsyncftp/ || true'
- name: save artifact
uses: actions/upload-artifact@v2
with:
name: cygwin-bin
path: |
rsync.exe
rsync-ssl
rsync.1
rsync-ssl.1
rsyncd.conf.5
rrsync.1
rrsync

60
.gitignore vendored Normal file
View File

@@ -0,0 +1,60 @@
*.[oa]
*~
dummy
ID
Makefile
Makefile.old
configure.sh
configure.sh.old
config.cache
config.h
config.h.in
config.h.in.old
config.log
config.status
aclocal.m4
/proto.h
/proto.h-tstamp
/rsync*.[15]
/rrsync
/rrsync*.1
/rsync*.html
/rrsync*.html
/help-rsync*.h
/default-cvsignore.h
/default-dont-compress.h
/daemon-parm.h
/.md2man-works
/autom4te*.cache
/confdefs.h
/conftest*
/dox
/getgroups
/gists
/gmon.out
/rsync
/stunnel-rsyncd.conf
/shconfig
/git-version.h
/testdir
/tests-dont-exist
/testtmp
/tls
/testrun
/trimslash
/t_unsafe
/wildtest
/getfsdev
/rounding.h
/doc/rsync.pdf
/doc/rsync.ps
/support/savetransfer
/testsuite/chown-fake.test
/testsuite/devices-fake.test
/testsuite/xattrs-hlink.test
/patches
/patches.gen
/build
/auto-build-save
.deps
/*.exe

19
.ignore
View File

@@ -1,19 +0,0 @@
.#*
*.log
Makefile
config.h
*.o
CVS
.ignore
.cvsignore
*~
rsync
config.status
config.cache
TAGS
config.log
test
*.gz
rsync-*
*.dvi
*.aux

858
COPYING
View File

@@ -1,285 +1,635 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
REGARDING OPENSSL AND XXHASH
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
In addition, as a special exception, the copyright holders give
permission to dynamically link rsync with the OpenSSL and xxhash
libraries when those libraries are being distributed in compliance
with their license terms, and to distribute a dynamically linked
combination of rsync and these libraries. This is also considered
to be covered under the GPL's System Libraries exception.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
TERMS AND CONDITIONS
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
0. Definitions.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"This License" refers to version 3 of the GNU General Public License.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
A "covered work" means either the unmodified Program or a work based
on the Program.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Source Code.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
The Corresponding Source for a work in source code form is that
same work.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Revised Versions of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -287,15 +637,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -304,36 +654,30 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

187
Doxyfile Normal file
View File

@@ -0,0 +1,187 @@
# Doxyfile 1.2.15
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = rsync
PROJECT_NUMBER = HEAD
OUTPUT_DIRECTORY = dox
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH = *source
INTERNAL_DOCS = YES
STRIP_CODE_COMMENTS = NO
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = YES
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = NO
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = NO
WARN_IF_UNDOCUMENTED = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = .
FILE_PATTERNS = *.c \
*.h
RECURSIVE = YES
EXCLUDE = proto.h \
zlib \
popt
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 3
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 3
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = YES
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = NO
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
HIDE_UNDOC_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
CGI_NAME = search.cgi
CGI_URL =
DOC_URL =
DOC_ABSPATH =
BIN_ABSPATH = /usr/local/bin/
EXT_DOC_PATHS =

242
INSTALL.md Normal file
View File

@@ -0,0 +1,242 @@
# How to build and install rsync
When building rsync, you'll want to install various libraries in order to get
all the features enabled. The configure script will alert you when the
newest libraries are missing and tell you the appropriate `--disable-LIB`
option to use if you want to just skip that feature. What follows are various
support libraries that you may want to install to build rsync with the maximum
features (the impatient can skip down to the package summary):
## The basic setup
You need to have a C compiler installed and optionally a C++ compiler in order
to try to build some hardware-accelerated checksum routines. Rsync also needs
a modern awk, which might be provided via gawk or nawk on some OSes.
## Autoconf & manpages
If you're installing from the git repo (instead of a release tar file) you'll
also need the GNU autotools (autoconf & automake) and your choice of 2 python3
markdown libraries: cmarkgfm or commonmark (needed to generate the manpages).
If your OS doesn't provide a python3-cmarkgfm or python3-commonmark package,
you can run the following to install the commonmark python library for your
build user (after installing python3's pip package):
> python3 -mpip install --user commonmark
You can test if you've got it fixed by running (from the rsync checkout):
> ./md2man --test rsync-ssl.1.md
Alternately, you can avoid generating the manpages by fetching the very latest
versions (that match the latest git source) from the [generated-files][6] dir.
One way to do that is to run:
> ./prepare-source fetchgen
[6]: https://download.samba.org/pub/rsync/generated-files/
## ACL support
To support copying ACL file information, make sure you have an acl
development library installed. It also helps to have the helper programs
installed to manipulate ACLs and to run the rsync testsuite.
## Xattr support
To support copying xattr file information, make sure you have an attr
development library installed. It also helps to have the helper programs
installed to manipulate xattrs and to run the rsync testsuite.
## xxhash
The [xxHash library][1] provides extremely fast checksum functions that can
make the "rsync algorithm" run much more quickly, especially when matching
blocks in large files. Installing this development library adds xxhash
checksums as the default checksum algorithm. You'll need at least v0.8.0
if you want rsync to include the full range of its checksum algorithms.
[1]: https://cyan4973.github.io/xxHash/
## zstd
The [zstd library][2] compression algorithm that uses less CPU than
the default zlib algorithm at the same compression level. Note that you
need at least version 1.4, so you might need to skip the zstd compression if
you can only install a 1.3 release. Installing this development library
adds zstd compression as the default compression algorithm.
[2]: http://facebook.github.io/zstd/
## lz4
The [lz4 library][3] compression algorithm that uses very little CPU, though
it also has the smallest compression ratio of other algorithms. Installing
this development library adds lz4 compression as an available compression
algorithm.
[3]: https://lz4.github.io/lz4/
## openssl crypto
The [openssl crypto library][4] provides some hardware accelerated checksum
algorithms for MD4 and MD5. Installing this development library makes rsync
use the (potentially) faster checksum routines when computing MD4 & MD5
checksums.
[4]: https://www.openssl.org/docs/man1.0.2/man3/crypto.html
## Package summary
To help you get the libraries installed, here are some package install commands
for various OSes. The commands are split up to correspond with the above
items, but feel free to combine the package names into a single install, if you
like.
- For Debian and Ubuntu (Debian Buster users may want to briefly(?) enable
buster-backports to update zstd from 1.3 to 1.4):
> sudo apt install -y gcc g++ gawk autoconf automake python3-cmarkgfm
> sudo apt install -y acl libacl1-dev
> sudo apt install -y attr libattr1-dev
> sudo apt install -y libxxhash-dev
> sudo apt install -y libzstd-dev
> sudo apt install -y liblz4-dev
> sudo apt install -y libssl-dev
- For CentOS (use EPEL for python3-pip):
> sudo yum -y install epel-release
> sudo yum -y install gcc g++ gawk autoconf automake python3-pip
> sudo yum -y install acl libacl-devel
> sudo yum -y install attr libattr-devel
> sudo yum -y install xxhash-devel
> sudo yum -y install libzstd-devel
> sudo yum -y install lz4-devel
> sudo yum -y install openssl-devel
> python3 -mpip install --user commonmark
- For Fedora 33:
> sudo dnf -y install acl libacl-devel
> sudo dnf -y install attr libattr-devel
> sudo dnf -y install xxhash-devel
> sudo dnf -y install libzstd-devel
> sudo dnf -y install lz4-devel
> sudo dnf -y install openssl-devel
- For FreeBSD (this assumes that the python3 version is 3.7):
> sudo pkg install -y autotools python3 py37-CommonMark
> sudo pkg install -y xxhash
> sudo pkg install -y zstd
> sudo pkg install -y liblz4
- For macOS:
> brew install automake
> brew install xxhash
> brew install zstd
> brew install lz4
> brew install openssl
- For Cygwin (with all cygwin programs stopped, run the appropriate setup program from a cmd shell):
> setup-x86_64 --quiet-mode -P make,gawk,autoconf,automake,gcc-core,python38,python38-pip
> setup-x86_64 --quiet-mode -P attr,libattr-devel
> setup-x86_64 --quiet-mode -P libzstd-devel
> setup-x86_64 --quiet-mode -P liblz4-devel
> setup-x86_64 --quiet-mode -P libssl-devel
Sometimes cygwin has commonmark packaged and sometimes it doesn't. Now that
its python38 has stabilized, you could install python38-commonmark. Or just
avoid the issue by running this from a bash shell as your build user:
> python3 -mpip install --user commonmark
## Build and install
After installing the various libraries, you need to configure, build, and
install the source:
> ./configure
> make
> sudo make install
The default install path is /usr/local/bin, but you can set the installation
directory and other parameters using options to ./configure. To see them, use:
> ./configure --help
Configure tries to figure out if the local system uses group "nobody" or
"nogroup" by looking in the /etc/group file. (This is only used for the
default group of an rsync daemon, which attempts to run with "nobody"
user and group permissions.) You can change the default user and group
for the daemon by editing the NOBODY_USER and NOBODY_GROUP defines in
config.h, or just override them in your /etc/rsyncd.conf file.
As of 2.4.7, rsync uses Eric Troan's popt option-parsing library. A
cut-down copy of a recent release is included in the rsync distribution,
and will be used if there is no popt library on your build host, or if
the `--with-included-popt` option is passed to ./configure.
If you configure using `--enable-maintainer-mode`, then rsync will try
to pop up an xterm on DISPLAY=:0 if it crashes. You might find this
useful, but it should be turned off for production builds.
If you want to automatically use a separate "build" directory based on
the current git branch name, start with a pristine git checkout and run
"mkdir auto-build-save" before you run the first ./configure command.
That will cause a fresh build dir to spring into existence along with a
special Makefile symlink that allows you to run "make" and "./configure"
from the source dir (the "build" dir gets auto switched based on branch).
This is helpful when using the branch-from-patch and patch-update scripts
to maintain the official rsync patches. If you ever need to build from
a "detached head" git position then you'll need to manually chdir into
the build dir to run make. I also like to create 2 more symlinks in the
source dir: `ln -s build/rsync . ; ln -s build/testtmp .`
## Make compatibility
Note that Makefile.in has a rule that uses a wildcard in a prerequisite. If
your make has a problem with this rule, you will see an error like this:
Don't know how to make ./*.c
You can change the "proto.h-tstamp" target in Makefile.in to list all the \*.c
filenames explicitly in order to avoid this issue.
## RPM notes
Under packaging you will find .spec files for several distributions.
The .spec file in packaging/lsb can be used for Linux systems that
adhere to the Linux Standards Base (e.g., RedHat and others).
## HP-UX notes
The HP-UX 10.10 "bundled" C compiler seems not to be able to cope with
ANSI C. You may see this error message in config.log if ./configure
fails:
(Bundled) cc: "configure", line 2162: error 1705: Function prototypes are an ANSI feature.
Install gcc or HP's "ANSI/C Compiler".
## Mac OS X notes
Some versions of Mac OS X (Darwin) seem to have an IPv6 stack, but do
not completely implement the "New Sockets" API.
[This site][5] says that Apple started to support IPv6 in 10.2 (Jaguar). If
your build fails, try again after running configure with `--disable-ipv6`.
[5]: http://www.ipv6.org/impl/mac.html
## IBM AIX notes
IBM AIX has a largefile problem with mkstemp. See IBM PR-51921.
The workaround is to append the following to config.h:
> #ifdef _LARGE_FILES
> #undef HAVE_SECURE_MKSTEMP
> #endif

View File

@@ -1,75 +1,367 @@
# Makefile for rsync. This is processed by configure to produce the final
# Makefile
# The Makefile for rsync (configure creates it from Makefile.in).
prefix=@prefix@
datarootdir=@datarootdir@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@/rsync
mandir=@mandir@
with_rrsync=@with_rrsync@
LIBS=@LIBS@
CC=@CC@
AWK=@AWK@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
EXEEXT=@EXEEXT@
LDFLAGS=@LDFLAGS@
LIBOBJDIR=lib/
INSTALLCMD=@INSTALL@
INSTALLMAN=@INSTALL@
srcdir=@srcdir@
MKDIR_P=@MKDIR_P@
VPATH=$(srcdir)
SHELL=/bin/sh
.SUFFIXES:
.SUFFIXES: .c .o
LIBOBJ=lib/getopt.o lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o
ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
zlib/zutil.o zlib/adler32.o
OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o main.o checksum.o match.o syscall.o log.o
OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o fileio.o
ROLL_SIMD_x86_64=simd-checksum-x86_64.o
ROLL_ASM_x86_64=simd-checksum-avx2.o
MD5_ASM_x86_64=lib/md5-asm-x86_64.o
GENFILES=configure.sh aclocal.m4 config.h.in rsync.1 rsync.1.html \
rsync-ssl.1 rsync-ssl.1.html rsyncd.conf.5 rsyncd.conf.5.html \
@GEN_RRSYNC@
HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
lib/pool_alloc.h lib/mdigest.h lib/md-defines.h
LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
zlib_OBJS=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
util1.o util2.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
usage.o fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
OBJS3=progress.o pipe.o @MD5_ASM@ @ROLL_SIMD@ @ROLL_ASM@
DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
OBJS=$(OBJS1) $(OBJS2) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ)
popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
popt/popthelp.o popt/poptparse.o
OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) @BUILD_ZLIB@ @BUILD_POPT@
TLS_OBJ = tls.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
# Programs we must have to run the test cases
CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
testrun$(EXEEXT) trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test testsuite/xattrs-hlink.test
# Objects for CHECK_PROGS to clean
CHECK_OBJS=tls.o testrun.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
# note that the -I. is needed to handle config.h when using VPATH
.c.o:
@OBJ_SAVE@
$(CC) -I. -I$(srcdir) $(CFLAGS) -c $< @CC_SHOBJ_FLAG@
$(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
@OBJ_RESTORE@
all: rsync
man: rsync.1 rsyncd.conf.5
all: Makefile rsync$(EXEEXT) stunnel-rsyncd.conf @MAKE_RRSYNC@ @MAKE_MAN@
.PHONY: all
.PHONY: install
install: all
-mkdir -p ${bindir}
${INSTALLCMD} -m 755 rsync ${bindir}
-mkdir -p ${mandir}/man1
-mkdir -p ${mandir}/man5
${INSTALLCMD} -m 644 $(srcdir)/rsync.1 ${mandir}/man1
${INSTALLCMD} -m 644 $(srcdir)/rsyncd.conf.5 ${mandir}/man5
-$(MKDIR_P) $(DESTDIR)$(bindir)
$(INSTALLCMD) $(INSTALL_STRIP) -m 755 rsync$(EXEEXT) $(DESTDIR)$(bindir)
$(INSTALLCMD) -m 755 $(srcdir)/rsync-ssl $(DESTDIR)$(bindir)
-$(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
if test -f rsync-ssl.1; then $(INSTALLMAN) -m 644 rsync-ssl.1 $(DESTDIR)$(mandir)/man1; fi
if test -f rsyncd.conf.5; then $(INSTALLMAN) -m 644 rsyncd.conf.5 $(DESTDIR)$(mandir)/man5; fi
if test "$(with_rrsync)" = yes; then \
$(INSTALLCMD) -m 755 rrsync $(DESTDIR)$(bindir); \
if test -f rrsync.1; then $(INSTALLMAN) -m 644 rrsync.1 $(DESTDIR)$(mandir)/man1; fi; \
fi
install-ssl-daemon: stunnel-rsyncd.conf
-$(MKDIR_P) $(DESTDIR)/etc/stunnel
$(INSTALLCMD) -m 644 stunnel-rsyncd.conf $(DESTDIR)/etc/stunnel/rsyncd.conf
@if ! ls /etc/rsync-ssl/certs/server.* >/dev/null 2>/dev/null; then \
echo "Note that you'll need to install the certificate used by /etc/stunnel/rsyncd.conf"; \
fi
install-all: install install-ssl-daemon
install-strip:
$(MAKE) INSTALLCMD='$(INSTALLCMD) -s' install
$(MAKE) INSTALL_STRIP='-s' install
rsync: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o rsync $(OBJS) $(LIBS)
rsync$(EXEEXT): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
rsync.1: rsync.yo
yodl2man -o rsync.1 rsync.yo
rrsync: support/rrsync
cp -p $(srcdir)/support/rrsync rrsync
rsyncd.conf.5: rsyncd.conf.yo
yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
$(OBJS): $(HEADERS)
$(CHECK_OBJS): $(HEADERS)
tls.o xattrs.o: lib/sysxattrs.h
usage.o: version.h latest-year.h help-rsync.h help-rsyncd.h git-version.h default-cvsignore.h
loadparm.o: default-dont-compress.h daemon-parm.h
proto:
cat *.c | awk -f mkproto.awk > proto.h
flist.o: rounding.h
clean:
rm -f *~ $(OBJS) rsync
default-cvsignore.h default-dont-compress.h: rsync.1.md define-from-md.awk
$(AWK) -f $(srcdir)/define-from-md.awk -v hfile=$@ $(srcdir)/rsync.1.md
help-rsync.h help-rsyncd.h: rsync.1.md help-from-md.awk
$(AWK) -f $(srcdir)/help-from-md.awk -v hfile=$@ $(srcdir)/rsync.1.md
daemon-parm.h: daemon-parm.txt daemon-parm.awk
$(AWK) -f $(srcdir)/daemon-parm.awk $(srcdir)/daemon-parm.txt
rounding.h: rounding.c rsync.h proto.h
@for r in 0 1 3; do \
if $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rounding -DEXTRA_ROUNDING=$$r -I. $(srcdir)/rounding.c >rounding.out 2>&1; then \
echo "#define EXTRA_ROUNDING $$r" >rounding.h; \
if test -f "$$HOME/build_farm/build_test.fns"; then \
echo "EXTRA_ROUNDING is $$r" >&2; \
fi; \
break; \
fi; \
done
@rm -f rounding
@if test -f rounding.h; then : ; else \
cat rounding.out 1>&2; \
echo "Failed to create rounding.h!" 1>&2; \
exit 1; \
fi
@rm -f rounding.out
git-version.h: ALWAYS_RUN
$(srcdir)/mkgitver
.PHONY: ALWAYS_RUN
ALWAYS_RUN:
simd-checksum-x86_64.o: simd-checksum-x86_64.cpp
@$(srcdir)/cmd-or-msg disable-roll-simd $(CXX) -I. $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $(srcdir)/simd-checksum-x86_64.cpp
simd-checksum-avx2.o: simd-checksum-avx2.S
@$(srcdir)/cmd-or-msg disable-roll-asm $(CC) $(CFLAGS) -I. @NOEXECSTACK@ -c -o $@ $(srcdir)/simd-checksum-avx2.S
lib/md5-asm-x86_64.o: lib/md5-asm-x86_64.S lib/md-defines.h
@$(srcdir)/cmd-or-msg disable-md5-asm $(CC) -I. @NOEXECSTACK@ -c -o $@ $(srcdir)/lib/md5-asm-x86_64.S
tls$(EXEEXT): $(TLS_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
testrun$(EXEEXT): testrun.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ testrun.o
getgroups$(EXEEXT): getgroups.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
getfsdev$(EXEEXT): getfsdev.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
TRIMSLASH_OBJ = trimslash.o syscall.o util2.o t_stub.o lib/compat.o lib/snprintf.o
trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
T_UNSAFE_OBJ = t_unsafe.o syscall.o util1.o util2.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o
t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
.PHONY: conf
conf: configure.sh config.h.in
.PHONY: gen
gen: conf proto.h man git-version.h
.PHONY: gensend
gensend: gen
if ! diff git-version.h $(srcdir)/gists/rsync-git-version.h >/dev/null; then \
./rsync -ai git-version.h $(srcdir)/gists/rsync-git-version.h && \
(cd $(srcdir)/gists && git commit --allow-empty-message -m '' rsync-git-version.h && git push) ; \
fi
rsync -aic $(GENFILES) git-version.h $${SAMBA_HOST-samba.org}:/home/ftp/pub/rsync/generated-files/ || true
aclocal.m4: $(srcdir)/m4/*.m4
aclocal -I $(srcdir)/m4
configure.sh config.h.in: configure.ac aclocal.m4
@if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
@if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
autoconf -o configure.sh
autoheader && touch config.h.in
@if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
echo "configure.sh is unchanged."; \
rm configure.sh.old; \
else \
echo "configure.sh has CHANGED."; \
fi
@if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
echo "config.h.in is unchanged."; \
rm config.h.in.old; \
else \
echo "config.h.in has CHANGED."; \
fi
@if test -f configure.sh.old || test -f config.h.in.old; then \
if test "$(MAKECMDGOALS)" = reconfigure; then \
echo 'Continuing with "make reconfigure".'; \
else \
echo 'You may need to run:'; \
echo ' make reconfigure'; \
exit 1; \
fi \
fi
.PHONY: reconfigure
reconfigure: configure.sh
./config.status --recheck
./config.status
.PHONY: restatus
restatus:
./config.status
Makefile: Makefile.in config.status configure.sh config.h.in
@if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
@./config.status
@if diff Makefile Makefile.old >/dev/null 2>&1; then \
echo "Makefile is unchanged."; \
rm Makefile.old; \
else \
if test "$(MAKECMDGOALS)" = reconfigure; then \
echo 'Continuing with "make reconfigure".'; \
else \
echo "Makefile updated -- rerun your make command."; \
exit 1; \
fi \
fi
stunnel-rsyncd.conf: $(srcdir)/stunnel-rsyncd.conf.in Makefile
sed 's;\@bindir\@;$(bindir);g' <$(srcdir)/stunnel-rsyncd.conf.in >stunnel-rsyncd.conf
.PHONY: proto
proto: proto.h-tstamp
proto.h: proto.h-tstamp
@if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi
proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
$(AWK) -f $(srcdir)/mkproto.awk $(srcdir)/*.c $(srcdir)/lib/compat.c daemon-parm.h
.PHONY: man
man: rsync.1 rsync-ssl.1 rsyncd.conf.5 @MAKE_RRSYNC_1@
rsync.1: rsync.1.md md-convert version.h Makefile
@$(srcdir)/maybe-make-man rsync.1.md
rsync-ssl.1: rsync-ssl.1.md md-convert version.h Makefile
@$(srcdir)/maybe-make-man rsync-ssl.1.md
rsyncd.conf.5: rsyncd.conf.5.md md-convert version.h Makefile
@$(srcdir)/maybe-make-man rsyncd.conf.5.md
rrsync.1: support/rrsync.1.md md-convert Makefile
@$(srcdir)/maybe-make-man support/rrsync.1.md
.PHONY: clean
clean: cleantests
rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) @MAKE_RRSYNC@ \
git-version.h rounding rounding.h *.old rsync*.1 rsync*.5 @MAKE_RRSYNC_1@ \
*.html daemon-parm.h help-*.h default-*.h proto.h proto.h-tstamp
.PHONY: cleantests
cleantests:
rm -rf ./testtmp*
# We try to delete built files from both the source and build
# directories, just in case somebody previously configured things in
# the source directory.
.PHONY: distclean
distclean: clean
for dir in $(srcdir) . ; do \
(cd "$$dir" && rm -rf Makefile config.h config.status stunnel-rsyncd.conf \
lib/dummy popt/dummy zlib/dummy config.cache config.log shconfig \
$(GENFILES) autom4te.cache) ; \
done
# this target is really just for my use. It only works on a limited
# range of machines and is used to produce a list of potentially
# dead (ie. unused) functions in the code. (tridge)
.PHONY: finddead
finddead:
nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
comm -13 nmused.txt nmfns.txt
comm -13 nmused.txt nmfns.txt
@rm nmused.txt nmfns.txt
# 'check' is the GNU name, 'test' is the name for everybody else :-)
.PHONY: test
test: check
# There seems to be no standard way to specify some variables as
# exported from a Makefile apart from listing them like this.
# This depends on building rsync; if we need any helper programs it
# should depend on them too.
# We try to run the scripts with POSIX mode on, in the hope that will
# catch Bash-isms earlier even if we're running on GNU. Of course, we
# might lose in the future where POSIX diverges from old sh.
.PHONY: check
check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
.PHONY: check29
check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
.PHONY: check30
check30: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=30
wildtest.o: wildtest.c t_stub.o lib/wildmatch.c rsync.h config.h
wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
testsuite/chown-fake.test:
ln -s chown.test $(srcdir)/testsuite/chown-fake.test
testsuite/devices-fake.test:
ln -s devices.test $(srcdir)/testsuite/devices-fake.test
testsuite/xattrs-hlink.test:
ln -s xattrs.test $(srcdir)/testsuite/xattrs-hlink.test
# This does *not* depend on building or installing: you can use it to
# check a version installed from a binary or some other source tree,
# if you want.
.PHONY: installcheck
installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
# TODO: Add 'dist' target; need to know which files will be included
# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
.PHONY: splint
splint:
splint +unixlib +gnuextensions -weak rsync.c
.PHONY: doxygen
doxygen:
cd $(srcdir) && rm dox/html/* && doxygen
# for maintainers only
.PHONY: doxygen-upload
doxygen-upload:
rsync -avzv $(srcdir)/dox/html/ --delete \
$${SAMBA_HOST-samba.org}:/home/httpd/html/rsync/doxygen/head/

4557
NEWS.md Normal file
View File

File diff suppressed because it is too large Load Diff

159
README
View File

@@ -1,159 +0,0 @@
WHAT IS RSYNC?
--------------
rsync is a replacement for rcp that has many more features.
rsync uses the "rsync algorithm" which provides a very fast method for
bringing remote files into sync. It does this by sending just the
differences in the files across the link, without requiring that both
sets of files are present at one of the ends of the link beforehand.
At first glance this may seem impossible because the calculation of
diffs between two files normally requires local access to both
files.
A technical report describing the rsync algorithm is included with
this package.
USAGE
-----
Basically you use rsync just like rcp, but rsync has many additional options.
Here is a brief description of available options:
Options:
-v, --verbose increase verbosity
-c, --checksum always checksum
-a, --archive archive mode (same as -rlptDog)
-r, --recursive recurse into directories
-R, --relative use relative path names
-b, --backup make backups (default ~ extension)
-u, --update update only (don't overwrite newer files)
-l, --links preserve soft links
-L, --copy-links treat soft links like regular files
-H, --hard-links preserve hard links
-p, --perms preserve permissions
-o, --owner preserve owner (root only)
-g, --group preserve group
-D, --devices preserve devices (root only)
-t, --times preserve times
-S, --sparse handle sparse files efficiently
-n, --dry-run show what would have been transferred
-W, --whole-file copy whole files, no incremental checks
-x, --one-file-system don't cross filesystem boundaries
-B, --block-size SIZE checksum blocking size
-e, --rsh COMMAND specify rsh replacement
--rsync-path PATH specify path to rsync on the remote machine
-C, --cvs-exclude auto ignore files in the same way CVS does
--delete delete files that don't exist on the sending side
--force force deletion of directories even if not empty
--numeric-ids don't map uid/gid values by user/group name
--timeout TIME set IO timeout in seconds
-I, --ignore-times don't exclude files that match length and time
-T --temp-dir DIR create temporary files in directory DIR
-z, --compress compress file data
--exclude FILE exclude file FILE
--exclude-from FILE exclude files listed in FILE
--suffix SUFFIX override backup suffix
--version print version number
--daemon run as a rsync daemon
--config FILE specify alternate rsyncd.conf file
--port PORT specify alternate rsyncd port number
SETUP
-----
Rsync uses rsh or ssh for communication. It does not need to be setuid
and requires no special privilages for installation. It does not
require a inetd entry or a daemon. You must, however, have a working
rsh or ssh system. Using ssh is recommended for its security
features.
To install rsync, first run the "configure" script. This will create a
Makefile and config.h appropriate for your system. Then type
"make".
Note that on some systems you will have to force configure not to use
gcc because gcc may not support some features (such as 64 bit file
offsets) that your system may support. Set the environment variable CC
to the name of your native compiler before running configure in this
case.
Once built put a copy of rsync in your search path on the local and
remote systems (or use "make install"). That's it!
RSYNC SERVERS
-------------
rsync can also talk to "rsync servers" which can provide anonymous or
authenticated rsync. See the rsync.conf(5) man page for details on how
to setup a rsync server. See the rsync(1) man page for info on how to
connect to a rsync server.
MAILING LIST
------------
There is a mailing list for the discussion of rsync and its
applications. It is open to anyone to join. I will announce new
versions on this list.
To join the mailing list send mail to listproc@samba.anu.edu.au with
no subject and a body of "subscribe rsync Your Name".
To send mail to everyone on the list send it to rsync@samba.anu.edu.au
BUG REPORTS
-----------
If you have web access then please look at
http://samba.anu.edu.au/rsync/
This will give you access to the bug tracking system used by the
developers of rsync and will allow you to look at other bug reports or
submit a new bug report.
If you don't have web access then mail bug reports to
rsync-bugs@samba.anu.edu.au or (if you think it will be of interest to
lots of people) send it to rsync@samba.anu.edu.au
CVS TREE
--------
If you want to get the very latest version of rsync direct from the
source code repository then you can use anonymous cvs. You will need a
recent version of cvs then use the following commands:
cvs -d :pserver:cvs@samba.anu.edu.au:/cvsroot login
Password: cvs
cvs -d :pserver:cvs@samba.anu.edu.au:/cvsroot co rsync
Look at the cvs documentation for more details.
COPYRIGHT
---------
Rsync was written by Andrew Tridgell and Paul Mackerras, and is
available under the Gnu Public License.
tridge@samba.anu.edu.au
paulus@cs.anu.edu.au
AVAILABILITY
------------
The main ftp site for rsync is ftp://samba.anu.edu.au/pub/rsync
This is also available as rsync://samba.anu.edu.au/rsyncftp/
Mirrors are available at:
ftp://sunsite.auc.dk/pub/unix/rsync
ftp://ftp.sunet.se/pub/unix/admin/rsync
ftp://ftp.fu-berlin.de/pub/unix/network/rsync/

144
README.md Normal file
View File

@@ -0,0 +1,144 @@
WHAT IS RSYNC?
--------------
Rsync is a fast and extraordinarily versatile file copying tool for
both remote and local files.
Rsync uses a delta-transfer algorithm which provides a very fast method
for bringing remote files into sync. It does this by sending just the
differences in the files across the link, without requiring that both
sets of files are present at one of the ends of the link beforehand. At
first glance this may seem impossible because the calculation of diffs
between two files normally requires local access to both files.
A technical report describing the rsync algorithm is included with this
package.
USAGE
-----
Basically you use rsync just like scp, but rsync has many additional
options. To get a complete list of supported options type:
rsync --help
See the [manpage][0] for more detailed information.
[0]: https://download.samba.org/pub/rsync/rsync.1
BUILDING AND INSTALLING
-----------------------
If you need to build rsync yourself, check out the [INSTALL][1] page for
information on what libraries and packages you can use to get the maximum
features in your build.
[1]: https://github.com/WayneD/rsync/blob/master/INSTALL.md
SETUP
-----
Rsync normally uses ssh or rsh for communication with remote systems.
It does not need to be setuid and requires no special privileges for
installation. You must, however, have a working ssh or rsh system.
Using ssh is recommended for its security features.
Alternatively, rsync can run in `daemon' mode, listening on a socket.
This is generally used for public file distribution, although
authentication and access control are available.
To install rsync, first run the "configure" script. This will create a
Makefile and config.h appropriate for your system. Then type "make".
Note that on some systems you will have to force configure not to use
gcc because gcc may not support some features (such as 64 bit file
offsets) that your system may support. Set the environment variable CC
to the name of your native compiler before running configure in this
case.
Once built put a copy of rsync in your search path on the local and
remote systems (or use "make install"). That's it!
RSYNC DAEMONS
-------------
Rsync can also talk to "rsync daemons" which can provide anonymous or
authenticated rsync. See the rsyncd.conf(5) manpage for details on how
to setup an rsync daemon. See the rsync(1) manpage for info on how to
connect to an rsync daemon.
WEB SITE
--------
For more information, visit the [main rsync web site][2].
[2]: https://rsync.samba.org/
You'll find a FAQ list, downloads, resources, HTML versions of the
manpages, etc.
MAILING LISTS
-------------
There is a mailing list for the discussion of rsync and its applications
that is open to anyone to join. New releases are announced on this
list, and there is also an announcement-only mailing list for those that
want official announcements. See the [mailing-list page][3] for full
details.
[3]: https://rsync.samba.org/lists.html
BUG REPORTS
-----------
The [bug-tracking web page][4] has full details on bug reporting.
[4]: https://rsync.samba.org/bug-tracking.html
That page contains links to the current bug list, and information on how to
do a good job when reporting a bug. You might also like to try searching
the Internet for the error message you've received, or looking in the
[mailing list archives][5].
[5]: https://mail-archive.com/rsync@lists.samba.org/
To send a bug report, follow the instructions on the bug-tracking
page of the web site.
Alternately, email your bug report to <rsync@lists.samba.org>.
GIT REPOSITORY
--------------
If you want to get the very latest version of rsync direct from the
source code repository, then you will need to use git. The git repo
is hosted [on GitHub][6] and [on Samba's site][7].
[6]: https://github.com/WayneD/rsync
[7]: https://git.samba.org/?p=rsync.git;a=summary
See [the download page][8] for full details on all the ways to grab the
source.
[8]: https://rsync.samba.org/download.html
COPYRIGHT
---------
Rsync was originally written by Andrew Tridgell and is currently
maintained by Wayne Davison. It has been improved by many developers
from around the world.
Rsync may be used, modified and redistributed only under the terms of
the GNU General Public License, found in the file [COPYING][9] in this
distribution, or at [the Free Software Foundation][10].
[9]: https://github.com/WayneD/rsync/blob/master/COPYING
[10]: https://www.fsf.org/licenses/gpl.html

12
SECURITY.md Normal file
View File

@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
Only the current release of the software is actively supported. If you need
help backporting fixes into an older release, feel free to ask.
## Reporting a Vulnerability
Email your vulnerability information to rsync's maintainer:
Wayne Davison <wayne@opencoder.net>

528
TODO Normal file
View File

@@ -0,0 +1,528 @@
-*- indented-text -*-
FEATURES ------------------------------------------------------------
Use chroot only if supported
Allow supplementary groups in rsyncd.conf 2002/04/09
Handling IPv6 on old machines
Other IPv6 stuff
Add ACL support 2001/12/02
proxy authentication 2002/01/23
SOCKS 2002/01/23
FAT support
--diff david.e.sewell 2002/03/15
Add daemon --no-fork option
Create more granular verbosity 2003/05/15
DOCUMENTATION --------------------------------------------------------
Keep list of open issues and todos on the web site
Perhaps redo manual as SGML
LOGGING --------------------------------------------------------------
Memory accounting
Improve error messages
Better statistics Rasmus 2002/03/08
Perhaps flush stdout like syslog
Log child death on signal
verbose output David Stein 2001/12/20
internationalization
DEVELOPMENT --------------------------------------------------------
Handling duplicate names
Use generic zlib 2002/02/25
TDB 2002/03/12
Splint 2002/03/12
PERFORMANCE ----------------------------------------------------------
Traverse just one directory at a time
Allow skipping MD4 file_sum 2002/04/08
Accelerate MD4
TESTING --------------------------------------------------------------
Torture test
Cross-test versions 2001/08/22
Test on kernel source
Test large files
Create mutator program for testing
Create configure option to enable dangerous tests
Create pipe program for testing
Create test makefile target for some tests
RELATED PROJECTS -----------------------------------------------------
rsyncsh
https://rsync.samba.org/rsync-and-debian/
rsyncable gzip patch
rsyncsplit as alternative to real integration with gzip?
reverse rsync over HTTP Range
FEATURES ------------------------------------------------------------
Use chroot only if supported
If the platform doesn't support it, then don't even try.
If running as non-root, then don't fail, just give a warning.
(There was a thread about this a while ago?)
https://lists.samba.org/pipermail/rsync/2001-August/thread.html
https://lists.samba.org/pipermail/rsync/2001-September/thread.html
-- --
Allow supplementary groups in rsyncd.conf 2002/04/09
Perhaps allow supplementary groups to be specified in rsyncd.conf;
then make the first one the primary gid and all the rest be
supplementary gids.
-- --
Handling IPv6 on old machines
The KAME IPv6 patch is nice in theory but has proved a bit of a
nightmare in practice. The basic idea of their patch is that rsync
is rewritten to use the new getaddrinfo()/getnameinfo() interface,
rather than gethostbyname()/gethostbyaddr() as in rsync 2.4.6.
Systems that don't have the new interface are handled by providing
our own implementation in lib/, which is selectively linked in.
The problem with this is that it is really hard to get right on
platforms that have a half-working implementation, so redefining
these functions clashes with system headers, and leaving them out
breaks. This affects at least OSF/1, RedHat 5, and Cobalt, which
are moderately important.
Perhaps the simplest solution would be to have two different files
implementing the same interface, and choose either the new or the
old API. This is probably necessary for systems that e.g. have
IPv6, but gethostbyaddr() can't handle it. The Linux manpage claims
this is currently the case.
In fact, our internal sockets interface (things like
open_socket_out(), etc) is much narrower than the getaddrinfo()
interface, and so probably simpler to get right. In addition, the
old code is known to work well on old machines.
We could drop the rather large lib/getaddrinfo files.
-- --
Other IPv6 stuff
Implement suggestions from http://www.kame.net/newsletter/19980604/
and ftp://ftp.iij.ad.jp/pub/RFC/rfc2553.txt
If a host has multiple addresses, then listen try to connect to all
in order until we get through. (getaddrinfo may return multiple
addresses.) This is kind of implemented already.
Possibly also when starting as a server we may need to listen on
multiple passive addresses. This might be a bit harder, because we
may need to select on all of them. Hm.
-- --
Add ACL support 2001/12/02
Transfer ACLs. Need to think of a standard representation.
Probably better not to even try to convert between NT and POSIX.
Possibly can share some code with Samba.
NOTE: there is a patch that implements this in the "patches" subdir.
-- --
proxy authentication 2002/01/23
Allow RSYNC_PROXY to be http://user:pass@proxy.foo:3128/, and do
HTTP Basic Proxy-Authentication.
Multiple schemes are possible, up to and including the insanity that
is NTLM, but Basic probably covers most cases.
-- --
SOCKS 2002/01/23
Add --with-socks, and then perhaps a command-line option to put them
on or off. This might be more reliable than LD_PRELOAD hacks.
-- --
FAT support
rsync to a FAT partition on a Unix machine doesn't work very well at
the moment. I think we get errors about invalid filenames and
perhaps also trying to do atomic renames.
I guess the code to do this is currently #ifdef'd on Windows;
perhaps we ought to intelligently fall back to it on Unix too.
-- --
--diff david.e.sewell 2002/03/15
Allow people to specify the diff command. (Might want to use wdiff,
gnudiff, etc.)
Just diff the temporary file with the destination file, and delete
the tmp file rather than moving it into place.
Interaction with --partial.
Security interactions with daemon mode?
-- --
Add daemon --no-fork option
Very useful for debugging. Also good when running under a
daemon-monitoring process that tries to restart the service when the
parent exits.
-- --
Create more granular verbosity 2003/05/15
Control output with the --report option.
The option takes as a single argument (no whitespace) a
comma delimited lists of keywords.
This would separate debugging from "logging" as well as
fine grained selection of statistical reporting and what
actions are logged.
https://lists.samba.org/archive/rsync/2003-May/006059.html
-- --
DOCUMENTATION --------------------------------------------------------
Keep list of open issues and todos on the web site
-- --
Perhaps redo manual as SGML
The man page is getting rather large, and there is more information
that ought to be added.
TexInfo source is probably a dying format.
Linuxdoc looks like the most likely contender. I know DocBook is
favoured by some people, but it's so bloody verbose, even with emacs
support.
-- --
LOGGING --------------------------------------------------------------
Memory accounting
At exit, show how much memory was used for the file list, etc.
We also do a weird exponential-growth allocation in flist.c. I'm
not sure this makes sense with modern mallocs. At any rate it will
make us allocate a huge amount of memory for large file lists.
-- --
Improve error messages
If we hang or get SIGINT, then explain where we were up to. Perhaps
have a static buffer that contains the current function name, or
some kind of description of what we were trying to do. This is a
little easier on people than needing to run strace/truss.
"The dungeon collapses! You are killed." Rather than "unexpected
eof" give a message that is more detailed if possible and also more
helpful.
If we get an error writing to a socket, then we should perhaps
continue trying to read to see if an error message comes across
explaining why the socket is closed. I'm not sure if this would
work, but it would certainly make our messages more helpful.
What happens if a directory is missing -x attributes. Do we lose
our load? (Debian #28416) Probably fixed now, but a test case would
be good.
-- --
Better statistics Rasmus 2002/03/08
<Rasmus>
hey, how about an rsync option that just gives you the
summary without the list of files? And perhaps gives
more information like the number of new files, number
of changed, deleted, etc. ?
<mbp>
nice idea there is --stats but at the moment it's very
tridge-oriented rather than user-friendly it would be
nice to improve it that would also work well with
--dryrun
-- --
Perhaps flush stdout like syslog
Perhaps flush stdout after each filename, so that people trying to
monitor progress in a log file can do so more easily. See
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48108
-- --
Log child death on signal
If a child of the rsync daemon dies with a signal, we should notice
that when we reap it and log a message.
-- --
verbose output David Stein 2001/12/20
At end of transfer, show how many files were or were not transferred
correctly.
-- --
internationalization
Change to using gettext(). Probably need to ship this for platforms
that don't have it.
Solicit translations.
Does anyone care? Before we bother modifying the code, we ought to
get the manual translated first, because that's possibly more useful
and at any rate demonstrates desire.
-- --
DEVELOPMENT --------------------------------------------------------
Handling duplicate names
Some folks would like rsync to be deterministic in how it handles
duplicate names that come from mering multiple source directories
into a single destination directory; e.g. the last name wins. We
could do this by switching our sort algorithm to one that will
guarantee that the names won't be reordered. Alternately, we could
assign an ever-increasing number to each item as we insert it into
the list and then make sure that we leave the largest number when
cleaning the file list (see clean_flist()). Another solution would
be to add a hash table, and thus never put any duplicate names into
the file list (and bump the protocol to handle this).
-- --
Use generic zlib 2002/02/25
Perhaps don't use our own zlib.
Advantages:
- will automatically be up to date with bugfixes in zlib
- can leave it out for small rsync on e.g. recovery disks
- can use a shared library
- avoids people breaking rsync by trying to do this themselves and
messing up
Should we ship zlib for systems that don't have it, or require
people to install it separately?
Apparently this will make us incompatible with versions of rsync
that use the patched version of rsync. Probably the simplest way to
do this is to just disable gzip (with a warning) when talking to old
versions.
-- --
Splint 2002/03/12
Build rsync with SPLINT to try to find security holes. Add
annotations as necessary. Keep track of the number of warnings
found initially, and see how many of them are real bugs, or real
security bugs. Knowing the percentage of likely hits would be
really interesting for other projects.
-- --
PERFORMANCE ----------------------------------------------------------
Allow skipping MD4 file_sum 2002/04/08
If we're doing a local transfer, or using -W, then perhaps don't
send the file checksum. If we're doing a local transfer, then
calculating MD4 checksums uses 90% of CPU and is unlikely to be
useful.
We should not allow it to be disabled separately from -W, though
as it is the only thing that lets us know when the rsync algorithm
got out of sync and messed the file up (i.e. if the basis file
changed between checksum generation and reception).
-- --
Accelerate MD4
Perhaps borrow an assembler MD4 from someone?
Make sure we call MD4 with properly-sized blocks whenever possible
to avoid copying into the residue region?
-- --
TESTING --------------------------------------------------------------
Torture test
Something that just keeps running rsync continuously over a data set
likely to generate problems.
-- --
Cross-test versions 2001/08/22
Part of the regression suite should be making sure that we
don't break backwards compatibility: old clients vs new
servers and so on. Ideally we would test both up and down
from the current release to all old versions.
Run current rsync versions against significant past releases.
We might need to omit broken old versions, or versions in which
particular functionality is broken
It might be sufficient to test downloads from well-known public
rsync servers running different versions of rsync. This will give
some testing and also be the most common case for having different
versions and not being able to upgrade.
The new --protocol option may help in this.
-- --
Test on kernel source
Download all versions of kernel; unpack, sync between them. Also
sync between uncompressed tarballs. Compare directories after
transfer.
Use local mode; ssh; daemon; --whole-file and --no-whole-file.
Use awk to pull out the 'speedup' number for each transfer. Make
sure it is >= x.
-- --
Test large files
Sparse and non-sparse
-- --
Create mutator program for testing
Insert bytes, delete bytes, swap blocks, ...
-- --
Create configure option to enable dangerous tests
-- --
Create pipe program for testing
Create pipe program that makes slow/jerky connections for
testing Versions of read() and write() that corrupt the
stream, or abruptly fail
-- --
Create test makefile target for some tests
Separate makefile target to run rough tests -- or perhaps
just run them every time?
-- --
RELATED PROJECTS -----------------------------------------------------
rsyncsh
Write a small emulation of interactive ftp as a Pythonn program
that calls rsync. Commands such as "cd", "ls", "ls *.c" etc map
fairly directly into rsync commands: it just needs to remember the
current host, directory and so on. We can probably even do
completion of remote filenames.
-- --
https://rsync.samba.org/rsync-and-debian/
-- --
rsyncable gzip patch
Exhaustive, tortuous testing
Cleanups?
-- --
rsyncsplit as alternative to real integration with gzip?
-- --
reverse rsync over HTTP Range
Goswin Brederlow suggested this on Debian; I think tridge and I
talked about it previous in relation to rproxy.
Addendum: It looks like someone is working on a version of this:
http://zsync.moria.org.uk/
-- --

344
access.c
View File

@@ -1,96 +1,257 @@
/*
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
hosts allow/deny code for rsync
*/
* Routines to authenticate access to a daemon (hosts allow/deny).
*
* Copyright (C) 1998 Andrew Tridgell
* Copyright (C) 2004-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "ifuncs.h"
#ifdef HAVE_NETGROUP_H
#include <netgroup.h>
#endif
static int allow_forward_dns;
static int match_hostname(char *host, char *tok)
extern const char undetermined_hostname[];
static int match_hostname(const char **host_ptr, const char *addr, const char *tok)
{
if (!host || !*host) return 0;
return (fnmatch(tok, host, 0) == 0);
}
struct hostent *hp;
unsigned int i;
const char *host = *host_ptr;
static int match_address(char *addr, char *tok)
{
char *p;
unsigned long a, t, mask = (unsigned long)~0;
if (!addr || !*addr) return 0;
if (!isdigit(tok[0])) return 0;
p = strchr(tok,'/');
if (p) *p = 0;
a = inet_addr(addr);
t = inet_addr(tok);
if (p) {
*p = '/';
}
if (t == INADDR_NONE) {
rprintf(FERROR,"malformed address %s\n", tok);
if (!host || !*host)
return 0;
}
a = ntohl(a);
t = ntohl(t);
#ifdef HAVE_INNETGR
if (*tok == '@' && tok[1])
return innetgr(tok + 1, host, NULL, NULL);
#endif
if (p) {
if (strchr(p+1,'.')) {
mask = inet_addr(p+1);
if (mask == INADDR_NONE) {
rprintf(FERROR,"malformed mask in %s\n", tok);
return 0;
}
mask = ntohl(mask);
} else {
int bits = atoi(p+1);
if (bits <= 0 || bits > 32) {
rprintf(FERROR,"malformed mask in %s\n", tok);
return 0;
}
mask &= (mask << (32-bits));
/* First check if the reverse-DNS-determined hostname matches. */
if (iwildmatch(tok, host))
return 1;
if (!allow_forward_dns)
return 0;
/* Fail quietly if tok is an address or wildcarded entry, not a simple hostname. */
if (!tok[strspn(tok, ".0123456789")] || tok[strcspn(tok, ":/*?[")])
return 0;
/* Now try forward-DNS on the token (config-specified hostname) and see if the IP matches. */
if (!(hp = gethostbyname(tok)))
return 0;
for (i = 0; hp->h_addr_list[i] != NULL; i++) {
if (strcmp(addr, inet_ntoa(*(struct in_addr*)(hp->h_addr_list[i]))) == 0) {
/* If reverse lookups are off, we'll use the conf-specified
* hostname in preference to UNDETERMINED. */
if (host == undetermined_hostname)
*host_ptr = strdup(tok);
return 1;
}
}
return ((a&mask) == (t&mask));
return 0;
}
static int access_match(char *list, char *addr, char *host)
static int match_binary(const char *b1, const char *b2, const char *mask, int addrlen)
{
int i;
for (i = 0; i < addrlen; i++) {
if ((b1[i] ^ b2[i]) & mask[i])
return 0;
}
return 1;
}
static void make_mask(char *mask, int plen, int addrlen)
{
int w, b;
w = plen >> 3;
b = plen & 0x7;
if (w)
memset(mask, 0xff, w);
if (w < addrlen)
mask[w] = 0xff & (0xff<<(8-b));
if (w+1 < addrlen)
memset(mask+w+1, 0, addrlen-w-1);
return;
}
static int match_address(const char *addr, const char *tok)
{
char *p;
struct addrinfo hints, *resa, *rest;
int gai;
int ret = 0;
int addrlen = 0;
#ifdef HAVE_STRTOL
long int bits;
#else
int bits;
#endif
char mask[16];
char *a = NULL, *t = NULL;
if (!addr || !*addr)
return 0;
p = strchr(tok,'/');
if (p)
*p = '\0';
/* Fail quietly if tok is a hostname, not an address. */
if (tok[strspn(tok, ".0123456789")] && strchr(tok, ':') == NULL) {
if (p)
*p = '/';
return 0;
}
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
#ifdef AI_NUMERICHOST
hints.ai_flags = AI_NUMERICHOST;
#endif
if (getaddrinfo(addr, NULL, &hints, &resa) != 0) {
if (p)
*p = '/';
return 0;
}
gai = getaddrinfo(tok, NULL, &hints, &rest);
if (p)
*p++ = '/';
if (gai != 0) {
rprintf(FLOG, "error matching address %s: %s\n",
tok, gai_strerror(gai));
freeaddrinfo(resa);
return 0;
}
if (rest->ai_family != resa->ai_family) {
ret = 0;
goto out;
}
switch(resa->ai_family) {
case PF_INET:
a = (char *)&((struct sockaddr_in *)resa->ai_addr)->sin_addr;
t = (char *)&((struct sockaddr_in *)rest->ai_addr)->sin_addr;
addrlen = 4;
break;
#ifdef INET6
case PF_INET6: {
struct sockaddr_in6 *sin6a, *sin6t;
sin6a = (struct sockaddr_in6 *)resa->ai_addr;
sin6t = (struct sockaddr_in6 *)rest->ai_addr;
a = (char *)&sin6a->sin6_addr;
t = (char *)&sin6t->sin6_addr;
addrlen = 16;
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
if (sin6t->sin6_scope_id && sin6a->sin6_scope_id != sin6t->sin6_scope_id) {
ret = 0;
goto out;
}
#endif
break;
}
#endif
default:
rprintf(FLOG, "unknown family %u\n", rest->ai_family);
ret = 0;
goto out;
}
bits = -1;
if (p) {
if (inet_pton(resa->ai_addr->sa_family, p, mask) <= 0) {
#ifdef HAVE_STRTOL
char *ep = NULL;
#else
unsigned char *pp;
#endif
#ifdef HAVE_STRTOL
bits = strtol(p, &ep, 10);
if (!*p || *ep) {
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}
#else
for (pp = (unsigned char *)p; *pp; pp++) {
if (!isascii(*pp) || !isdigit(*pp)) {
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}
}
bits = atoi(p);
#endif
if (bits == 0) {
ret = 1;
goto out;
}
if (bits < 0 || bits > (addrlen << 3)) {
rprintf(FLOG, "malformed mask in %s\n", tok);
ret = 0;
goto out;
}
}
} else {
bits = 128;
}
if (bits >= 0)
make_mask(mask, bits, addrlen);
ret = match_binary(a, t, mask, addrlen);
out:
freeaddrinfo(resa);
freeaddrinfo(rest);
return ret;
}
static int access_match(const char *list, const char *addr, const char **host_ptr)
{
char *tok;
char *list2 = strdup(list);
if (!list2) out_of_memory("access_match");
strlower(list2);
if (host) strlower(host);
for (tok=strtok(list2," ,\t"); tok; tok=strtok(NULL," ,\t")) {
if (match_hostname(host, tok) || match_address(addr, tok)) {
for (tok = strtok(list2, " ,\t"); tok; tok = strtok(NULL, " ,\t")) {
if (match_hostname(host_ptr, addr, tok) || match_address(addr, tok)) {
free(list2);
return 1;
}
@@ -100,31 +261,32 @@ static int access_match(char *list, char *addr, char *host)
return 0;
}
int allow_access(char *addr, char *host, char *allow_list, char *deny_list)
int allow_access(const char *addr, const char **host_ptr, int i)
{
/* if theres no deny list and no allow list then allow access */
if ((!deny_list || !*deny_list) && (!allow_list || !*allow_list))
return 1;
const char *allow_list = lp_hosts_allow(i);
const char *deny_list = lp_hosts_deny(i);
/* if there is an allow list but no deny list then allow only hosts
on the allow list */
if (!deny_list || !*deny_list)
return(access_match(allow_list, addr, host));
if (allow_list && !*allow_list)
allow_list = NULL;
if (deny_list && !*deny_list)
deny_list = NULL;
/* if theres a deny list but no allow list then allow
all hosts not on the deny list */
if (!allow_list || !*allow_list)
return(!access_match(deny_list,addr,host));
allow_forward_dns = lp_forward_lookup(i);
/* if there are both type of list then allow all hosts on the
allow list */
if (access_match(allow_list,addr,host))
return 1;
/* If we match an allow-list item, we always allow access. */
if (allow_list) {
if (access_match(allow_list, addr, host_ptr))
return 1;
/* For an allow-list w/o a deny-list, disallow non-matches. */
if (!deny_list)
return 0;
}
/* if there are both type of list and it's not on the allow then
allow it if its not on the deny */
if (access_match(deny_list,addr,host))
/* If we match a deny-list item (and got past any allow-list
* items), we always disallow access. */
if (deny_list && access_match(deny_list, addr, host_ptr))
return 0;
/* Allow all other access. */
return 1;
}

View File

@@ -1,11 +0,0 @@
#undef HAVE_BROKEN_READDIR
#undef HAVE_ERRNO_DECL
#undef HAVE_LONGLONG
#undef HAVE_OFF64_T
#undef HAVE_REMSH
#undef HAVE_UNSIGNED_CHAR
#undef HAVE_UTIMBUF
#undef ino_t
#undef HAVE_CONNECT
#undef HAVE_SHORT_INO_T
#undef REPLACE_INET_NTOA

1139
acls.c Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,38 +1,42 @@
/*
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Support rsync daemon authentication.
*
* Copyright (C) 1998-2000 Andrew Tridgell
* Copyright (C) 2002-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
/* support rsync authentication */
#include "rsync.h"
#include "itypes.h"
#include "ifuncs.h"
extern int read_only;
extern char *password_file;
/***************************************************************************
encode a buffer using base64 - simple and slow algorithm. null terminates
the result.
***************************************************************************/
static void base64_encode(char *buf, int len, char *out)
void base64_encode(const char *buf, int len, char *out, int pad)
{
char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
int bit_offset, byte_offset, idx, i;
unsigned char *d = (unsigned char *)buf;
const uchar *d = (const uchar *)buf;
int bytes = (len*8 + 5)/6;
memset(out, 0, bytes+1);
for (i=0;i<bytes;i++) {
for (i = 0; i < bytes; i++) {
byte_offset = (i*6)/8;
bit_offset = (i*6)%8;
if (bit_offset < 3) {
@@ -45,171 +49,325 @@ static void base64_encode(char *buf, int len, char *out)
}
out[i] = b64[idx];
}
while (pad && (i % 4))
out[i++] = '=';
out[i] = '\0';
}
/* create a 16 byte challenge buffer */
static void gen_challenge(char *addr, char *challenge)
/* Generate a challenge buffer and return it base64-encoded. */
static void gen_challenge(const char *addr, char *challenge)
{
char input[32];
char digest[MAX_DIGEST_LEN];
struct timeval tv;
int len;
memset(input, 0, sizeof(input));
memset(input, 0, sizeof input);
strlcpy((char *)input, addr, 16);
gettimeofday(&tv, NULL);
strlcpy(input, addr, 17);
sys_gettimeofday(&tv);
SIVAL(input, 16, tv.tv_sec);
SIVAL(input, 20, tv.tv_usec);
SIVAL(input, 24, getpid());
sum_init();
sum_update(input, sizeof(input));
sum_end(challenge);
sum_init(-1, 0);
sum_update(input, sizeof input);
len = sum_end(digest);
base64_encode(digest, len, challenge, 0);
}
/* return the secret for a user from the sercret file. maximum length
is len. null terminate it */
static int get_secret(int module, char *user, char *secret, int len)
/* Generate an MD4 hash created from the combination of the password
* and the challenge string and return it base64-encoded. */
static void generate_hash(const char *in, const char *challenge, char *out)
{
char *fname = lp_secrets_file(module);
int fd, found=0;
char line[MAXPATHLEN];
char *p, *pass=NULL;
char buf[MAX_DIGEST_LEN];
int len;
if (!fname || !*fname) return 0;
fd = open(fname,O_RDONLY);
if (fd == -1) return 0;
while (!found) {
int i = 0;
memset(line, 0, sizeof(line));
while (i<(sizeof(line)-1)) {
if (read(fd, &line[i], 1) != 1) {
memset(line, 0, sizeof(line));
close(fd);
return 0;
}
if (line[i] == '\r') continue;
if (line[i] == '\n') break;
i++;
}
line[i] = 0;
if (line[0] == '#') continue;
p = strchr(line,':');
if (!p) continue;
*p = 0;
if (strcmp(user, line)) continue;
pass = p+1;
found = 1;
}
close(fd);
if (!found) return 0;
strlcpy(secret, pass, len);
return 1;
}
/* generate a 16 byte hash from a password and challenge */
static void generate_hash(char *in, char *challenge, char *out)
{
char buf[16];
sum_init();
sum_init(-1, 0);
sum_update(in, strlen(in));
sum_update(challenge, strlen(challenge));
sum_end(buf);
len = sum_end(buf);
base64_encode(buf, 16, out);
base64_encode(buf, len, out, 0);
}
/* possible negotiate authentication with the client. Use "leader" to
start off the auth if necessary
/* Return the secret for a user from the secret file, null terminated.
* Maximum length is len (not counting the null). */
static const char *check_secret(int module, const char *user, const char *group,
const char *challenge, const char *pass)
{
char line[1024];
char pass2[MAX_DIGEST_LEN*2];
const char *fname = lp_secrets_file(module);
STRUCT_STAT st;
int ok = 1;
int user_len = strlen(user);
int group_len = group ? strlen(group) : 0;
char *err;
FILE *fh;
return NULL if authentication failed
if (!fname || !*fname || (fh = fopen(fname, "r")) == NULL)
return "no secrets file";
return "" if anonymous access
if (do_fstat(fileno(fh), &st) == -1) {
rsyserr(FLOG, errno, "fstat(%s)", fname);
ok = 0;
} else if (lp_strict_modes(module)) {
if ((st.st_mode & 06) != 0) {
rprintf(FLOG, "secrets file must not be other-accessible (see strict modes option)\n");
ok = 0;
} else if (MY_UID() == ROOT_UID && st.st_uid != ROOT_UID) {
rprintf(FLOG, "secrets file must be owned by root when running as root (see strict modes)\n");
ok = 0;
}
}
if (!ok) {
fclose(fh);
return "ignoring secrets file";
}
otherwise return username
*/
char *auth_server(int fd, int module, char *addr, char *leader)
if (*user == '#') {
/* Reject attempt to match a comment. */
fclose(fh);
return "invalid username";
}
/* Try to find a line that starts with the user (or @group) name and a ':'. */
err = "secret not found";
while ((user || group) && fgets(line, sizeof line, fh) != NULL) {
const char **ptr, *s = strtok(line, "\n\r");
int len;
if (!s)
continue;
if (*s == '@') {
ptr = &group;
len = group_len;
s++;
} else {
ptr = &user;
len = user_len;
}
if (!*ptr || strncmp(s, *ptr, len) != 0 || s[len] != ':')
continue;
generate_hash(s+len+1, challenge, pass2);
if (strcmp(pass, pass2) == 0) {
err = NULL;
break;
}
err = "password mismatch";
*ptr = NULL; /* Don't look for name again. */
}
fclose(fh);
force_memzero(line, sizeof line);
force_memzero(pass2, sizeof pass2);
return err;
}
static const char *getpassf(const char *filename)
{
STRUCT_STAT st;
char buffer[512], *p;
int n;
if (!filename)
return NULL;
if (strcmp(filename, "-") == 0) {
n = fgets(buffer, sizeof buffer, stdin) == NULL ? -1 : (int)strlen(buffer);
} else {
int fd;
if ((fd = open(filename,O_RDONLY)) < 0) {
rsyserr(FERROR, errno, "could not open password file %s", filename);
exit_cleanup(RERR_SYNTAX);
}
if (do_stat(filename, &st) == -1) {
rsyserr(FERROR, errno, "stat(%s)", filename);
exit_cleanup(RERR_SYNTAX);
}
if ((st.st_mode & 06) != 0) {
rprintf(FERROR, "ERROR: password file must not be other-accessible\n");
exit_cleanup(RERR_SYNTAX);
}
if (MY_UID() == ROOT_UID && st.st_uid != ROOT_UID) {
rprintf(FERROR, "ERROR: password file must be owned by root when running as root\n");
exit_cleanup(RERR_SYNTAX);
}
n = read(fd, buffer, sizeof buffer - 1);
close(fd);
}
if (n > 0) {
buffer[n] = '\0';
if ((p = strtok(buffer, "\n\r")) != NULL)
return strdup(p);
}
rprintf(FERROR, "ERROR: failed to read a password from %s\n", filename);
exit_cleanup(RERR_SYNTAX);
}
/* Possibly negotiate authentication with the client. Use "leader" to
* start off the auth if necessary.
*
* Return NULL if authentication failed. Return "" if anonymous access.
* Otherwise return username.
*/
char *auth_server(int f_in, int f_out, int module, const char *host,
const char *addr, const char *leader)
{
char *users = lp_auth_users(module);
char challenge[16];
char b64_challenge[30];
char line[MAXPATHLEN];
static char user[100];
char secret[100];
char pass[30];
char pass2[30];
char *tok;
char challenge[MAX_DIGEST_LEN*2];
char line[BIGPATHBUFLEN];
const char **auth_uid_groups = NULL;
int auth_uid_groups_cnt = -1;
const char *err = NULL;
int group_match = -1;
char *tok, *pass;
char opt_ch = '\0';
/* if no auth list then allow anyone in! */
if (!users || !*users) return "";
if (!users || !*users)
return "";
gen_challenge(addr, challenge);
base64_encode(challenge, 16, b64_challenge);
io_printf(fd,"%s%s\n", leader, b64_challenge);
io_printf(f_out, "%s%s\n", leader, challenge);
if (!read_line(fd, line, sizeof(line)-1)) {
return NULL;
}
memset(user, 0, sizeof(user));
memset(pass, 0, sizeof(pass));
if (sscanf(line,"%99s %29s", user, pass) != 2) {
if (!read_line_old(f_in, line, sizeof line, 0)
|| (pass = strchr(line, ' ')) == NULL) {
rprintf(FLOG, "auth failed on module %s from %s (%s): "
"invalid challenge response\n",
lp_name(module), host, addr);
return NULL;
}
*pass++ = '\0';
users = strdup(users);
if (!users) return NULL;
for (tok=strtok(users," ,\t"); tok; tok = strtok(NULL," ,\t")) {
if (strcmp(tok, user) == 0) break;
for (tok = strtok(users, " ,\t"); tok; tok = strtok(NULL, " ,\t")) {
char *opts;
/* See if the user appended :deny, :ro, or :rw. */
if ((opts = strchr(tok, ':')) != NULL) {
*opts++ = '\0';
opt_ch = isUpper(opts) ? toLower(opts) : *opts;
if (opt_ch == 'r') { /* handle ro and rw */
opt_ch = isUpper(opts+1) ? toLower(opts+1) : opts[1];
if (opt_ch == 'o')
opt_ch = 'r';
else if (opt_ch != 'w')
opt_ch = '\0';
} else if (opt_ch != 'd') /* if it's not deny, ignore it */
opt_ch = '\0';
} else
opt_ch = '\0';
if (*tok != '@') {
/* Match the username */
if (wildmatch(tok, line))
break;
} else {
#ifdef HAVE_GETGROUPLIST
int j;
/* See if authorizing user is a real user, and if so, see
* if it is in a group that matches tok+1 wildmat. */
if (auth_uid_groups_cnt < 0) {
item_list gid_list = EMPTY_ITEM_LIST;
uid_t auth_uid;
if (!user_to_uid(line, &auth_uid, False)
|| getallgroups(auth_uid, &gid_list) != NULL)
auth_uid_groups_cnt = 0;
else {
gid_t *gid_array = gid_list.items;
auth_uid_groups_cnt = gid_list.count;
auth_uid_groups = new_array(const char *, auth_uid_groups_cnt);
for (j = 0; j < auth_uid_groups_cnt; j++)
auth_uid_groups[j] = gid_to_group(gid_array[j]);
}
}
for (j = 0; j < auth_uid_groups_cnt; j++) {
if (auth_uid_groups[j] && wildmatch(tok+1, auth_uid_groups[j])) {
group_match = j;
break;
}
}
if (group_match >= 0)
break;
#else
rprintf(FLOG, "your computer doesn't support getgrouplist(), so no @group authorization is possible.\n");
#endif
}
}
free(users);
if (!tok) {
return NULL;
if (!tok)
err = "no matching rule";
else if (opt_ch == 'd')
err = "denied by rule";
else {
const char *group = group_match >= 0 ? auth_uid_groups[group_match] : NULL;
err = check_secret(module, line, group, challenge, pass);
}
memset(secret, 0, sizeof(secret));
if (!get_secret(module, user, secret, sizeof(secret)-1)) {
memset(secret, 0, sizeof(secret));
force_memzero(challenge, sizeof challenge);
force_memzero(pass, strlen(pass));
if (auth_uid_groups) {
int j;
for (j = 0; j < auth_uid_groups_cnt; j++) {
if (auth_uid_groups[j])
free((char*)auth_uid_groups[j]);
}
free(auth_uid_groups);
}
if (err) {
rprintf(FLOG, "auth failed on module %s from %s (%s) for %s: %s\n",
lp_name(module), host, addr, line, err);
return NULL;
}
generate_hash(secret, b64_challenge, pass2);
memset(secret, 0, sizeof(secret));
if (strcmp(pass, pass2) == 0)
return user;
if (opt_ch == 'r')
read_only = 1;
else if (opt_ch == 'w')
read_only = 0;
return NULL;
return strdup(line);
}
void auth_client(int fd, char *user, char *challenge)
void auth_client(int fd, const char *user, const char *challenge)
{
char *pass;
char pass2[30];
const char *pass;
char pass2[MAX_DIGEST_LEN*2];
if (!user || !*user) return;
if (!user || !*user)
user = "nobody";
if (!(pass=getenv("RSYNC_PASSWORD"))) {
if (!(pass = getpassf(password_file))
&& !(pass = getenv("RSYNC_PASSWORD"))) {
/* XXX: cyeoh says that getpass is deprecated, because
* it may return a truncated password on some systems,
* and it is not in the LSB.
*
* Andrew Klein says that getpassphrase() is present
* on Solaris and reads up to 256 characters.
*
* OpenBSD has a readpassphrase() that might be more suitable.
*/
pass = getpass("Password: ");
}
if (!pass || !*pass) {
if (!pass)
pass = "";
}
generate_hash(pass, challenge, pass2);
io_printf(fd, "%s %s\n", user, pass2);
}

355
backup.c Normal file
View File

@@ -0,0 +1,355 @@
/*
* Backup handling code.
*
* Copyright (C) 1999 Andrew Tridgell
* Copyright (C) 2003-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "ifuncs.h"
extern int am_root;
extern int preserve_acls;
extern int preserve_xattrs;
extern int preserve_devices;
extern int preserve_specials;
extern int preserve_links;
extern int safe_symlinks;
extern int backup_dir_len;
extern unsigned int backup_dir_remainder;
extern char backup_dir_buf[MAXPATHLEN];
extern char *backup_suffix;
extern char *backup_dir;
/* Returns -1 on error, 0 on missing dir, and 1 on present dir. */
static int validate_backup_dir(void)
{
STRUCT_STAT st;
if (do_lstat(backup_dir_buf, &st) < 0) {
if (errno == ENOENT)
return 0;
rsyserr(FERROR, errno, "backup lstat %s failed", backup_dir_buf);
return -1;
}
if (!S_ISDIR(st.st_mode)) {
int flags = get_del_for_flag(st.st_mode) | DEL_FOR_BACKUP | DEL_RECURSE;
if (delete_item(backup_dir_buf, st.st_mode, flags) == 0)
return 0;
return -1;
}
return 1;
}
/* Create a backup path from the given fname, putting the result into
* backup_dir_buf. Any new directories (compared to the prior backup
* path) are ensured to exist as directories, replacing anything else
* that may be in the way (e.g. a symlink). */
static BOOL copy_valid_path(const char *fname)
{
const char *f;
int val;
BOOL ret = True;
stat_x sx;
char *b, *rel = backup_dir_buf + backup_dir_len, *name = rel;
for (f = fname, b = rel; *f && *f == *b; f++, b++) {
if (*b == '/')
name = b + 1;
}
if (stringjoin(rel, backup_dir_remainder, fname, backup_suffix, NULL) >= backup_dir_remainder) {
rprintf(FERROR, "backup filename too long\n");
*name = '\0';
return False;
}
for ( ; ; name = b + 1) {
if ((b = strchr(name, '/')) == NULL)
return True;
*b = '\0';
val = validate_backup_dir();
if (val == 0)
break;
if (val < 0) {
*name = '\0';
return False;
}
*b = '/';
}
init_stat_x(&sx);
for ( ; b; name = b + 1, b = strchr(name, '/')) {
*b = '\0';
while (do_mkdir(backup_dir_buf, ACCESSPERMS) < 0) {
if (errno == EEXIST) {
val = validate_backup_dir();
if (val > 0)
break;
if (val == 0)
continue;
} else
rsyserr(FERROR, errno, "backup mkdir %s failed", backup_dir_buf);
*name = '\0';
ret = False;
goto cleanup;
}
/* Try to transfer the directory settings of the actual dir
* that the files are coming from. */
if (x_stat(rel, &sx.st, NULL) < 0)
rsyserr(FERROR, errno, "backup stat %s failed", full_fname(rel));
else {
struct file_struct *file;
if (!(file = make_file(rel, NULL, NULL, 0, NO_FILTERS)))
continue;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(rel, &sx);
cache_tmp_acl(file, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(rel, &sx);
cache_tmp_xattr(file, &sx);
free_xattr(&sx);
}
#endif
set_file_attrs(backup_dir_buf, file, NULL, NULL, 0);
unmake_file(file);
}
*b = '/';
}
cleanup:
#ifdef SUPPORT_ACLS
uncache_tmp_acls();
#endif
#ifdef SUPPORT_XATTRS
uncache_tmp_xattrs();
#endif
return ret;
}
/* Make a complete pathname for backup file and verify any new path elements. */
char *get_backup_name(const char *fname)
{
if (backup_dir) {
static int initialized = 0;
if (!initialized) {
int ret;
if (backup_dir_len > 1)
backup_dir_buf[backup_dir_len-1] = '\0';
ret = make_path(backup_dir_buf, 0);
if (backup_dir_len > 1)
backup_dir_buf[backup_dir_len-1] = '/';
if (ret < 0)
return NULL;
initialized = 1;
}
/* copy fname into backup_dir_buf while validating the dirs. */
if (copy_valid_path(fname))
return backup_dir_buf;
/* copy_valid_path() has printed an error message. */
return NULL;
}
if (stringjoin(backup_dir_buf, MAXPATHLEN, fname, backup_suffix, NULL) < MAXPATHLEN)
return backup_dir_buf;
rprintf(FERROR, "backup filename too long\n");
return NULL;
}
/* Has same return codes as make_backup(). */
static inline int link_or_rename(const char *from, const char *to,
BOOL prefer_rename, STRUCT_STAT *stp)
{
#ifdef SUPPORT_HARD_LINKS
if (!prefer_rename) {
#ifndef CAN_HARDLINK_SYMLINK
if (S_ISLNK(stp->st_mode))
return 0; /* Use copy code. */
#endif
#ifndef CAN_HARDLINK_SPECIAL
if (IS_SPECIAL(stp->st_mode) || IS_DEVICE(stp->st_mode))
return 0; /* Use copy code. */
#endif
if (do_link(from, to) == 0) {
if (DEBUG_GTE(BACKUP, 1))
rprintf(FINFO, "make_backup: HLINK %s successful.\n", from);
return 2;
}
/* We prefer to rename a regular file rather than copy it. */
if (!S_ISREG(stp->st_mode) || errno == EEXIST || errno == EISDIR)
return 0;
}
#endif
if (do_rename(from, to) == 0) {
if (stp->st_nlink > 1 && !S_ISDIR(stp->st_mode)) {
/* If someone has hard-linked the file into the backup
* dir, rename() might return success but do nothing! */
robust_unlink(from); /* Just in case... */
}
if (DEBUG_GTE(BACKUP, 1))
rprintf(FINFO, "make_backup: RENAME %s successful.\n", from);
return 1;
}
return 0;
}
/* Hard-link, rename, or copy an item to the backup name. Returns 0 for
* failure, 1 if item was moved, 2 if item was duplicated or hard linked
* into backup area, or 3 if item doesn't exist or isn't a regular file. */
int make_backup(const char *fname, BOOL prefer_rename)
{
stat_x sx;
struct file_struct *file;
int save_preserve_xattrs;
char *buf;
int ret = 0;
init_stat_x(&sx);
/* Return success if no file to keep. */
if (x_lstat(fname, &sx.st, NULL) < 0)
return 3;
if (!(buf = get_backup_name(fname)))
return 0;
/* Try a hard-link or a rename first. Using rename is not atomic, but
* is more efficient than forcing a copy for larger files when no hard-
* linking is possible. */
if ((ret = link_or_rename(fname, buf, prefer_rename, &sx.st)) != 0)
goto success;
if (errno == EEXIST || errno == EISDIR) {
STRUCT_STAT bakst;
if (do_lstat(buf, &bakst) == 0) {
int flags = get_del_for_flag(bakst.st_mode) | DEL_FOR_BACKUP | DEL_RECURSE;
if (delete_item(buf, bakst.st_mode, flags) != 0)
return 0;
}
if ((ret = link_or_rename(fname, buf, prefer_rename, &sx.st)) != 0)
goto success;
}
/* Fall back to making a copy. */
if (!(file = make_file(fname, NULL, &sx.st, 0, NO_FILTERS)))
return 3; /* the file could have disappeared */
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
get_acl(fname, &sx);
cache_tmp_acl(file, &sx);
free_acl(&sx);
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
get_xattr(fname, &sx);
cache_tmp_xattr(file, &sx);
free_xattr(&sx);
}
#endif
/* Check to see if this is a device file, or link */
if ((am_root && preserve_devices && IS_DEVICE(file->mode))
|| (preserve_specials && IS_SPECIAL(file->mode))) {
if (do_mknod(buf, file->mode, sx.st.st_rdev) < 0)
rsyserr(FERROR, errno, "mknod %s failed", full_fname(buf));
else if (DEBUG_GTE(BACKUP, 1))
rprintf(FINFO, "make_backup: DEVICE %s successful.\n", fname);
ret = 2;
}
#ifdef SUPPORT_LINKS
if (!ret && preserve_links && S_ISLNK(file->mode)) {
const char *sl = F_SYMLINK(file);
if (safe_symlinks && unsafe_symlink(sl, fname)) {
if (INFO_GTE(SYMSAFE, 1)) {
rprintf(FINFO, "not backing up unsafe symlink \"%s\" -> \"%s\"\n",
fname, sl);
}
ret = 2;
} else {
if (do_symlink(sl, buf) < 0)
rsyserr(FERROR, errno, "link %s -> \"%s\"", full_fname(buf), sl);
else if (DEBUG_GTE(BACKUP, 1))
rprintf(FINFO, "make_backup: SYMLINK %s successful.\n", fname);
ret = 2;
}
}
#endif
if (!ret && !S_ISREG(file->mode)) {
if (INFO_GTE(NONREG, 1))
rprintf(FINFO, "make_bak: skipping non-regular file %s\n", fname);
unmake_file(file);
#ifdef SUPPORT_ACLS
uncache_tmp_acls();
#endif
#ifdef SUPPORT_XATTRS
uncache_tmp_xattrs();
#endif
return 3;
}
/* Copy to backup tree if a file. */
if (!ret) {
if (copy_file(fname, buf, -1, file->mode) < 0) {
rsyserr(FERROR, errno, "keep_backup failed: %s -> \"%s\"",
full_fname(fname), buf);
unmake_file(file);
#ifdef SUPPORT_ACLS
uncache_tmp_acls();
#endif
#ifdef SUPPORT_XATTRS
uncache_tmp_xattrs();
#endif
return 0;
}
if (DEBUG_GTE(BACKUP, 1))
rprintf(FINFO, "make_backup: COPY %s successful.\n", fname);
ret = 2;
}
save_preserve_xattrs = preserve_xattrs;
preserve_xattrs = 0;
set_file_attrs(buf, file, NULL, fname, ATTRS_ACCURATE_TIME);
preserve_xattrs = save_preserve_xattrs;
unmake_file(file);
#ifdef SUPPORT_ACLS
uncache_tmp_acls();
#endif
#ifdef SUPPORT_XATTRS
uncache_tmp_xattrs();
#endif
success:
if (INFO_GTE(BACKUP, 1))
rprintf(FINFO, "backed up %s to %s\n", fname, buf);
return ret;
}

312
batch.c Normal file
View File

@@ -0,0 +1,312 @@
/*
* Support for the batch-file options.
*
* Copyright (C) 1999 Weiss
* Copyright (C) 2004 Chris Shoemaker
* Copyright (C) 2004-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include <zlib.h>
#include <time.h>
extern int eol_nulls;
extern int recurse;
extern int xfer_dirs;
extern int preserve_links;
extern int preserve_hard_links;
extern int preserve_devices;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_acls;
extern int preserve_xattrs;
extern int always_checksum;
extern int do_compression;
extern int inplace;
extern int append_mode;
extern int write_batch;
extern int protocol_version;
extern int raw_argc, cooked_argc;
extern char **raw_argv, **cooked_argv;
extern char *batch_name;
#ifdef ICONV_OPTION
extern char *iconv_opt;
#endif
extern filter_rule_list filter_list;
int batch_fd = -1;
int batch_sh_fd = -1;
int batch_stream_flags;
static int tweaked_append;
static int tweaked_append_verify;
static int tweaked_iconv;
static int *flag_ptr[] = {
&recurse, /* 0 */
&preserve_uid, /* 1 */
&preserve_gid, /* 2 */
&preserve_links, /* 3 */
&preserve_devices, /* 4 */
&preserve_hard_links, /* 5 */
&always_checksum, /* 6 */
&xfer_dirs, /* 7 (protocol 29) */
&do_compression, /* 8 (protocol 29) */
&tweaked_iconv, /* 9 (protocol 30) */
&preserve_acls, /* 10 (protocol 30) */
&preserve_xattrs, /* 11 (protocol 30) */
&inplace, /* 12 (protocol 30) */
&tweaked_append, /* 13 (protocol 30) */
&tweaked_append_verify, /* 14 (protocol 30) */
NULL
};
static char *flag_name[] = {
"--recurse (-r)",
"--owner (-o)",
"--group (-g)",
"--links (-l)",
"--devices (-D)",
"--hard-links (-H)",
"--checksum (-c)",
"--dirs (-d)",
"--compress (-z)",
"--iconv",
"--acls (-A)",
"--xattrs (-X)",
"--inplace",
"--append",
"--append-verify",
NULL
};
void write_stream_flags(int fd)
{
int i, flags;
tweaked_append = append_mode == 1;
tweaked_append_verify = append_mode == 2;
#ifdef ICONV_OPTION
tweaked_iconv = iconv_opt != NULL;
#endif
/* Start the batch file with a bitmap of data-stream-affecting
* flags. */
for (i = 0, flags = 0; flag_ptr[i]; i++) {
if (*flag_ptr[i])
flags |= 1 << i;
}
write_int(fd, flags);
}
void read_stream_flags(int fd)
{
batch_stream_flags = read_int(fd);
}
void check_batch_flags(void)
{
int i;
if (protocol_version < 29)
flag_ptr[7] = NULL;
else if (protocol_version < 30)
flag_ptr[9] = NULL;
tweaked_append = append_mode == 1;
tweaked_append_verify = append_mode == 2;
#ifdef ICONV_OPTION
tweaked_iconv = iconv_opt != NULL;
#endif
for (i = 0; flag_ptr[i]; i++) {
int set = batch_stream_flags & (1 << i) ? 1 : 0;
if (*flag_ptr[i] != set) {
if (i == 9) {
rprintf(FERROR,
"%s specify the --iconv option to use this batch file.\n",
set ? "Please" : "Do not");
exit_cleanup(RERR_SYNTAX);
}
if (INFO_GTE(MISC, 1)) {
rprintf(FINFO,
"%sing the %s option to match the batchfile.\n",
set ? "Sett" : "Clear", flag_name[i]);
}
*flag_ptr[i] = set;
}
}
if (protocol_version < 29) {
if (recurse)
xfer_dirs |= 1;
else if (xfer_dirs < 2)
xfer_dirs = 0;
}
if (tweaked_append)
append_mode = 1;
else if (tweaked_append_verify)
append_mode = 2;
}
static int write_arg(const char *arg)
{
const char *x, *s;
int len, err = 0;
if (*arg == '-' && (x = strchr(arg, '=')) != NULL) {
err |= write(batch_sh_fd, arg, x - arg + 1) != x - arg + 1;
arg += x - arg + 1;
}
if (strpbrk(arg, " \"'&;|[]()$#!*?^\\") != NULL) {
err |= write(batch_sh_fd, "'", 1) != 1;
for (s = arg; (x = strchr(s, '\'')) != NULL; s = x + 1) {
err |= write(batch_sh_fd, s, x - s + 1) != x - s + 1;
err |= write(batch_sh_fd, "'", 1) != 1;
}
len = strlen(s);
err |= write(batch_sh_fd, s, len) != len;
err |= write(batch_sh_fd, "'", 1) != 1;
return err;
}
len = strlen(arg);
err |= write(batch_sh_fd, arg, len) != len;
return err;
}
/* Writes out a space and then an option (or other string) with an optional "=" + arg suffix. */
static int write_opt(const char *opt, const char *arg)
{
int len = strlen(opt);
int err = write(batch_sh_fd, " ", 1) != 1;
err = write(batch_sh_fd, opt, len) != len ? 1 : 0;
if (arg) {
err |= write(batch_sh_fd, "=", 1) != 1;
err |= write_arg(arg);
}
return err;
}
static void write_filter_rules(int fd)
{
filter_rule *ent;
write_sbuf(fd, " <<'#E#'\n");
for (ent = filter_list.head; ent; ent = ent->next) {
unsigned int plen;
char *p = get_rule_prefix(ent, "- ", 0, &plen);
write_buf(fd, p, plen);
write_sbuf(fd, ent->pattern);
if (ent->rflags & FILTRULE_DIRECTORY)
write_byte(fd, '/');
write_byte(fd, eol_nulls ? 0 : '\n');
}
if (eol_nulls)
write_sbuf(fd, ";\n");
write_sbuf(fd, "#E#");
}
/* This sets batch_fd and (for --write-batch) batch_sh_fd. */
void open_batch_files(void)
{
if (write_batch) {
char filename[MAXPATHLEN];
stringjoin(filename, sizeof filename, batch_name, ".sh", NULL);
batch_sh_fd = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IXUSR);
if (batch_sh_fd < 0) {
rsyserr(FERROR, errno, "Batch file %s open error", full_fname(filename));
exit_cleanup(RERR_FILESELECT);
}
batch_fd = do_open(batch_name, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
} else if (strcmp(batch_name, "-") == 0)
batch_fd = STDIN_FILENO;
else
batch_fd = do_open(batch_name, O_RDONLY, S_IRUSR | S_IWUSR);
if (batch_fd < 0) {
rsyserr(FERROR, errno, "Batch file %s open error", full_fname(batch_name));
exit_cleanup(RERR_FILEIO);
}
}
/* This routine tries to write out an equivalent --read-batch command
* given the user's --write-batch args. However, it doesn't really
* understand most of the options, so it uses some overly simple
* heuristics to munge the command line into something that will
* (hopefully) work. */
void write_batch_shell_file(void)
{
int i, j, len, err = 0;
char *p, *p2;
/* Write argvs info to BATCH.sh file */
err |= write_arg(raw_argv[0]);
if (filter_list.head) {
if (protocol_version >= 29)
err |= write_opt("--filter", "._-");
else
err |= write_opt("--exclude-from", "-");
}
/* Elide the filename args from the option list, but scan for them in reverse. */
for (i = raw_argc-1, j = cooked_argc-1; i > 0 && j >= 0; i--) {
if (strcmp(raw_argv[i], cooked_argv[j]) == 0) {
raw_argv[i] = NULL;
j--;
}
}
for (i = 1; i < raw_argc; i++) {
if (!(p = raw_argv[i]))
continue;
if (strncmp(p, "--files-from", 12) == 0
|| strncmp(p, "--filter", 8) == 0
|| strncmp(p, "--include", 9) == 0
|| strncmp(p, "--exclude", 9) == 0) {
if (strchr(p, '=') == NULL)
i++;
continue;
}
if (strcmp(p, "-f") == 0) {
i++;
continue;
}
if (strncmp(p, "--write-batch", len = 13) == 0
|| strncmp(p, "--only-write-batch", len = 18) == 0)
err |= write_opt("--read-batch", p[len] == '=' ? p + len + 1 : NULL);
else {
err |= write(batch_sh_fd, " ", 1) != 1;
err |= write_arg(p);
}
}
if (!(p = check_for_hostspec(cooked_argv[cooked_argc - 1], &p2, &i)))
p = cooked_argv[cooked_argc - 1];
err |= write_opt("${1:-", NULL);
err |= write_arg(p);
err |= write(batch_sh_fd, "}", 1) != 1;
if (filter_list.head)
write_filter_rules(batch_sh_fd);
if (write(batch_sh_fd, "\n", 1) != 1 || close(batch_sh_fd) < 0 || err) {
rsyserr(FERROR, errno, "Batch file %s.sh write error", batch_name);
exit_cleanup(RERR_FILEIO);
}
batch_sh_fd = -1;
}

View File

@@ -1,27 +1,28 @@
/*
simple byteorder handling
Copyright (C) Andrew Tridgell 1992-1995
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Simple byteorder handling.
*
* Copyright (C) 1992-1995 Andrew Tridgell
* Copyright (C) 2007-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#undef CAREFUL_ALIGNMENT
/* we know that the x86 can handle misalignment and has the "right"
byteorder */
#ifdef __i386__
/* We know that the x86 can handle misalignment and has the same
* byte order (LSB-first) as the 32-bit numbers we transmit. */
#if defined __i386__ || defined __i486__ || defined __i586__ || defined __i686__ || __amd64
#define CAREFUL_ALIGNMENT 0
#endif
@@ -30,25 +31,102 @@
#endif
#define CVAL(buf,pos) (((unsigned char *)(buf))[pos])
#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val))
#define UVAL(buf,pos) ((uint32)CVAL(buf,pos))
#if CAREFUL_ALIGNMENT
#define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8)
#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
#define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8)
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
#else
/* this handles things for architectures like the 386 that can handle
alignment errors */
/*
WARNING: This section is dependent on the length of int32
being correct. set CAREFUL_ALIGNMENT if it is not.
*/
#define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos)))
#define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val))
#endif
static inline uint32
IVALu(const uchar *buf, int pos)
{
return UVAL(buf, pos)
| UVAL(buf, pos + 1) << 8
| UVAL(buf, pos + 2) << 16
| UVAL(buf, pos + 3) << 24;
}
static inline void
SIVALu(uchar *buf, int pos, uint32 val)
{
CVAL(buf, pos) = val;
CVAL(buf, pos + 1) = val >> 8;
CVAL(buf, pos + 2) = val >> 16;
CVAL(buf, pos + 3) = val >> 24;
}
static inline int64
IVAL64(const char *buf, int pos)
{
return IVALu((uchar*)buf, pos) | (int64)IVALu((uchar*)buf, pos + 4) << 32;
}
static inline void
SIVAL64(char *buf, int pos, int64 val)
{
SIVALu((uchar*)buf, pos, val);
SIVALu((uchar*)buf, pos + 4, val >> 32);
}
#else /* !CAREFUL_ALIGNMENT */
/* This handles things for architectures like the 386 that can handle alignment errors.
* WARNING: This section is dependent on the length of an int32 (and thus a uint32)
* being correct (4 bytes)! Set CAREFUL_ALIGNMENT if it is not. */
static inline uint32
IVALu(const uchar *buf, int pos)
{
union {
const uchar *b;
const uint32 *num;
} u;
u.b = buf + pos;
return *u.num;
}
static inline void
SIVALu(uchar *buf, int pos, uint32 val)
{
union {
uchar *b;
uint32 *num;
} u;
u.b = buf + pos;
*u.num = val;
}
static inline int64
IVAL64(const char *buf, int pos)
{
union {
const char *b;
const int64 *num;
} u;
u.b = buf + pos;
return *u.num;
}
static inline void
SIVAL64(char *buf, int pos, int64 val)
{
union {
char *b;
int64 *num;
} u;
u.b = buf + pos;
*u.num = val;
}
#endif /* !CAREFUL_ALIGNMENT */
static inline uint32
IVAL(const char *buf, int pos)
{
return IVALu((uchar*)buf, pos);
}
static inline void
SIVAL(char *buf, int pos, uint32 val)
{
SIVALu((uchar*)buf, pos, val);
}

92
case_N.h Normal file
View File

@@ -0,0 +1,92 @@
/*
* Allow an arbitrary sequence of case labels.
*
* Copyright (C) 2006-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
/* This is included multiple times, once for every segment in a switch statement.
* This produces the next "case N:" statement in sequence. */
#if !defined CASE_N_STATE_0
#define CASE_N_STATE_0
case 0:
#elif !defined CASE_N_STATE_1
#define CASE_N_STATE_1
/* FALLTHROUGH */
case 1:
#elif !defined CASE_N_STATE_2
#define CASE_N_STATE_2
/* FALLTHROUGH */
case 2:
#elif !defined CASE_N_STATE_3
#define CASE_N_STATE_3
/* FALLTHROUGH */
case 3:
#elif !defined CASE_N_STATE_4
#define CASE_N_STATE_4
/* FALLTHROUGH */
case 4:
#elif !defined CASE_N_STATE_5
#define CASE_N_STATE_5
/* FALLTHROUGH */
case 5:
#elif !defined CASE_N_STATE_6
#define CASE_N_STATE_6
/* FALLTHROUGH */
case 6:
#elif !defined CASE_N_STATE_7
#define CASE_N_STATE_7
/* FALLTHROUGH */
case 7:
#elif !defined CASE_N_STATE_8
#define CASE_N_STATE_8
/* FALLTHROUGH */
case 8:
#elif !defined CASE_N_STATE_9
#define CASE_N_STATE_9
/* FALLTHROUGH */
case 9:
#elif !defined CASE_N_STATE_10
#define CASE_N_STATE_10
/* FALLTHROUGH */
case 10:
#elif !defined CASE_N_STATE_11
#define CASE_N_STATE_11
/* FALLTHROUGH */
case 11:
#elif !defined CASE_N_STATE_12
#define CASE_N_STATE_12
/* FALLTHROUGH */
case 12:
#elif !defined CASE_N_STATE_13
#define CASE_N_STATE_13
/* FALLTHROUGH */
case 13:
#elif !defined CASE_N_STATE_14
#define CASE_N_STATE_14
/* FALLTHROUGH */
case 14:
#elif !defined CASE_N_STATE_15
#define CASE_N_STATE_15
/* FALLTHROUGH */
case 15:
#elif !defined CASE_N_STATE_16
#define CASE_N_STATE_16
/* FALLTHROUGH */
case 16:
#else
#error Need to add more case statements!
#endif

View File

@@ -1,180 +1,625 @@
/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Routines to support checksumming of bytes.
*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2004-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the copyright holders give
* permission to dynamically link rsync with the OpenSSL and xxhash
* libraries when those libraries are being distributed in compliance
* with their license terms, and to distribute a dynamically linked
* combination of rsync and these libraries. This is also considered
* to be covered under the GPL's System Libraries exception.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
int csum_length=2; /* initial value */
#ifdef SUPPORT_XXHASH
#include <xxhash.h>
# if XXH_VERSION_NUMBER >= 800
# define SUPPORT_XXH3 1
# endif
#endif
#define CSUM_CHUNK 64
extern int am_server;
extern int whole_file;
extern int checksum_seed;
extern int protocol_version;
extern int proper_seed_order;
extern const char *checksum_choice;
int checksum_seed = 0;
extern int remote_version;
struct name_num_obj valid_checksums = {
"checksum", NULL, NULL, 0, 0, {
#ifdef SUPPORT_XXH3
{ CSUM_XXH3_128, "xxh128", NULL },
{ CSUM_XXH3_64, "xxh3", NULL },
#endif
#ifdef SUPPORT_XXHASH
{ CSUM_XXH64, "xxh64", NULL },
{ CSUM_XXH64, "xxhash", NULL },
#endif
{ CSUM_MD5, "md5", NULL },
{ CSUM_MD4, "md4", NULL },
{ CSUM_NONE, "none", NULL },
{ 0, NULL, NULL }
}
};
int xfersum_type = 0; /* used for the file transfer checksums */
int checksum_type = 0; /* used for the pre-transfer (--checksum) checksums */
int parse_csum_name(const char *name, int len)
{
struct name_num_item *nni;
if (len < 0 && name)
len = strlen(name);
if (!name || (len == 4 && strncasecmp(name, "auto", 4) == 0)) {
if (protocol_version >= 30)
return CSUM_MD5;
if (protocol_version >= 27)
return CSUM_MD4_OLD;
if (protocol_version >= 21)
return CSUM_MD4_BUSTED;
return CSUM_MD4_ARCHAIC;
}
nni = get_nni_by_name(&valid_checksums, name, len);
if (!nni) {
rprintf(FERROR, "unknown checksum name: %s\n", name);
exit_cleanup(RERR_UNSUPPORTED);
}
return nni->num;
}
static const char *checksum_name(int num)
{
struct name_num_item *nni = get_nni_by_num(&valid_checksums, num);
return nni ? nni->name : num < CSUM_MD4 ? "md4" : "UNKNOWN";
}
void parse_checksum_choice(int final_call)
{
if (valid_checksums.negotiated_name)
xfersum_type = checksum_type = valid_checksums.negotiated_num;
else {
char *cp = checksum_choice ? strchr(checksum_choice, ',') : NULL;
if (cp) {
xfersum_type = parse_csum_name(checksum_choice, cp - checksum_choice);
checksum_type = parse_csum_name(cp+1, -1);
} else
xfersum_type = checksum_type = parse_csum_name(checksum_choice, -1);
if (am_server && checksum_choice)
validate_choice_vs_env(NSTR_CHECKSUM, xfersum_type, checksum_type);
}
if (xfersum_type == CSUM_NONE)
whole_file = 1;
/* Snag the checksum name for both write_batch's option output & the following debug output. */
if (valid_checksums.negotiated_name)
checksum_choice = valid_checksums.negotiated_name;
else if (checksum_choice == NULL)
checksum_choice = checksum_name(xfersum_type);
if (final_call && DEBUG_GTE(NSTR, am_server ? 3 : 1)) {
rprintf(FINFO, "%s%s checksum: %s\n",
am_server ? "Server" : "Client",
valid_checksums.negotiated_name ? " negotiated" : "",
checksum_choice);
}
}
int csum_len_for_type(int cst, BOOL flist_csum)
{
switch (cst) {
case CSUM_NONE:
return 1;
case CSUM_MD4_ARCHAIC:
/* The oldest checksum code is rather weird: the file-list code only sent
* 2-byte checksums, but all other checksums were full MD4 length. */
return flist_csum ? 2 : MD4_DIGEST_LEN;
case CSUM_MD4:
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
return MD4_DIGEST_LEN;
case CSUM_MD5:
return MD5_DIGEST_LEN;
case CSUM_XXH64:
case CSUM_XXH3_64:
return 64/8;
case CSUM_XXH3_128:
return 128/8;
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
return 0;
}
/* Returns 0 if the checksum is not canonical (i.e. it includes a seed value).
* Returns 1 if the public sum order matches our internal sum order.
* Returns -1 if the public sum order is the reverse of our internal sum order.
*/
int canonical_checksum(int csum_type)
{
switch (csum_type) {
case CSUM_NONE:
case CSUM_MD4_ARCHAIC:
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
break;
case CSUM_MD4:
case CSUM_MD5:
return -1;
case CSUM_XXH64:
case CSUM_XXH3_64:
case CSUM_XXH3_128:
return 1;
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
return 0;
}
#ifndef USE_ROLL_SIMD /* See simd-checksum-*.cpp. */
/*
a simple 32 bit checksum that can be upadted from either end
a simple 32 bit checksum that can be updated from either end
(inspired by Mark Adler's Adler-32 checksum)
*/
uint32 get_checksum1(char *buf1,int len)
uint32 get_checksum1(char *buf1, int32 len)
{
int i;
uint32 s1, s2;
schar *buf = (schar *)buf1;
int32 i;
uint32 s1, s2;
schar *buf = (schar *)buf1;
s1 = s2 = 0;
for (i = 0; i < (len-4); i+=4) {
s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3] +
10*CHAR_OFFSET;
s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4*CHAR_OFFSET);
}
for (; i < len; i++) {
s1 += (buf[i]+CHAR_OFFSET); s2 += s1;
}
return (s1 & 0xffff) + (s2 << 16);
s1 = s2 = 0;
for (i = 0; i < (len-4); i+=4) {
s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3] + 10*CHAR_OFFSET;
s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4*CHAR_OFFSET);
}
for (; i < len; i++) {
s1 += (buf[i]+CHAR_OFFSET); s2 += s1;
}
return (s1 & 0xffff) + (s2 << 16);
}
#endif
void get_checksum2(char *buf, int32 len, char *sum)
{
switch (xfersum_type) {
#ifdef SUPPORT_XXHASH
case CSUM_XXH64:
SIVAL64(sum, 0, XXH64(buf, len, checksum_seed));
break;
#endif
#ifdef SUPPORT_XXH3
case CSUM_XXH3_64:
SIVAL64(sum, 0, XXH3_64bits_withSeed(buf, len, checksum_seed));
break;
case CSUM_XXH3_128: {
XXH128_hash_t digest = XXH3_128bits_withSeed(buf, len, checksum_seed);
SIVAL64(sum, 0, digest.low64);
SIVAL64(sum, 8, digest.high64);
break;
}
#endif
case CSUM_MD5: {
md5_context m5;
uchar seedbuf[4];
md5_begin(&m5);
if (proper_seed_order) {
if (checksum_seed) {
SIVALu(seedbuf, 0, checksum_seed);
md5_update(&m5, seedbuf, 4);
}
md5_update(&m5, (uchar *)buf, len);
} else {
md5_update(&m5, (uchar *)buf, len);
if (checksum_seed) {
SIVALu(seedbuf, 0, checksum_seed);
md5_update(&m5, seedbuf, 4);
}
}
md5_result(&m5, (uchar *)sum);
break;
}
case CSUM_MD4:
#ifdef USE_OPENSSL
{
MD4_CTX m4;
MD4_Init(&m4);
MD4_Update(&m4, (uchar *)buf, len);
if (checksum_seed) {
uchar seedbuf[4];
SIVALu(seedbuf, 0, checksum_seed);
MD4_Update(&m4, seedbuf, 4);
}
MD4_Final((uchar *)sum, &m4);
break;
}
#endif
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
case CSUM_MD4_ARCHAIC: {
md_context m;
int32 i;
static char *buf1;
static int32 len1;
mdfour_begin(&m);
if (len > len1) {
if (buf1)
free(buf1);
buf1 = new_array(char, len+4);
len1 = len;
}
memcpy(buf1, buf, len);
if (checksum_seed) {
SIVAL(buf1,len,checksum_seed);
len += 4;
}
for (i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK)
mdfour_update(&m, (uchar *)(buf1+i), CSUM_CHUNK);
/*
* Prior to version 27 an incorrect MD4 checksum was computed
* by failing to call mdfour_tail() for block sizes that
* are multiples of 64. This is fixed by calling mdfour_update()
* even when there are no more bytes.
*/
if (len - i > 0 || xfersum_type > CSUM_MD4_BUSTED)
mdfour_update(&m, (uchar *)(buf1+i), len-i);
mdfour_result(&m, (uchar *)sum);
break;
}
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
}
void get_checksum2(char *buf,int len,char *sum)
void file_checksum(const char *fname, const STRUCT_STAT *st_p, char *sum)
{
int i;
static char *buf1;
static int len1;
struct mdfour m;
if (len > len1) {
if (buf1) free(buf1);
buf1 = (char *)malloc(len+4);
len1 = len;
if (!buf1) out_of_memory("get_checksum2");
}
mdfour_begin(&m);
memcpy(buf1,buf,len);
if (checksum_seed) {
SIVAL(buf1,len,checksum_seed);
len += 4;
}
for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) {
mdfour_update(&m, (uchar *)(buf1+i), CSUM_CHUNK);
}
if (len - i > 0) {
mdfour_update(&m, (uchar *)(buf1+i), (len-i));
}
mdfour_result(&m, (uchar *)sum);
}
void file_checksum(char *fname,char *sum,OFF_T size)
{
OFF_T i;
struct map_struct *buf;
OFF_T i, len = st_p->st_size;
int32 remainder;
int fd;
OFF_T len = size;
char tmpchunk[CSUM_CHUNK];
struct mdfour m;
memset(sum,0,csum_length);
fd = open(fname,O_RDONLY);
if (fd == -1) return;
buf = map_file(fd,size);
mdfour_begin(&m);
for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) {
memcpy(tmpchunk, map_ptr(buf,i,CSUM_CHUNK), CSUM_CHUNK);
mdfour_update(&m, (uchar *)tmpchunk, CSUM_CHUNK);
memset(sum, 0, MAX_DIGEST_LEN);
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1)
return;
buf = map_file(fd, len, MAX_MAP_SIZE, CHUNK_SIZE);
switch (checksum_type) {
#ifdef SUPPORT_XXHASH
case CSUM_XXH64: {
static XXH64_state_t* state = NULL;
if (!state && !(state = XXH64_createState()))
out_of_memory("file_checksum");
XXH64_reset(state, 0);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
XXH64_update(state, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
remainder = (int32)(len - i);
if (remainder > 0)
XXH64_update(state, (uchar *)map_ptr(buf, i, remainder), remainder);
SIVAL64(sum, 0, XXH64_digest(state));
break;
}
#endif
#ifdef SUPPORT_XXH3
case CSUM_XXH3_64: {
static XXH3_state_t* state = NULL;
if (!state && !(state = XXH3_createState()))
out_of_memory("file_checksum");
XXH3_64bits_reset(state);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
XXH3_64bits_update(state, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
remainder = (int32)(len - i);
if (remainder > 0)
XXH3_64bits_update(state, (uchar *)map_ptr(buf, i, remainder), remainder);
SIVAL64(sum, 0, XXH3_64bits_digest(state));
break;
}
case CSUM_XXH3_128: {
XXH128_hash_t digest;
static XXH3_state_t* state = NULL;
if (!state && !(state = XXH3_createState()))
out_of_memory("file_checksum");
XXH3_128bits_reset(state);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
XXH3_128bits_update(state, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
remainder = (int32)(len - i);
if (remainder > 0)
XXH3_128bits_update(state, (uchar *)map_ptr(buf, i, remainder), remainder);
digest = XXH3_128bits_digest(state);
SIVAL64(sum, 0, digest.low64);
SIVAL64(sum, 8, digest.high64);
break;
}
#endif
case CSUM_MD5: {
md5_context m5;
md5_begin(&m5);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
md5_update(&m5, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
remainder = (int32)(len - i);
if (remainder > 0)
md5_update(&m5, (uchar *)map_ptr(buf, i, remainder), remainder);
md5_result(&m5, (uchar *)sum);
break;
}
case CSUM_MD4:
#ifdef USE_OPENSSL
{
MD4_CTX m4;
MD4_Init(&m4);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
MD4_Update(&m4, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
remainder = (int32)(len - i);
if (remainder > 0)
MD4_Update(&m4, (uchar *)map_ptr(buf, i, remainder), remainder);
MD4_Final((uchar *)sum, &m4);
break;
}
#endif
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
case CSUM_MD4_ARCHAIC: {
md_context m;
mdfour_begin(&m);
for (i = 0; i + CHUNK_SIZE <= len; i += CHUNK_SIZE)
mdfour_update(&m, (uchar *)map_ptr(buf, i, CHUNK_SIZE), CHUNK_SIZE);
/* Prior to version 27 an incorrect MD4 checksum was computed
* by failing to call mdfour_tail() for block sizes that
* are multiples of 64. This is fixed by calling mdfour_update()
* even when there are no more bytes. */
remainder = (int32)(len - i);
if (remainder > 0 || checksum_type > CSUM_MD4_BUSTED)
mdfour_update(&m, (uchar *)map_ptr(buf, i, remainder), remainder);
mdfour_result(&m, (uchar *)sum);
break;
}
default:
rprintf(FERROR, "Invalid checksum-choice for --checksum: %s (%d)\n",
checksum_name(checksum_type), checksum_type);
exit_cleanup(RERR_UNSUPPORTED);
}
if (len - i > 0) {
memcpy(tmpchunk, map_ptr(buf,i,len-i), len-i);
mdfour_update(&m, (uchar *)tmpchunk, (len-i));
}
mdfour_result(&m, (uchar *)sum);
close(fd);
unmap_file(buf);
}
static int32 sumresidue;
static union {
md_context md;
#ifdef USE_OPENSSL
MD4_CTX m4;
#endif
md5_context m5;
} ctx;
#ifdef SUPPORT_XXHASH
static XXH64_state_t* xxh64_state;
#endif
#ifdef SUPPORT_XXH3
static XXH3_state_t* xxh3_state;
#endif
static int cursum_type;
void checksum_init(void)
{
if (remote_version >= 14)
csum_length = 2; /* adaptive */
else
csum_length = SUM_LENGTH;
}
static int sumresidue;
static char sumrbuf[CSUM_CHUNK];
static struct mdfour md;
void sum_init(void)
void sum_init(int csum_type, int seed)
{
char s[4];
mdfour_begin(&md);
sumresidue=0;
SIVAL(s,0,checksum_seed);
sum_update(s,4);
if (csum_type < 0)
csum_type = parse_csum_name(NULL, 0);
cursum_type = csum_type;
switch (csum_type) {
#ifdef SUPPORT_XXHASH
case CSUM_XXH64:
if (!xxh64_state && !(xxh64_state = XXH64_createState()))
out_of_memory("sum_init");
XXH64_reset(xxh64_state, 0);
break;
#endif
#ifdef SUPPORT_XXH3
case CSUM_XXH3_64:
if (!xxh3_state && !(xxh3_state = XXH3_createState()))
out_of_memory("sum_init");
XXH3_64bits_reset(xxh3_state);
break;
case CSUM_XXH3_128:
if (!xxh3_state && !(xxh3_state = XXH3_createState()))
out_of_memory("sum_init");
XXH3_128bits_reset(xxh3_state);
break;
#endif
case CSUM_MD5:
md5_begin(&ctx.m5);
break;
case CSUM_MD4:
#ifdef USE_OPENSSL
MD4_Init(&ctx.m4);
#else
mdfour_begin(&ctx.md);
sumresidue = 0;
#endif
break;
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
case CSUM_MD4_ARCHAIC:
mdfour_begin(&ctx.md);
sumresidue = 0;
SIVAL(s, 0, seed);
sum_update(s, 4);
break;
case CSUM_NONE:
break;
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
}
void sum_update(char *p,int len)
/**
* Feed data into an MD4 accumulator, md. The results may be
* retrieved using sum_end(). md is used for different purposes at
* different points during execution.
*
* @todo Perhaps get rid of md and just pass in the address each time.
* Very slightly clearer and slower.
**/
void sum_update(const char *p, int32 len)
{
int i;
if (len + sumresidue < CSUM_CHUNK) {
memcpy(sumrbuf+sumresidue, p, len);
sumresidue += len;
return;
}
switch (cursum_type) {
#ifdef SUPPORT_XXHASH
case CSUM_XXH64:
XXH64_update(xxh64_state, p, len);
break;
#endif
#ifdef SUPPORT_XXH3
case CSUM_XXH3_64:
XXH3_64bits_update(xxh3_state, p, len);
break;
case CSUM_XXH3_128:
XXH3_128bits_update(xxh3_state, p, len);
break;
#endif
case CSUM_MD5:
md5_update(&ctx.m5, (uchar *)p, len);
break;
case CSUM_MD4:
#ifdef USE_OPENSSL
MD4_Update(&ctx.m4, (uchar *)p, len);
break;
#endif
case CSUM_MD4_OLD:
case CSUM_MD4_BUSTED:
case CSUM_MD4_ARCHAIC:
if (len + sumresidue < CSUM_CHUNK) {
memcpy(ctx.md.buffer + sumresidue, p, len);
sumresidue += len;
break;
}
if (sumresidue) {
i = MIN(CSUM_CHUNK-sumresidue,len);
memcpy(sumrbuf+sumresidue,p,i);
mdfour_update(&md, (uchar *)sumrbuf, (i+sumresidue));
len -= i;
p += i;
}
if (sumresidue) {
int32 i = CSUM_CHUNK - sumresidue;
memcpy(ctx.md.buffer + sumresidue, p, i);
mdfour_update(&ctx.md, (uchar *)ctx.md.buffer, CSUM_CHUNK);
len -= i;
p += i;
}
for(i = 0; i + CSUM_CHUNK <= len; i += CSUM_CHUNK) {
memcpy(sumrbuf,p+i,CSUM_CHUNK);
mdfour_update(&md, (uchar *)sumrbuf, CSUM_CHUNK);
}
while (len >= CSUM_CHUNK) {
mdfour_update(&ctx.md, (uchar *)p, CSUM_CHUNK);
len -= CSUM_CHUNK;
p += CSUM_CHUNK;
}
if (len - i > 0) {
sumresidue = len-i;
memcpy(sumrbuf,p+i,sumresidue);
} else {
sumresidue = 0;
sumresidue = len;
if (sumresidue)
memcpy(ctx.md.buffer, p, sumresidue);
break;
case CSUM_NONE:
break;
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
}
void sum_end(char *sum)
/* NOTE: all the callers of sum_end() pass in a pointer to a buffer that is
* MAX_DIGEST_LEN in size, so even if the csum-len is shorter that that (i.e.
* CSUM_MD4_ARCHAIC), we don't have to worry about limiting the data we write
* into the "sum" buffer. */
int sum_end(char *sum)
{
if (sumresidue) {
mdfour_update(&md, (uchar *)sumrbuf, sumresidue);
switch (cursum_type) {
#ifdef SUPPORT_XXHASH
case CSUM_XXH64:
SIVAL64(sum, 0, XXH64_digest(xxh64_state));
break;
#endif
#ifdef SUPPORT_XXH3
case CSUM_XXH3_64:
SIVAL64(sum, 0, XXH3_64bits_digest(xxh3_state));
break;
case CSUM_XXH3_128: {
XXH128_hash_t digest = XXH3_128bits_digest(xxh3_state);
SIVAL64(sum, 0, digest.low64);
SIVAL64(sum, 8, digest.high64);
break;
}
#endif
case CSUM_MD5:
md5_result(&ctx.m5, (uchar *)sum);
break;
case CSUM_MD4:
#ifdef USE_OPENSSL
MD4_Final((uchar *)sum, &ctx.m4);
break;
#endif
case CSUM_MD4_OLD:
mdfour_update(&ctx.md, (uchar *)ctx.md.buffer, sumresidue);
mdfour_result(&ctx.md, (uchar *)sum);
break;
case CSUM_MD4_BUSTED:
case CSUM_MD4_ARCHAIC:
if (sumresidue)
mdfour_update(&ctx.md, (uchar *)ctx.md.buffer, sumresidue);
mdfour_result(&ctx.md, (uchar *)sum);
break;
case CSUM_NONE:
*sum = '\0';
break;
default: /* paranoia to prevent missing case values */
exit_cleanup(RERR_UNSUPPORTED);
}
mdfour_result(&md, (uchar *)sum);
return csum_len_for_type(cursum_type, 0);
}

249
chmod.c Normal file
View File

@@ -0,0 +1,249 @@
/*
* Implement the core of the --chmod option.
*
* Copyright (C) 2002 Scott Howard
* Copyright (C) 2005-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "itypes.h"
extern mode_t orig_umask;
#define FLAG_X_KEEP (1<<0)
#define FLAG_DIRS_ONLY (1<<1)
#define FLAG_FILES_ONLY (1<<2)
struct chmod_mode_struct {
struct chmod_mode_struct *next;
int ModeAND, ModeOR;
char flags;
};
#define CHMOD_ADD 1
#define CHMOD_SUB 2
#define CHMOD_EQ 3
#define CHMOD_SET 4
#define STATE_ERROR 0
#define STATE_1ST_HALF 1
#define STATE_2ND_HALF 2
#define STATE_OCTAL_NUM 3
/* Parse a chmod-style argument, and break it down into one or more AND/OR
* pairs in a linked list. We return a pointer to new items on success
* (appending the items to the specified list), or NULL on error. */
struct chmod_mode_struct *parse_chmod(const char *modestr,
struct chmod_mode_struct **root_mode_ptr)
{
int state = STATE_1ST_HALF;
int where = 0, what = 0, op = 0, topbits = 0, topoct = 0, flags = 0;
struct chmod_mode_struct *first_mode = NULL, *curr_mode = NULL,
*prev_mode = NULL;
while (state != STATE_ERROR) {
if (!*modestr || *modestr == ',') {
int bits;
if (!op) {
state = STATE_ERROR;
break;
}
prev_mode = curr_mode;
curr_mode = new_array(struct chmod_mode_struct, 1);
if (prev_mode)
prev_mode->next = curr_mode;
else
first_mode = curr_mode;
curr_mode->next = NULL;
if (where)
bits = where * what;
else {
where = 0111;
bits = (where * what) & ~orig_umask;
}
switch (op) {
case CHMOD_ADD:
curr_mode->ModeAND = CHMOD_BITS;
curr_mode->ModeOR = bits + topoct;
break;
case CHMOD_SUB:
curr_mode->ModeAND = CHMOD_BITS - bits - topoct;
curr_mode->ModeOR = 0;
break;
case CHMOD_EQ:
curr_mode->ModeAND = CHMOD_BITS - (where * 7) - (topoct ? topbits : 0);
curr_mode->ModeOR = bits + topoct;
break;
case CHMOD_SET:
curr_mode->ModeAND = 0;
curr_mode->ModeOR = bits;
break;
}
curr_mode->flags = flags;
if (!*modestr)
break;
modestr++;
state = STATE_1ST_HALF;
where = what = op = topoct = topbits = flags = 0;
}
switch (state) {
case STATE_1ST_HALF:
switch (*modestr) {
case 'D':
if (flags & FLAG_FILES_ONLY)
state = STATE_ERROR;
flags |= FLAG_DIRS_ONLY;
break;
case 'F':
if (flags & FLAG_DIRS_ONLY)
state = STATE_ERROR;
flags |= FLAG_FILES_ONLY;
break;
case 'u':
where |= 0100;
topbits |= 04000;
break;
case 'g':
where |= 0010;
topbits |= 02000;
break;
case 'o':
where |= 0001;
break;
case 'a':
where |= 0111;
break;
case '+':
op = CHMOD_ADD;
state = STATE_2ND_HALF;
break;
case '-':
op = CHMOD_SUB;
state = STATE_2ND_HALF;
break;
case '=':
op = CHMOD_EQ;
state = STATE_2ND_HALF;
break;
default:
if (isDigit(modestr) && *modestr < '8' && !where) {
op = CHMOD_SET;
state = STATE_OCTAL_NUM;
where = 1;
what = *modestr - '0';
} else
state = STATE_ERROR;
break;
}
break;
case STATE_2ND_HALF:
switch (*modestr) {
case 'r':
what |= 4;
break;
case 'w':
what |= 2;
break;
case 'X':
flags |= FLAG_X_KEEP;
/* FALL THROUGH */
case 'x':
what |= 1;
break;
case 's':
if (topbits)
topoct |= topbits;
else
topoct = 04000;
break;
case 't':
topoct |= 01000;
break;
default:
state = STATE_ERROR;
break;
}
break;
case STATE_OCTAL_NUM:
if (isDigit(modestr) && *modestr < '8') {
what = what*8 + *modestr - '0';
if (what > CHMOD_BITS)
state = STATE_ERROR;
} else
state = STATE_ERROR;
break;
}
modestr++;
}
if (state == STATE_ERROR) {
free_chmod_mode(first_mode);
return NULL;
}
if (!(curr_mode = *root_mode_ptr))
*root_mode_ptr = first_mode;
else {
while (curr_mode->next)
curr_mode = curr_mode->next;
curr_mode->next = first_mode;
}
return first_mode;
}
/* Takes an existing file permission and a list of AND/OR changes, and
* create a new permissions. */
int tweak_mode(int mode, struct chmod_mode_struct *chmod_modes)
{
int IsX = mode & 0111;
int NonPerm = mode & ~CHMOD_BITS;
for ( ; chmod_modes; chmod_modes = chmod_modes->next) {
if ((chmod_modes->flags & FLAG_DIRS_ONLY) && !S_ISDIR(NonPerm))
continue;
if ((chmod_modes->flags & FLAG_FILES_ONLY) && S_ISDIR(NonPerm))
continue;
mode &= chmod_modes->ModeAND;
if ((chmod_modes->flags & FLAG_X_KEEP) && !IsX && !S_ISDIR(NonPerm))
mode |= chmod_modes->ModeOR & ~0111;
else
mode |= chmod_modes->ModeOR;
}
return mode | NonPerm;
}
/* Free the linked list created by parse_chmod. */
int free_chmod_mode(struct chmod_mode_struct *chmod_modes)
{
struct chmod_mode_struct *next;
while (chmod_modes) {
next = chmod_modes->next;
free(chmod_modes);
chmod_modes = next;
}
return 0;
}

331
cleanup.c
View File

@@ -1,87 +1,298 @@
/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* End-of-run cleanup routines.
*
* Copyright (C) 1996-2000 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool
* Copyright (C) 2003-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
/* handling the cleanup when a transfer is interrupted is tricky when
--partial is selected. We need to ensure that the partial file is
kept if any real data has been transferred */
int cleanup_got_literal=0;
extern int dry_run;
extern int am_server;
extern int am_daemon;
extern int am_receiver;
extern int am_sender;
extern int io_error;
extern int keep_partial;
extern int got_xfer_error;
extern int protocol_version;
extern int output_needs_newline;
extern char *partial_dir;
extern char *logfile_name;
static char *cleanup_fname;
static char *cleanup_new_fname;
static struct file_struct *cleanup_file;
static int cleanup_fd1, cleanup_fd2;
static struct map_struct *cleanup_buf;
static int cleanup_pid = 0;
int called_from_signal_handler = 0;
BOOL shutting_down = False;
BOOL flush_ok_after_signal = False;
void exit_cleanup(int code)
#ifdef HAVE_SIGACTION
static struct sigaction sigact;
#endif
/**
* Close all open sockets and files, allowing a (somewhat) graceful
* shutdown() of socket connections. This eliminates the abortive
* TCP RST sent by a Winsock-based system when the close() occurs.
**/
void close_all(void)
{
extern int keep_partial;
#ifdef SHUTDOWN_ALL_SOCKETS
int max_fd;
int fd;
int ret;
STRUCT_STAT st;
signal(SIGUSR1, SIG_IGN);
if (cleanup_got_literal && cleanup_fname && keep_partial) {
char *fname = cleanup_fname;
cleanup_fname = NULL;
if (cleanup_buf) unmap_file(cleanup_buf);
if (cleanup_fd1 != -1) close(cleanup_fd1);
if (cleanup_fd2 != -1) close(cleanup_fd2);
finish_transfer(cleanup_new_fname, fname, cleanup_file);
}
io_flush();
if (cleanup_fname)
do_unlink(cleanup_fname);
if (code) {
kill_all(SIGUSR1);
}
if ((cleanup_pid != 0) && (cleanup_pid == (int) getpid())) {
char *pidf = lp_pid_file();
if (pidf && *pidf) {
unlink(lp_pid_file());
max_fd = sysconf(_SC_OPEN_MAX) - 1;
for (fd = max_fd; fd >= 0; fd--) {
if ((ret = do_fstat(fd, &st)) == 0) {
if (is_a_socket(fd))
ret = shutdown(fd, 2);
ret = close(fd);
}
}
#endif
}
if (code) log_exit(code);
/**
* @file cleanup.c
*
* Code for handling interrupted transfers. Depending on the @c
* --partial option, we may either delete the temporary file, or go
* ahead and overwrite the destination. This second behaviour only
* occurs if we've sent literal data and therefore hopefully made
* progress on the transfer.
**/
exit(code);
/**
* Set to True once literal data has been sent across the link for the
* current file. (????)
*
* Handling the cleanup when a transfer is interrupted is tricky when
* --partial is selected. We need to ensure that the partial file is
* kept if any real data has been transferred.
**/
int cleanup_got_literal = 0;
static const char *cleanup_fname;
static const char *cleanup_new_fname;
static struct file_struct *cleanup_file;
static int cleanup_fd_r = -1, cleanup_fd_w = -1;
static pid_t cleanup_pid = 0;
pid_t cleanup_child_pid = -1;
/**
* Eventually calls exit(), passing @p code, therefore does not return.
*
* @param code one of the RERR_* codes from errcode.h.
**/
NORETURN void _exit_cleanup(int code, const char *file, int line)
{
static int switch_step = 0;
static int exit_code = 0, exit_line = 0;
static const char *exit_file = NULL;
static int first_code = 0;
SIGACTION(SIGUSR1, SIG_IGN);
SIGACTION(SIGUSR2, SIG_IGN);
if (!exit_code) { /* Preserve first error exit info when recursing. */
exit_code = code;
exit_file = file;
exit_line = line < 0 ? -line : line;
}
/* If this is the exit at the end of the run, the server side
* should not attempt to output a message (see log_exit()). */
if (am_server && code == 0)
am_server = 2;
/* Some of our actions might cause a recursive call back here, so we
* keep track of where we are in the cleanup and never repeat a step. */
switch (switch_step) {
#include "case_N.h" /* case 0: */
switch_step++;
first_code = code;
if (output_needs_newline) {
fputc('\n', stdout);
output_needs_newline = 0;
}
if (DEBUG_GTE(EXIT, 2)) {
rprintf(FINFO,
"[%s] _exit_cleanup(code=%d, file=%s, line=%d): entered\n",
who_am_i(), code, src_file(file), line);
}
#include "case_N.h"
switch_step++;
if (cleanup_child_pid != -1) {
int status;
int pid = wait_process(cleanup_child_pid, &status, WNOHANG);
if (pid == cleanup_child_pid) {
status = WEXITSTATUS(status);
if (status > exit_code)
exit_code = status;
}
}
#include "case_N.h"
switch_step++;
if (cleanup_got_literal && (cleanup_fname || cleanup_fd_w != -1)) {
if (cleanup_fd_r != -1) {
close(cleanup_fd_r);
cleanup_fd_r = -1;
}
if (cleanup_fd_w != -1) {
flush_write_file(cleanup_fd_w);
close(cleanup_fd_w);
cleanup_fd_w = -1;
}
if (cleanup_fname && cleanup_new_fname && keep_partial
&& handle_partial_dir(cleanup_new_fname, PDIR_CREATE)) {
int tweak_modtime = 0;
const char *fname = cleanup_fname;
cleanup_fname = NULL;
if (!partial_dir) {
/* We don't want to leave a partial file with a modern time or it
* could be skipped via --update. Setting the time to something
* really old also helps it to stand out as unfinished in an ls. */
tweak_modtime = 1;
cleanup_file->modtime = 0;
}
finish_transfer(cleanup_new_fname, fname, NULL, NULL,
cleanup_file, tweak_modtime, !partial_dir);
}
}
#include "case_N.h"
switch_step++;
if (flush_ok_after_signal) {
flush_ok_after_signal = False;
if (code == RERR_SIGNAL)
io_flush(FULL_FLUSH);
}
if (!exit_code && !code)
io_flush(FULL_FLUSH);
#include "case_N.h"
switch_step++;
if (cleanup_fname)
do_unlink(cleanup_fname);
if (exit_code)
kill_all(SIGUSR1);
if (cleanup_pid && cleanup_pid == getpid()) {
char *pidf = lp_pid_file();
if (pidf && *pidf)
unlink(lp_pid_file());
}
if (exit_code == 0) {
if (code)
exit_code = code;
if (io_error & IOERR_DEL_LIMIT)
exit_code = RERR_DEL_LIMIT;
if (io_error & IOERR_VANISHED)
exit_code = RERR_VANISHED;
if (io_error & IOERR_GENERAL || got_xfer_error)
exit_code = RERR_PARTIAL;
}
/* If line < 0, this exit is after a MSG_ERROR_EXIT event, so
* we don't want to output a duplicate error. */
if ((exit_code && line > 0)
|| am_daemon || (logfile_name && (am_server || !INFO_GTE(STATS, 1)))) {
log_exit(exit_code, exit_file, exit_line);
}
#include "case_N.h"
switch_step++;
if (DEBUG_GTE(EXIT, 1)) {
rprintf(FINFO,
"[%s] _exit_cleanup(code=%d, file=%s, line=%d): "
"about to call exit(%d)%s\n",
who_am_i(), first_code, exit_file, exit_line, exit_code,
dry_run ? " (DRY RUN)" : "");
}
#include "case_N.h"
switch_step++;
if (exit_code && exit_code != RERR_SOCKETIO && exit_code != RERR_STREAMIO && exit_code != RERR_SIGNAL1
&& exit_code != RERR_TIMEOUT && !shutting_down) {
if (protocol_version >= 31 || am_receiver) {
if (line > 0) {
if (DEBUG_GTE(EXIT, 3)) {
rprintf(FINFO, "[%s] sending MSG_ERROR_EXIT with exit_code %d\n",
who_am_i(), exit_code);
}
send_msg_int(MSG_ERROR_EXIT, exit_code);
}
if (!am_sender)
io_flush(MSG_FLUSH); /* Be sure to send all messages */
noop_io_until_death();
}
else if (!am_sender)
io_flush(MSG_FLUSH); /* Be sure to send all messages */
}
#include "case_N.h"
switch_step++;
if (am_server && exit_code)
msleep(100);
close_all();
/* FALLTHROUGH */
default:
break;
}
if (called_from_signal_handler)
_exit(exit_code);
exit(exit_code);
}
void cleanup_disable(void)
{
cleanup_fname = NULL;
cleanup_fname = cleanup_new_fname = NULL;
cleanup_fd_r = cleanup_fd_w = -1;
cleanup_got_literal = 0;
}
void cleanup_set(char *fnametmp, char *fname, struct file_struct *file,
struct map_struct *buf, int fd1, int fd2)
void cleanup_set(const char *fnametmp, const char *fname, struct file_struct *file,
int fd_r, int fd_w)
{
cleanup_fname = fnametmp;
cleanup_new_fname = fname;
cleanup_new_fname = fname; /* can be NULL on a partial-dir failure */
cleanup_file = file;
cleanup_buf = buf;
cleanup_fd1 = fd1;
cleanup_fd2 = fd2;
cleanup_fd_r = fd_r;
cleanup_fd_w = fd_w;
}
void cleanup_set_pid(int pid)
void cleanup_set_pid(pid_t pid)
{
cleanup_pid = pid;
}

538
clientname.c Normal file
View File

@@ -0,0 +1,538 @@
/*
* Functions for looking up the remote name or addr of a socket.
*
* Copyright (C) 1992-2001 Andrew Tridgell <tridge@samba.org>
* Copyright (C) 2001, 2002 Martin Pool <mbp@samba.org>
* Copyright (C) 2002-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
/*
* This file is now converted to use the new-style getaddrinfo()
* interface, which supports IPv6 but is also supported on recent
* IPv4-only machines. On systems that don't have that interface, we
* emulate it using the KAME implementation.
*/
#include "rsync.h"
#include "itypes.h"
extern int am_daemon;
static const char default_name[] = "UNKNOWN";
static const char proxyv2sig[] = "\r\n\r\n\0\r\nQUIT\n";
static char ipaddr_buf[100];
#define PROXY_V2_SIG_SIZE ((int)sizeof proxyv2sig - 1)
#define PROXY_V2_HEADER_SIZE (PROXY_V2_SIG_SIZE + 1 + 1 + 2)
#define CMD_LOCAL 0
#define CMD_PROXY 1
#define PROXY_FAM_TCPv4 0x11
#define PROXY_FAM_TCPv6 0x21
#define GET_SOCKADDR_FAMILY(ss) ((struct sockaddr*)ss)->sa_family
static void client_sockaddr(int fd, struct sockaddr_storage *ss, socklen_t *ss_len);
static int check_name(const char *ipaddr, const struct sockaddr_storage *ss, char *name_buf, size_t name_buf_size);
static int valid_ipaddr(const char *s, int allow_scope);
/* Return the IP addr of the client as a string. */
char *client_addr(int fd)
{
struct sockaddr_storage ss;
socklen_t length = sizeof ss;
if (*ipaddr_buf)
return ipaddr_buf;
if (am_daemon < 0) { /* daemon over --rsh mode */
char *env_str;
strlcpy(ipaddr_buf, "0.0.0.0", sizeof ipaddr_buf);
if ((env_str = getenv("REMOTE_HOST")) != NULL
|| (env_str = getenv("SSH_CONNECTION")) != NULL
|| (env_str = getenv("SSH_CLIENT")) != NULL
|| (env_str = getenv("SSH2_CLIENT")) != NULL) {
char *p;
strlcpy(ipaddr_buf, env_str, sizeof ipaddr_buf);
/* Truncate the value to just the IP address. */
if ((p = strchr(ipaddr_buf, ' ')) != NULL)
*p = '\0';
}
if (valid_ipaddr(ipaddr_buf, True))
return ipaddr_buf;
}
client_sockaddr(fd, &ss, &length);
getnameinfo((struct sockaddr *)&ss, length, ipaddr_buf, sizeof ipaddr_buf, NULL, 0, NI_NUMERICHOST);
return ipaddr_buf;
}
/**
* Return the DNS name of the client.
*
* The name is statically cached so that repeated lookups are quick,
* so there is a limit of one lookup per customer.
*
* If anything goes wrong, including the name->addr->name check, then
* we just use "UNKNOWN", so you can use that value in hosts allow
* lines.
*
* After translation from sockaddr to name we do a forward lookup to
* make sure nobody is spoofing PTR records.
**/
char *client_name(const char *ipaddr)
{
static char name_buf[100];
char port_buf[100];
struct sockaddr_storage ss;
socklen_t ss_len;
struct addrinfo hint, *answer;
int err;
if (*name_buf)
return name_buf;
strlcpy(name_buf, default_name, sizeof name_buf);
if (strcmp(ipaddr, "0.0.0.0") == 0)
return name_buf;
memset(&ss, 0, sizeof ss);
memset(&hint, 0, sizeof hint);
#ifdef AI_NUMERICHOST
hint.ai_flags = AI_NUMERICHOST;
#endif
hint.ai_socktype = SOCK_STREAM;
if ((err = getaddrinfo(ipaddr, NULL, &hint, &answer)) != 0) {
rprintf(FLOG, "malformed address %s: %s\n", ipaddr, gai_strerror(err));
return name_buf;
}
switch (answer->ai_family) {
case AF_INET:
ss_len = sizeof (struct sockaddr_in);
memcpy(&ss, answer->ai_addr, ss_len);
break;
#ifdef INET6
case AF_INET6:
ss_len = sizeof (struct sockaddr_in6);
memcpy(&ss, answer->ai_addr, ss_len);
break;
#endif
default:
NOISY_DEATH("Unknown ai_family value");
}
freeaddrinfo(answer);
/* reverse lookup */
err = getnameinfo((struct sockaddr*)&ss, ss_len, name_buf, sizeof name_buf,
port_buf, sizeof port_buf, NI_NAMEREQD | NI_NUMERICSERV);
if (err) {
strlcpy(name_buf, default_name, sizeof name_buf);
rprintf(FLOG, "name lookup failed for %s: %s\n", ipaddr, gai_strerror(err));
} else
check_name(ipaddr, &ss, name_buf, sizeof name_buf);
return name_buf;
}
/* Try to read a proxy protocol header (V1 or V2). Returns 1 on success or 0 on failure. */
int read_proxy_protocol_header(int fd)
{
union {
struct {
char line[108];
} v1;
struct {
char sig[PROXY_V2_SIG_SIZE];
char ver_cmd;
char fam;
char len[2];
union {
struct {
char src_addr[4];
char dst_addr[4];
char src_port[2];
char dst_port[2];
} ip4;
struct {
char src_addr[16];
char dst_addr[16];
char src_port[2];
char dst_port[2];
} ip6;
struct {
char src_addr[108];
char dst_addr[108];
} unx;
} addr;
} v2;
} hdr;
read_buf(fd, (char*)&hdr, PROXY_V2_SIG_SIZE);
if (memcmp(hdr.v2.sig, proxyv2sig, PROXY_V2_SIG_SIZE) == 0) { /* Proxy V2 */
int ver, cmd, size;
read_buf(fd, (char*)&hdr + PROXY_V2_SIG_SIZE, PROXY_V2_HEADER_SIZE - PROXY_V2_SIG_SIZE);
ver = (hdr.v2.ver_cmd & 0xf0) >> 4;
cmd = (hdr.v2.ver_cmd & 0x0f);
size = (hdr.v2.len[0] << 8) + hdr.v2.len[1];
if (ver != 2 || size + PROXY_V2_HEADER_SIZE > (int)sizeof hdr)
return 0;
/* Grab all the remaining data in the binary request. */
read_buf(fd, (char*)&hdr + PROXY_V2_HEADER_SIZE, size);
switch (cmd) {
case CMD_PROXY:
switch (hdr.v2.fam) {
case PROXY_FAM_TCPv4:
if (size != sizeof hdr.v2.addr.ip4)
return 0;
inet_ntop(AF_INET, hdr.v2.addr.ip4.src_addr, ipaddr_buf, sizeof ipaddr_buf);
return valid_ipaddr(ipaddr_buf, False);
#ifdef INET6
case PROXY_FAM_TCPv6:
if (size != sizeof hdr.v2.addr.ip6)
return 0;
inet_ntop(AF_INET6, hdr.v2.addr.ip6.src_addr, ipaddr_buf, sizeof ipaddr_buf);
return valid_ipaddr(ipaddr_buf, False);
#endif
default:
break;
}
/* For an unsupported protocol we'll ignore the proxy data (leaving ipaddr_buf unset)
* and accept the connection, which will get handled as a normal socket addr. */
return 1;
case CMD_LOCAL:
return 1;
default:
break;
}
return 0;
}
if (memcmp(hdr.v1.line, "PROXY", 5) == 0) { /* Proxy V1 */
char *endc, *sp, *p = hdr.v1.line + PROXY_V2_SIG_SIZE;
int port_chk;
*p = '\0';
if (!strchr(hdr.v1.line, '\n')) {
while (1) {
read_buf(fd, p, 1);
if (*p++ == '\n')
break;
if (p - hdr.v1.line >= (int)sizeof hdr.v1.line - 1)
return 0;
}
*p = '\0';
}
endc = strchr(hdr.v1.line, '\r');
if (!endc || endc[1] != '\n' || endc[2])
return 0;
*endc = '\0';
p = hdr.v1.line + 5;
if (!isSpace(p++))
return 0;
if (strncmp(p, "TCP4", 4) == 0)
p += 4;
else if (strncmp(p, "TCP6", 4) == 0)
p += 4;
else if (strncmp(p, "UNKNOWN", 7) == 0)
return 1;
else
return 0;
if (!isSpace(p++))
return 0;
if ((sp = strchr(p, ' ')) == NULL)
return 0;
*sp = '\0';
if (!valid_ipaddr(p, False))
return 0;
strlcpy(ipaddr_buf, p, sizeof ipaddr_buf); /* It will always fit when valid. */
p = sp + 1;
if ((sp = strchr(p, ' ')) == NULL)
return 0;
*sp = '\0';
if (!valid_ipaddr(p, False))
return 0;
/* Ignore destination address. */
p = sp + 1;
if ((sp = strchr(p, ' ')) == NULL)
return 0;
*sp = '\0';
port_chk = strtol(p, &endc, 10);
if (*endc || port_chk == 0)
return 0;
/* Ignore source port. */
p = sp + 1;
port_chk = strtol(p, &endc, 10);
if (*endc || port_chk == 0)
return 0;
/* Ignore destination port. */
return 1;
}
return 0;
}
/**
* Get the sockaddr for the client.
*
* If it comes in as an ipv4 address mapped into IPv6 format then we
* convert it back to a regular IPv4.
**/
static void client_sockaddr(int fd, struct sockaddr_storage *ss, socklen_t *ss_len)
{
memset(ss, 0, sizeof *ss);
if (getpeername(fd, (struct sockaddr *) ss, ss_len)) {
/* FIXME: Can we really not continue? */
rsyserr(FLOG, errno, "getpeername on fd%d failed", fd);
exit_cleanup(RERR_SOCKETIO);
}
#ifdef INET6
if (GET_SOCKADDR_FAMILY(ss) == AF_INET6
&& IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss)->sin6_addr)) {
/* OK, so ss is in the IPv6 family, but it is really
* an IPv4 address: something like
* "::ffff:10.130.1.2". If we use it as-is, then the
* reverse lookup might fail or perhaps something else
* bad might happen. So instead we convert it to an
* equivalent address in the IPv4 address family. */
struct sockaddr_in6 sin6;
struct sockaddr_in *sin;
memcpy(&sin6, ss, sizeof sin6);
sin = (struct sockaddr_in *)ss;
memset(sin, 0, sizeof *sin);
sin->sin_family = AF_INET;
*ss_len = sizeof (struct sockaddr_in);
#ifdef HAVE_SOCKADDR_IN_LEN
sin->sin_len = *ss_len;
#endif
sin->sin_port = sin6.sin6_port;
/* There is a macro to extract the mapped part
* (IN6_V4MAPPED_TO_SINADDR ?), but it does not seem
* to be present in the Linux headers. */
memcpy(&sin->sin_addr, &sin6.sin6_addr.s6_addr[12], sizeof sin->sin_addr);
}
#endif
}
/**
* Compare an addrinfo from the resolver to a sockinfo.
*
* Like strcmp, returns 0 for identical.
**/
static int compare_addrinfo_sockaddr(const struct addrinfo *ai, const struct sockaddr_storage *ss)
{
int ss_family = GET_SOCKADDR_FAMILY(ss);
const char fn[] = "compare_addrinfo_sockaddr";
if (ai->ai_family != ss_family) {
rprintf(FLOG, "%s: response family %d != %d\n",
fn, ai->ai_family, ss_family);
return 1;
}
/* The comparison method depends on the particular AF. */
if (ss_family == AF_INET) {
const struct sockaddr_in *sin1, *sin2;
sin1 = (const struct sockaddr_in *) ss;
sin2 = (const struct sockaddr_in *) ai->ai_addr;
return memcmp(&sin1->sin_addr, &sin2->sin_addr, sizeof sin1->sin_addr);
}
#ifdef INET6
if (ss_family == AF_INET6) {
const struct sockaddr_in6 *sin1, *sin2;
sin1 = (const struct sockaddr_in6 *) ss;
sin2 = (const struct sockaddr_in6 *) ai->ai_addr;
if (ai->ai_addrlen < (int)sizeof (struct sockaddr_in6)) {
rprintf(FLOG, "%s: too short sockaddr_in6; length=%d\n",
fn, (int)ai->ai_addrlen);
return 1;
}
if (memcmp(&sin1->sin6_addr, &sin2->sin6_addr, sizeof sin1->sin6_addr))
return 1;
#ifdef HAVE_SOCKADDR_IN6_SCOPE_ID
if (sin1->sin6_scope_id != sin2->sin6_scope_id)
return 1;
#endif
return 0;
}
#endif /* INET6 */
/* don't know */
return 1;
}
/**
* Do a forward lookup on @p name_buf and make sure it corresponds to
* @p ss -- otherwise we may be being spoofed. If we suspect we are,
* then we don't abort the connection but just emit a warning, and
* change @p name_buf to be "UNKNOWN".
*
* We don't do anything with the service when checking the name,
* because it doesn't seem that it could be spoofed in any way, and
* getaddrinfo on random service names seems to cause problems on AIX.
**/
static int check_name(const char *ipaddr, const struct sockaddr_storage *ss, char *name_buf, size_t name_buf_size)
{
struct addrinfo hints, *res, *res0;
int error;
int ss_family = GET_SOCKADDR_FAMILY(ss);
memset(&hints, 0, sizeof hints);
hints.ai_family = ss_family;
hints.ai_flags = AI_CANONNAME;
hints.ai_socktype = SOCK_STREAM;
error = getaddrinfo(name_buf, NULL, &hints, &res0);
if (error) {
rprintf(FLOG, "forward name lookup for %s failed: %s\n",
name_buf, gai_strerror(error));
strlcpy(name_buf, default_name, name_buf_size);
return error;
}
/* Given all these results, we expect that one of them will be
* the same as ss. The comparison is a bit complicated. */
for (res = res0; res; res = res->ai_next) {
if (!compare_addrinfo_sockaddr(res, ss))
break; /* OK, identical */
}
if (!res0) {
/* We hit the end of the list without finding an
* address that was the same as ss. */
rprintf(FLOG, "no known address for \"%s\": "
"spoofed address?\n", name_buf);
strlcpy(name_buf, default_name, name_buf_size);
} else if (res == NULL) {
/* We hit the end of the list without finding an
* address that was the same as ss. */
rprintf(FLOG, "%s is not a known address for \"%s\": "
"spoofed address?\n", ipaddr, name_buf);
strlcpy(name_buf, default_name, name_buf_size);
}
freeaddrinfo(res0);
return 0;
}
/* Returns 1 for a valid IPv4 or IPv6 addr, or 0 for a bad one. */
static int valid_ipaddr(const char *s, int allow_scope)
{
int i;
if (strchr(s, ':') != NULL) { /* Only IPv6 has a colon. */
int count, saw_double_colon = 0;
int ipv4_at_end = 0;
if (*s == ':') { /* A colon at the start must be a :: */
if (*++s != ':')
return 0;
saw_double_colon = 1;
s++;
}
for (count = 0; count < 8; count++) {
if (!*s)
return saw_double_colon;
if (allow_scope && *s == '%') {
if (saw_double_colon)
break;
return 0;
}
if (strchr(s, ':') == NULL && strchr(s, '.') != NULL) {
if ((!saw_double_colon && count != 6) || (saw_double_colon && count > 6))
return 0;
ipv4_at_end = 1;
break;
}
if (!isHexDigit(s++)) /* Need 1-4 hex digits */
return 0;
if (isHexDigit(s) && isHexDigit(++s) && isHexDigit(++s) && isHexDigit(++s))
return 0;
if (*s == ':') {
if (!*++s)
return 0;
if (*s == ':') {
if (saw_double_colon)
return 0;
saw_double_colon = 1;
s++;
}
}
}
if (!ipv4_at_end) {
if (allow_scope && *s == '%')
for (s++; isAlNum(s); s++) { }
return !*s && s[-1] != '%';
}
}
/* IPv4 */
for (i = 0; i < 4; i++) {
long n;
char *end;
if (i && *s++ != '.')
return 0;
n = strtol(s, &end, 10);
if (n > 255 || n < 0 || end <= s || end > s+3)
return 0;
s = end;
}
return !*s;
}

View File

File diff suppressed because it is too large Load Diff

11
cmd-or-msg Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
srcdir=`dirname $0`
opt="$1"
shift
echo "$*"
if ! "${@}"; then
echo "If you can't fix the issue, re-run $srcdir/configure with --$opt."
exit 1
fi

854
compat.c
View File

@@ -1,75 +1,811 @@
/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* compatability routines for older rsync protocol versions */
/*
* Compatibility routines for older rsync protocol versions.
*
* Copyright (C) Andrew Tridgell 1996
* Copyright (C) Paul Mackerras 1996
* Copyright (C) 2004-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "itypes.h"
#include "ifuncs.h"
extern int am_server;
extern int csum_length;
extern int preserve_links;
extern int preserve_perms;
extern int preserve_devices;
extern int am_sender;
extern int local_server;
extern int inplace;
extern int recurse;
extern int use_qsort;
extern int allow_inc_recurse;
extern int preallocate_files;
extern int append_mode;
extern int fuzzy_basis;
extern int read_batch;
extern int write_batch;
extern int delay_updates;
extern int checksum_seed;
extern int basis_dir_cnt;
extern int prune_empty_dirs;
extern int protocol_version;
extern int protect_args;
extern int preserve_uid;
extern int preserve_gid;
extern int preserve_times;
extern int always_checksum;
extern int checksum_seed;
extern int preserve_atimes;
extern int preserve_crtimes;
extern int preserve_acls;
extern int preserve_xattrs;
extern int xfer_flags_as_varint;
extern int need_messages_from_generator;
extern int delete_mode, delete_before, delete_during, delete_after;
extern int do_compression;
extern int do_compression_level;
extern int saw_stderr_opt;
extern int msgs2stderr;
extern char *shell_cmd;
extern char *partial_dir;
extern char *files_from;
extern char *filesfrom_host;
extern const char *checksum_choice;
extern const char *compress_choice;
extern filter_rule_list filter_list;
extern int need_unsorted_flist;
#ifdef ICONV_OPTION
extern iconv_t ic_send, ic_recv;
extern char *iconv_opt;
#endif
extern struct name_num_obj valid_checksums;
int remote_protocol = 0;
int file_extra_cnt = 0; /* count of file-list extras that everyone gets */
int inc_recurse = 0;
int compat_flags = 0;
int use_safe_inc_flist = 0;
int want_xattr_optim = 0;
int proper_seed_order = 0;
int inplace_partial = 0;
int do_negotiated_strings = 0;
int xmit_id0_names = 0;
extern int remote_version;
extern int verbose;
/* These index values are for the file-list's extra-attribute array. */
int pathname_ndx, depth_ndx, atimes_ndx, crtimes_ndx, uid_ndx, gid_ndx, acls_ndx, xattrs_ndx, unsort_ndx;
int receiver_symlink_times = 0; /* receiver can set the time on a symlink */
int sender_symlink_iconv = 0; /* sender should convert symlink content */
#ifdef ICONV_OPTION
int filesfrom_convert = 0;
#endif
#define MAX_NSTR_STRLEN 256
struct name_num_obj valid_compressions = {
"compress", NULL, NULL, 0, 0, {
#ifdef SUPPORT_ZSTD
{ CPRES_ZSTD, "zstd", NULL },
#endif
#ifdef SUPPORT_LZ4
{ CPRES_LZ4, "lz4", NULL },
#endif
{ CPRES_ZLIBX, "zlibx", NULL },
{ CPRES_ZLIB, "zlib", NULL },
{ CPRES_NONE, "none", NULL },
{ 0, NULL, NULL }
}
};
#define CF_INC_RECURSE (1<<0)
#define CF_SYMLINK_TIMES (1<<1)
#define CF_SYMLINK_ICONV (1<<2)
#define CF_SAFE_FLIST (1<<3)
#define CF_AVOID_XATTR_OPTIM (1<<4)
#define CF_CHKSUM_SEED_FIX (1<<5)
#define CF_INPLACE_PARTIAL_DIR (1<<6)
#define CF_VARINT_FLIST_FLAGS (1<<7)
#define CF_ID0_NAMES (1<<8)
static const char *client_info;
/* The server makes sure that if either side only supports a pre-release
* version of a protocol, that both sides must speak a compatible version
* of that protocol for it to be advertised as available. */
static void check_sub_protocol(void)
{
char *dot;
int their_protocol, their_sub;
#if SUBPROTOCOL_VERSION != 0
int our_sub = protocol_version < PROTOCOL_VERSION ? 0 : SUBPROTOCOL_VERSION;
#else
int our_sub = 0;
#endif
/* client_info starts with VER.SUB string if client is a pre-release. */
if (!(their_protocol = atoi(client_info))
|| !(dot = strchr(client_info, '.'))
|| !(their_sub = atoi(dot+1))) {
#if SUBPROTOCOL_VERSION != 0
if (our_sub)
protocol_version--;
#endif
return;
}
if (their_protocol < protocol_version) {
if (their_sub)
protocol_version = their_protocol - 1;
return;
}
if (their_protocol > protocol_version)
their_sub = 0; /* 0 == final version of older protocol */
if (their_sub != our_sub)
protocol_version--;
}
void set_allow_inc_recurse(void)
{
if (!local_server)
client_info = shell_cmd ? shell_cmd : "";
else if (am_server) {
char buf[64];
maybe_add_e_option(buf, sizeof buf);
client_info = *buf ? strdup(buf+1) : ""; /* The +1 skips the leading "e". */
}
if (!recurse || use_qsort)
allow_inc_recurse = 0;
else if (!am_sender
&& (delete_before || delete_after
|| delay_updates || prune_empty_dirs))
allow_inc_recurse = 0;
else if (am_server && strchr(client_info, 'i') == NULL)
allow_inc_recurse = 0;
}
void parse_compress_choice(int final_call)
{
if (valid_compressions.negotiated_name)
do_compression = valid_compressions.negotiated_num;
else if (compress_choice) {
struct name_num_item *nni = get_nni_by_name(&valid_compressions, compress_choice, -1);
if (!nni) {
rprintf(FERROR, "unknown compress name: %s\n", compress_choice);
exit_cleanup(RERR_UNSUPPORTED);
}
do_compression = nni->num;
if (am_server)
validate_choice_vs_env(NSTR_COMPRESS, do_compression, -1);
} else if (do_compression)
do_compression = CPRES_ZLIB;
else
do_compression = CPRES_NONE;
if (do_compression != CPRES_NONE && final_call)
init_compression_level(); /* There's a chance this might turn compression off! */
if (do_compression == CPRES_NONE)
compress_choice = NULL;
/* Snag the compression name for both write_batch's option output & the following debug output. */
if (valid_compressions.negotiated_name)
compress_choice = valid_compressions.negotiated_name;
else if (compress_choice == NULL) {
struct name_num_item *nni = get_nni_by_num(&valid_compressions, do_compression);
compress_choice = nni ? nni->name : "UNKNOWN";
}
if (final_call && DEBUG_GTE(NSTR, am_server ? 3 : 1)
&& (do_compression != CPRES_NONE || do_compression_level != CLVL_NOT_SPECIFIED)) {
rprintf(FINFO, "%s%s compress: %s (level %d)\n",
am_server ? "Server" : "Client",
valid_compressions.negotiated_name ? " negotiated" : "",
compress_choice, do_compression_level);
}
}
struct name_num_item *get_nni_by_name(struct name_num_obj *nno, const char *name, int len)
{
struct name_num_item *nni;
if (len < 0)
len = strlen(name);
for (nni = nno->list; nni->name; nni++) {
if (strncasecmp(name, nni->name, len) == 0 && nni->name[len] == '\0')
return nni;
}
return NULL;
}
struct name_num_item *get_nni_by_num(struct name_num_obj *nno, int num)
{
struct name_num_item *nni;
for (nni = nno->list; nni->name; nni++) {
if (num == nni->num)
return nni;
}
return NULL;
}
static void init_nno_saw(struct name_num_obj *nno, int val)
{
struct name_num_item *nni;
int cnt;
if (!nno->saw_len) {
for (nni = nno->list; nni->name; nni++) {
if (nni->num >= nno->saw_len)
nno->saw_len = nni->num + 1;
}
}
if (!nno->saw) {
nno->saw = new_array0(uchar, nno->saw_len);
/* We'll take this opportunity to make sure that the main_name values are set right. */
for (cnt = 1, nni = nno->list; nni->name; nni++, cnt++) {
if (nno->saw[nni->num])
nni->main_name = nno->list[nno->saw[nni->num]-1].name;
else
nno->saw[nni->num] = cnt;
}
}
memset(nno->saw, val, nno->saw_len);
}
/* Simplify the user-provided string so that it contains valid names without any duplicates.
* It also sets the "saw" flags to a 1-relative count of which name was seen first. */
static int parse_nni_str(struct name_num_obj *nno, const char *from, char *tobuf, int tobuf_len)
{
char *to = tobuf, *tok = NULL;
int saw_tok = 0, cnt = 0;
while (1) {
int at_space = isSpace(from);
char ch = *from++;
if (ch == '&')
ch = '\0';
if (!ch || at_space) {
if (tok) {
struct name_num_item *nni = get_nni_by_name(nno, tok, to - tok);
if (nni && !nno->saw[nni->num]) {
nno->saw[nni->num] = ++cnt;
if (nni->main_name) {
to = tok + strlcpy(tok, nni->main_name, tobuf_len - (tok - tobuf));
if (to - tobuf >= tobuf_len) {
to = tok - 1;
break;
}
}
} else
to = tok - (tok != tobuf);
saw_tok = 1;
tok = NULL;
}
if (!ch)
break;
continue;
}
if (!tok) {
if (to != tobuf)
*to++ = ' ';
tok = to;
}
if (to - tobuf >= tobuf_len - 1) {
to = tok - (tok != tobuf);
break;
}
*to++ = ch;
}
*to = '\0';
if (saw_tok && to == tobuf)
return strlcpy(tobuf, "INVALID", MAX_NSTR_STRLEN);
return to - tobuf;
}
/* This routine is always called with a tmpbuf of MAX_NSTR_STRLEN length, but the
* buffer may be pre-populated with a "len" length string to use OR a len of -1
* to tell us to read a string from the fd. */
static void recv_negotiate_str(int f_in, struct name_num_obj *nno, char *tmpbuf, int len)
{
struct name_num_item *ret = NULL;
if (len < 0)
len = read_vstring(f_in, tmpbuf, MAX_NSTR_STRLEN);
if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) {
if (am_server)
rprintf(FINFO, "Client %s list (on server): %s\n", nno->type, tmpbuf);
else
rprintf(FINFO, "Server %s list (on client): %s\n", nno->type, tmpbuf);
}
if (len > 0) {
struct name_num_item *nni;
int best = nno->saw_len; /* We want best == 1 from the client list, so start with a big number. */
char *space, *tok = tmpbuf;
while (tok) {
while (*tok == ' ') tok++; /* Should be unneeded... */
if (!*tok)
break;
if ((space = strchr(tok, ' ')) != NULL)
*space = '\0';
nni = get_nni_by_name(nno, tok, -1);
if (space) {
*space = ' ';
tok = space + 1;
} else
tok = NULL;
if (!nni || !nno->saw[nni->num] || best <= nno->saw[nni->num])
continue;
ret = nni;
best = nno->saw[nni->num];
if (best == 1 || am_server) /* The server side stops at the first acceptable client choice */
break;
}
if (ret) {
free(nno->saw);
nno->saw = NULL;
nno->negotiated_name = ret->main_name ? ret->main_name : ret->name;
nno->negotiated_num = ret->num;
return;
}
}
if (!am_server || !do_negotiated_strings) {
char *cp = tmpbuf;
int j;
rprintf(FERROR, "Failed to negotiate a %s choice.\n", nno->type);
rprintf(FERROR, "%s list: %s\n", am_server ? "Client" : "Server", tmpbuf);
/* Recreate our original list from the saw values. This can't overflow our huge
* buffer because we don't have enough valid entries to get anywhere close. */
for (j = 1, *cp = '\0'; j <= nno->saw_len; j++) {
struct name_num_item *nni;
for (nni = nno->list; nni->name; nni++) {
if (nno->saw[nni->num] == j) {
*cp++ = ' ';
cp += strlcpy(cp, nni->name, MAX_NSTR_STRLEN - (cp - tmpbuf));
break;
}
}
}
if (!*tmpbuf)
strlcpy(cp, " INVALID", MAX_NSTR_STRLEN);
rprintf(FERROR, "%s list:%s\n", am_server ? "Server" : "Client", tmpbuf);
}
exit_cleanup(RERR_UNSUPPORTED);
}
static const char *getenv_nstr(int ntype)
{
const char *env_str = getenv(ntype == NSTR_COMPRESS ? "RSYNC_COMPRESS_LIST" : "RSYNC_CHECKSUM_LIST");
/* When writing a batch file, we always negotiate an old-style choice. */
if (write_batch)
env_str = ntype == NSTR_COMPRESS ? "zlib" : protocol_version >= 30 ? "md5" : "md4";
if (am_server && env_str) {
char *cp = strchr(env_str, '&');
if (cp)
env_str = cp + 1;
}
return env_str;
}
void validate_choice_vs_env(int ntype, int num1, int num2)
{
struct name_num_obj *nno = ntype == NSTR_COMPRESS ? &valid_compressions : &valid_checksums;
const char *list_str = getenv_nstr(ntype);
char tmpbuf[MAX_NSTR_STRLEN];
if (!list_str)
return;
while (isSpace(list_str)) list_str++;
if (!*list_str)
return;
init_nno_saw(nno, 0);
parse_nni_str(nno, list_str, tmpbuf, MAX_NSTR_STRLEN);
if (ntype == NSTR_CHECKSUM) /* If "md4" is in the env list, all the old MD4 choices are OK too. */
nno->saw[CSUM_MD4_ARCHAIC] = nno->saw[CSUM_MD4_BUSTED] = nno->saw[CSUM_MD4_OLD] = nno->saw[CSUM_MD4];
if (!nno->saw[num1] || (num2 >= 0 && !nno->saw[num2])) {
rprintf(FERROR, "Your --%s-choice value (%s) was refused by the server.\n",
ntype == NSTR_COMPRESS ? "compress" : "checksum",
ntype == NSTR_COMPRESS ? compress_choice : checksum_choice);
exit_cleanup(RERR_UNSUPPORTED);
}
free(nno->saw);
nno->saw = NULL;
}
/* The saw buffer is initialized and used to store ordinal values from 1 to N
* for the order of the args in the array. If dup_markup == '\0', duplicates
* are removed otherwise the char is prefixed to the duplicate term and, if it
* is an opening paren/bracket/brace, the matching closing char is suffixed.
* "none" is removed on the client side unless dup_markup != '\0'. */
int get_default_nno_list(struct name_num_obj *nno, char *to_buf, int to_buf_len, char dup_markup)
{
struct name_num_item *nni;
int len = 0, cnt = 0;
char delim = '\0', post_delim;
switch (dup_markup) {
case '(': post_delim = ')'; break;
case '[': post_delim = ']'; break;
case '{': post_delim = '}'; break;
default: post_delim = '\0'; break;
}
init_nno_saw(nno, 0);
for (nni = nno->list, len = 0; nni->name; nni++) {
if (nni->main_name) {
if (!dup_markup)
continue;
delim = dup_markup;
}
if (nni->num == 0 && !am_server && !dup_markup)
continue;
if (len)
to_buf[len++]= ' ';
if (delim) {
to_buf[len++]= delim;
delim = post_delim;
}
len += strlcpy(to_buf+len, nni->name, to_buf_len - len);
if (len >= to_buf_len - 3)
exit_cleanup(RERR_UNSUPPORTED); /* IMPOSSIBLE... */
if (delim) {
to_buf[len++]= delim;
delim = '\0';
}
nno->saw[nni->num] = ++cnt;
}
return len;
}
static void send_negotiate_str(int f_out, struct name_num_obj *nno, int ntype)
{
char tmpbuf[MAX_NSTR_STRLEN];
const char *list_str = getenv_nstr(ntype);
int len;
if (list_str && *list_str) {
init_nno_saw(nno, 0);
len = parse_nni_str(nno, list_str, tmpbuf, MAX_NSTR_STRLEN);
list_str = tmpbuf;
} else
list_str = NULL;
if (!list_str || !*list_str)
len = get_default_nno_list(nno, tmpbuf, MAX_NSTR_STRLEN, '\0');
if (DEBUG_GTE(NSTR, am_server ? 3 : 2)) {
if (am_server)
rprintf(FINFO, "Server %s list (on server): %s\n", nno->type, tmpbuf);
else
rprintf(FINFO, "Client %s list (on client): %s\n", nno->type, tmpbuf);
}
/* Each side sends their list of valid names to the other side and then both sides
* pick the first name in the client's list that is also in the server's list. */
if (do_negotiated_strings)
write_vstring(f_out, tmpbuf, len);
}
static void negotiate_the_strings(int f_in, int f_out)
{
/* We send all the negotiation strings before we start to read them to help avoid a slow startup. */
if (!checksum_choice)
send_negotiate_str(f_out, &valid_checksums, NSTR_CHECKSUM);
if (do_compression && !compress_choice)
send_negotiate_str(f_out, &valid_compressions, NSTR_COMPRESS);
if (valid_checksums.saw) {
char tmpbuf[MAX_NSTR_STRLEN];
int len;
if (do_negotiated_strings)
len = -1;
else
len = strlcpy(tmpbuf, protocol_version >= 30 ? "md5" : "md4", MAX_NSTR_STRLEN);
recv_negotiate_str(f_in, &valid_checksums, tmpbuf, len);
}
if (valid_compressions.saw) {
char tmpbuf[MAX_NSTR_STRLEN];
int len;
if (do_negotiated_strings)
len = -1;
else
len = strlcpy(tmpbuf, "zlib", MAX_NSTR_STRLEN);
recv_negotiate_str(f_in, &valid_compressions, tmpbuf, len);
}
/* If the other side is too old to negotiate, the above steps just made sure that
* the env didn't disallow the old algorithm. Mark things as non-negotiated. */
if (!do_negotiated_strings)
valid_checksums.negotiated_name = valid_compressions.negotiated_name = NULL;
}
void setup_protocol(int f_out,int f_in)
{
if (remote_version == 0) {
if (am_server) {
remote_version = read_int(f_in);
write_int(f_out,PROTOCOL_VERSION);
} else {
write_int(f_out,PROTOCOL_VERSION);
remote_version = read_int(f_in);
}
}
assert(file_extra_cnt == 0);
assert(EXTRA64_CNT == 2 || EXTRA64_CNT == 1);
if (remote_version < MIN_PROTOCOL_VERSION ||
remote_version > MAX_PROTOCOL_VERSION) {
rprintf(FERROR,"protocol version mismatch - is your shell clean?\n");
rprintf(FERROR,"(see the rsync man page for an explanation)\n");
/* All int64 values must be set first so that they are guaranteed to be
* aligned for direct int64-pointer memory access. */
if (preserve_atimes)
atimes_ndx = (file_extra_cnt += EXTRA64_CNT);
if (preserve_crtimes)
crtimes_ndx = (file_extra_cnt += EXTRA64_CNT);
if (am_sender) /* This is most likely in the file_extras64 union as well. */
pathname_ndx = (file_extra_cnt += PTR_EXTRA_CNT);
else
depth_ndx = ++file_extra_cnt;
if (preserve_uid)
uid_ndx = ++file_extra_cnt;
if (preserve_gid)
gid_ndx = ++file_extra_cnt;
if (preserve_acls && !am_sender)
acls_ndx = ++file_extra_cnt;
if (preserve_xattrs)
xattrs_ndx = ++file_extra_cnt;
if (am_server)
set_allow_inc_recurse();
if (remote_protocol == 0) {
if (am_server && !local_server)
check_sub_protocol();
if (!read_batch)
write_int(f_out, protocol_version);
remote_protocol = read_int(f_in);
if (protocol_version > remote_protocol)
protocol_version = remote_protocol;
}
if (read_batch && remote_protocol > protocol_version) {
rprintf(FERROR, "The protocol version in the batch file is too new (%d > %d).\n",
remote_protocol, protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
if (verbose > 2)
rprintf(FINFO, "local_version=%d remote_version=%d\n",
PROTOCOL_VERSION, remote_version);
if (remote_version >= 12) {
if (am_server) {
checksum_seed = time(NULL);
write_int(f_out,checksum_seed);
} else {
checksum_seed = read_int(f_in);
}
if (DEBUG_GTE(PROTO, 1)) {
rprintf(FINFO, "(%s) Protocol versions: remote=%d, negotiated=%d\n",
am_server? "Server" : "Client", remote_protocol, protocol_version);
}
if (remote_protocol < MIN_PROTOCOL_VERSION
|| remote_protocol > MAX_PROTOCOL_VERSION) {
rprintf(FERROR,"protocol version mismatch -- is your shell clean?\n");
rprintf(FERROR,"(see the rsync manpage for an explanation)\n");
exit_cleanup(RERR_PROTOCOL);
}
if (remote_protocol < OLD_PROTOCOL_VERSION) {
rprintf(FINFO,"%s is very old version of rsync, upgrade recommended.\n",
am_server? "Client" : "Server");
}
if (protocol_version < MIN_PROTOCOL_VERSION) {
rprintf(FERROR, "--protocol must be at least %d on the %s.\n",
MIN_PROTOCOL_VERSION, am_server? "Server" : "Client");
exit_cleanup(RERR_PROTOCOL);
}
if (protocol_version > PROTOCOL_VERSION) {
rprintf(FERROR, "--protocol must be no more than %d on the %s.\n",
PROTOCOL_VERSION, am_server? "Server" : "Client");
exit_cleanup(RERR_PROTOCOL);
}
if (read_batch)
check_batch_flags();
if (!saw_stderr_opt && protocol_version <= 28 && am_server)
msgs2stderr = 0; /* The client side may not have stderr setup for us. */
#ifndef SUPPORT_PREALLOCATION
if (preallocate_files && !am_sender) {
rprintf(FERROR, "preallocation is not supported on this %s\n",
am_server ? "Server" : "Client");
exit_cleanup(RERR_SYNTAX);
}
#endif
if (protocol_version < 30) {
if (append_mode == 1)
append_mode = 2;
if (preserve_acls && !local_server) {
rprintf(FERROR,
"--acls requires protocol 30 or higher"
" (negotiated %d).\n",
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
if (preserve_xattrs && !local_server) {
rprintf(FERROR,
"--xattrs requires protocol 30 or higher"
" (negotiated %d).\n",
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
}
checksum_init();
}
if (delete_mode && !(delete_before+delete_during+delete_after)) {
if (protocol_version < 30)
delete_before = 1;
else
delete_during = 1;
}
if (protocol_version < 29) {
if (fuzzy_basis) {
rprintf(FERROR,
"--fuzzy requires protocol 29 or higher"
" (negotiated %d).\n",
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
if (basis_dir_cnt && inplace) {
rprintf(FERROR,
"%s with --inplace requires protocol 29 or higher"
" (negotiated %d).\n",
alt_dest_opt(0), protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
if (basis_dir_cnt > 1) {
rprintf(FERROR,
"Using more than one %s option requires protocol"
" 29 or higher (negotiated %d).\n",
alt_dest_opt(0), protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
if (prune_empty_dirs) {
rprintf(FERROR,
"--prune-empty-dirs requires protocol 29 or higher"
" (negotiated %d).\n",
protocol_version);
exit_cleanup(RERR_PROTOCOL);
}
} else if (protocol_version >= 30) {
if (am_server) {
compat_flags = allow_inc_recurse ? CF_INC_RECURSE : 0;
#ifdef CAN_SET_SYMLINK_TIMES
compat_flags |= CF_SYMLINK_TIMES;
#endif
#ifdef ICONV_OPTION
compat_flags |= CF_SYMLINK_ICONV;
#endif
if (strchr(client_info, 'f') != NULL)
compat_flags |= CF_SAFE_FLIST;
if (strchr(client_info, 'x') != NULL)
compat_flags |= CF_AVOID_XATTR_OPTIM;
if (strchr(client_info, 'C') != NULL)
compat_flags |= CF_CHKSUM_SEED_FIX;
if (strchr(client_info, 'I') != NULL)
compat_flags |= CF_INPLACE_PARTIAL_DIR;
if (strchr(client_info, 'u') != NULL)
compat_flags |= CF_ID0_NAMES;
if (strchr(client_info, 'v') != NULL) {
do_negotiated_strings = 1;
compat_flags |= CF_VARINT_FLIST_FLAGS;
}
if (strchr(client_info, 'V') != NULL) { /* Support a pre-release 'V' that got superseded */
if (!write_batch)
compat_flags |= CF_VARINT_FLIST_FLAGS;
write_byte(f_out, compat_flags);
} else
write_varint(f_out, compat_flags);
} else { /* read_varint() is compatible with the older write_byte() when the 0x80 bit isn't on. */
compat_flags = read_varint(f_in);
if (compat_flags & CF_VARINT_FLIST_FLAGS)
do_negotiated_strings = 1;
}
/* The inc_recurse var MUST be set to 0 or 1. */
inc_recurse = compat_flags & CF_INC_RECURSE ? 1 : 0;
want_xattr_optim = protocol_version >= 31 && !(compat_flags & CF_AVOID_XATTR_OPTIM);
proper_seed_order = compat_flags & CF_CHKSUM_SEED_FIX ? 1 : 0;
xfer_flags_as_varint = compat_flags & CF_VARINT_FLIST_FLAGS ? 1 : 0;
xmit_id0_names = compat_flags & CF_ID0_NAMES ? 1 : 0;
if (!xfer_flags_as_varint && preserve_crtimes) {
fprintf(stderr, "Both rsync versions must be at least 3.2.0 for --crtimes.\n");
exit_cleanup(RERR_PROTOCOL);
}
if (am_sender) {
receiver_symlink_times = am_server
? strchr(client_info, 'L') != NULL
: !!(compat_flags & CF_SYMLINK_TIMES);
}
#ifdef CAN_SET_SYMLINK_TIMES
else
receiver_symlink_times = 1;
#endif
#ifdef ICONV_OPTION
sender_symlink_iconv = iconv_opt && (am_server
? strchr(client_info, 's') != NULL
: !!(compat_flags & CF_SYMLINK_ICONV));
#endif
if (inc_recurse && !allow_inc_recurse) {
/* This should only be able to happen in a batch. */
fprintf(stderr,
"Incompatible options specified for inc-recursive %s.\n",
read_batch ? "batch file" : "connection");
exit_cleanup(RERR_SYNTAX);
}
use_safe_inc_flist = (compat_flags & CF_SAFE_FLIST) || protocol_version >= 31;
need_messages_from_generator = 1;
if (compat_flags & CF_INPLACE_PARTIAL_DIR)
inplace_partial = 1;
#ifdef CAN_SET_SYMLINK_TIMES
} else if (!am_sender) {
receiver_symlink_times = 1;
#endif
}
if (read_batch)
do_negotiated_strings = 0;
if (need_unsorted_flist && (!am_sender || inc_recurse))
unsort_ndx = ++file_extra_cnt;
if (partial_dir && *partial_dir != '/' && (!am_server || local_server)) {
int rflags = FILTRULE_NO_PREFIXES | FILTRULE_DIRECTORY;
if (!am_sender || protocol_version >= 30)
rflags |= FILTRULE_PERISHABLE;
parse_filter_str(&filter_list, partial_dir, rule_template(rflags), 0);
}
#ifdef ICONV_OPTION
if (protect_args && files_from) {
if (am_sender)
filesfrom_convert = filesfrom_host && ic_send != (iconv_t)-1;
else
filesfrom_convert = !filesfrom_host && ic_recv != (iconv_t)-1;
}
#endif
negotiate_the_strings(f_in, f_out);
if (am_server) {
if (!checksum_seed)
checksum_seed = time(NULL) ^ (getpid() << 6);
write_int(f_out, checksum_seed);
} else {
checksum_seed = read_int(f_in);
}
parse_checksum_choice(1); /* Sets checksum_type & xfersum_type */
parse_compress_choice(1); /* Sets do_compression */
if (write_batch && !am_server)
write_batch_shell_file();
init_flist();
}

1761
config.guess vendored Executable file → Normal file
View File

File diff suppressed because it is too large Load Diff

2348
config.sub vendored Executable file → Normal file
View File

File diff suppressed because it is too large Load Diff

27
configure vendored Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh -e
# This configure script ensures that the configure.sh script exists, and
# if not, it tries to fetch rsync's generated files or build them. We
# then transfer control to the configure.sh script to do the real work.
dir=`dirname $0`
if test x"$dir" = x; then
dir=.
fi
if test "$dir" = '.'; then
branch=`packaging/prep-auto-dir` || exit 1
if test x"$branch" != x; then
cd build || exit 1
dir=..
fi
fi
if test ! -f configure.sh; then
if ! "$dir/prepare-source" build; then
echo 'Failed to build configure.sh and/or config.h.in -- giving up.' >&2
rm -f configure.sh
exit 1
fi
fi
exec ./configure.sh --srcdir="$dir" "${@}"

1447
configure.ac Normal file
View File

File diff suppressed because it is too large Load Diff

View File

@@ -1,187 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(byteorder.h)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_SYSTEM
AC_VALIDATE_CACHE_SYSTEM_TYPE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_SUBST(SHELL)
AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)
AC_DEFINE_UNQUOTED(HAVE_REMSH, $HAVE_REMSH)
AC_C_BIGENDIAN
AC_HEADER_DIRENT
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h unistd.h utime.h grp.h)
AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
AC_CHECK_HEADERS(glob.h)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(short)
AC_C_INLINE
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_PID_T
AC_STRUCT_ST_RDEV
AC_CHECK_TYPE(ino_t,unsigned)
AC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [
AC_TRY_COMPILE([#include <errno.h>],[int i = errno],
rsync_cv_errno=yes,rsync_cv_have_errno_decl=no)])
if test x"$rsync_cv_errno" = x"yes"; then
AC_DEFINE(HAVE_ERRNO_DECL)
fi
AC_FUNC_MEMCMP
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS(mmap munmap waitpid getcwd strdup strerror chown chmod mknod)
AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
AC_CHECK_FUNCS(memmove getopt_long lchown vsnprintf snprintf setsid glob strpbrk)
echo $ac_n "checking for working fnmatch... $ac_c"
AC_TRY_RUN([#include <fnmatch.h>
main() { exit(fnmatch("*.o", "x.o", 0) == 0? 0: 1); }],
echo yes;AC_DEFINE(HAVE_FNMATCH),
echo no)
AC_CACHE_CHECK([for long long],rsync_cv_have_longlong,[
AC_TRY_RUN([#include <stdio.h>
main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
rsync_cv_have_longlong=yes,rsync_cv_have_longlong=no,rsync_cv_have_longlong=cross)])
if test x"$rsync_cv_have_longlong" = x"yes"; then
AC_DEFINE(HAVE_LONGLONG)
fi
AC_CACHE_CHECK([for off64_t],rsync_cv_HAVE_OFF64_T,[
AC_TRY_RUN([#include <stdio.h>
#include <sys/stat.h>
main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
rsync_cv_HAVE_OFF64_T=yes,rsync_cv_HAVE_OFF64_T=no,rsync_cv_HAVE_OFF64_T=cross)])
if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then
AC_DEFINE(HAVE_OFF64_T)
fi
echo $ac_n "checking for short ino_t ... $ac_c"
AC_TRY_RUN([#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 1; }],
echo yes;AC_DEFINE(HAVE_SHORT_INO_T),
echo no)
AC_CACHE_CHECK([for unsigned char],rsync_cv_HAVE_UNSIGNED_CHAR,[
AC_TRY_RUN([#include <stdio.h>
main() { char c; c=250; exit((c > 0)?0:1); }],
rsync_cv_HAVE_UNSIGNED_CHAR=yes,rsync_cv_HAVE_UNSIGNED_CHAR=no,rsync_cv_HAVE_UNSIGNED_CHAR=cross)])
if test x"$rsync_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
AC_DEFINE(HAVE_UNSIGNED_CHAR)
fi
AC_CACHE_CHECK([for broken readdir],rsync_cv_HAVE_BROKEN_READDIR,[
AC_TRY_RUN([#include <sys/types.h>
#include <dirent.h>
main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
di->d_name[0] == 0) exit(0); exit(1);} ],
rsync_cv_HAVE_BROKEN_READDIR=yes,rsync_cv_HAVE_BROKEN_READDIR=no,rsync_cv_HAVE_BROKEN_READDIR=cross)])
if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then
AC_DEFINE(HAVE_BROKEN_READDIR)
fi
AC_CACHE_CHECK([for utimbuf],rsync_cv_HAVE_UTIMBUF,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <utime.h>],
[struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
rsync_cv_HAVE_UTIMBUF=yes,rsync_cv_HAVE_UTIMBUF=no,rsync_cv_HAVE_UTIMBUF=cross)])
if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then
AC_DEFINE(HAVE_UTIMBUF)
fi
AC_CACHE_CHECK([for broken inet_ntoa],rsync_cv_REPLACE_INET_NTOA,[
AC_TRY_RUN([
#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
main() { struct in_addr ip; ip.s_addr = 0x12345678;
if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); }
exit(1);}],
rsync_cv_REPLACE_INET_NTOA=yes,rsync_cv_REPLACE_INET_NTOA=no,rsync_cv_REPLACE_INET_NTOA=cross)])
if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then
AC_DEFINE(REPLACE_INET_NTOA)
fi
# The following test taken from the cvs sources
# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
# libsocket.so which has a bad implementation of gethostbyname (it
# only looks in /etc/hosts), so we only look for -lsocket if we need
# it.
AC_CHECK_FUNCS(connect)
if test x"$ac_cv_func_connect" = x"no"; then
case "$LIBS" in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl_s, printf) ;;
esac
case "$LIBS" in
*-lnsl*) ;;
*) AC_CHECK_LIB(nsl, printf) ;;
esac
case "$LIBS" in
*-lsocket*) ;;
*) AC_CHECK_LIB(socket, connect) ;;
esac
case "$LIBS" in
*-linet*) ;;
*) AC_CHECK_LIB(inet, connect) ;;
esac
dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
dnl has been cached.
if test x"$ac_cv_lib_socket_connect" = x"yes" ||
test x"$ac_cv_lib_inet_connect" = x"yes"; then
# ac_cv_func_connect=yes
# don't! it would cause AC_CHECK_FUNC to succeed next time configure is run
AC_DEFINE(HAVE_CONNECT)
fi
fi
#
# The following test was mostly taken from the tcl/tk plus patches
#
echo $ac_n "checking whether -c -o works ... $ac_c"
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
int main() { return 0; }
EOF
${CC-cc} -c -o conftest..o conftest.$ac_ext
if test -f conftest..o; then
OBJ_SAVE="#"
OBJ_RESTORE="#"
CC_SHOBJ_FLAG='-o $@'
echo yes
else
OBJ_SAVE=' @b=`basename $@ .o`;rm -f $$b.o.sav;if test -f $$b.o; then mv $$b.o $$b.o.sav;fi;'
OBJ_RESTORE=' @b=`basename $@ .o`;if test "$$b.o" != "$@"; then mv $$b.o $@; if test -f $$b.o.sav; then mv $$b.o.sav $$b.o; fi; fi'
CC_SHOBJ_FLAG=""
echo no
fi
rm -rf conftest*
AC_SUBST(OBJ_SAVE)
AC_SUBST(OBJ_RESTORE)
AC_SUBST(CC_SHOBJ_FLAG)
AC_OUTPUT(Makefile lib/dummy zlib/dummy)

View File

@@ -1,49 +1,47 @@
/*
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Support the max connections option.
*
* Copyright (C) 1998 Andrew Tridgell
* Copyright (C) 2006-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
/* support the max connections option */
#include "rsync.h"
/****************************************************************************
simple routine to do connection counting
****************************************************************************/
int claim_connection(char *fname,int max_connections)
/* A simple routine to do connection counting. This returns 1 on success
* and 0 on failure, with errno also being set if the open() failed (errno
* will be 0 if the lock request failed). */
int claim_connection(char *fname, int max_connections)
{
int fd, i;
if (max_connections <= 0)
if (max_connections == 0)
return 1;
fd = open(fname,O_RDWR|O_CREAT, 0600);
if (fd == -1) {
if ((fd = open(fname, O_RDWR|O_CREAT, 0600)) < 0)
return 0;
/* Find a free spot. */
for (i = 0; i < max_connections; i++) {
if (lock_range(fd, i*4, 4))
return 1;
}
/* find a free spot */
for (i=0;i<max_connections;i++) {
if (lock_range(fd, i*4, 4)) return 1;
}
/* only interested in open failures */
errno = 0;
close(fd);
/* A lock failure needs to return an errno of 0. */
errno = 0;
return 0;
}

88
csprotocol.txt Normal file
View File

@@ -0,0 +1,88 @@
This is kind of informal and may be wrong, but it helped me. It's
basically a summary of clientserver.c and authenticate.c.
-- Martin Pool <mbp@samba.org>
This is the protocol used for rsync --daemon; i.e. connections to port
873 rather than invocations over a remote shell.
When the server accepts a connection, it prints a greeting
@RSYNCD: <version>.<subprotocol>
where <version> is the numeric version (see PROTOCOL_VERSION in rsync.h)
'.' is a literal period, and <subprotocol> is the numeric subprotocol
version (see SUBPROTOCOL_VERSION -- it will be 0 for final releases).
Protocols prior to 30 only output <version> alone. The daemon expects
to see a similar greeting back from the client. For protocols prior to
30, an absent ".<subprotocol>" value is assumed to be 0. For protocol
30, an absent value is a fatal error. The daemon then follows this line
with a free-format text message-of-the-day (if any is defined).
The server is now in the connected state. The client can either send
the command
#list
to get a listing of modules, or the name of a module. After this, the
connection is now bound to a particular module. Access per host for
this module is now checked, as is per-module connection limits.
If authentication is required to use this module, the server will say
@RSYNCD: AUTHREQD <challenge>
where <challenge> is a random string of base64 characters. The client
must respond with
<user> <response>
where <user> is the username they claim to be, and <response> is the
base64 form of the MD4 hash of challenge+password.
At this point the server applies all remaining constraints before
handing control to the client, including switching uid/gid, setting up
include and exclude lists, moving to the root of the module, and doing
chroot.
If the login is acceptable, then the server will respond with
@RSYNCD: OK
The client now writes some rsync options, as if it were remotely
executing the command. The server parses these arguments as if it had
just been invoked with them, but they're added to the existing state.
So if the client specifies a list of files to be included or excluded,
they'll defer to existing limits specified in the server
configuration.
At this point the client and server both switch to using a
multiplexing layer across the socket. The main point of this is to
allow the server to asynchronously pass errors back, while still
allowing streamed and pipelined data.
Unfortunately, the multiplex protocol is not used at every stage. We
start up in plain socket mode and then change over by calling
io_start_buffering. Of course both the client and the server have to
do this at the same point.
The server then talks to the client as normal across the socket,
passing checksums, file lists and so on. For documentation of that,
stay tuned (or write it yourself!).
------------
Protocol version changes
30 (2007-10-04, 3.0.0pre1)
The use of a ".<subprotocol>" number was added to
@RSYNCD: <version>.<subprotocol>
25 (2001-08-20, 2.4.7pre2)
Send an explicit "@RSYNC EXIT" command at the end of the
module listing. We never intentionally end the transmission
by just closing the socket anymore.

114
daemon-parm.awk Executable file
View File

@@ -0,0 +1,114 @@
#!/usr/bin/awk -f
# The caller must pass arg: daemon-parm.txt
# The resulting code is output into daemon-parm.h
BEGIN {
heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from a list of values in " ARGV[1] "! */\n\n"
sect = psect = defines = accessors = prior_ptype = ""
parms = "\nstatic struct parm_struct parm_table[] = {"
comment_fmt = "\n/********** %s **********/\n"
tdstruct = "typedef struct {"
}
/^\s*$/ { next }
/^#/ { next }
/^Globals:/ {
if (defines != "") {
print "The Globals section must come first!"
defines = ""
exit
}
defines = tdstruct
values = "\nstatic const all_vars Defaults = {\n { /* Globals: */\n"
exps = exp_values = sprintf(comment_fmt, "EXP")
sect = "GLOBAL"
psect = ", P_GLOBAL, &Vars.g."
next
}
/^Locals:/ {
if (sect == "") {
print "The Locals section must come after the Globals!"
exit
}
defines = defines exps "} global_vars;\n\n" tdstruct
values = values exp_values "\n }, { /* Locals: */\n"
exps = exp_values = sprintf(comment_fmt, "EXP")
sect = "LOCAL"
psect = ", P_LOCAL, &Vars.l."
next
}
/^(STRING|CHAR|PATH|INTEGER|ENUM|OCTAL|BOOL|BOOLREV|BOOL3)[ \t]/ {
ptype = $1
name = $2
$1 = $2 = ""
sub(/^[ \t]+/, "")
if (ptype != prior_ptype) {
comment = sprintf(comment_fmt, ptype)
defines = defines comment
values = values comment
parms = parms "\n"
accessors = accessors "\n"
prior_ptype = ptype
}
if (ptype == "STRING" || ptype == "PATH") {
atype = "STRING"
vtype = "char*"
} else if (ptype ~ /BOOL/) {
atype = vtype = "BOOL"
} else if (ptype == "CHAR") {
atype = "CHAR"
vtype = "char"
} else {
atype = "INTEGER"
vtype = "int"
}
# The name might be var_name|public_name
pubname = name
sub(/\|.*/, "", name)
sub(/.*\|/, "", pubname)
gsub(/_/, " ", pubname)
gsub(/-/, "", name)
if (ptype == "ENUM")
enum = "enum_" name
else
enum = "NULL"
defines = defines "\t" vtype " " name ";\n"
values = values "\t" $0 ", /* " name " */\n"
parms = parms " {\"" pubname "\", P_" ptype psect name ", " enum ", 0},\n"
accessors = accessors "FN_" sect "_" atype "(lp_" name ", " name ")\n"
if (vtype == "char*") {
exps = exps "\tBOOL " name "_EXP;\n"
exp_values = exp_values "\tFalse, /* " name "_EXP */\n"
}
next
}
/./ {
print "Extraneous line:" $0
defines = ""
exit
}
END {
if (sect != "" && defines != "") {
defines = defines exps "} local_vars;\n\n"
defines = defines tdstruct "\n\tglobal_vars g;\n\tlocal_vars l;\n} all_vars;\n"
values = values exp_values "\n }\n};\n\nstatic all_vars Vars;\n"
parms = parms "\n {NULL, P_BOOL, P_NONE, NULL, NULL, 0}\n};\n"
print heading defines values parms accessors > "daemon-parm.h"
} else {
print "Failed to parse the data in " ARGV[1]
exit 1
}
}

68
daemon-parm.txt Normal file
View File

@@ -0,0 +1,68 @@
Globals: ================================================================
STRING bind_address|address NULL
STRING daemon_chroot NULL
STRING daemon_gid NULL
STRING daemon_uid NULL
STRING motd_file NULL
STRING pid_file NULL
STRING socket_options NULL
INTEGER listen_backlog 5
INTEGER rsync_port|port 0
BOOL proxy_protocol False
Locals: =================================================================
STRING auth_users NULL
STRING charset NULL
STRING comment NULL
STRING dont_compress DEFAULT_DONT_COMPRESS
STRING early_exec NULL
STRING exclude NULL
STRING exclude_from NULL
STRING filter NULL
STRING gid NULL
STRING hosts_allow NULL
STRING hosts_deny NULL
STRING include NULL
STRING include_from NULL
STRING incoming_chmod NULL
STRING lock_file DEFAULT_LOCK_FILE
STRING log_file NULL
STRING log_format "%o %h [%a] %m (%u) %f %l"
STRING name NULL
STRING name_converter NULL
STRING outgoing_chmod NULL
STRING post-xfer_exec NULL
STRING pre-xfer_exec NULL
STRING refuse_options NULL
STRING secrets_file NULL
STRING syslog_tag "rsyncd"
STRING uid NULL
PATH path NULL
PATH temp_dir NULL
INTEGER max_connections 0
INTEGER max_verbosity 1
INTEGER timeout 0
ENUM syslog_facility LOG_DAEMON
BOOL fake_super False
BOOL forward_lookup True
BOOL ignore_errors False
BOOL ignore_nonreadable False
BOOL list True
BOOL read_only True
BOOL reverse_lookup True
BOOL strict_modes True
BOOL transfer_logging False
BOOL use_chroot True
BOOL write_only False
BOOL3 munge_symlinks Unset
BOOL3 numeric_ids Unset
BOOL3 open_noatime Unset

41
define-from-md.awk Executable file
View File

@@ -0,0 +1,41 @@
#!/usr/bin/awk -f
# The caller must pass args: -v hfile=NAME rsync.1.md
BEGIN {
heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from a list of values in " ARGV[1] "! */"
if (hfile ~ /compress/) {
define = "#define DEFAULT_DONT_COMPRESS"
prefix = "*."
} else {
define = "#define DEFAULT_CVSIGNORE"
prefix = ""
}
value_list = ""
}
/^ > [^ ]+$/ {
gsub(/`/, "")
if (value_list != "") value_list = value_list " "
value_list = value_list prefix $2
next
}
value_list ~ /\.gz / && hfile ~ /compress/ {
exit
}
value_list ~ /SCCS / && hfile ~ /cvsignore/ {
exit
}
value_list = ""
END {
if (value_list != "")
print heading "\n\n" define " \"" value_list "\"" > hfile
else {
print "Failed to find a value list in " ARGV[1] " for " hfile
exit 1
}
}

240
delete.c Normal file
View File

@@ -0,0 +1,240 @@
/*
* Deletion routines used in rsync.
*
* Copyright (C) 1996-2000 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
* Copyright (C) 2003-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
extern int am_root;
extern int make_backups;
extern int max_delete;
extern char *backup_dir;
extern char *backup_suffix;
extern int backup_suffix_len;
extern struct stats stats;
int ignore_perishable = 0;
int non_perishable_cnt = 0;
int skipped_deletes = 0;
static inline int is_backup_file(char *fn)
{
int k = strlen(fn) - backup_suffix_len;
return k > 0 && strcmp(fn+k, backup_suffix) == 0;
}
/* The directory is about to be deleted: if DEL_RECURSE is given, delete all
* its contents, otherwise just checks for content. Returns DR_SUCCESS or
* DR_NOT_EMPTY. Note that fname must point to a MAXPATHLEN buffer! (The
* buffer is used for recursion, but returned unchanged.)
*/
static enum delret delete_dir_contents(char *fname, uint16 flags)
{
struct file_list *dirlist;
enum delret ret;
unsigned remainder;
void *save_filters;
int j, dlen;
char *p;
if (DEBUG_GTE(DEL, 3)) {
rprintf(FINFO, "delete_dir_contents(%s) flags=%d\n",
fname, flags);
}
dlen = strlen(fname);
save_filters = push_local_filters(fname, dlen);
non_perishable_cnt = 0;
dirlist = get_dirlist(fname, dlen, 0);
ret = non_perishable_cnt ? DR_NOT_EMPTY : DR_SUCCESS;
if (!dirlist->used)
goto done;
if (!(flags & DEL_RECURSE)) {
ret = DR_NOT_EMPTY;
goto done;
}
p = fname + dlen;
if (dlen != 1 || *fname != '/')
*p++ = '/';
remainder = MAXPATHLEN - (p - fname);
/* We do our own recursion, so make delete_item() non-recursive. */
flags = (flags & ~(DEL_RECURSE|DEL_MAKE_ROOM|DEL_NO_UID_WRITE))
| DEL_DIR_IS_EMPTY;
for (j = dirlist->used; j--; ) {
struct file_struct *fp = dirlist->files[j];
if (fp->flags & FLAG_MOUNT_DIR && S_ISDIR(fp->mode)) {
if (DEBUG_GTE(DEL, 1)) {
rprintf(FINFO,
"mount point, %s, pins parent directory\n",
f_name(fp, NULL));
}
ret = DR_NOT_EMPTY;
continue;
}
strlcpy(p, fp->basename, remainder);
if (!(fp->mode & S_IWUSR) && !am_root && fp->flags & FLAG_OWNED_BY_US)
do_chmod(fname, fp->mode | S_IWUSR);
/* Save stack by recursing to ourself directly. */
if (S_ISDIR(fp->mode)) {
if (delete_dir_contents(fname, flags | DEL_RECURSE) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
}
if (delete_item(fname, fp->mode, flags) != DR_SUCCESS)
ret = DR_NOT_EMPTY;
}
fname[dlen] = '\0';
done:
flist_free(dirlist);
pop_local_filters(save_filters);
if (ret == DR_NOT_EMPTY) {
rprintf(FINFO, "cannot delete non-empty directory: %s\n",
fname);
}
return ret;
}
/* Delete a file or directory. If DEL_RECURSE is set in the flags, this will
* delete recursively.
*
* Note that fbuf must point to a MAXPATHLEN buffer if the mode indicates it's
* a directory! (The buffer is used for recursion, but returned unchanged.)
*/
enum delret delete_item(char *fbuf, uint16 mode, uint16 flags)
{
enum delret ret;
char *what;
int ok;
if (DEBUG_GTE(DEL, 2)) {
rprintf(FINFO, "delete_item(%s) mode=%o flags=%d\n",
fbuf, (int)mode, (int)flags);
}
if (flags & DEL_NO_UID_WRITE)
do_chmod(fbuf, mode | S_IWUSR);
if (S_ISDIR(mode) && !(flags & DEL_DIR_IS_EMPTY)) {
/* This only happens on the first call to delete_item() since
* delete_dir_contents() always calls us w/DEL_DIR_IS_EMPTY. */
ignore_perishable = 1;
/* If DEL_RECURSE is not set, this just reports emptiness. */
ret = delete_dir_contents(fbuf, flags);
ignore_perishable = 0;
if (ret == DR_NOT_EMPTY || ret == DR_AT_LIMIT)
goto check_ret;
/* OK: try to delete the directory. */
}
if (!(flags & DEL_MAKE_ROOM) && max_delete >= 0 && stats.deleted_files >= max_delete) {
skipped_deletes++;
return DR_AT_LIMIT;
}
if (S_ISDIR(mode)) {
what = "rmdir";
ok = do_rmdir(fbuf) == 0;
} else {
if (make_backups > 0 && !(flags & DEL_FOR_BACKUP) && (backup_dir || !is_backup_file(fbuf))) {
what = "make_backup";
ok = make_backup(fbuf, True);
if (ok == 2) {
what = "unlink";
ok = robust_unlink(fbuf) == 0;
}
} else {
what = "unlink";
ok = robust_unlink(fbuf) == 0;
}
}
if (ok) {
if (!(flags & DEL_MAKE_ROOM)) {
log_delete(fbuf, mode);
stats.deleted_files++;
if (S_ISREG(mode)) {
/* Nothing more to count */
} else if (S_ISDIR(mode))
stats.deleted_dirs++;
#ifdef SUPPORT_LINKS
else if (S_ISLNK(mode))
stats.deleted_symlinks++;
#endif
else if (IS_DEVICE(mode))
stats.deleted_symlinks++;
else
stats.deleted_specials++;
}
ret = DR_SUCCESS;
} else {
if (S_ISDIR(mode) && errno == ENOTEMPTY) {
rprintf(FINFO, "cannot delete non-empty directory: %s\n",
fbuf);
ret = DR_NOT_EMPTY;
} else if (errno != ENOENT) {
rsyserr(FERROR_XFER, errno, "delete_file: %s(%s) failed",
what, fbuf);
ret = DR_FAILURE;
} else
ret = DR_SUCCESS;
}
check_ret:
if (ret != DR_SUCCESS && flags & DEL_MAKE_ROOM) {
const char *desc;
switch (flags & DEL_MAKE_ROOM) {
case DEL_FOR_FILE: desc = "regular file"; break;
case DEL_FOR_DIR: desc = "directory"; break;
case DEL_FOR_SYMLINK: desc = "symlink"; break;
case DEL_FOR_DEVICE: desc = "device file"; break;
case DEL_FOR_SPECIAL: desc = "special file"; break;
default: exit_cleanup(RERR_UNSUPPORTED); /* IMPOSSIBLE */
}
rprintf(FERROR_XFER, "could not make way for %s %s: %s\n",
flags & DEL_FOR_BACKUP ? "backup" : "new",
desc, fbuf);
}
return ret;
}
uint16 get_del_for_flag(uint16 mode)
{
if (S_ISREG(mode))
return DEL_FOR_FILE;
if (S_ISDIR(mode))
return DEL_FOR_DIR;
if (S_ISLNK(mode))
return DEL_FOR_SYMLINK;
if (IS_DEVICE(mode))
return DEL_FOR_DEVICE;
if (IS_SPECIAL(mode))
return DEL_FOR_SPECIAL;
exit_cleanup(RERR_UNSUPPORTED); /* IMPOSSIBLE */
}

20
doc/README-SGML Normal file
View File

@@ -0,0 +1,20 @@
Handling the rsync SGML documentation
rsync documentation is now primarily in Docbook format. Docbook is an
SGML/XML documentation format that is becoming standard on free
operating systems. It's also used for Samba documentation.
The SGML files are source code that can be translated into various
useful output formats, primarily PDF, HTML, Postscript and plain text.
To do this transformation on Debian, you should install the
docbook-utils package. Having done that, you can say
docbook2pdf rsync.sgml
and so on.
On other systems you probably need James Clark's "sp" and "JadeTeX"
packages. Work it out for yourself and send a note to the mailing
list.

42
doc/profile.txt Normal file
View File

@@ -0,0 +1,42 @@
Notes on rsync profiling
strlcpy is hot:
0.00 0.00 1/7735635 push_dir [68]
0.00 0.00 1/7735635 pop_dir [71]
0.00 0.00 1/7735635 send_file_list [15]
0.01 0.00 18857/7735635 send_files [4]
0.04 0.00 129260/7735635 send_file_entry [18]
0.04 0.00 129260/7735635 make_file [20]
0.04 0.00 141666/7735635 send_directory <cycle 1> [36]
2.29 0.00 7316589/7735635 f_name [13]
[14] 11.7 2.42 0.00 7735635 strlcpy [14]
Here's the top few functions:
46.23 9.57 9.57 13160929 0.00 0.00 mdfour64
14.78 12.63 3.06 13160929 0.00 0.00 copy64
11.69 15.05 2.42 7735635 0.00 0.00 strlcpy
10.05 17.13 2.08 41438 0.05 0.38 sum_update
4.11 17.98 0.85 13159996 0.00 0.00 mdfour_update
1.50 18.29 0.31 file_compare
1.45 18.59 0.30 129261 0.00 0.01 send_file_entry
1.23 18.84 0.26 2557585 0.00 0.00 f_name
1.11 19.07 0.23 1483750 0.00 0.00 u_strcmp
1.11 19.30 0.23 118129 0.00 0.00 writefd_unbuffered
0.92 19.50 0.19 1085011 0.00 0.00 writefd
0.43 19.59 0.09 156987 0.00 0.00 read_timeout
0.43 19.68 0.09 129261 0.00 0.00 clean_fname
0.39 19.75 0.08 32887 0.00 0.38 matched
0.34 19.82 0.07 1 70.00 16293.92 send_files
0.29 19.89 0.06 129260 0.00 0.00 make_file
0.29 19.95 0.06 75430 0.00 0.00 read_unbuffered
mdfour could perhaps be made faster:
/* NOTE: This code makes no attempt to be fast! */
There might be an optimized version somewhere that we can borrow.

351
doc/rsync.sgml Normal file
View File

@@ -0,0 +1,351 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<book id="rsync">
<bookinfo>
<title>rsync</title>
<copyright>
<year>1996 -- 2002</year>
<holder>Martin Pool</holder>
<holder>Andrew Tridgell</holder>
</copyright>
<author>
<firstname>Martin</firstname>
<surname>Pool</surname>
</author>
</bookinfo>
<chapter>
<title>Introduction</title>
<para>rsync is a flexible program for efficiently copying files or
directory trees.
<para>rsync has many options to select which files will be copied
and how they are to be transferred. It may be used as an
alternative to ftp, http, scp or rcp.
<para>The rsync remote-update protocol allows rsync to transfer just
the differences between two sets of files across the network link,
using an efficient checksum-search algorithm described in the
technical report that accompanies this package.</para>
<para>Some of the additional features of rsync are:</para>
<itemizedlist>
<listitem>
<para>support for copying links, devices, owners, groups and
permissions
</para>
</listitem>
<listitem>
<para>
exclude and exclude-from options similar to GNU tar
</para>
</listitem>
<listitem>
<para>
a CVS exclude mode for ignoring the same files that CVS would ignore
</listitem>
<listitem>
<para>
can use any transparent remote shell, including rsh or ssh
</listitem>
<listitem>
<para>
does not require root privileges
</listitem>
<listitem>
<para>
pipelining of file transfers to minimize latency costs
</listitem>
<listitem>
<para>
support for anonymous or authenticated rsync servers (ideal for
mirroring)
</para>
</listitem>
</itemizedlist>
</chapter>
<chapter>
<title>Using rsync</title>
<section>
<title>
Introductory example
</title>
<para>
Probably the most common case of rsync usage is to copy files
to or from a remote machine using
<application>ssh</application> as a network transport. In
this situation rsync is a good alternative to
<application>scp</application>.
</para>
<para>
The most commonly used arguments for rsync are
</para>
<variablelist>
<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>Be verbose. Primarily, display the name of each file as it is copied.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-a</option></term>
<listitem>
<para>
Reproduce the structure and attributes of the origin files as exactly
as possible: this includes copying subdirectories, symlinks, special
files, ownership and permissions. (@xref{Attributes to
copy}.)
</para>
</listitem>
</varlistentry>
</variablelist>
<para><option>-v </option>
<para><option>-z</option>
Compress network traffic, using a modified version of the
@command{zlib} library.</para>
<para><option>-P</option>
Display a progress indicator while files are transferred. This should
normally be omitted if rsync is not run on a terminal.
</para>
</section>
<section>
<title>Local and remote</title>
<para>There are six different ways of using rsync. They
are:</para>
<!-- one of (CALLOUTLIST GLOSSLIST ITEMIZEDLIST ORDEREDLIST SEGMENTEDLIST SIMPLELIST VARIABLELIST CAUTION IMPORTANT NOTE TIP WARNING LITERALLAYOUT PROGRAMLISTING PROGRAMLISTINGCO SCREEN SCREENCO SCREENSHOT SYNOPSIS CMDSYNOPSIS FUNCSYNOPSIS CLASSSYNOPSIS FIELDSYNOPSIS CONSTRUCTORSYNOPSIS DESTRUCTORSYNOPSIS METHODSYNOPSIS FORMALPARA PARA SIMPARA ADDRESS BLOCKQUOTE GRAPHIC GRAPHICCO MEDIAOBJECT MEDIAOBJECTCO INFORMALEQUATION INFORMALEXAMPLE INFORMALFIGURE INFORMALTABLE EQUATION EXAMPLE FIGURE TABLE MSGSET PROCEDURE SIDEBAR QANDASET ANCHOR BRIDGEHEAD REMARK HIGHLIGHTS ABSTRACT AUTHORBLURB EPIGRAPH INDEXTERM REFENTRY SECTION) -->
<orderedlist>
<listitem>
<para>
for copying local files. This is invoked when neither
source nor destination path contains a @code{:} separator
<listitem>
<para>
for copying from the local machine to a remote machine using
a remote shell program as the transport (such as rsh or
ssh). This is invoked when the destination path contains a
single @code{:} separator.
<listitem>
<para>
for copying from a remote machine to the local machine
using a remote shell program. This is invoked when the source
contains a @code{:} separator.
<listitem>
<para>
for copying from a remote rsync server to the local
machine. This is invoked when the source path contains a @code{::}
separator or a @code{rsync://} URL.
<listitem>
<para>
for copying from the local machine to a remote rsync
server. This is invoked when the destination path contains a @code{::}
separator.
<listitem>
<para>
for listing files on a remote machine. This is done the
same way as rsync transfers except that you leave off the
local destination.
</listitem>
</orderedlist>
<para>
Note that in all cases (other than listing) at least one of the source
and destination paths must be local.
<para>
Any one invocation of rsync makes a copy in a single direction. rsync
currently has no equivalent of @command{ftp}'s interactive mode.
@cindex @sc{nfs}
@cindex network filesystems
@cindex remote filesystems
<para>
rsync's network protocol is generally faster at copying files than
network filesystems such as @sc{nfs} or @sc{cifs}. It is better to
run rsync on the file server either as a daemon or over ssh than
running rsync giving the network directory.
</para>
</section>
</chapter>
<chapter>
<title>Frequently asked questions</title>
<!-- one of (CALLOUTLIST GLOSSLIST ITEMIZEDLIST ORDEREDLIST SEGMENTEDLIST SIMPLELIST VARIABLELIST CAUTION IMPORTANT NOTE TIP WARNING LITERALLAYOUT PROGRAMLISTING PROGRAMLISTINGCO SCREEN SCREENCO SCREENSHOT SYNOPSIS CMDSYNOPSIS FUNCSYNOPSIS CLASSSYNOPSIS FIELDSYNOPSIS CONSTRUCTORSYNOPSIS DESTRUCTORSYNOPSIS METHODSYNOPSIS FORMALPARA PARA SIMPARA ADDRESS BLOCKQUOTE GRAPHIC GRAPHICCO MEDIAOBJECT MEDIAOBJECTCO INFORMALEQUATION INFORMALEXAMPLE INFORMALFIGURE INFORMALTABLE EQUATION EXAMPLE FIGURE TABLE MSGSET PROCEDURE SIDEBAR QANDASET ANCHOR BRIDGEHEAD REMARK HIGHLIGHTS ABSTRACT AUTHORBLURB EPIGRAPH INDEXTERM SECTION SIMPLESECT REFENTRY SECT1) -->
<qandaset>
<!-- one of (QANDADIV QANDAENTRY) -->
<qandaentry>
<question>
<!-- one of (CALLOUTLIST GLOSSLIST ITEMIZEDLIST ORDEREDLIST
SEGMENTEDLIST SIMPLELIST VARIABLELIST CAUTION IMPORTANT NOTE
TIP WARNING LITERALLAYOUT PROGRAMLISTING PROGRAMLISTINGCO
SCREEN SCREENCO SCREENSHOT SYNOPSIS CMDSYNOPSIS FUNCSYNOPSIS
CLASSSYNOPSIS FIELDSYNOPSIS CONSTRUCTORSYNOPSIS
DESTRUCTORSYNOPSIS METHODSYNOPSIS FORMALPARA PARA SIMPARA
ADDRESS BLOCKQUOTE GRAPHIC GRAPHICCO MEDIAOBJECT
MEDIAOBJECTCO INFORMALEQUATION INFORMALEXAMPLE
INFORMALFIGURE INFORMALTABLE EQUATION EXAMPLE FIGURE TABLE
PROCEDURE ANCHOR BRIDGEHEAD REMARK HIGHLIGHTS INDEXTERM) -->
<para>Are there mailing lists for rsync?
</question>
<answer>
<para>Yes, and you can subscribe and unsubscribe through a
web interface at
<ulink
url="http://lists.samba.org/">http://lists.samba.org/</ulink>
</para>
<para>
If you are having trouble with the mailing list, please
send mail to the administrator
<email>rsync-admin@lists.samba.org</email>
not to the list itself.
</para>
<para>
The mailing list archives are searchable. Use
<ulink url="http://google.com/">Google</ulink> and prepend
the search with <userinput>site:lists.samba.org
rsync</userinput>, plus relevant keywords.
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>
Why is rsync so much bigger when I build it with
<command>gcc</command>?
</para>
</question>
<answer>
<para>
On gcc, rsync builds by default with debug symbols
included. If you strip both executables, they should end
up about the same size. (Use <command>make
install-strip</command>.)
</para>
</answer>
</qandaentry>
<qandaentry>
<question>
<para>Is rsync useful for a single large file like an ISO image?</para>
</question>
<answer>
<para>
Yes, but note the following:
<para>
Background: A common use of rsync is to update a file (or set of files) in one location from a more
correct or up-to-date copy in another location, taking advantage of portions of the files that are
identical to speed up the process. (Note that rsync will transfer a file in its entirety if no copy
exists at the destination.)
<para>
(This discussion is written in terms of updating a local copy of a file from a correct file in a
remote location, although rsync can work in either direction.)
<para>
The file to be updated (the local file) must be in a destination directory that has enough space for
two copies of the file. (In addition, keep an extra copy of the file to be updated in a different
location for safety -- see the discussion (below) about rsync's behavior when the rsync process is
interrupted before completion.)
<para>
The local file must have the same name as the remote file being sync'd to (I think?). If you are
trying to upgrade an iso from, for example, beta1 to beta2, rename the local file to the same name
as the beta2 file. *(This is a useful thing to do -- only the changed portions will be
transmitted.)*
<para>
The extra copy of the local file kept in a different location is because of rsync's behavior if
interrupted before completion:
<para>
* If you specify the --partial option and rsync is interrupted, rsync will save the partially
rsync'd file and throw away the original local copy. (The partially rsync'd file is correct but
truncated.) If rsync is restarted, it will not have a local copy of the file to check for duplicate
blocks beyond the section of the file that has already been rsync'd, thus the remainder of the rsync
process will be a "pure transfer" of the file rather than taking advantage of the rsync algorithm.
<para>
* If you don't specify the --partial option and rsync is interrupted, rsync will throw away the
partially rsync'd file, and, when rsync is restarted starts the rsync process over from the
beginning.
<para>
Which of these is most desirable depends on the degree of commonality between the local and remote
copies of the file *and how much progress was made before the interruption*.
<para>
The ideal approach after an interruption would be to create a new file by taking the original file
and deleting a portion equal in size to the portion already rsync'd and then appending *the
remaining* portion to the portion of the file that has already been rsync'd. (There has been some
discussion about creating an option to do this automatically.)
The --compare-dest option is useful when transferring multiple files, but is of no benefit in
transferring a single file. (AFAIK)
*Other potentially useful information can be found at:
-[3]http://twiki.org/cgi-bin/view/Wikilearn/RsyncingALargeFile
This answer, formatted with "real" bullets, can be found at:
-[4]http://twiki.org/cgi-bin/view/Wikilearn/RsyncingALargeFileFAQ*
</para>
</answer>
</qandaentry>
</qandaset>
</chapter>
<appendix>
<title>Other Resources</title>
<para><ulink url="http://www.ccp14.ac.uk/ccp14admin/rsync/"></ulink></para>
</appendix>
</book>

View File

@@ -1,18 +1,64 @@
/* error codes returned by rsync */
/*
* Error codes returned by rsync.
*
* Copyright (C) 1998-2000 Andrew Tridgell
* Copyright (C) 2003-2019 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
/* If you change these, please also update the string mappings in log.c and
* the EXIT VALUES in rsync.yo. */
#define RERR_OK 0
#define RERR_SYNTAX 1 /* syntax or usage error */
#define RERR_PROTOCOL 2 /* protocol incompatibility */
#define RERR_FILESELECT 3 /* errors selecting input/output files, dirs */
#define RERR_NOSUPPORT 4 /* requested action not supported */
#define RERR_UNSUPPORTED 4 /* requested action not supported */
#define RERR_STARTCLIENT 5 /* error starting client-server protocol */
#define RERR_SOCKETIO 10 /* error in socket IO */
#define RERR_FILEIO 11 /* error in file IO */
#define RERR_STREAMIO 12 /* error in rsync protocol data stream */
#define RERR_MESSAGEIO 13 /* errors with program diagnostics */
#define RERR_IPC 14 /* error in IPC code */
#define RERR_CRASHED 15 /* sibling crashed */
#define RERR_TERMINATED 16 /* sibling terminated abnormally */
#define RERR_SIGNAL 20 /* status returned when sent SIGUSR1, SIGINT */
#define RERR_SIGNAL1 19 /* status returned when sent SIGUSR1 */
#define RERR_SIGNAL 20 /* status returned when sent SIGINT, SIGTERM, SIGHUP */
#define RERR_WAITCHILD 21 /* some error returned by waitpid() */
#define RERR_MALLOC 22 /* error allocating core memory buffers */
#define RERR_PARTIAL 23 /* partial transfer */
#define RERR_VANISHED 24 /* file(s) vanished on sender side */
#define RERR_DEL_LIMIT 25 /* skipped some deletes due to --max-delete */
#define RERR_TIMEOUT 30 /* timeout in data send/receive */
#define RERR_CONTIMEOUT 35 /* timeout waiting for daemon connection */
/* Although it doesn't seem to be specified anywhere,
* ssh and the shell seem to return these values:
*
* 124 if the command exited with status 255
* 125 if the command is killed by a signal
* 126 if the command cannot be run
* 127 if the command is not found
*
* and we could use this to give a better explanation if the remote
* command is not found.
*/
#define RERR_CMD_FAILED 124
#define RERR_CMD_KILLED 125
#define RERR_CMD_RUN 126
#define RERR_CMD_NOTFOUND 127

1622
exclude.c
View File

File diff suppressed because it is too large Load Diff

432
fileio.c
View File

@@ -1,85 +1,178 @@
/*
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
File IO utilities used in rsync
*/
#include "rsync.h"
* File IO utilities used in rsync.
*
* Copyright (C) 1998 Andrew Tridgell
* Copyright (C) 2002 Martin Pool
* Copyright (C) 2004-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "inums.h"
#ifndef ENODATA
#define ENODATA EAGAIN
#endif
/* We want all reads to be aligned on 1K boundaries. */
#define ALIGN_BOUNDARY 1024
/* How far past the boundary is an offset? */
#define ALIGNED_OVERSHOOT(oft) ((oft) & (ALIGN_BOUNDARY-1))
/* Round up a length to the next boundary */
#define ALIGNED_LENGTH(len) ((((len) - 1) | (ALIGN_BOUNDARY-1)) + 1)
static char last_byte;
static int last_sparse;
extern int sparse_files;
int sparse_end(int f)
{
if (last_sparse) {
do_lseek(f,-1,SEEK_CUR);
return (write(f,&last_byte,1) == 1 ? 0 : -1);
}
last_sparse = 0;
return 0;
}
OFF_T preallocated_len = 0;
static OFF_T sparse_seek = 0;
static OFF_T sparse_past_write = 0;
static int write_sparse(int f,char *buf,int len)
int sparse_end(int f, OFF_T size)
{
int l1=0,l2=0;
int ret;
for (l1=0;l1<len && buf[l1]==0;l1++) ;
for (l2=0;l2<(len-l1) && buf[len-(l2+1)]==0;l2++) ;
sparse_past_write = 0;
last_byte = buf[len-1];
if (!sparse_seek)
return 0;
if (l1 == len || l2 > 0)
last_sparse=1;
#ifdef HAVE_FTRUNCATE
ret = do_ftruncate(f, size);
#else
if (do_lseek(f, sparse_seek-1, SEEK_CUR) != size-1)
ret = -1;
else {
do {
ret = write(f, "", 1);
} while (ret < 0 && errno == EINTR);
if (l1 > 0)
do_lseek(f,l1,SEEK_CUR);
ret = ret <= 0 ? -1 : 0;
}
#endif
if (l1 == len)
sparse_seek = 0;
return ret;
}
/* Note that the offset is just the caller letting us know where
* the current file position is in the file. The use_seek arg tells
* us that we should seek over matching data instead of writing it. */
static int write_sparse(int f, int use_seek, OFF_T offset, const char *buf, int len)
{
int l1 = 0, l2 = 0;
int ret;
for (l1 = 0; l1 < len && buf[l1] == 0; l1++) {}
for (l2 = 0; l2 < len-l1 && buf[len-(l2+1)] == 0; l2++) {}
sparse_seek += l1;
if (l1 == len)
return len;
if ((ret=write(f,buf+l1,len-(l1+l2))) != len-(l1+l2)) {
if (ret == -1 || ret == 0) return ret;
return (l1+ret);
if (sparse_seek) {
if (sparse_past_write >= preallocated_len) {
if (do_lseek(f, sparse_seek, SEEK_CUR) < 0)
return -1;
} else if (do_punch_hole(f, sparse_past_write, sparse_seek) < 0) {
sparse_seek = 0;
return -1;
}
}
sparse_seek = l2;
sparse_past_write = offset + len - l2;
if (use_seek) {
/* The in-place data already matches. */
if (do_lseek(f, len - (l1+l2), SEEK_CUR) < 0)
return -1;
return len;
}
while ((ret = write(f, buf + l1, len - (l1+l2))) <= 0) {
if (ret < 0 && errno == EINTR)
continue;
sparse_seek = 0;
return ret;
}
if (ret != (int)(len - (l1+l2))) {
sparse_seek = 0;
return l1+ret;
}
if (l2 > 0)
do_lseek(f,l2,SEEK_CUR);
return len;
}
static char *wf_writeBuf;
static size_t wf_writeBufSize;
static size_t wf_writeBufCnt;
int flush_write_file(int f)
{
int ret = 0;
char *bp = wf_writeBuf;
int write_file(int f,char *buf,int len)
while (wf_writeBufCnt > 0) {
if ((ret = write(f, bp, wf_writeBufCnt)) < 0) {
if (errno == EINTR)
continue;
return ret;
}
wf_writeBufCnt -= ret;
bp += ret;
}
return ret;
}
/* write_file does not allow incomplete writes. It loops internally
* until len bytes are written or errno is set. Note that use_seek and
* offset are only used in sparse processing (see write_sparse()). */
int write_file(int f, int use_seek, OFF_T offset, const char *buf, int len)
{
int ret = 0;
if (!sparse_files)
return write(f,buf,len);
while (len>0) {
int len1 = MIN(len, SPARSE_WRITE_SIZE);
int r1 = write_sparse(f, buf, len1);
while (len > 0) {
int r1;
if (sparse_files > 0) {
int len1 = MIN(len, SPARSE_WRITE_SIZE);
r1 = write_sparse(f, use_seek, offset, buf, len1);
offset += r1;
} else {
if (!wf_writeBuf) {
wf_writeBufSize = WRITE_SIZE * 8;
wf_writeBufCnt = 0;
wf_writeBuf = new_array(char, wf_writeBufSize);
}
r1 = (int)MIN((size_t)len, wf_writeBufSize - wf_writeBufCnt);
if (r1) {
memcpy(wf_writeBuf + wf_writeBufCnt, buf, r1);
wf_writeBufCnt += r1;
}
if (wf_writeBufCnt == wf_writeBufSize) {
if (flush_write_file(f) < 0)
return -1;
if (!r1 && len)
continue;
}
}
if (r1 <= 0) {
if (ret > 0) return ret;
if (ret > 0)
return ret;
return r1;
}
len -= r1;
@@ -89,130 +182,147 @@ int write_file(int f,char *buf,int len)
return ret;
}
struct map_struct *map_file(int fd,OFF_T len)
/* An in-place update found identical data at an identical location. We either
* just seek past it, or (for an in-place sparse update), we give the data to
* the sparse processor with the use_seek flag set. */
int skip_matched(int fd, OFF_T offset, const char *buf, int len)
{
struct map_struct *ret;
ret = (struct map_struct *)malloc(sizeof(*ret));
if (!ret) out_of_memory("map_file");
OFF_T pos;
ret->map = NULL;
ret->fd = fd;
ret->size = len;
ret->p = NULL;
ret->p_size = 0;
ret->p_offset = 0;
ret->p_len = 0;
#ifdef USE_MMAP
len = MIN(len, MAX_MAP_SIZE);
ret->map = (char *)do_mmap(NULL,len,PROT_READ,MAP_SHARED,fd,0);
if (ret->map == (char *)-1) {
ret->map = NULL;
} else {
ret->p_len = len;
if (sparse_files > 0) {
if (write_file(fd, 1, offset, buf, len) != len)
return -1;
return 0;
}
#endif
return ret;
if (flush_write_file(fd) < 0)
return -1;
if ((pos = do_lseek(fd, len, SEEK_CUR)) != offset + len) {
rsyserr(FERROR_XFER, errno, "lseek returned %s, not %s",
big_num(pos), big_num(offset));
return -1;
}
return 0;
}
/* This provides functionality somewhat similar to mmap() but using read().
* It gives sliding window access to a file. mmap() is not used because of
* the possibility of another program (such as a mailer) truncating the
* file thus giving us a SIGBUS. */
struct map_struct *map_file(int fd, OFF_T len, int32 read_size, int32 blk_size)
{
struct map_struct *map;
map = new0(struct map_struct);
if (blk_size && (read_size % blk_size))
read_size += blk_size - (read_size % blk_size);
map->fd = fd;
map->file_size = len;
map->def_window_size = ALIGNED_LENGTH(read_size);
return map;
}
char *map_ptr(struct map_struct *map,OFF_T offset,int len)
/* slide the read window in the file */
char *map_ptr(struct map_struct *map, OFF_T offset, int32 len)
{
int nread;
OFF_T window_start, read_start;
int32 window_size, read_size, read_offset, align_fudge;
if (len == 0)
if (len == 0)
return NULL;
if (len > (map->size-offset))
len = map->size-offset;
#ifdef USE_MMAP
if (map->map) {
if (offset >= map->p_offset &&
offset+len <= map->p_offset+map->p_len) {
return (map->map + (offset - map->p_offset));
}
if (munmap(map->map, map->p_len) != 0) {
rprintf(FERROR,"munmap failed : %s\n", strerror(errno));
exit_cleanup(RERR_MALLOC);
}
/* align the mmap region on a nice boundary back a bit from
where it is asked for to allow for some seeking */
if (offset > 2*CHUNK_SIZE) {
map->p_offset = offset - 2*CHUNK_SIZE;
map->p_offset &= ~((OFF_T)(CHUNK_SIZE-1));
} else {
map->p_offset = 0;
}
/* map up to MAX_MAP_SIZE */
map->p_len = MAX(len, MAX_MAP_SIZE);
map->p_len = MIN(map->p_len, map->size - map->p_offset);
map->map = (char *)do_mmap(NULL,map->p_len,PROT_READ,
MAP_SHARED,map->fd,map->p_offset);
if (map->map == (char *)-1) {
map->map = NULL;
map->p_len = 0;
map->p_offset = 0;
} else {
return (map->map + (offset - map->p_offset));
}
}
#endif
if (offset >= map->p_offset &&
offset+len <= map->p_offset+map->p_len) {
return (map->p + (offset - map->p_offset));
}
len = MAX(len,CHUNK_SIZE);
if (len > (map->size-offset))
len = map->size-offset;
if (len > map->p_size) {
if (map->p) free(map->p);
map->p = (char *)malloc(len);
if (!map->p) out_of_memory("map_ptr");
map->p_size = len;
}
map->p_offset = offset;
map->p_len = len;
if (do_lseek(map->fd,offset,SEEK_SET) != offset) {
rprintf(FERROR,"lseek failed in map_ptr\n");
if (len < 0) {
rprintf(FERROR, "invalid len passed to map_ptr: %ld\n",
(long)len);
exit_cleanup(RERR_FILEIO);
}
if ((nread=read(map->fd,map->p,len)) != len) {
if (nread < 0) nread = 0;
/* the best we can do is zero the buffer - the file
has changed mid transfer! */
memset(map->p+nread, 0, len - nread);
/* in most cases the region will already be available */
if (offset >= map->p_offset && offset+len <= map->p_offset+map->p_len)
return map->p + (offset - map->p_offset);
/* nope, we are going to have to do a read. Work out our desired window */
align_fudge = (int32)ALIGNED_OVERSHOOT(offset);
window_start = offset - align_fudge;
window_size = map->def_window_size;
if (window_start + window_size > map->file_size)
window_size = (int32)(map->file_size - window_start);
if (window_size < len + align_fudge)
window_size = ALIGNED_LENGTH(len + align_fudge);
/* make sure we have allocated enough memory for the window */
if (window_size > map->p_size) {
map->p = realloc_array(map->p, char, window_size);
map->p_size = window_size;
}
return map->p;
/* Now try to avoid re-reading any bytes by reusing any bytes from the previous buffer. */
if (window_start >= map->p_offset && window_start < map->p_offset + map->p_len
&& window_start + window_size >= map->p_offset + map->p_len) {
read_start = map->p_offset + map->p_len;
read_offset = (int32)(read_start - window_start);
read_size = window_size - read_offset;
memmove(map->p, map->p + (map->p_len - read_offset), read_offset);
} else {
read_start = window_start;
read_size = window_size;
read_offset = 0;
}
if (read_size <= 0) {
rprintf(FERROR, "invalid read_size of %ld in map_ptr\n",
(long)read_size);
exit_cleanup(RERR_FILEIO);
}
if (map->p_fd_offset != read_start) {
OFF_T ret = do_lseek(map->fd, read_start, SEEK_SET);
if (ret != read_start) {
rsyserr(FERROR, errno, "lseek returned %s, not %s",
big_num(ret), big_num(read_start));
exit_cleanup(RERR_FILEIO);
}
map->p_fd_offset = read_start;
}
map->p_offset = window_start;
map->p_len = window_size;
while (read_size > 0) {
int32 nread = read(map->fd, map->p + read_offset, read_size);
if (nread <= 0) {
if (!map->status)
map->status = nread ? errno : ENODATA;
/* The best we can do is zero the buffer -- the file
* has changed mid transfer! */
memset(map->p + read_offset, 0, read_size);
break;
}
map->p_fd_offset += nread;
read_offset += nread;
read_size -= nread;
}
return map->p + align_fudge;
}
void unmap_file(struct map_struct *map)
int unmap_file(struct map_struct *map)
{
#ifdef USE_MMAP
if (map->map) {
munmap(map->map,map->p_len);
map->map = NULL;
}
#endif
int ret;
if (map->p) {
free(map->p);
map->p = NULL;
}
memset(map, 0, sizeof(*map));
ret = map->status;
#if 0 /* I don't think we really need this. */
force_memzero(map, sizeof map[0]);
#endif
free(map);
}
return ret;
}

4037
flist.c
View File

File diff suppressed because it is too large Load Diff

View File

File diff suppressed because it is too large Load Diff

22
getfsdev.c Normal file
View File

@@ -0,0 +1,22 @@
#include "rsync.h"
int main(int argc, char *argv[])
{
STRUCT_STAT st;
int ret;
while (--argc > 0) {
#ifdef USE_STAT64_FUNCS
ret = stat64(*++argv, &st);
#else
ret = stat(*++argv, &st);
#endif
if (ret < 0) {
fprintf(stderr, "Unable to stat `%s'\n", *argv);
exit(1);
}
printf("%ld/%ld\n", (long)major(st.st_dev), (long)minor(st.st_dev));
}
return 0;
}

61
getgroups.c Normal file
View File

@@ -0,0 +1,61 @@
/*
* Print out the gids of all groups for the current user. This is like
* `id -G` on Linux, but it's too hard to find a portable equivalent.
*
* Copyright (C) 2002 Martin Pool
* Copyright (C) 2003-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
int main(UNUSED(int argc), UNUSED(char *argv[]))
{
int n, i;
gid_t *list;
gid_t gid = MY_GID();
int gid_in_list = 0;
#ifdef HAVE_GETGROUPS
if ((n = getgroups(0, NULL)) < 0) {
perror("getgroups");
return 1;
}
#else
n = 0;
#endif
list = (gid_t*)malloc(sizeof (gid_t) * (n + 1));
if (!list) {
fprintf(stderr, "out of memory!\n");
exit(1);
}
#ifdef HAVE_GETGROUPS
if (n > 0)
n = getgroups(n, list);
#endif
for (i = 0; i < n; i++) {
printf("%lu ", (unsigned long)list[i]);
if (list[i] == gid)
gid_in_list = 1;
}
/* The default gid might not be in the list on some systems. */
if (!gid_in_list)
printf("%lu", (unsigned long)gid);
printf("\n");
return 0;
}

498
hashtable.c Normal file
View File

@@ -0,0 +1,498 @@
/*
* Routines to provide a memory-efficient hashtable.
*
* Copyright (C) 2007-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#define HASH_LOAD_LIMIT(size) ((size)*3/4)
struct hashtable *hashtable_create(int size, int key64)
{
int req = size;
struct hashtable *tbl;
int node_size = key64 ? sizeof (struct ht_int64_node)
: sizeof (struct ht_int32_node);
/* Pick a power of 2 that can hold the requested size. */
if (size & (size-1) || size < 16) {
size = 16;
while (size < req)
size *= 2;
}
tbl = new(struct hashtable);
tbl->nodes = new_array0(char, size * node_size);
tbl->size = size;
tbl->entries = 0;
tbl->node_size = node_size;
tbl->key64 = key64 ? 1 : 0;
if (DEBUG_GTE(HASH, 1)) {
char buf[32];
if (req != size)
snprintf(buf, sizeof buf, "req: %d, ", req);
else
*buf = '\0';
rprintf(FINFO, "[%s] created hashtable %lx (%ssize: %d, keys: %d-bit)\n",
who_am_i(), (long)tbl, buf, size, key64 ? 64 : 32);
}
return tbl;
}
void hashtable_destroy(struct hashtable *tbl)
{
if (DEBUG_GTE(HASH, 1)) {
rprintf(FINFO, "[%s] destroyed hashtable %lx (size: %d, keys: %d-bit)\n",
who_am_i(), (long)tbl, tbl->size, tbl->key64 ? 64 : 32);
}
free(tbl->nodes);
free(tbl);
}
/* Returns the node that holds the indicated key if it exists. When it does not
* exist, it returns either NULL (when data_when_new is NULL), or it returns a
* new node with its node->data set to the indicated value.
*
* If your code doesn't know the data value for a new node in advance (usually
* because it doesn't know if a node is new or not) you should pass in a unique
* (non-0) value that you can use to check if the returned node is new. You can
* then overwrite the data with any value you want (even 0) since it only needs
* to be different than whatever data_when_new value you use later on.
*
* This return is a void* just because it might be pointing at a ht_int32_node
* or a ht_int64_node, and that makes the caller's assignment a little easier. */
void *hashtable_find(struct hashtable *tbl, int64 key, void *data_when_new)
{
int key64 = tbl->key64;
struct ht_int32_node *node;
uint32 ndx;
if (key64 ? key == 0 : (int32)key == 0) {
rprintf(FERROR, "Internal hashtable error: illegal key supplied!\n");
exit_cleanup(RERR_MESSAGEIO);
}
if (data_when_new && tbl->entries > HASH_LOAD_LIMIT(tbl->size)) {
void *old_nodes = tbl->nodes;
int size = tbl->size * 2;
int i;
tbl->nodes = new_array0(char, size * tbl->node_size);
tbl->size = size;
tbl->entries = 0;
if (DEBUG_GTE(HASH, 1)) {
rprintf(FINFO, "[%s] growing hashtable %lx (size: %d, keys: %d-bit)\n",
who_am_i(), (long)tbl, size, key64 ? 64 : 32);
}
for (i = size / 2; i-- > 0; ) {
struct ht_int32_node *move_node = HT_NODE(tbl, old_nodes, i);
int64 move_key = HT_KEY(move_node, key64);
if (move_key == 0)
continue;
if (move_node->data)
hashtable_find(tbl, move_key, move_node->data);
else {
node = hashtable_find(tbl, move_key, "");
node->data = 0;
}
}
free(old_nodes);
}
if (!key64) {
/* Based on Jenkins One-at-a-time hash. */
uchar buf[4], *keyp = buf;
int i;
SIVALu(buf, 0, key);
for (ndx = 0, i = 0; i < 4; i++) {
ndx += keyp[i];
ndx += (ndx << 10);
ndx ^= (ndx >> 6);
}
ndx += (ndx << 3);
ndx ^= (ndx >> 11);
ndx += (ndx << 15);
} else {
/* Based on Jenkins hashword() from lookup3.c. */
uint32 a, b, c;
/* Set up the internal state */
a = b = c = 0xdeadbeef + (8 << 2);
#define rot(x,k) (((x)<<(k)) ^ ((x)>>(32-(k))))
#if SIZEOF_INT64 >= 8
b += (uint32)(key >> 32);
#endif
a += (uint32)key;
c ^= b; c -= rot(b, 14);
a ^= c; a -= rot(c, 11);
b ^= a; b -= rot(a, 25);
c ^= b; c -= rot(b, 16);
a ^= c; a -= rot(c, 4);
b ^= a; b -= rot(a, 14);
c ^= b; c -= rot(b, 24);
#undef rot
ndx = c;
}
/* If it already exists, return the node. If we're not
* allocating, return NULL if the key is not found. */
while (1) {
int64 nkey;
ndx &= tbl->size - 1;
node = HT_NODE(tbl, tbl->nodes, ndx);
nkey = HT_KEY(node, key64);
if (nkey == key)
return node;
if (nkey == 0) {
if (!data_when_new)
return NULL;
break;
}
ndx++;
}
/* Take over this empty spot and then return the node. */
if (key64)
((struct ht_int64_node*)node)->key = key;
else
node->key = (int32)key;
node->data = data_when_new;
tbl->entries++;
return node;
}
#ifndef WORDS_BIGENDIAN
# define HASH_LITTLE_ENDIAN 1
# define HASH_BIG_ENDIAN 0
#else
# define HASH_LITTLE_ENDIAN 0
# define HASH_BIG_ENDIAN 1
#endif
/*
-------------------------------------------------------------------------------
lookup3.c, by Bob Jenkins, May 2006, Public Domain.
These are functions for producing 32-bit hashes for hash table lookup.
hash_word(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
are externally useful functions. Routines to test the hash are included
if SELF_TEST is defined. You can use this free for any purpose. It's in
the public domain. It has no warranty.
You probably want to use hashlittle(). hashlittle() and hashbig()
hash byte arrays. hashlittle() is is faster than hashbig() on
little-endian machines. Intel and AMD are little-endian machines.
On second thought, you probably want hashlittle2(), which is identical to
hashlittle() except it returns two 32-bit hashes for the price of one.
You could implement hashbig2() if you wanted but I haven't bothered here.
If you want to find a hash of, say, exactly 7 integers, do
a = i1; b = i2; c = i3;
mix(a,b,c);
a += i4; b += i5; c += i6;
mix(a,b,c);
a += i7;
final(a,b,c);
then use c as the hash value. If you have a variable length array of
4-byte integers to hash, use hash_word(). If you have a byte array (like
a character string), use hashlittle(). If you have several byte arrays, or
a mix of things, see the comments above hashlittle().
Why is this so big? I read 12 bytes at a time into 3 4-byte integers,
then mix those integers. This is fast (you can do a lot more thorough
mixing with 12*3 instructions on 3 integers than you can with 3 instructions
on 1 byte), but shoehorning those bytes into integers efficiently is messy.
*/
#define hashsize(n) ((uint32_t)1<<(n))
#define hashmask(n) (hashsize(n)-1)
#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
/*
-------------------------------------------------------------------------------
mix -- mix 3 32-bit values reversibly.
This is reversible, so any information in (a,b,c) before mix() is
still in (a,b,c) after mix().
If four pairs of (a,b,c) inputs are run through mix(), or through
mix() in reverse, there are at least 32 bits of the output that
are sometimes the same for one pair and different for another pair.
This was tested for:
* pairs that differed by one bit, by two bits, in any combination
of top bits of (a,b,c), or in any combination of bottom bits of
(a,b,c).
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
is commonly produced by subtraction) look like a single 1-bit
difference.
* the base values were pseudorandom, all zero but one bit set, or
all zero plus a counter that starts at zero.
Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
satisfy this are
4 6 8 16 19 4
9 15 3 18 27 15
14 9 3 7 17 3
Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
for "differ" defined as + with a one-bit base and a two-bit delta. I
used http://burtleburtle.net/bob/hash/avalanche.html to choose
the operations, constants, and arrangements of the variables.
This does not achieve avalanche. There are input bits of (a,b,c)
that fail to affect some output bits of (a,b,c), especially of a. The
most thoroughly mixed value is c, but it doesn't really even achieve
avalanche in c.
This allows some parallelism. Read-after-writes are good at doubling
the number of bits affected, so the goal of mixing pulls in the opposite
direction as the goal of parallelism. I did what I could. Rotates
seem to cost as much as shifts on every machine I could lay my hands
on, and rotates are much kinder to the top and bottom bits, so I used
rotates.
-------------------------------------------------------------------------------
*/
#define mix(a,b,c) \
{ \
a -= c; a ^= rot(c, 4); c += b; \
b -= a; b ^= rot(a, 6); a += c; \
c -= b; c ^= rot(b, 8); b += a; \
a -= c; a ^= rot(c,16); c += b; \
b -= a; b ^= rot(a,19); a += c; \
c -= b; c ^= rot(b, 4); b += a; \
}
/*
-------------------------------------------------------------------------------
final -- final mixing of 3 32-bit values (a,b,c) into c
Pairs of (a,b,c) values differing in only a few bits will usually
produce values of c that look totally different. This was tested for
* pairs that differed by one bit, by two bits, in any combination
of top bits of (a,b,c), or in any combination of bottom bits of
(a,b,c).
* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed
the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
is commonly produced by subtraction) look like a single 1-bit
difference.
* the base values were pseudorandom, all zero but one bit set, or
all zero plus a counter that starts at zero.
These constants passed:
14 11 25 16 4 14 24
12 14 25 16 4 14 24
and these came close:
4 8 15 26 3 22 24
10 8 15 26 3 22 24
11 8 15 26 3 22 24
-------------------------------------------------------------------------------
*/
#define final(a,b,c) \
{ \
c ^= b; c -= rot(b,14); \
a ^= c; a -= rot(c,11); \
b ^= a; b -= rot(a,25); \
c ^= b; c -= rot(b,16); \
a ^= c; a -= rot(c,4); \
b ^= a; b -= rot(a,14); \
c ^= b; c -= rot(b,24); \
}
/*
-------------------------------------------------------------------------------
hashlittle() -- hash a variable-length key into a 32-bit value
k : the key (the unaligned variable-length array of bytes)
length : the length of the key, counting by bytes
val2 : IN: can be any 4-byte value OUT: second 32 bit hash.
Returns a 32-bit value. Every bit of the key affects every bit of
the return value. Two keys differing by one or two bits will have
totally different hash values. Note that the return value is better
mixed than val2, so use that first.
The best hash table sizes are powers of 2. There is no need to do
mod a prime (mod is sooo slow!). If you need less than 32 bits,
use a bitmask. For example, if you need only 10 bits, do
h = (h & hashmask(10));
In which case, the hash table should have hashsize(10) elements.
If you are hashing n strings (uint8_t **)k, do it like this:
for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
By Bob Jenkins, 2006. bob_jenkins@burtleburtle.net. You may use this
code any way you wish, private, educational, or commercial. It's free.
Use for hash table lookup, or anything where one collision in 2^^32 is
acceptable. Do NOT use for cryptographic purposes.
-------------------------------------------------------------------------------
*/
uint32_t hashlittle(const void *key, size_t length)
{
uint32_t a,b,c; /* internal state */
union { const void *ptr; size_t i; } u; /* needed for Mac Powerbook G4 */
/* Set up the internal state */
a = b = c = 0xdeadbeef + ((uint32_t)length);
u.ptr = key;
if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */
const uint8_t *k8;
/*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
b += k[1];
c += k[2];
mix(a,b,c);
length -= 12;
k += 3;
}
/*----------------------------- handle the last (probably partial) block */
k8 = (const uint8_t *)k;
switch(length)
{
case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
case 10: c+=((uint32_t)k8[9])<<8; /* fall through */
case 9 : c+=k8[8]; /* fall through */
case 8 : b+=k[1]; a+=k[0]; break;
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */
case 5 : b+=k8[4]; /* fall through */
case 4 : a+=k[0]; break;
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */
case 1 : a+=k8[0]; break;
case 0 : return c;
}
} else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */
const uint8_t *k8;
/*--------------- all but last block: aligned reads and different mixing */
while (length > 12)
{
a += k[0] + (((uint32_t)k[1])<<16);
b += k[2] + (((uint32_t)k[3])<<16);
c += k[4] + (((uint32_t)k[5])<<16);
mix(a,b,c);
length -= 12;
k += 6;
}
/*----------------------------- handle the last (probably partial) block */
k8 = (const uint8_t *)k;
switch(length)
{
case 12: c+=k[4]+(((uint32_t)k[5])<<16);
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
case 11: c+=((uint32_t)k8[10])<<16; /* fall through */
case 10: c+=k[4];
b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
case 9 : c+=k8[8]; /* fall through */
case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
a+=k[0]+(((uint32_t)k[1])<<16);
break;
case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */
case 6 : b+=k[2];
a+=k[0]+(((uint32_t)k[1])<<16);
break;
case 5 : b+=k8[4]; /* fall through */
case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
break;
case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */
case 2 : a+=k[0];
break;
case 1 : a+=k8[0];
break;
case 0 : return c; /* zero length requires no mixing */
}
} else { /* need to read the key one byte at a time */
const uint8_t *k = (const uint8_t *)key;
/*--------------- all but the last block: affect some 32 bits of (a,b,c) */
while (length > 12)
{
a += k[0];
a += ((uint32_t)k[1])<<8;
a += ((uint32_t)k[2])<<16;
a += ((uint32_t)k[3])<<24;
b += k[4];
b += ((uint32_t)k[5])<<8;
b += ((uint32_t)k[6])<<16;
b += ((uint32_t)k[7])<<24;
c += k[8];
c += ((uint32_t)k[9])<<8;
c += ((uint32_t)k[10])<<16;
c += ((uint32_t)k[11])<<24;
mix(a,b,c);
length -= 12;
k += 12;
}
/*-------------------------------- last block: affect all 32 bits of (c) */
switch(length) /* all the case statements fall through */
{
case 12: c+=((uint32_t)k[11])<<24;
/* FALLTHROUGH */
case 11: c+=((uint32_t)k[10])<<16;
/* FALLTHROUGH */
case 10: c+=((uint32_t)k[9])<<8;
/* FALLTHROUGH */
case 9 : c+=k[8];
/* FALLTHROUGH */
case 8 : b+=((uint32_t)k[7])<<24;
/* FALLTHROUGH */
case 7 : b+=((uint32_t)k[6])<<16;
/* FALLTHROUGH */
case 6 : b+=((uint32_t)k[5])<<8;
/* FALLTHROUGH */
case 5 : b+=k[4];
/* FALLTHROUGH */
case 4 : a+=((uint32_t)k[3])<<24;
/* FALLTHROUGH */
case 3 : a+=((uint32_t)k[2])<<16;
/* FALLTHROUGH */
case 2 : a+=((uint32_t)k[1])<<8;
/* FALLTHROUGH */
case 1 : a+=k[0];
break;
case 0 : return c;
}
}
final(a,b,c);
return c;
}

40
help-from-md.awk Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/awk -f
# The caller must pass args: -v hfile=help-NAME.h NAME.NUM.md
BEGIN {
heading = "/* DO NOT EDIT THIS FILE! It is auto-generated from the option list in " ARGV[1] "! */"
findcomment = hfile
sub("\\.", "\\.", findcomment)
findcomment = "\\[comment\\].*" findcomment
backtick_cnt = 0
prints = ""
}
/^```/ {
backtick_cnt++
next
}
foundcomment {
if (backtick_cnt > 1) exit
if (backtick_cnt == 1) {
gsub(/"/, "\\\"")
prints = prints "\n rprintf(F,\"" $0 "\\n\");"
}
next
}
$0 ~ findcomment {
foundcomment = 1
backtick_cnt = 0
}
END {
if (foundcomment && backtick_cnt > 1)
print heading "\n" prints > hfile
else {
print "Failed to find " hfile " section in " ARGV[1]
exit 1
}
}

686
hlink.c
View File

@@ -1,156 +1,566 @@
/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Routines to support hard-linking.
*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2002 Martin Pool <mbp@samba.org>
* Copyright (C) 2004-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "inums.h"
#include "ifuncs.h"
extern int dry_run;
extern int verbose;
extern int list_only;
extern int am_sender;
extern int inc_recurse;
extern int do_xfers;
extern int alt_dest_type;
extern int preserve_acls;
extern int preserve_xattrs;
extern int protocol_version;
extern int remove_source_files;
extern int stdout_format_has_i;
extern int maybe_ATTRS_REPORT;
extern int unsort_ndx;
extern char *basis_dir[MAX_BASIS_DIRS+1];
extern struct file_list *cur_flist;
#if SUPPORT_HARD_LINKS
static int hlink_compare(struct file_struct *f1,struct file_struct *f2)
#ifdef SUPPORT_HARD_LINKS
/* Starting with protocol 30, we use a simple hashtable on the sending side
* for hashing the st_dev and st_ino info. The receiving side gets told
* (via flags and a "group index") which items are hard-linked together, so
* we can avoid the pool of dev+inode data. For incremental recursion mode,
* the receiver will use a ndx hash to remember old pathnames. */
static void *data_when_new = "";
static struct hashtable *dev_tbl;
static struct hashtable *prior_hlinks;
static struct file_list *hlink_flist;
void init_hard_links(void)
{
if (!S_ISREG(f1->mode) && !S_ISREG(f2->mode)) return 0;
if (!S_ISREG(f1->mode)) return -1;
if (!S_ISREG(f2->mode)) return 1;
if (f1->dev != f2->dev)
return (int)(f1->dev>f2->dev?1:-1);
if (f1->inode != f2->inode)
return (int)(f1->inode>f2->inode?1:-1);
return file_compare(&f1,&f2);
if (am_sender || protocol_version < 30)
dev_tbl = hashtable_create(16, HT_KEY64);
else if (inc_recurse)
prior_hlinks = hashtable_create(1024, HT_KEY32);
}
static struct file_struct *hlink_list;
static int hlink_count;
#endif
void init_hard_links(struct file_list *flist)
struct ht_int64_node *idev_find(int64 dev, int64 ino)
{
#if SUPPORT_HARD_LINKS
int i;
if (flist->count < 2) return;
static struct ht_int64_node *dev_node = NULL;
if (hlink_list) free(hlink_list);
if (!(hlink_list =
(struct file_struct *)malloc(sizeof(hlink_list[0])*flist->count)))
out_of_memory("init_hard_links");
for (i = 0; i < flist->count; i++)
memcpy(&hlink_list[i], flist->files[i], sizeof(hlink_list[0]));
qsort(hlink_list,flist->count,
sizeof(hlink_list[0]),
(int (*)())hlink_compare);
hlink_count=flist->count;
#endif
}
/* check if a file should be skipped because it is the same as an
earlier hard link */
int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
int low=0,high=hlink_count-1;
int ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
while (low != high) {
int mid = (low+high)/2;
ret = hlink_compare(&hlink_list[mid],file);
if (ret == 0) {
low = mid;
break;
}
if (ret > 0)
high=mid;
else
low=mid+1;
}
if (hlink_compare(&hlink_list[low],file) != 0) return 0;
if (low > 0 &&
S_ISREG(hlink_list[low-1].mode) &&
file->dev == hlink_list[low-1].dev &&
file->inode == hlink_list[low-1].inode)
return 1;
#endif
return 0;
}
#if SUPPORT_HARD_LINKS
static void hard_link_one(int i)
{
STRUCT_STAT st1,st2;
if (link_stat(f_name(&hlink_list[i-1]),&st1) != 0) return;
if (link_stat(f_name(&hlink_list[i]),&st2) != 0) {
if (do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) {
if (verbose > 0)
rprintf(FINFO,"link %s => %s : %s\n",
f_name(&hlink_list[i]),
f_name(&hlink_list[i-1]),strerror(errno));
return;
}
} else {
if (st2.st_dev == st1.st_dev && st2.st_ino == st1.st_ino) return;
if (do_unlink(f_name(&hlink_list[i])) != 0 ||
do_link(f_name(&hlink_list[i-1]),f_name(&hlink_list[i])) != 0) {
if (verbose > 0)
rprintf(FINFO,"link %s => %s : %s\n",
f_name(&hlink_list[i]),
f_name(&hlink_list[i-1]),strerror(errno));
return;
/* Note that some OSes have a dev == 0, so increment to avoid storing a 0. */
if (!dev_node || dev_node->key != dev+1) {
/* We keep a separate hash table of inodes for every device. */
dev_node = hashtable_find(dev_tbl, dev+1, data_when_new);
if (dev_node->data == data_when_new) {
dev_node->data = hashtable_create(512, HT_KEY64);
if (DEBUG_GTE(HLINK, 3)) {
rprintf(FINFO, "[%s] created hashtable for dev %s\n",
who_am_i(), big_num(dev));
}
}
}
if (verbose > 0)
rprintf(FINFO,"%s => %s\n",
f_name(&hlink_list[i]),f_name(&hlink_list[i-1]));
}
#endif
/* create any hard links in the flist */
void do_hard_links(struct file_list *flist)
return hashtable_find(dev_node->data, ino, (void*)-1L);
}
void idev_destroy(void)
{
#if SUPPORT_HARD_LINKS
int i;
if (!hlink_list) return;
for (i=1;i<hlink_count;i++) {
if (S_ISREG(hlink_list[i].mode) &&
S_ISREG(hlink_list[i-1].mode) &&
hlink_list[i].basename && hlink_list[i-1].basename &&
hlink_list[i].dev == hlink_list[i-1].dev &&
hlink_list[i].inode == hlink_list[i-1].inode) {
hard_link_one(i);
}
for (i = 0; i < dev_tbl->size; i++) {
struct ht_int32_node *node = HT_NODE(dev_tbl, dev_tbl->nodes, i);
if (node->data)
hashtable_destroy(node->data);
}
#endif
hashtable_destroy(dev_tbl);
}
static int hlink_compare_gnum(int *int1, int *int2)
{
struct file_struct *f1 = hlink_flist->sorted[*int1];
struct file_struct *f2 = hlink_flist->sorted[*int2];
int32 gnum1 = F_HL_GNUM(f1);
int32 gnum2 = F_HL_GNUM(f2);
if (gnum1 != gnum2)
return gnum1 > gnum2 ? 1 : -1;
return *int1 > *int2 ? 1 : -1;
}
static void match_gnums(int32 *ndx_list, int ndx_count)
{
int32 from, prev;
struct file_struct *file, *file_next;
struct ht_int32_node *node = NULL;
int32 gnum, gnum_next;
qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)()) hlink_compare_gnum);
for (from = 0; from < ndx_count; from++) {
file = hlink_flist->sorted[ndx_list[from]];
gnum = F_HL_GNUM(file);
if (inc_recurse) {
node = hashtable_find(prior_hlinks, gnum, data_when_new);
if (node->data == data_when_new) {
node->data = new_array0(char, 5);
assert(gnum >= hlink_flist->ndx_start);
file->flags |= FLAG_HLINK_FIRST;
prev = -1;
} else if (CVAL(node->data, 0) == 0) {
struct file_list *flist;
prev = IVAL(node->data, 1);
flist = flist_for_ndx(prev, NULL);
if (flist)
flist->files[prev - flist->ndx_start]->flags &= ~FLAG_HLINK_LAST;
else {
/* We skipped all prior files in this
* group, so mark this as a "first". */
file->flags |= FLAG_HLINK_FIRST;
prev = -1;
}
} else
prev = -1;
} else {
file->flags |= FLAG_HLINK_FIRST;
prev = -1;
}
for ( ; from < ndx_count-1; file = file_next, gnum = gnum_next, from++) { /*SHARED ITERATOR*/
file_next = hlink_flist->sorted[ndx_list[from+1]];
gnum_next = F_HL_GNUM(file_next);
if (gnum != gnum_next)
break;
F_HL_PREV(file) = prev;
/* The linked list uses over-the-wire ndx values. */
if (unsort_ndx)
prev = F_NDX(file);
else
prev = ndx_list[from] + hlink_flist->ndx_start;
}
if (prev < 0 && !inc_recurse) {
/* Disable hard-link bit and set DONE so that
* HLINK_BUMP()-dependent values are unaffected. */
file->flags &= ~(FLAG_HLINKED | FLAG_HLINK_FIRST);
file->flags |= FLAG_HLINK_DONE;
continue;
}
file->flags |= FLAG_HLINK_LAST;
F_HL_PREV(file) = prev;
if (inc_recurse && CVAL(node->data, 0) == 0) {
if (unsort_ndx)
prev = F_NDX(file);
else
prev = ndx_list[from] + hlink_flist->ndx_start;
SIVAL(node->data, 1, prev);
}
}
}
/* Analyze the hard-links in the file-list by creating a list of all the
* items that have hlink data, sorting them, and matching up identical
* values into clusters. These will be a single linked list from last
* to first when we're done. */
void match_hard_links(struct file_list *flist)
{
if (!list_only && flist->used) {
int i, ndx_count = 0;
int32 *ndx_list;
ndx_list = new_array(int32, flist->used);
for (i = 0; i < flist->used; i++) {
if (F_IS_HLINKED(flist->sorted[i]))
ndx_list[ndx_count++] = i;
}
hlink_flist = flist;
if (ndx_count)
match_gnums(ndx_list, ndx_count);
free(ndx_list);
}
if (protocol_version < 30)
idev_destroy();
}
static int maybe_hard_link(struct file_struct *file, int ndx,
char *fname, int statret, stat_x *sxp,
const char *oldname, STRUCT_STAT *old_stp,
const char *realname, int itemizing, enum logcode code)
{
if (statret == 0) {
if (sxp->st.st_dev == old_stp->st_dev
&& sxp->st.st_ino == old_stp->st_ino) {
if (itemizing) {
itemize(fname, file, ndx, statret, sxp,
ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS,
0, "");
}
if (INFO_GTE(NAME, 2) && maybe_ATTRS_REPORT)
rprintf(FCLIENT, "%s is uptodate\n", fname);
file->flags |= FLAG_HLINK_DONE;
return 0;
}
}
if (atomic_create(file, fname, NULL, oldname, MAKEDEV(0, 0), sxp, statret == 0 ? DEL_FOR_FILE : 0)) {
if (itemizing) {
itemize(fname, file, ndx, statret, sxp,
ITEM_LOCAL_CHANGE | ITEM_XNAME_FOLLOWS, 0,
realname);
}
if (code != FNONE && INFO_GTE(NAME, 1))
rprintf(code, "%s => %s\n", fname, realname);
return 0;
}
return -1;
}
/* Figure out if a prior entry is still there or if we just have a
* cached name for it. */
static char *check_prior(struct file_struct *file, int gnum,
int *prev_ndx_p, struct file_list **flist_p)
{
struct file_struct *fp;
struct ht_int32_node *node;
int prev_ndx = F_HL_PREV(file);
while (1) {
struct file_list *flist;
if (prev_ndx < 0
|| (flist = flist_for_ndx(prev_ndx, NULL)) == NULL)
break;
fp = flist->files[prev_ndx - flist->ndx_start];
if (!(fp->flags & FLAG_SKIP_HLINK)) {
*prev_ndx_p = prev_ndx;
*flist_p = flist;
return NULL;
}
F_HL_PREV(file) = prev_ndx = F_HL_PREV(fp);
}
if (inc_recurse
&& (node = hashtable_find(prior_hlinks, gnum, NULL)) != NULL) {
assert(node->data != NULL);
if (CVAL(node->data, 0) != 0) {
*prev_ndx_p = -1;
*flist_p = NULL;
return node->data;
}
/* The prior file must have been skipped. */
F_HL_PREV(file) = -1;
}
*prev_ndx_p = -1;
*flist_p = NULL;
return NULL;
}
/* Only called if FLAG_HLINKED is set and FLAG_HLINK_FIRST is not. Returns:
* 0 = process the file, 1 = skip the file, -1 = error occurred. */
int hard_link_check(struct file_struct *file, int ndx, char *fname,
int statret, stat_x *sxp, int itemizing,
enum logcode code)
{
STRUCT_STAT prev_st;
char namebuf[MAXPATHLEN], altbuf[MAXPATHLEN];
char *realname, *prev_name;
struct file_list *flist;
int gnum = inc_recurse ? F_HL_GNUM(file) : -1;
int prev_ndx;
prev_name = realname = check_prior(file, gnum, &prev_ndx, &flist);
if (!prev_name) {
struct file_struct *prev_file;
if (!flist) {
/* The previous file was skipped, so this one is
* treated as if it were the first in its group. */
if (DEBUG_GTE(HLINK, 2)) {
rprintf(FINFO, "hlink for %d (%s,%d): virtual first\n",
ndx, f_name(file, NULL), gnum);
}
return 0;
}
prev_file = flist->files[prev_ndx - flist->ndx_start];
/* Is the previous link not complete yet? */
if (!(prev_file->flags & FLAG_HLINK_DONE)) {
/* Is the previous link being transferred? */
if (prev_file->flags & FLAG_FILE_SENT) {
/* Add ourselves to the list of files that will
* be updated when the transfer completes, and
* mark ourself as waiting for the transfer. */
F_HL_PREV(file) = F_HL_PREV(prev_file);
F_HL_PREV(prev_file) = ndx;
file->flags |= FLAG_FILE_SENT;
cur_flist->in_progress++;
if (DEBUG_GTE(HLINK, 2)) {
rprintf(FINFO, "hlink for %d (%s,%d): waiting for %d\n",
ndx, f_name(file, NULL), gnum, F_HL_PREV(file));
}
return 1;
}
if (DEBUG_GTE(HLINK, 2)) {
rprintf(FINFO, "hlink for %d (%s,%d): looking for a leader\n",
ndx, f_name(file, NULL), gnum);
}
return 0;
}
/* There is a finished file to link with! */
if (!(prev_file->flags & FLAG_HLINK_FIRST)) {
/* The previous previous is FIRST when prev is not. */
prev_name = realname = check_prior(prev_file, gnum, &prev_ndx, &flist);
/* Update our previous pointer to point to the FIRST. */
F_HL_PREV(file) = prev_ndx;
}
if (!prev_name) {
int alt_dest;
assert(flist != NULL);
prev_file = flist->files[prev_ndx - flist->ndx_start];
/* F_HL_PREV() is alt_dest value when DONE && FIRST. */
alt_dest = F_HL_PREV(prev_file);
if (DEBUG_GTE(HLINK, 2)) {
rprintf(FINFO, "hlink for %d (%s,%d): found flist match (alt %d)\n",
ndx, f_name(file, NULL), gnum, alt_dest);
}
if (alt_dest >= 0 && dry_run) {
pathjoin(namebuf, MAXPATHLEN, basis_dir[alt_dest],
f_name(prev_file, NULL));
prev_name = namebuf;
realname = f_name(prev_file, altbuf);
} else {
prev_name = f_name(prev_file, namebuf);
realname = prev_name;
}
}
}
if (DEBUG_GTE(HLINK, 2)) {
rprintf(FINFO, "hlink for %d (%s,%d): leader is %d (%s)\n",
ndx, f_name(file, NULL), gnum, prev_ndx, prev_name);
}
if (link_stat(prev_name, &prev_st, 0) < 0) {
if (!dry_run || errno != ENOENT) {
rsyserr(FERROR_XFER, errno, "stat %s failed", full_fname(prev_name));
return -1;
}
/* A new hard-link will get a new dev & inode, so approximate
* those values in dry-run mode by zeroing them. */
memset(&prev_st, 0, sizeof prev_st);
}
if (statret < 0 && basis_dir[0] != NULL) {
/* If we match an alt-dest item, we don't output this as a change. */
char cmpbuf[MAXPATHLEN];
stat_x alt_sx;
int j = 0;
init_stat_x(&alt_sx);
do {
pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname);
if (link_stat(cmpbuf, &alt_sx.st, 0) < 0)
continue;
if (alt_dest_type == LINK_DEST) {
if (prev_st.st_dev != alt_sx.st.st_dev
|| prev_st.st_ino != alt_sx.st.st_ino)
continue;
statret = 1;
if (stdout_format_has_i == 0
|| (!INFO_GTE(NAME, 2) && stdout_format_has_i < 2)) {
itemizing = 0;
code = FNONE;
if (INFO_GTE(NAME, 2) && maybe_ATTRS_REPORT)
rprintf(FCLIENT, "%s is uptodate\n", fname);
}
break;
}
if (!quick_check_ok(FT_REG, cmpbuf, file, &alt_sx.st))
continue;
statret = 1;
if (unchanged_attrs(cmpbuf, file, &alt_sx))
break;
} while (basis_dir[++j] != NULL);
if (statret == 1) {
sxp->st = alt_sx.st;
#ifdef SUPPORT_ACLS
if (preserve_acls && !S_ISLNK(file->mode)) {
free_acl(sxp);
if (!ACL_READY(alt_sx))
get_acl(cmpbuf, sxp);
else {
sxp->acc_acl = alt_sx.acc_acl;
sxp->def_acl = alt_sx.def_acl;
alt_sx.acc_acl = alt_sx.def_acl = NULL;
}
}
#endif
#ifdef SUPPORT_XATTRS
if (preserve_xattrs) {
free_xattr(sxp);
if (!XATTR_READY(alt_sx))
get_xattr(cmpbuf, sxp);
else {
sxp->xattr = alt_sx.xattr;
alt_sx.xattr = NULL;
}
}
#endif
} else
free_stat_x(&alt_sx);
}
if (maybe_hard_link(file, ndx, fname, statret, sxp, prev_name, &prev_st,
realname, itemizing, code) < 0)
return -1;
if (remove_source_files == 1 && do_xfers)
send_msg_int(MSG_SUCCESS, ndx);
return 1;
}
int hard_link_one(struct file_struct *file, const char *fname,
const char *oldname, int terse)
{
if (do_link(oldname, fname) < 0) {
enum logcode code;
if (terse) {
if (!INFO_GTE(NAME, 1))
return 0;
code = FINFO;
} else
code = FERROR_XFER;
rsyserr(code, errno, "link %s => %s failed",
full_fname(fname), oldname);
return 0;
}
file->flags |= FLAG_HLINK_DONE;
return 1;
}
void finish_hard_link(struct file_struct *file, const char *fname, int fin_ndx,
STRUCT_STAT *stp, int itemizing, enum logcode code,
int alt_dest)
{
stat_x prev_sx;
STRUCT_STAT st;
char prev_name[MAXPATHLEN], alt_name[MAXPATHLEN];
const char *our_name;
struct file_list *flist;
int prev_statret, ndx, prev_ndx = F_HL_PREV(file);
if (stp == NULL && prev_ndx >= 0) {
if (link_stat(fname, &st, 0) < 0 && !dry_run) {
rsyserr(FERROR_XFER, errno, "stat %s failed",
full_fname(fname));
return;
}
stp = &st;
}
/* FIRST combined with DONE means we were the first to get done. */
file->flags |= FLAG_HLINK_FIRST | FLAG_HLINK_DONE;
F_HL_PREV(file) = alt_dest;
if (alt_dest >= 0 && dry_run) {
pathjoin(alt_name, MAXPATHLEN, basis_dir[alt_dest],
f_name(file, NULL));
our_name = alt_name;
} else
our_name = fname;
init_stat_x(&prev_sx);
while ((ndx = prev_ndx) >= 0) {
int val;
flist = flist_for_ndx(ndx, "finish_hard_link");
file = flist->files[ndx - flist->ndx_start];
file->flags = (file->flags & ~FLAG_HLINK_FIRST) | FLAG_HLINK_DONE;
prev_ndx = F_HL_PREV(file);
F_HL_PREV(file) = fin_ndx;
prev_statret = link_stat(f_name(file, prev_name), &prev_sx.st, 0);
val = maybe_hard_link(file, ndx, prev_name, prev_statret, &prev_sx,
our_name, stp, fname, itemizing, code);
flist->in_progress--;
free_stat_x(&prev_sx);
if (val < 0)
continue;
if (remove_source_files == 1 && do_xfers)
send_msg_int(MSG_SUCCESS, ndx);
}
if (inc_recurse) {
int gnum = F_HL_GNUM(file);
struct ht_int32_node *node = hashtable_find(prior_hlinks, gnum, NULL);
if (node == NULL) {
rprintf(FERROR, "Unable to find a hlink node for %d (%s)\n", gnum, f_name(file, prev_name));
exit_cleanup(RERR_MESSAGEIO);
}
if (node->data == NULL) {
rprintf(FERROR, "Hlink node data for %d is NULL (%s)\n", gnum, f_name(file, prev_name));
exit_cleanup(RERR_MESSAGEIO);
}
if (CVAL(node->data, 0) != 0) {
rprintf(FERROR, "Hlink node data for %d already has path=%s (%s)\n",
gnum, (char*)node->data, f_name(file, prev_name));
exit_cleanup(RERR_MESSAGEIO);
}
free(node->data);
node->data = strdup(our_name);
}
}
int skip_hard_link(struct file_struct *file, struct file_list **flist_p)
{
struct file_list *flist;
int prev_ndx;
file->flags |= FLAG_SKIP_HLINK;
if (!(file->flags & FLAG_HLINK_LAST))
return -1;
check_prior(file, F_HL_GNUM(file), &prev_ndx, &flist);
if (prev_ndx >= 0) {
file = flist->files[prev_ndx - flist->ndx_start];
if (file->flags & (FLAG_HLINK_DONE|FLAG_FILE_SENT))
return -1;
file->flags |= FLAG_HLINK_LAST;
*flist_p = flist;
}
return prev_ndx;
}
#endif

112
ifuncs.h Normal file
View File

@@ -0,0 +1,112 @@
/* Inline functions for rsync.
*
* Copyright (C) 2007-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
static inline void
alloc_xbuf(xbuf *xb, size_t sz)
{
xb->buf = new_array(char, sz);
xb->size = sz;
xb->len = xb->pos = 0;
}
static inline void
realloc_xbuf(xbuf *xb, size_t sz)
{
char *bf = realloc_array(xb->buf, char, sz);
xb->buf = bf;
xb->size = sz;
}
static inline void
free_xbuf(xbuf *xb)
{
if (xb->buf)
free(xb->buf);
memset(xb, 0, sizeof (xbuf));
}
static inline int
to_wire_mode(mode_t mode)
{
#ifdef SUPPORT_LINKS
#if _S_IFLNK != 0120000
if (S_ISLNK(mode))
return (mode & ~(_S_IFMT)) | 0120000;
#endif
#endif
return mode;
}
static inline mode_t
from_wire_mode(int mode)
{
#if _S_IFLNK != 0120000
if ((mode & (_S_IFMT)) == 0120000)
return (mode & ~(_S_IFMT)) | _S_IFLNK;
#endif
return mode;
}
static inline char *
d_name(struct dirent *di)
{
#ifdef HAVE_BROKEN_READDIR
return (di->d_name - 2);
#else
return di->d_name;
#endif
}
static inline void
init_stat_x(stat_x *sx_p)
{
sx_p->crtime = 0;
#ifdef SUPPORT_ACLS
sx_p->acc_acl = sx_p->def_acl = NULL;
#endif
#ifdef SUPPORT_XATTRS
sx_p->xattr = NULL;
#endif
}
static inline void
free_stat_x(stat_x *sx_p)
{
#ifdef SUPPORT_ACLS
{
extern int preserve_acls;
if (preserve_acls)
free_acl(sx_p);
}
#endif
#ifdef SUPPORT_XATTRS
{
extern int preserve_xattrs;
if (preserve_xattrs)
free_xattr(sx_p);
}
#endif
}
static inline char *my_strdup(const char *str, const char *file, int line)
{
int len = strlen(str)+1;
char *buf = my_alloc(NULL, len, 1, file, line);
memcpy(buf, str, len);
return buf;
}

View File

@@ -115,7 +115,7 @@ else
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
if [ -f $src ] || [ -d $src ]
then
true
else
@@ -208,7 +208,7 @@ else
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
dsttmp=$dstdir/_inst.$$_
# Move or copy the file name to the temp name

57
inums.h Normal file
View File

@@ -0,0 +1,57 @@
/* Inline functions for rsync.
*
* Copyright (C) 2008-2019 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
static inline char *
big_num(int64 num)
{
return do_big_num(num, 0, NULL);
}
static inline char *
comma_num(int64 num)
{
extern int human_readable;
return do_big_num(num, human_readable != 0, NULL);
}
static inline char *
human_num(int64 num)
{
extern int human_readable;
return do_big_num(num, human_readable, NULL);
}
static inline char *
big_dnum(double dnum, int decimal_digits)
{
return do_big_dnum(dnum, 0, decimal_digits);
}
static inline char *
comma_dnum(double dnum, int decimal_digits)
{
extern int human_readable;
return do_big_dnum(dnum, human_readable != 0, decimal_digits);
}
static inline char *
human_dnum(double dnum, int decimal_digits)
{
extern int human_readable;
return do_big_dnum(dnum, human_readable, decimal_digits);
}

2695
io.c
View File

File diff suppressed because it is too large Load Diff

52
io.h Normal file
View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2007-2019 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
extern int protocol_version;
static inline int32
read_varint30(int f)
{
if (protocol_version < 30)
return read_int(f);
return read_varint(f);
}
static inline int64
read_varlong30(int f, uchar min_bytes)
{
if (protocol_version < 30)
return read_longint(f);
return read_varlong(f, min_bytes);
}
static inline void
write_varint30(int f, int32 x)
{
if (protocol_version < 30)
write_int(f, x);
else
write_varint(f, x);
}
static inline void
write_varlong30(int f, int64 x, uchar min_bytes)
{
if (protocol_version < 30)
write_longint(f, x);
else
write_varlong(f, x, min_bytes);
}

71
itypes.h Normal file
View File

@@ -0,0 +1,71 @@
/* Inline functions for rsync.
*
* Copyright (C) 2007-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
static inline int
isDigit(const char *ptr)
{
return isdigit(*(unsigned char *)ptr);
}
static inline int
isHexDigit(const char *ptr)
{
return isxdigit(*(unsigned char *)ptr);
}
static inline int
isPrint(const char *ptr)
{
return isprint(*(unsigned char *)ptr);
}
static inline int
isSpace(const char *ptr)
{
return isspace(*(unsigned char *)ptr);
}
static inline int
isAlNum(const char *ptr)
{
return isalnum(*(unsigned char *)ptr);
}
static inline int
isLower(const char *ptr)
{
return islower(*(unsigned char *)ptr);
}
static inline int
isUpper(const char *ptr)
{
return isupper(*(unsigned char *)ptr);
}
static inline int
toLower(const char *ptr)
{
return tolower(*(unsigned char *)ptr);
}
static inline int
toUpper(const char *ptr)
{
return toupper(*(unsigned char *)ptr);
}

1
latest-year.h Normal file
View File

@@ -0,0 +1 @@
#define LATEST_YEAR "2022"

View File

@@ -1,49 +0,0 @@
.cvsignore
Makefile
a
b
config.cache
config.h
config.log
config.status
dist.tar.gz
dummy
rsync
rsync-0.1
rsync-0.1
rsync-0.1
rsync-0.1.tar.gz
rsync-0.2
rsync-0.2
rsync-0.2.tar.gz
rsync-0.3
rsync-0.3
rsync-0.3.tar.gz
rsync-0.4
rsync-0.4
rsync-0.4.tar.gz
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5
rsync-0.5.tar.gz
rsync-0.6
rsync-0.7
rsync-0.7
rsync-0.8
rsync-0.8
rsync-0.8
rsync-0.8
rsync-ERSION
rsync.aux
rsync.dvi
rsync.log
tech_report.aux
tech_report.dvi
tech_report.log
tech_report.ps
test

180
lib/addrinfo.h Normal file
View File

@@ -0,0 +1,180 @@
/*
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this paragraph
and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
/*-------------------------------------------------------------------------
*
* getaddrinfo.h
* Support getaddrinfo() on platforms that don't have it.
*
* Note: we use our own routines on platforms that don't HAVE_STRUCT_ADDRINFO,
* whether or not the library routine getaddrinfo() can be found. This
* policy is needed because on some platforms a manually installed libbind.a
* may provide getaddrinfo(), yet the system headers may not provide the
* struct definitions needed to call it. To avoid conflict with the libbind
* definition in such cases, we rename our routines to pg_xxx() via macros.
*
* This code will also work on platforms where struct addrinfo is defined
* in the system headers but no getaddrinfo() can be located.
*
* Copyright (c) 2003-2007, PostgreSQL Global Development Group
*
*-------------------------------------------------------------------------
*/
#ifndef ADDRINFO_H
#define ADDRINFO_H
/* Various macros that ought to be in <netdb.h>, but might not be */
#ifndef EAI_FAIL
#define EAI_BADFLAGS (-1)
#define EAI_NONAME (-2)
#define EAI_AGAIN (-3)
#define EAI_FAIL (-4)
#define EAI_FAMILY (-6)
#define EAI_SOCKTYPE (-7)
#define EAI_SERVICE (-8)
#define EAI_MEMORY (-10)
#define EAI_SYSTEM (-11)
#endif /* !EAI_FAIL */
#ifndef AI_PASSIVE
#define AI_PASSIVE 0x0001
#endif
#ifndef AI_NUMERICHOST
/*
* some platforms don't support AI_NUMERICHOST; define as zero if using
* the system version of getaddrinfo...
*/
#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
#define AI_NUMERICHOST 0
#else
#define AI_NUMERICHOST 0x0004
#endif
#endif
#ifndef AI_CANONNAME
#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
#define AI_CANONNAME 0
#else
#define AI_CANONNAME 0x0008
#endif
#endif
#ifndef AI_NUMERICSERV
#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
#define AI_NUMERICSERV 0
#else
#define AI_NUMERICSERV 0x0010
#endif
#endif
#ifndef NI_NUMERICHOST
#define NI_NUMERICHOST 1
#endif
#ifndef NI_NUMERICSERV
#define NI_NUMERICSERV 2
#endif
#ifndef NI_NOFQDN
#define NI_NOFQDN 4
#endif
#ifndef NI_NAMEREQD
#define NI_NAMEREQD 8
#endif
#ifndef NI_DGRAM
#define NI_DGRAM 16
#endif
#ifndef NI_MAXHOST
#define NI_MAXHOST 1025
#endif
#ifndef NI_MAXSERV
#define NI_MAXSERV 32
#endif
#ifndef HAVE_STRUCT_ADDRINFO
struct addrinfo
{
int ai_flags;
int ai_family;
int ai_socktype;
int ai_protocol;
size_t ai_addrlen;
struct sockaddr *ai_addr;
char *ai_canonname;
struct addrinfo *ai_next;
};
#endif /* !HAVE_STRUCT_ADDRINFO */
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
struct sockaddr_storage {
unsigned short ss_family;
unsigned long ss_align;
char ss_padding[128 - sizeof (unsigned long)];
};
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
#ifndef HAVE_GETADDRINFO
/* Rename private copies per comments above */
#ifdef getaddrinfo
#undef getaddrinfo
#endif
#define getaddrinfo pg_getaddrinfo
#ifdef freeaddrinfo
#undef freeaddrinfo
#endif
#define freeaddrinfo pg_freeaddrinfo
#ifdef gai_strerror
#undef gai_strerror
#endif
#define gai_strerror pg_gai_strerror
#ifdef getnameinfo
#undef getnameinfo
#endif
#define getnameinfo pg_getnameinfo
extern int getaddrinfo(const char *node, const char *service,
const struct addrinfo * hints, struct addrinfo ** res);
extern void freeaddrinfo(struct addrinfo * res);
extern const char *gai_strerror(int errcode);
extern int getnameinfo(const struct sockaddr * sa, socklen_t salen,
char *node, size_t nodelen,
char *service, size_t servicelen, int flags);
#endif /* !HAVE_GETADDRINFO */
#endif /* ADDRINFO_H */

View File

@@ -1,42 +1,50 @@
/*
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
compatibility functions - replacing functions for platforms that don't
have them.
* Reimplementations of standard functions for platforms that don't have them.
*
* Copyright (C) 1998 Andrew Tridgell
* Copyright (C) 2002 Martin Pool
* Copyright (C) 2004-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
*/
#include "rsync.h"
#include "itypes.h"
static char number_separator;
#ifndef HAVE_STRDUP
char *strdup(char *s)
char get_number_separator(void)
{
int l = strlen(s) + 1;
char *ret = (char *)malloc(l);
if (ret)
strcpy(ret,s);
return ret;
if (!number_separator) {
char buf[32];
snprintf(buf, sizeof buf, "%f", 3.14);
if (strchr(buf, '.') != NULL)
number_separator = ',';
else
number_separator = '.';
}
return number_separator;
}
char get_decimal_point(void)
{
return get_number_separator() == ',' ? '.' : ',';
}
#endif
#ifndef HAVE_GETCWD
char *getcwd(char *buf, int size)
char *getcwd(char *buf, int size)
{
return getwd(buf);
}
@@ -44,26 +52,46 @@ char *getcwd(char *buf, int size)
#ifndef HAVE_WAITPID
pid_t waitpid(pid_t pid, int *statptr, int options)
pid_t waitpid(pid_t pid, int *statptr, int options)
{
#ifdef HAVE_WAIT4
return wait4(pid, statptr, options, NULL);
#else
/* If wait4 is also not available, try wait3 for SVR3 variants */
/* Less ideal because can't actually request a specific pid */
/* At least the WNOHANG option is supported */
/* Code borrowed from apache fragment written by dwd@bell-labs.com */
int tmp_pid, dummystat;;
if (kill(pid, 0) == -1) {
errno = ECHILD;
return -1;
}
if (statptr == NULL)
statptr = &dummystat;
while (((tmp_pid = wait3(statptr, options, 0)) != pid) &&
(tmp_pid != -1) && (tmp_pid != 0) && (pid != -1))
;
return tmp_pid;
#endif
}
#endif
#ifndef HAVE_MEMMOVE
void *memmove(void *dest, const void *src, size_t n)
void *memmove(void *dest, const void *src, size_t n)
{
memcpy(dest, src, n);
bcopy((char *) src, (char *) dest, n);
return dest;
}
#endif
#ifndef HAVE_STRPBRK
/* Find the first ocurrence in S of any character in ACCEPT.
derived from glibc
*/
char *strpbrk(const char *s, const char *accept)
/**
* Find the first occurrence in @p s of any character in @p accept.
*
* Derived from glibc
**/
char *strpbrk(const char *s, const char *accept)
{
while (*s != '\0') {
const char *a = accept;
@@ -77,18 +105,168 @@ char *strpbrk(const char *s, const char *accept)
}
#endif
#ifdef REPLACE_INET_NTOA
char *rep_inet_ntoa(struct in_addr ip)
#ifndef HAVE_STRLCPY
/**
* Like strncpy but does not 0 fill the buffer and always null
* terminates.
*
* @param bufsize is the size of the destination buffer.
*
* @return index of the terminating byte.
**/
size_t strlcpy(char *d, const char *s, size_t bufsize)
{
unsigned char *p = (unsigned char *)&ip.s_addr;
static char buf[18];
#if WORDS_BIGENDIAN
slprintf(buf, 17, "%d.%d.%d.%d",
(int)p[0], (int)p[1], (int)p[2], (int)p[3]);
#else
slprintf(buf, 17, "%d.%d.%d.%d",
(int)p[3], (int)p[2], (int)p[1], (int)p[0]);
#endif
return buf;
size_t len = strlen(s);
size_t ret = len;
if (bufsize > 0) {
if (len >= bufsize)
len = bufsize-1;
memcpy(d, s, len);
d[len] = 0;
}
return ret;
}
#endif
#ifndef HAVE_STRLCAT
/**
* Like strncat() but does not 0 fill the buffer and always null
* terminates.
*
* @param bufsize length of the buffer, which should be one more than
* the maximum resulting string length.
**/
size_t strlcat(char *d, const char *s, size_t bufsize)
{
size_t len1 = strlen(d);
size_t len2 = strlen(s);
size_t ret = len1 + len2;
if (len1 < bufsize - 1) {
if (len2 >= bufsize - len1)
len2 = bufsize - len1 - 1;
memcpy(d+len1, s, len2);
d[len1+len2] = 0;
}
return ret;
}
#endif
/* some systems don't take the 2nd argument */
int sys_gettimeofday(struct timeval *tv)
{
#ifdef HAVE_GETTIMEOFDAY_TZ
return gettimeofday(tv, NULL);
#else
return gettimeofday(tv);
#endif
}
/* Return the int64 number as a string. If the human_flag arg is non-zero,
* we may output the number in K, M, G, or T units. If we don't add a unit
* suffix, we will append the fract string, if it is non-NULL. We can
* return up to 4 buffers at a time. */
char *do_big_num(int64 num, int human_flag, const char *fract)
{
static char bufs[4][128]; /* more than enough room */
static unsigned int n;
char *s;
int len, negated;
if (human_flag && !number_separator)
(void)get_number_separator();
n = (n + 1) % (sizeof bufs / sizeof bufs[0]);
if (human_flag > 1) {
int mult = human_flag == 2 ? 1000 : 1024;
if (num >= mult || num <= -mult) {
double dnum = (double)num / mult;
char units;
if (num < 0)
dnum = -dnum;
if (dnum < mult)
units = 'K';
else if ((dnum /= mult) < mult)
units = 'M';
else if ((dnum /= mult) < mult)
units = 'G';
else if ((dnum /= mult) < mult)
units = 'T';
else {
dnum /= mult;
units = 'P';
}
if (num < 0)
dnum = -dnum;
snprintf(bufs[n], sizeof bufs[0], "%.2f%c", dnum, units);
return bufs[n];
}
}
s = bufs[n] + sizeof bufs[0] - 1;
if (fract) {
len = strlen(fract);
s -= len;
strlcpy(s, fract, len + 1);
} else
*s = '\0';
len = 0;
if (!num)
*--s = '0';
if (num < 0) {
/* A maximum-size negated number can't fit as a positive,
* so do one digit in negated form to start us off. */
*--s = (char)(-(num % 10)) + '0';
num = -(num / 10);
len++;
negated = 1;
} else
negated = 0;
while (num) {
if (human_flag) {
if (len == 3) {
*--s = number_separator;
len = 1;
} else
len++;
}
*--s = (char)(num % 10) + '0';
num /= 10;
}
if (negated)
*--s = '-';
return s;
}
/* Return the double number as a string. If the human_flag option is > 1,
* we may output the number in K, M, G, or T units. The buffer we use for
* our result is either a single static buffer defined here, or a buffer
* we get from do_big_num(). */
char *do_big_dnum(double dnum, int human_flag, int decimal_digits)
{
static char tmp_buf[128];
#if SIZEOF_INT64 >= 8
char *fract;
snprintf(tmp_buf, sizeof tmp_buf, "%.*f", decimal_digits, dnum);
if (!human_flag || (dnum < 1000.0 && dnum > -1000.0))
return tmp_buf;
for (fract = tmp_buf+1; isDigit(fract); fract++) {}
return do_big_num((int64)dnum, human_flag, fract);
#else
/* A big number might lose digits converting to a too-short int64,
* so let's just return the raw double conversion. */
snprintf(tmp_buf, sizeof tmp_buf, "%.*f", decimal_digits, dnum);
return tmp_buf;
#endif
}

View File

@@ -1,204 +0,0 @@
#include "../rsync.h"
#ifndef HAVE_FNMATCH
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if defined (STDC_HEADERS) || !defined (isascii)
#define ISASCII(c) 1
#else
#define ISASCII(c) isascii(c)
#endif
#define ISUPPER(c) (ISASCII (c) && isupper (c))
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
extern int errno;
#endif
/* Match STRING against the filename pattern PATTERN, returning zero if
it matches, nonzero if not. */
int
fnmatch (pattern, string, flags)
const char *pattern;
const char *string;
int flags;
{
register const char *p = pattern, *n = string;
register char c;
/* Note that this evalutes C many times. */
#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
while ((c = *p++) != '\0')
{
c = FOLD (c);
switch (c)
{
case '?':
if (*n == '\0')
return FNM_NOMATCH;
else if ((flags & FNM_FILE_NAME) && *n == '/')
return FNM_NOMATCH;
else if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
break;
case '\\':
if (!(flags & FNM_NOESCAPE))
{
c = *p++;
c = FOLD (c);
}
if (FOLD (*n) != c)
return FNM_NOMATCH;
break;
case '*':
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
if (((flags & FNM_FILE_NAME) && *n == '/') ||
(c == '?' && *n == '\0'))
return FNM_NOMATCH;
if (c == '\0')
return 0;
{
char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
c1 = FOLD (c1);
for (--p; *n != '\0'; ++n)
if ((c == '[' || FOLD (*n) == c1) &&
fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
return 0;
return FNM_NOMATCH;
}
case '[':
{
/* Nonzero if the sense of the character class is inverted. */
register int not;
if (*n == '\0')
return FNM_NOMATCH;
if ((flags & FNM_PERIOD) && *n == '.' &&
(n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
return FNM_NOMATCH;
not = (*p == '!' || *p == '^');
if (not)
++p;
c = *p++;
for (;;)
{
register char cstart = c, cend = c;
if (!(flags & FNM_NOESCAPE) && c == '\\')
cstart = cend = *p++;
cstart = cend = FOLD (cstart);
if (c == '\0')
/* [ (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
c = FOLD (c);
if ((flags & FNM_FILE_NAME) && c == '/')
/* [/] can never match. */
return FNM_NOMATCH;
if (c == '-' && *p != ']')
{
cend = *p++;
if (!(flags & FNM_NOESCAPE) && cend == '\\')
cend = *p++;
if (cend == '\0')
return FNM_NOMATCH;
cend = FOLD (cend);
c = *p++;
}
if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
goto matched;
if (c == ']')
break;
}
if (!not)
return FNM_NOMATCH;
break;
matched:;
/* Skip the rest of the [...] that already matched. */
while (c != ']')
{
if (c == '\0')
/* [... (unterminated) loses. */
return FNM_NOMATCH;
c = *p++;
if (!(flags & FNM_NOESCAPE) && c == '\\')
/* XXX 1003.2d11 is unclear if this is right. */
++p;
}
if (not)
return FNM_NOMATCH;
}
break;
default:
if (c != FOLD (*n))
return FNM_NOMATCH;
}
++n;
}
if (*n == '\0')
return 0;
if ((flags & FNM_LEADING_DIR) && *n == '/')
/* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
return 0;
return FNM_NOMATCH;
}
#else /* HAVE_FNMATCH */
void fnmatch_dummy(void) {}
#endif

View File

@@ -1,69 +0,0 @@
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */

504
lib/getaddrinfo.c Normal file
View File

@@ -0,0 +1,504 @@
/*
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)
Portions Copyright (c) 1996-2005, The PostgreSQL Global Development Group
Portions Copyright (c) 1994, The Regents of the University of California
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this paragraph
and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
/*-------------------------------------------------------------------------
*
* getaddrinfo.c
* Support getaddrinfo() on platforms that don't have it.
*
* We also supply getnameinfo() here, assuming that the platform will have
* it if and only if it has getaddrinfo(). If this proves false on some
* platform, we'll need to split this file and provide a separate configure
* test for getnameinfo().
*
* Copyright (c) 2003-2007, PostgreSQL Global Development Group
*
* Copyright (C) 2007 Jeremy Allison.
* Modified to return multiple IPv4 addresses for Samba.
*
*-------------------------------------------------------------------------
*/
#include "rsync.h"
#ifndef SMB_MALLOC
#define SMB_MALLOC(s) malloc(s)
#endif
#ifndef SMB_STRDUP
#define SMB_STRDUP(s) strdup(s)
#endif
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 255
#endif
static int check_hostent_err(struct hostent *hp)
{
#ifndef INET6
extern int h_errno;
#endif
if (!hp) {
switch (h_errno) {
case HOST_NOT_FOUND:
case NO_DATA:
return EAI_NONAME;
case TRY_AGAIN:
return EAI_AGAIN;
case NO_RECOVERY:
default:
return EAI_FAIL;
}
}
if (!hp->h_name || hp->h_addrtype != AF_INET) {
return EAI_FAIL;
}
return 0;
}
static char *canon_name_from_hostent(struct hostent *hp,
int *perr)
{
char *ret = NULL;
*perr = check_hostent_err(hp);
if (*perr) {
return NULL;
}
ret = SMB_STRDUP(hp->h_name);
if (!ret) {
*perr = EAI_MEMORY;
}
return ret;
}
static char *get_my_canon_name(int *perr)
{
char name[HOST_NAME_MAX+1];
if (gethostname(name, HOST_NAME_MAX) == -1) {
*perr = EAI_FAIL;
return NULL;
}
/* Ensure null termination. */
name[HOST_NAME_MAX] = '\0';
return canon_name_from_hostent(gethostbyname(name), perr);
}
static char *get_canon_name_from_addr(struct in_addr ip,
int *perr)
{
return canon_name_from_hostent(
gethostbyaddr((void *)&ip, sizeof ip, AF_INET),
perr);
}
static struct addrinfo *alloc_entry(const struct addrinfo *hints,
struct in_addr ip,
unsigned short port)
{
struct sockaddr_in *psin = NULL;
struct addrinfo *ai = SMB_MALLOC(sizeof(*ai));
if (!ai) {
return NULL;
}
memset(ai, '\0', sizeof(*ai));
psin = SMB_MALLOC(sizeof(*psin));
if (!psin) {
free(ai);
return NULL;
}
memset(psin, '\0', sizeof(*psin));
psin->sin_family = AF_INET;
psin->sin_port = htons(port);
psin->sin_addr = ip;
ai->ai_flags = 0;
ai->ai_family = AF_INET;
ai->ai_socktype = hints->ai_socktype;
ai->ai_protocol = hints->ai_protocol;
ai->ai_addrlen = sizeof(*psin);
ai->ai_addr = (struct sockaddr *) psin;
ai->ai_canonname = NULL;
ai->ai_next = NULL;
return ai;
}
/*
* get address info for a single ipv4 address.
*
* Bugs: - servname can only be a number, not text.
*/
static int getaddr_info_single_addr(const char *service,
uint32 addr,
const struct addrinfo *hints,
struct addrinfo **res)
{
struct addrinfo *ai = NULL;
struct in_addr ip;
unsigned short port = 0;
if (service) {
port = (unsigned short)atoi(service);
}
ip.s_addr = htonl(addr);
ai = alloc_entry(hints, ip, port);
if (!ai) {
return EAI_MEMORY;
}
/* If we're asked for the canonical name,
* make sure it returns correctly. */
if (!(hints->ai_flags & AI_NUMERICSERV) &&
hints->ai_flags & AI_CANONNAME) {
int err;
if (addr == INADDR_LOOPBACK || addr == INADDR_ANY) {
ai->ai_canonname = get_my_canon_name(&err);
} else {
ai->ai_canonname =
get_canon_name_from_addr(ip,&err);
}
if (ai->ai_canonname == NULL) {
freeaddrinfo(ai);
return err;
}
}
*res = ai;
return 0;
}
/*
* get address info for multiple ipv4 addresses.
*
* Bugs: - servname can only be a number, not text.
*/
static int getaddr_info_name(const char *node,
const char *service,
const struct addrinfo *hints,
struct addrinfo **res)
{
struct addrinfo *listp = NULL, *prevp = NULL;
char **pptr = NULL;
int err;
struct hostent *hp = NULL;
unsigned short port = 0;
if (service) {
port = (unsigned short)atoi(service);
}
hp = gethostbyname(node);
err = check_hostent_err(hp);
if (err) {
return err;
}
for(pptr = hp->h_addr_list; *pptr; pptr++) {
struct in_addr ip = *(struct in_addr *)*pptr;
struct addrinfo *ai = alloc_entry(hints, ip, port);
if (!ai) {
freeaddrinfo(listp);
return EAI_MEMORY;
}
if (!listp) {
listp = ai;
prevp = ai;
ai->ai_canonname = SMB_STRDUP(hp->h_name);
if (!ai->ai_canonname) {
freeaddrinfo(listp);
return EAI_MEMORY;
}
} else {
prevp->ai_next = ai;
prevp = ai;
}
}
*res = listp;
return 0;
}
/*
* get address info for ipv4 sockets.
*
* Bugs: - servname can only be a number, not text.
*/
int getaddrinfo(const char *node,
const char *service,
const struct addrinfo * hintp,
struct addrinfo ** res)
{
struct addrinfo hints;
/* Setup the hints struct. */
if (hintp == NULL) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
} else {
memcpy(&hints, hintp, sizeof(hints));
}
if (hints.ai_family != AF_INET && hints.ai_family != AF_UNSPEC) {
return EAI_FAMILY;
}
if (hints.ai_socktype == 0) {
hints.ai_socktype = SOCK_STREAM;
}
if (!node && !service) {
return EAI_NONAME;
}
if (node) {
if (node[0] == '\0') {
return getaddr_info_single_addr(service,
INADDR_ANY,
&hints,
res);
} else if (hints.ai_flags & AI_NUMERICHOST) {
struct in_addr ip;
if (inet_pton(AF_INET, node, &ip) <= 0)
return EAI_FAIL;
return getaddr_info_single_addr(service,
ntohl(ip.s_addr),
&hints,
res);
} else {
return getaddr_info_name(node,
service,
&hints,
res);
}
} else if (hints.ai_flags & AI_PASSIVE) {
return getaddr_info_single_addr(service,
INADDR_ANY,
&hints,
res);
}
return getaddr_info_single_addr(service,
INADDR_LOOPBACK,
&hints,
res);
}
void freeaddrinfo(struct addrinfo *res)
{
struct addrinfo *next = NULL;
for (;res; res = next) {
next = res->ai_next;
if (res->ai_canonname) {
free(res->ai_canonname);
}
if (res->ai_addr) {
free(res->ai_addr);
}
free(res);
}
}
const char *gai_strerror(int errcode)
{
#ifdef HAVE_HSTRERROR
int hcode;
switch (errcode)
{
case EAI_NONAME:
hcode = HOST_NOT_FOUND;
break;
case EAI_AGAIN:
hcode = TRY_AGAIN;
break;
case EAI_FAIL:
default:
hcode = NO_RECOVERY;
break;
}
return hstrerror(hcode);
#else /* !HAVE_HSTRERROR */
switch (errcode)
{
case EAI_NONAME:
return "Unknown host";
case EAI_AGAIN:
return "Host name lookup failure";
#ifdef EAI_BADFLAGS
case EAI_BADFLAGS:
return "Invalid argument";
#endif
#ifdef EAI_FAMILY
case EAI_FAMILY:
return "Address family not supported";
#endif
#ifdef EAI_MEMORY
case EAI_MEMORY:
return "Not enough memory";
#endif
#ifdef EAI_NODATA
case EAI_NODATA:
return "No host data of that type was found";
#endif
#ifdef EAI_SERVICE
case EAI_SERVICE:
return "Class type not found";
#endif
#ifdef EAI_SOCKTYPE
case EAI_SOCKTYPE:
return "Socket type not supported";
#endif
default:
return "Unknown server error";
}
#endif /* HAVE_HSTRERROR */
}
static int gethostnameinfo(const struct sockaddr *sa,
char *node,
size_t nodelen,
int flags)
{
int ret = -1;
char *p = NULL;
if (!(flags & NI_NUMERICHOST)) {
struct hostent *hp = gethostbyaddr(
(void *)&((struct sockaddr_in *)sa)->sin_addr,
sizeof (struct in_addr),
sa->sa_family);
ret = check_hostent_err(hp);
if (ret == 0) {
/* Name looked up successfully. */
ret = snprintf(node, nodelen, "%s", hp->h_name);
if (ret < 0 || (size_t)ret >= nodelen) {
return EAI_MEMORY;
}
if (flags & NI_NOFQDN) {
p = strchr(node,'.');
if (p) {
*p = '\0';
}
}
return 0;
}
if (flags & NI_NAMEREQD) {
/* If we require a name and didn't get one,
* automatically fail. */
return ret;
}
/* Otherwise just fall into the numeric host code... */
}
p = inet_ntoa(((struct sockaddr_in *)sa)->sin_addr);
ret = snprintf(node, nodelen, "%s", p);
if (ret < 0 || (size_t)ret >= nodelen) {
return EAI_MEMORY;
}
return 0;
}
static int getservicenameinfo(const struct sockaddr *sa,
char *service,
size_t servicelen,
int flags)
{
int ret = -1;
int port = ntohs(((struct sockaddr_in *)sa)->sin_port);
if (!(flags & NI_NUMERICSERV)) {
struct servent *se = getservbyport(
port,
(flags & NI_DGRAM) ? "udp" : "tcp");
if (se && se->s_name) {
/* Service name looked up successfully. */
ret = snprintf(service, servicelen, "%s", se->s_name);
if (ret < 0 || (size_t)ret >= servicelen) {
return EAI_MEMORY;
}
return 0;
}
/* Otherwise just fall into the numeric service code... */
}
ret = snprintf(service, servicelen, "%d", port);
if (ret < 0 || (size_t)ret >= servicelen) {
return EAI_MEMORY;
}
return 0;
}
/*
* Convert an ipv4 address to a hostname.
*
* Bugs: - No IPv6 support.
*/
int getnameinfo(const struct sockaddr *sa, socklen_t salen,
char *node, size_t nodelen,
char *service, size_t servicelen, int flags)
{
/* Invalid arguments. */
if (sa == NULL || (node == NULL && service == NULL)) {
return EAI_FAIL;
}
if (sa->sa_family != AF_INET) {
return EAI_FAIL;
}
if (salen < (socklen_t)sizeof (struct sockaddr_in)) {
return EAI_FAIL;
}
if (node) {
int ret = gethostnameinfo(sa, node, nodelen, flags);
if (ret)
return ret;
}
if (service) {
return getservicenameinfo(sa, service, servicelen, flags);
}
return 0;
}

View File

@@ -1,751 +0,0 @@
#include "../rsync.h"
#ifndef HAVE_GETOPT_LONG
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
before changing it!
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */
#ifndef _NO_PROTO
#define _NO_PROTO
#endif
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself. This code is part of the GNU C
Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object files,
it is simpler to just do this in the source for each such file. */
#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
/* This is for other GNU distributions with internationalized messages.
The GNU C Library itself does not yet support such messages. */
#if HAVE_LIBINTL_H
# include <libintl.h>
#else
# define gettext(msgid) (msgid)
#endif
/* This version of `getopt' appears to the caller like standard Unix `getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
As `getopt' works, it permutes the elements of ARGV so that,
when it is done, all the options precede everything else. Thus
all application programs are extended to handle flexible argument order.
Setting the environment variable POSIXLY_CORRECT disables permutation.
Then the behavior is completely standard.
GNU application programs can use a third alternative mode in which
they can distinguish the relative order of options and other arguments. */
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
char *optarg = NULL;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
/* XXX 1003.2 says this must be 1 before any call. */
int optind = 0;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
static char *nextchar;
/* Callers store zero here to inhibit the error message
for unrecognized options. */
int opterr = 1;
/* Set to an option character which was unrecognized.
This must be initialized on some systems to avoid linking in the
system's own getopt implementation. */
int optopt = '?';
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters.
PERMUTE is the default. We permute the contents of ARGV as we scan,
so that eventually all the non-options are at the end. This allows options
to be given in any order, even with programs that were not written to
expect this.
RETURN_IN_ORDER is an option available to programs that were written
to expect options and other ARGV-elements in any order and that care about
the ordering of the two. We describe each non-option ARGV-element
as if it were the argument of an option with character code 1.
Using `-' as the first character of the list of option characters
selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return EOF with `optind' != ARGC. */
static enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} ordering;
/* Value of POSIXLY_CORRECT environment variable. */
static char *posixly_correct;
#ifdef __GNU_LIBRARY__
/* We want to avoid inclusion of string.h with non-GNU libraries
because there are many ways it can cause trouble.
On some systems, it contains special magic macros that don't work
in GCC. */
#include <string.h>
#define my_index strchr
#else
/* Avoid depending on library functions or files
whose names are inconsistent. */
char *getenv ();
static char *
my_index (str, chr)
const char *str;
int chr;
{
while (*str)
{
if (*str == chr)
return (char *) str;
str++;
}
return 0;
}
/* If using GCC, we can safely declare strlen this way.
If not using GCC, it is ok not to declare it. */
#ifdef __GNUC__
/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
That was relevant to code that was here before. */
#if !defined (__STDC__) || !__STDC__
/* gcc with -traditional declares the built-in strlen to return int,
and has done so at least since version 2.4.5. -- rms. */
extern int strlen (const char *);
#endif /* not __STDC__ */
#endif /* __GNUC__ */
#endif /* not __GNU_LIBRARY__ */
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first of them;
`last_nonopt' is the index after the last of them. */
static int first_nonopt;
static int last_nonopt;
/* Exchange two adjacent subsequences of ARGV.
One subsequence is elements [first_nonopt,last_nonopt)
which contains all the non-options that have been skipped so far.
The other is elements [last_nonopt,optind), which contains all
the options processed since those non-options were skipped.
`first_nonopt' and `last_nonopt' are relocated so that they describe
the new indices of the non-options in ARGV after they are moved. */
static void
exchange (argv)
char **argv;
{
int bottom = first_nonopt;
int middle = last_nonopt;
int top = optind;
char *tem;
/* Exchange the shorter segment with the far end of the longer segment.
That puts the shorter segment into the right place.
It leaves the longer segment in the right place overall,
but it consists of two parts that need to be swapped next. */
while (top > middle && middle > bottom)
{
if (top - middle > middle - bottom)
{
/* Bottom segment is the short one. */
int len = middle - bottom;
register int i;
/* Swap it with the top part of the top segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[top - (middle - bottom) + i];
argv[top - (middle - bottom) + i] = tem;
}
/* Exclude the moved bottom segment from further swapping. */
top -= len;
}
else
{
/* Top segment is the short one. */
int len = top - middle;
register int i;
/* Swap it with the bottom part of the bottom segment. */
for (i = 0; i < len; i++)
{
tem = argv[bottom + i];
argv[bottom + i] = argv[middle + i];
argv[middle + i] = tem;
}
/* Exclude the moved top segment from further swapping. */
bottom += len;
}
}
/* Update records for the slots the non-options now occupy. */
first_nonopt += (optind - last_nonopt);
last_nonopt = optind;
}
/* Initialize the internal data when the first call is made. */
static const char *
_getopt_initialize (optstring)
const char *optstring;
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
is the program name); the sequence of previously skipped
non-option ARGV-elements is empty. */
first_nonopt = last_nonopt = optind = 1;
nextchar = NULL;
posixly_correct = getenv ("POSIXLY_CORRECT");
/* Determine how to handle the ordering of options and nonoptions. */
if (optstring[0] == '-')
{
ordering = RETURN_IN_ORDER;
++optstring;
}
else if (optstring[0] == '+')
{
ordering = REQUIRE_ORDER;
++optstring;
}
else if (posixly_correct != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
return optstring;
}
/* Scan elements of ARGV (whose length is ARGC) for option characters
given in OPTSTRING.
If an element of ARGV starts with '-', and is not exactly "-" or "--",
then it is an option element. The characters of this element
(aside from the initial '-') are option characters. If `getopt'
is called repeatedly, it returns successively each of the option characters
from each of the option elements.
If `getopt' finds another option character, it returns that character,
updating `optind' and `nextchar' so that the next call to `getopt' can
resume the scan with the following option character or ARGV-element.
If there are no more option characters, `getopt' returns `EOF'.
Then `optind' is the index in ARGV of the first ARGV-element
that is not an option. (The ARGV-elements have been permuted
so that those that are not options now come last.)
OPTSTRING is a string containing the legitimate option characters.
If an option character is seen that is not listed in OPTSTRING,
return '?' after printing an error message. If you set `opterr' to
zero, the error message is suppressed but we still return '?'.
If a char in OPTSTRING is followed by a colon, that means it wants an arg,
so the following text in the same ARGV-element, or the text of the following
ARGV-element, is returned in `optarg'. Two colons mean an option that
wants an optional arg; if there is text in the current ARGV-element,
it is returned in `optarg', otherwise `optarg' is set to zero.
If OPTSTRING starts with `-' or `+', it requests different methods of
handling the non-option ARGV-elements.
See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
Long-named options begin with `--' instead of `-'.
Their names may be abbreviated as long as the abbreviation is unique
or is an exact match for some defined option. If they have an
argument, it follows the option name in the same ARGV-element, separated
from the option name by a `=', or else the in next ARGV-element.
When `getopt' finds a long-named option, it returns 0 if that option's
`flag' field is nonzero, the value of the option's `val' field
if the `flag' field is zero.
The elements of ARGV aren't really const, because we permute them.
But we pretend they're const in the prototype to be compatible
with other systems.
LONGOPTS is a vector of `struct option' terminated by an
element containing a name which is zero.
LONGIND returns the index in LONGOPT of the long-named option found.
It is only valid when a long-named option has been found by the most
recent call.
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
long-named options. */
int
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
int argc;
char *const *argv;
const char *optstring;
const struct option *longopts;
int *longind;
int long_only;
{
optarg = NULL;
if (optind == 0)
optstring = _getopt_initialize (optstring);
if (nextchar == NULL || *nextchar == '\0')
{
/* Advance to the next ARGV-element. */
if (ordering == PERMUTE)
{
/* If we have just processed some options following some non-options,
exchange them so that the options come first. */
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (last_nonopt != optind)
first_nonopt = optind;
/* Skip any additional non-options
and extend the range of non-options previously skipped. */
while (optind < argc
&& (argv[optind][0] != '-' || argv[optind][1] == '\0'))
optind++;
last_nonopt = optind;
}
/* The special ARGV-element `--' means premature end of options.
Skip it like a null option,
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
if (first_nonopt != last_nonopt && last_nonopt != optind)
exchange ((char **) argv);
else if (first_nonopt == last_nonopt)
first_nonopt = optind;
last_nonopt = argc;
optind = argc;
}
/* If we have done all the ARGV-elements, stop the scan
and back over any non-options that we skipped and permuted. */
if (optind == argc)
{
/* Set the next-arg-index to point at the non-options
that we previously skipped, so the caller will digest them. */
if (first_nonopt != last_nonopt)
optind = first_nonopt;
return EOF;
}
/* If we have come to a non-option and did not permute it,
either stop the scan or describe it to the caller and pass it by. */
if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
{
if (ordering == REQUIRE_ORDER)
return EOF;
optarg = argv[optind++];
return 1;
}
/* We have found another option-ARGV-element.
Skip the initial punctuation. */
nextchar = (argv[optind] + 1
+ (longopts != NULL && argv[optind][1] == '-'));
}
/* Decode the current option-ARGV-element. */
/* Check whether the ARGV-element is a long option.
If long_only and the ARGV-element has the form "-f", where f is
a valid short option, don't consider it an abbreviated form of
a long option that starts with f. Otherwise there would be no
way to give the -f short option.
On the other hand, if there's a long option "fubar" and
the ARGV-element is "-fu", do consider that an abbreviation of
the long option, just like "--fu", and not "-f" with arg "u".
This distinction seems to be the most useful approach. */
if (longopts != NULL
&& (argv[optind][1] == '-'
|| (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
{
char *nameend;
const struct option *p;
const struct option *pfound = NULL;
int exact = 0;
int ambig = 0;
int indfound;
int option_index;
for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
/* Do nothing. */ ;
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if (nameend - nextchar == strlen (p->name))
{
/* Exact match found. */
pfound = p;
indfound = option_index;
exact = 1;
break;
}
else if (pfound == NULL)
{
/* First nonexact match found. */
pfound = p;
indfound = option_index;
}
else
/* Second or later nonexact match found. */
ambig = 1;
}
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
return '?';
}
if (pfound != NULL)
{
option_index = indfound;
optind++;
if (*nameend)
{
/* Don't test has_arg with >, because some C compilers don't
allow it to be used on enums. */
if (pfound->has_arg)
optarg = nameend + 1;
else
{
if (opterr)
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
gettext ("%s: option `--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
gettext ("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
nextchar += strlen (nextchar);
return '?';
}
}
else if (pfound->has_arg == 1)
{
if (optind < argc)
optarg = argv[optind++];
else
{
if (opterr)
fprintf (stderr,
gettext ("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
{
*(pfound->flag) = pfound->val;
return 0;
}
return pfound->val;
}
/* Can't find it as a long option. If this is not getopt_long_only,
or the option starts with '--' or is not a valid short
option, then it's an error.
Otherwise interpret it as a short option. */
if (!long_only || argv[optind][1] == '-'
|| my_index (optstring, *nextchar) == NULL)
{
if (opterr)
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"),
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
optind++;
return '?';
}
}
/* Look at and handle the next short option-character. */
{
char c = *nextchar++;
char *temp = my_index (optstring, c);
/* Increment `optind' when we start to process its last character. */
if (*nextchar == '\0')
++optind;
if (temp == NULL || c == ':')
{
if (opterr)
{
if (posixly_correct)
/* 1003.2 specifies the format of this message. */
fprintf (stderr, gettext ("%s: illegal option -- %c\n"),
argv[0], c);
else
fprintf (stderr, gettext ("%s: invalid option -- %c\n"),
argv[0], c);
}
optopt = c;
return '?';
}
if (temp[1] == ':')
{
if (temp[2] == ':')
{
/* This is an option that accepts an argument optionally. */
if (*nextchar != '\0')
{
optarg = nextchar;
optind++;
}
else
optarg = NULL;
nextchar = NULL;
}
else
{
/* This is an option that requires an argument. */
if (*nextchar != '\0')
{
optarg = nextchar;
/* If we end this ARGV-element by taking the rest as an arg,
we must advance to the next element now. */
optind++;
}
else if (optind == argc)
{
if (opterr)
{
/* 1003.2 specifies the format of this message. */
fprintf (stderr,
gettext ("%s: option requires an argument -- %c\n"),
argv[0], c);
}
optopt = c;
if (optstring[0] == ':')
c = ':';
else
c = '?';
}
else
/* We already incremented `optind' once;
increment it again when taking next ARGV-elt as argument. */
optarg = argv[optind++];
nextchar = NULL;
}
}
return c;
}
}
int
getopt (argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
return _getopt_internal (argc, argv, optstring,
(const struct option *) 0,
(int *) 0,
0);
}
int
getopt_long (argc, argv, options, long_options, opt_index)
int argc;
char *const *argv;
const char *options;
const struct option *long_options;
int *opt_index;
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
#endif /* _LIBC or not __GNU_LIBRARY__. */
#ifdef TEST
/* Compile with -DTEST to make an executable for use in testing
the above definition of `getopt'. */
int
main (argc, argv)
int argc;
char **argv;
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
c = getopt (argc, argv, "abc:d:0123456789");
if (c == EOF)
break;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */
#else /* HAVE_GETOPT_LONG */
void getopt_dummy(void) {}
#endif

View File

@@ -1,129 +0,0 @@
/* Declarations for getopt.
Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if defined (__STDC__) && __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if defined (__STDC__) && __STDC__
#ifdef __GNU_LIBRARY__
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _GETOPT_H */

72
lib/getpass.c Normal file
View File

@@ -0,0 +1,72 @@
/*
* An implementation of getpass for systems that lack one.
*
* Copyright (C) 2013 Roman Donchenko
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include "rsync.h"
char *getpass(const char *prompt)
{
static char password[256];
BOOL tty_changed = False, read_success;
struct termios tty_old, tty_new;
FILE *in = stdin, *out = stderr;
FILE *tty = fopen("/dev/tty", "w+");
if (tty)
in = out = tty;
if (tcgetattr(fileno(in), &tty_old) == 0) {
tty_new = tty_old;
tty_new.c_lflag &= ~(ECHO | ISIG);
if (tcsetattr(fileno(in), TCSAFLUSH, &tty_new) == 0)
tty_changed = True;
}
if (!tty_changed)
fputs("(WARNING: will be visible) ", out);
fputs(prompt, out);
fflush(out);
read_success = fgets(password, sizeof password, in) != NULL;
/* Print the newline that hasn't been echoed. */
fputc('\n', out);
if (tty_changed)
tcsetattr(fileno(in), TCSAFLUSH, &tty_old);
if (tty)
fclose(tty);
if (read_success) {
/* Remove the trailing newline. */
size_t password_len = strlen(password);
if (password_len && password[password_len - 1] == '\n')
password[password_len - 1] = '\0';
return password;
}
return NULL;
}

186
lib/inet_ntop.c Normal file
View File

@@ -0,0 +1,186 @@
/*
* Copyright (C) 1996-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "rsync.h"
#define NS_INT16SZ 2
#define NS_IN6ADDRSZ 16
/*
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
static const char *inet_ntop4(const unsigned char *src, char *dst,
size_t size);
#ifdef AF_INET6
static const char *inet_ntop6(const unsigned char *src, char *dst,
size_t size);
#endif
/* char *
* isc_net_ntop(af, src, dst, size)
* convert a network format address to presentation format.
* return:
* pointer to presentation format address (`dst'), or NULL (see errno).
* author:
* Paul Vixie, 1996.
*/
const char *
inet_ntop(int af, const void *src, char *dst, size_t size)
{
switch (af) {
case AF_INET:
return (inet_ntop4(src, dst, size));
#ifdef AF_INET6
case AF_INET6:
return (inet_ntop6(src, dst, size));
#endif
default:
errno = EAFNOSUPPORT;
return (NULL);
}
/* NOTREACHED */
}
/* const char *
* inet_ntop4(src, dst, size)
* format an IPv4 address
* return:
* `dst' (as a const)
* notes:
* (1) uses no statics
* (2) takes a unsigned char* not an in_addr as input
* author:
* Paul Vixie, 1996.
*/
static const char *
inet_ntop4(const unsigned char *src, char *dst, size_t size)
{
static const char *fmt = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
size_t len;
len = snprintf(tmp, sizeof tmp, fmt, src[0], src[1], src[2], src[3]);
if (len >= size) {
errno = ENOSPC;
return (NULL);
}
memcpy(dst, tmp, len + 1);
return (dst);
}
/* const char *
* isc_inet_ntop6(src, dst, size)
* convert IPv6 binary address into presentation (printable) format
* author:
* Paul Vixie, 1996.
*/
#ifdef AF_INET6
static const char *
inet_ntop6(const unsigned char *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
* to contain a value of the specified size. On some systems, like
* Crays, there is no such thing as an integer variable with 16 bits.
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
struct { int base, len; } best, cur;
unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
int i, inc;
/*
* Preprocess:
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
memset(words, '\0', sizeof words);
for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
cur.base = -1;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
if (words[i] == 0) {
if (cur.base == -1)
cur.base = i, cur.len = 1;
else
cur.len++;
} else {
if (cur.base != -1) {
if (best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
}
}
}
if (cur.base != -1) {
if (best.base == -1 || cur.len > best.len)
best = cur;
}
if (best.base != -1 && best.len < 2)
best.base = -1;
/*
* Format the result.
*/
tp = tmp;
for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
/* Are we inside the best run of 0x00's? */
if (best.base != -1 && i >= best.base &&
i < (best.base + best.len)) {
if (i == best.base)
*tp++ = ':';
continue;
}
/* Are we following an initial run of 0x00s or any real hex? */
if (i != 0)
*tp++ = ':';
/* Is this address an encapsulated IPv4? */
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
return (NULL);
tp += strlen(tp);
break;
}
inc = snprintf(tp, 5, "%x", words[i]);
assert(inc < 5);
tp += inc;
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) ==
(NS_IN6ADDRSZ / NS_INT16SZ))
*tp++ = ':';
*tp++ = '\0';
/*
* Check for overflow, copy, and we're done.
*/
if ((size_t)(tp - tmp) > size) {
errno = ENOSPC;
return (NULL);
}
memcpy(dst, tmp, tp - tmp);
return (dst);
}
#endif /* AF_INET6 */

212
lib/inet_pton.c Normal file
View File

@@ -0,0 +1,212 @@
/*
* Copyright (C) 1996-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "rsync.h"
#define NS_INT16SZ 2
#define NS_INADDRSZ 4
#define NS_IN6ADDRSZ 16
/*
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
static int inet_pton4(const char *src, unsigned char *dst);
#ifdef INET6
static int inet_pton6(const char *src, unsigned char *dst);
#endif
/* int
* inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* author:
* Paul Vixie, 1996.
*/
int
inet_pton(int af,
const char *src,
void *dst)
{
switch (af) {
case AF_INET:
return (inet_pton4(src, dst));
#ifdef INET6
case AF_INET6:
return (inet_pton6(src, dst));
#endif
default:
errno = EAFNOSUPPORT;
return (-1);
}
/* NOTREACHED */
}
/* int
* inet_pton4(src, dst)
* like inet_aton() but without all the hexadecimal and shorthand.
* return:
* 1 if `src' is a valid dotted quad, else 0.
* notice:
* does not touch `dst' unless it's returning 1.
* author:
* Paul Vixie, 1996.
*/
static int
inet_pton4(src, dst)
const char *src;
unsigned char *dst;
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
unsigned char tmp[NS_INADDRSZ], *tp;
saw_digit = 0;
octets = 0;
*(tp = tmp) = 0;
while ((ch = *src++) != '\0') {
const char *pch;
if ((pch = strchr(digits, ch)) != NULL) {
unsigned int new = *tp * 10 + (pch - digits);
if (new > 255)
return (0);
*tp = new;
if (! saw_digit) {
if (++octets > 4)
return (0);
saw_digit = 1;
}
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);
*++tp = 0;
saw_digit = 0;
} else
return (0);
}
if (octets < 4)
return (0);
memcpy(dst, tmp, NS_INADDRSZ);
return (1);
}
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
* return:
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* notice:
* (1) does not touch `dst' unless it's returning 1.
* (2) :: in a full address is silently ignored.
* credit:
* inspired by Mark Andrews.
* author:
* Paul Vixie, 1996.
*/
#ifdef INET6
static int
inet_pton6(src, dst)
const char *src;
unsigned char *dst;
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
unsigned int val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
endp = tp + NS_IN6ADDRSZ;
colonp = NULL;
/* Leading :: requires some special handling. */
if (*src == ':')
if (*++src != ':')
return (0);
curtok = src;
saw_xdigit = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
pch = strchr((xdigits = xdigits_u), ch);
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
if (val > 0xffff)
return (0);
saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
if (!saw_xdigit) {
if (colonp)
return (0);
colonp = tp;
continue;
}
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
saw_xdigit = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
if (saw_xdigit) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (unsigned char) (val >> 8) & 0xff;
*tp++ = (unsigned char) val & 0xff;
}
if (colonp != NULL) {
/*
* Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand.
*/
const int n = tp - colonp;
int i;
for (i = 1; i <= n; i++) {
endp[- i] = colonp[n - i];
colonp[n - i] = 0;
}
tp = endp;
}
if (tp != endp)
return (0);
memcpy(dst, tmp, NS_IN6ADDRSZ);
return (1);
}
#endif

17
lib/md-defines.h Normal file
View File

@@ -0,0 +1,17 @@
/* Keep this simple so both C and ASM can use it */
#define MD4_DIGEST_LEN 16
#define MD5_DIGEST_LEN 16
#define MAX_DIGEST_LEN MD5_DIGEST_LEN
#define CSUM_CHUNK 64
#define CSUM_NONE 0
#define CSUM_MD4_ARCHAIC 1
#define CSUM_MD4_BUSTED 2
#define CSUM_MD4_OLD 3
#define CSUM_MD4 4
#define CSUM_MD5 5
#define CSUM_XXH64 6
#define CSUM_XXH3_64 7
#define CSUM_XXH3_128 8

701
lib/md5-asm-x86_64.S Normal file
View File

@@ -0,0 +1,701 @@
/*
* x86-64 optimized assembler MD5 implementation
*
* Author: Marc Bevand, 2004
*
* This code was placed in the public domain by the author. The original
* publication can be found at:
*
* https://www.zorinaq.com/papers/md5-amd64.html
*/
/*
* No modifications were made aside from changing the function and file names.
* The MD5_CTX structure as expected here (from OpenSSL) is binary compatible
* with the md_context used by rsync, for the fields accessed.
*
* Benchmarks (in MB/s) C ASM
* - Intel Atom D2700 302 334
* - Intel i7-7700hq 351 376
* - AMD ThreadRipper 2950x 728 784
*
* The original code was also incorporated into OpenSSL. It has since been
* modified there. Those changes have not been made here due to licensing
* incompatibilities. Benchmarks of those changes on the above CPUs did not
* show any significant difference in performance, though.
*/
#include "config.h"
#include "md-defines.h"
#ifdef USE_MD5_ASM /* { */
#ifdef __APPLE__
#define md5_process_asm _md5_process_asm
#endif
.text
.align 16
.globl md5_process_asm
md5_process_asm:
push %rbp
push %rbx
push %r12
push %r13 # not really useful (r13 is unused)
push %r14
push %r15
# rdi = arg #1 (ctx, MD5_CTX pointer)
# rsi = arg #2 (ptr, data pointer)
# rdx = arg #3 (nbr, number of 16-word blocks to process)
mov %rdi, %rbp # rbp = ctx
shl $6, %rdx # rdx = nbr in bytes
lea (%rsi,%rdx), %rdi # rdi = end
mov 0*4(%rbp), %eax # eax = ctx->A
mov 1*4(%rbp), %ebx # ebx = ctx->B
mov 2*4(%rbp), %ecx # ecx = ctx->C
mov 3*4(%rbp), %edx # edx = ctx->D
# end is 'rdi'
# ptr is 'rsi'
# A is 'eax'
# B is 'ebx'
# C is 'ecx'
# D is 'edx'
cmp %rdi, %rsi # cmp end with ptr
je 1f # jmp if ptr == end
# BEGIN of loop over 16-word blocks
2: # save old values of A, B, C, D
mov %eax, %r8d
mov %ebx, %r9d
mov %ecx, %r14d
mov %edx, %r15d
mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
xor %ecx, %r11d /* y ^ ... */
lea -680876936(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r11d /* x & ... */
xor %edx, %r11d /* z ^ ... */
mov 1*4(%rsi),%r10d /* (NEXT STEP) X[1] */
add %r11d, %eax /* dst += ... */
rol $7, %eax /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %ebx, %eax /* dst += x */
xor %ebx, %r11d /* y ^ ... */
lea -389564586(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r11d /* x & ... */
xor %ecx, %r11d /* z ^ ... */
mov 2*4(%rsi),%r10d /* (NEXT STEP) X[2] */
add %r11d, %edx /* dst += ... */
rol $12, %edx /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %eax, %edx /* dst += x */
xor %eax, %r11d /* y ^ ... */
lea 606105819(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r11d /* x & ... */
xor %ebx, %r11d /* z ^ ... */
mov 3*4(%rsi),%r10d /* (NEXT STEP) X[3] */
add %r11d, %ecx /* dst += ... */
rol $17, %ecx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %edx, %ecx /* dst += x */
xor %edx, %r11d /* y ^ ... */
lea -1044525330(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r11d /* x & ... */
xor %eax, %r11d /* z ^ ... */
mov 4*4(%rsi),%r10d /* (NEXT STEP) X[4] */
add %r11d, %ebx /* dst += ... */
rol $22, %ebx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %ecx, %ebx /* dst += x */
xor %ecx, %r11d /* y ^ ... */
lea -176418897(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r11d /* x & ... */
xor %edx, %r11d /* z ^ ... */
mov 5*4(%rsi),%r10d /* (NEXT STEP) X[5] */
add %r11d, %eax /* dst += ... */
rol $7, %eax /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %ebx, %eax /* dst += x */
xor %ebx, %r11d /* y ^ ... */
lea 1200080426(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r11d /* x & ... */
xor %ecx, %r11d /* z ^ ... */
mov 6*4(%rsi),%r10d /* (NEXT STEP) X[6] */
add %r11d, %edx /* dst += ... */
rol $12, %edx /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %eax, %edx /* dst += x */
xor %eax, %r11d /* y ^ ... */
lea -1473231341(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r11d /* x & ... */
xor %ebx, %r11d /* z ^ ... */
mov 7*4(%rsi),%r10d /* (NEXT STEP) X[7] */
add %r11d, %ecx /* dst += ... */
rol $17, %ecx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %edx, %ecx /* dst += x */
xor %edx, %r11d /* y ^ ... */
lea -45705983(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r11d /* x & ... */
xor %eax, %r11d /* z ^ ... */
mov 8*4(%rsi),%r10d /* (NEXT STEP) X[8] */
add %r11d, %ebx /* dst += ... */
rol $22, %ebx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %ecx, %ebx /* dst += x */
xor %ecx, %r11d /* y ^ ... */
lea 1770035416(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r11d /* x & ... */
xor %edx, %r11d /* z ^ ... */
mov 9*4(%rsi),%r10d /* (NEXT STEP) X[9] */
add %r11d, %eax /* dst += ... */
rol $7, %eax /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %ebx, %eax /* dst += x */
xor %ebx, %r11d /* y ^ ... */
lea -1958414417(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r11d /* x & ... */
xor %ecx, %r11d /* z ^ ... */
mov 10*4(%rsi),%r10d /* (NEXT STEP) X[10] */
add %r11d, %edx /* dst += ... */
rol $12, %edx /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %eax, %edx /* dst += x */
xor %eax, %r11d /* y ^ ... */
lea -42063(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r11d /* x & ... */
xor %ebx, %r11d /* z ^ ... */
mov 11*4(%rsi),%r10d /* (NEXT STEP) X[11] */
add %r11d, %ecx /* dst += ... */
rol $17, %ecx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %edx, %ecx /* dst += x */
xor %edx, %r11d /* y ^ ... */
lea -1990404162(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r11d /* x & ... */
xor %eax, %r11d /* z ^ ... */
mov 12*4(%rsi),%r10d /* (NEXT STEP) X[12] */
add %r11d, %ebx /* dst += ... */
rol $22, %ebx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %ecx, %ebx /* dst += x */
xor %ecx, %r11d /* y ^ ... */
lea 1804603682(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r11d /* x & ... */
xor %edx, %r11d /* z ^ ... */
mov 13*4(%rsi),%r10d /* (NEXT STEP) X[13] */
add %r11d, %eax /* dst += ... */
rol $7, %eax /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %ebx, %eax /* dst += x */
xor %ebx, %r11d /* y ^ ... */
lea -40341101(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r11d /* x & ... */
xor %ecx, %r11d /* z ^ ... */
mov 14*4(%rsi),%r10d /* (NEXT STEP) X[14] */
add %r11d, %edx /* dst += ... */
rol $12, %edx /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %eax, %edx /* dst += x */
xor %eax, %r11d /* y ^ ... */
lea -1502002290(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r11d /* x & ... */
xor %ebx, %r11d /* z ^ ... */
mov 15*4(%rsi),%r10d /* (NEXT STEP) X[15] */
add %r11d, %ecx /* dst += ... */
rol $17, %ecx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %edx, %ecx /* dst += x */
xor %edx, %r11d /* y ^ ... */
lea 1236535329(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r11d /* x & ... */
xor %eax, %r11d /* z ^ ... */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
add %r11d, %ebx /* dst += ... */
rol $22, %ebx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %ecx, %ebx /* dst += x */
mov 1*4(%rsi), %r10d /* (NEXT STEP) X[1] */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
mov %edx, %r12d /* (NEXT STEP) z' = %edx */
not %r11d /* not z */
lea -165796510(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r12d /* x & z */
and %ecx, %r11d /* y & (not z) */
mov 6*4(%rsi),%r10d /* (NEXT STEP) X[6] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %r12d, %eax /* dst += ... */
mov %ecx, %r12d /* (NEXT STEP) z' = %ecx */
rol $5, %eax /* dst <<< s */
add %ebx, %eax /* dst += x */
not %r11d /* not z */
lea -1069501632(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r12d /* x & z */
and %ebx, %r11d /* y & (not z) */
mov 11*4(%rsi),%r10d /* (NEXT STEP) X[11] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %r12d, %edx /* dst += ... */
mov %ebx, %r12d /* (NEXT STEP) z' = %ebx */
rol $9, %edx /* dst <<< s */
add %eax, %edx /* dst += x */
not %r11d /* not z */
lea 643717713(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r12d /* x & z */
and %eax, %r11d /* y & (not z) */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %r12d, %ecx /* dst += ... */
mov %eax, %r12d /* (NEXT STEP) z' = %eax */
rol $14, %ecx /* dst <<< s */
add %edx, %ecx /* dst += x */
not %r11d /* not z */
lea -373897302(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r12d /* x & z */
and %edx, %r11d /* y & (not z) */
mov 5*4(%rsi),%r10d /* (NEXT STEP) X[5] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %r12d, %ebx /* dst += ... */
mov %edx, %r12d /* (NEXT STEP) z' = %edx */
rol $20, %ebx /* dst <<< s */
add %ecx, %ebx /* dst += x */
not %r11d /* not z */
lea -701558691(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r12d /* x & z */
and %ecx, %r11d /* y & (not z) */
mov 10*4(%rsi),%r10d /* (NEXT STEP) X[10] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %r12d, %eax /* dst += ... */
mov %ecx, %r12d /* (NEXT STEP) z' = %ecx */
rol $5, %eax /* dst <<< s */
add %ebx, %eax /* dst += x */
not %r11d /* not z */
lea 38016083(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r12d /* x & z */
and %ebx, %r11d /* y & (not z) */
mov 15*4(%rsi),%r10d /* (NEXT STEP) X[15] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %r12d, %edx /* dst += ... */
mov %ebx, %r12d /* (NEXT STEP) z' = %ebx */
rol $9, %edx /* dst <<< s */
add %eax, %edx /* dst += x */
not %r11d /* not z */
lea -660478335(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r12d /* x & z */
and %eax, %r11d /* y & (not z) */
mov 4*4(%rsi),%r10d /* (NEXT STEP) X[4] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %r12d, %ecx /* dst += ... */
mov %eax, %r12d /* (NEXT STEP) z' = %eax */
rol $14, %ecx /* dst <<< s */
add %edx, %ecx /* dst += x */
not %r11d /* not z */
lea -405537848(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r12d /* x & z */
and %edx, %r11d /* y & (not z) */
mov 9*4(%rsi),%r10d /* (NEXT STEP) X[9] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %r12d, %ebx /* dst += ... */
mov %edx, %r12d /* (NEXT STEP) z' = %edx */
rol $20, %ebx /* dst <<< s */
add %ecx, %ebx /* dst += x */
not %r11d /* not z */
lea 568446438(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r12d /* x & z */
and %ecx, %r11d /* y & (not z) */
mov 14*4(%rsi),%r10d /* (NEXT STEP) X[14] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %r12d, %eax /* dst += ... */
mov %ecx, %r12d /* (NEXT STEP) z' = %ecx */
rol $5, %eax /* dst <<< s */
add %ebx, %eax /* dst += x */
not %r11d /* not z */
lea -1019803690(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r12d /* x & z */
and %ebx, %r11d /* y & (not z) */
mov 3*4(%rsi),%r10d /* (NEXT STEP) X[3] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %r12d, %edx /* dst += ... */
mov %ebx, %r12d /* (NEXT STEP) z' = %ebx */
rol $9, %edx /* dst <<< s */
add %eax, %edx /* dst += x */
not %r11d /* not z */
lea -187363961(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r12d /* x & z */
and %eax, %r11d /* y & (not z) */
mov 8*4(%rsi),%r10d /* (NEXT STEP) X[8] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %r12d, %ecx /* dst += ... */
mov %eax, %r12d /* (NEXT STEP) z' = %eax */
rol $14, %ecx /* dst <<< s */
add %edx, %ecx /* dst += x */
not %r11d /* not z */
lea 1163531501(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r12d /* x & z */
and %edx, %r11d /* y & (not z) */
mov 13*4(%rsi),%r10d /* (NEXT STEP) X[13] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %r12d, %ebx /* dst += ... */
mov %edx, %r12d /* (NEXT STEP) z' = %edx */
rol $20, %ebx /* dst <<< s */
add %ecx, %ebx /* dst += x */
not %r11d /* not z */
lea -1444681467(%eax,%r10d),%eax /* Const + dst + ... */
and %ebx, %r12d /* x & z */
and %ecx, %r11d /* y & (not z) */
mov 2*4(%rsi),%r10d /* (NEXT STEP) X[2] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ecx, %r11d /* (NEXT STEP) z' = %ecx */
add %r12d, %eax /* dst += ... */
mov %ecx, %r12d /* (NEXT STEP) z' = %ecx */
rol $5, %eax /* dst <<< s */
add %ebx, %eax /* dst += x */
not %r11d /* not z */
lea -51403784(%edx,%r10d),%edx /* Const + dst + ... */
and %eax, %r12d /* x & z */
and %ebx, %r11d /* y & (not z) */
mov 7*4(%rsi),%r10d /* (NEXT STEP) X[7] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %ebx, %r11d /* (NEXT STEP) z' = %ebx */
add %r12d, %edx /* dst += ... */
mov %ebx, %r12d /* (NEXT STEP) z' = %ebx */
rol $9, %edx /* dst <<< s */
add %eax, %edx /* dst += x */
not %r11d /* not z */
lea 1735328473(%ecx,%r10d),%ecx /* Const + dst + ... */
and %edx, %r12d /* x & z */
and %eax, %r11d /* y & (not z) */
mov 12*4(%rsi),%r10d /* (NEXT STEP) X[12] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %eax, %r11d /* (NEXT STEP) z' = %eax */
add %r12d, %ecx /* dst += ... */
mov %eax, %r12d /* (NEXT STEP) z' = %eax */
rol $14, %ecx /* dst <<< s */
add %edx, %ecx /* dst += x */
not %r11d /* not z */
lea -1926607734(%ebx,%r10d),%ebx /* Const + dst + ... */
and %ecx, %r12d /* x & z */
and %edx, %r11d /* y & (not z) */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
or %r11d, %r12d /* (y & (not z)) | (x & z) */
mov %edx, %r11d /* (NEXT STEP) z' = %edx */
add %r12d, %ebx /* dst += ... */
mov %edx, %r12d /* (NEXT STEP) z' = %edx */
rol $20, %ebx /* dst <<< s */
add %ecx, %ebx /* dst += x */
mov 5*4(%rsi), %r10d /* (NEXT STEP) X[5] */
mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */
lea -378558(%eax,%r10d),%eax /* Const + dst + ... */
mov 8*4(%rsi),%r10d /* (NEXT STEP) X[8] */
xor %edx, %r11d /* z ^ ... */
xor %ebx, %r11d /* x ^ ... */
add %r11d, %eax /* dst += ... */
rol $4, %eax /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) y' = %ebx */
add %ebx, %eax /* dst += x */
lea -2022574463(%edx,%r10d),%edx /* Const + dst + ... */
mov 11*4(%rsi),%r10d /* (NEXT STEP) X[11] */
xor %ecx, %r11d /* z ^ ... */
xor %eax, %r11d /* x ^ ... */
add %r11d, %edx /* dst += ... */
rol $11, %edx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) y' = %eax */
add %eax, %edx /* dst += x */
lea 1839030562(%ecx,%r10d),%ecx /* Const + dst + ... */
mov 14*4(%rsi),%r10d /* (NEXT STEP) X[14] */
xor %ebx, %r11d /* z ^ ... */
xor %edx, %r11d /* x ^ ... */
add %r11d, %ecx /* dst += ... */
rol $16, %ecx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) y' = %edx */
add %edx, %ecx /* dst += x */
lea -35309556(%ebx,%r10d),%ebx /* Const + dst + ... */
mov 1*4(%rsi),%r10d /* (NEXT STEP) X[1] */
xor %eax, %r11d /* z ^ ... */
xor %ecx, %r11d /* x ^ ... */
add %r11d, %ebx /* dst += ... */
rol $23, %ebx /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */
add %ecx, %ebx /* dst += x */
lea -1530992060(%eax,%r10d),%eax /* Const + dst + ... */
mov 4*4(%rsi),%r10d /* (NEXT STEP) X[4] */
xor %edx, %r11d /* z ^ ... */
xor %ebx, %r11d /* x ^ ... */
add %r11d, %eax /* dst += ... */
rol $4, %eax /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) y' = %ebx */
add %ebx, %eax /* dst += x */
lea 1272893353(%edx,%r10d),%edx /* Const + dst + ... */
mov 7*4(%rsi),%r10d /* (NEXT STEP) X[7] */
xor %ecx, %r11d /* z ^ ... */
xor %eax, %r11d /* x ^ ... */
add %r11d, %edx /* dst += ... */
rol $11, %edx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) y' = %eax */
add %eax, %edx /* dst += x */
lea -155497632(%ecx,%r10d),%ecx /* Const + dst + ... */
mov 10*4(%rsi),%r10d /* (NEXT STEP) X[10] */
xor %ebx, %r11d /* z ^ ... */
xor %edx, %r11d /* x ^ ... */
add %r11d, %ecx /* dst += ... */
rol $16, %ecx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) y' = %edx */
add %edx, %ecx /* dst += x */
lea -1094730640(%ebx,%r10d),%ebx /* Const + dst + ... */
mov 13*4(%rsi),%r10d /* (NEXT STEP) X[13] */
xor %eax, %r11d /* z ^ ... */
xor %ecx, %r11d /* x ^ ... */
add %r11d, %ebx /* dst += ... */
rol $23, %ebx /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */
add %ecx, %ebx /* dst += x */
lea 681279174(%eax,%r10d),%eax /* Const + dst + ... */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
xor %edx, %r11d /* z ^ ... */
xor %ebx, %r11d /* x ^ ... */
add %r11d, %eax /* dst += ... */
rol $4, %eax /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) y' = %ebx */
add %ebx, %eax /* dst += x */
lea -358537222(%edx,%r10d),%edx /* Const + dst + ... */
mov 3*4(%rsi),%r10d /* (NEXT STEP) X[3] */
xor %ecx, %r11d /* z ^ ... */
xor %eax, %r11d /* x ^ ... */
add %r11d, %edx /* dst += ... */
rol $11, %edx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) y' = %eax */
add %eax, %edx /* dst += x */
lea -722521979(%ecx,%r10d),%ecx /* Const + dst + ... */
mov 6*4(%rsi),%r10d /* (NEXT STEP) X[6] */
xor %ebx, %r11d /* z ^ ... */
xor %edx, %r11d /* x ^ ... */
add %r11d, %ecx /* dst += ... */
rol $16, %ecx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) y' = %edx */
add %edx, %ecx /* dst += x */
lea 76029189(%ebx,%r10d),%ebx /* Const + dst + ... */
mov 9*4(%rsi),%r10d /* (NEXT STEP) X[9] */
xor %eax, %r11d /* z ^ ... */
xor %ecx, %r11d /* x ^ ... */
add %r11d, %ebx /* dst += ... */
rol $23, %ebx /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */
add %ecx, %ebx /* dst += x */
lea -640364487(%eax,%r10d),%eax /* Const + dst + ... */
mov 12*4(%rsi),%r10d /* (NEXT STEP) X[12] */
xor %edx, %r11d /* z ^ ... */
xor %ebx, %r11d /* x ^ ... */
add %r11d, %eax /* dst += ... */
rol $4, %eax /* dst <<< s */
mov %ebx, %r11d /* (NEXT STEP) y' = %ebx */
add %ebx, %eax /* dst += x */
lea -421815835(%edx,%r10d),%edx /* Const + dst + ... */
mov 15*4(%rsi),%r10d /* (NEXT STEP) X[15] */
xor %ecx, %r11d /* z ^ ... */
xor %eax, %r11d /* x ^ ... */
add %r11d, %edx /* dst += ... */
rol $11, %edx /* dst <<< s */
mov %eax, %r11d /* (NEXT STEP) y' = %eax */
add %eax, %edx /* dst += x */
lea 530742520(%ecx,%r10d),%ecx /* Const + dst + ... */
mov 2*4(%rsi),%r10d /* (NEXT STEP) X[2] */
xor %ebx, %r11d /* z ^ ... */
xor %edx, %r11d /* x ^ ... */
add %r11d, %ecx /* dst += ... */
rol $16, %ecx /* dst <<< s */
mov %edx, %r11d /* (NEXT STEP) y' = %edx */
add %edx, %ecx /* dst += x */
lea -995338651(%ebx,%r10d),%ebx /* Const + dst + ... */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
xor %eax, %r11d /* z ^ ... */
xor %ecx, %r11d /* x ^ ... */
add %r11d, %ebx /* dst += ... */
rol $23, %ebx /* dst <<< s */
mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */
add %ecx, %ebx /* dst += x */
mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */
mov $0xffffffff, %r11d
xor %edx, %r11d /* (NEXT STEP) not z' = not %edx*/
lea -198630844(%eax,%r10d),%eax /* Const + dst + ... */
or %ebx, %r11d /* x | ... */
xor %ecx, %r11d /* y ^ ... */
add %r11d, %eax /* dst += ... */
mov 7*4(%rsi),%r10d /* (NEXT STEP) X[7] */
mov $0xffffffff, %r11d
rol $6, %eax /* dst <<< s */
xor %ecx, %r11d /* (NEXT STEP) not z' = not %ecx */
add %ebx, %eax /* dst += x */
lea 1126891415(%edx,%r10d),%edx /* Const + dst + ... */
or %eax, %r11d /* x | ... */
xor %ebx, %r11d /* y ^ ... */
add %r11d, %edx /* dst += ... */
mov 14*4(%rsi),%r10d /* (NEXT STEP) X[14] */
mov $0xffffffff, %r11d
rol $10, %edx /* dst <<< s */
xor %ebx, %r11d /* (NEXT STEP) not z' = not %ebx */
add %eax, %edx /* dst += x */
lea -1416354905(%ecx,%r10d),%ecx /* Const + dst + ... */
or %edx, %r11d /* x | ... */
xor %eax, %r11d /* y ^ ... */
add %r11d, %ecx /* dst += ... */
mov 5*4(%rsi),%r10d /* (NEXT STEP) X[5] */
mov $0xffffffff, %r11d
rol $15, %ecx /* dst <<< s */
xor %eax, %r11d /* (NEXT STEP) not z' = not %eax */
add %edx, %ecx /* dst += x */
lea -57434055(%ebx,%r10d),%ebx /* Const + dst + ... */
or %ecx, %r11d /* x | ... */
xor %edx, %r11d /* y ^ ... */
add %r11d, %ebx /* dst += ... */
mov 12*4(%rsi),%r10d /* (NEXT STEP) X[12] */
mov $0xffffffff, %r11d
rol $21, %ebx /* dst <<< s */
xor %edx, %r11d /* (NEXT STEP) not z' = not %edx */
add %ecx, %ebx /* dst += x */
lea 1700485571(%eax,%r10d),%eax /* Const + dst + ... */
or %ebx, %r11d /* x | ... */
xor %ecx, %r11d /* y ^ ... */
add %r11d, %eax /* dst += ... */
mov 3*4(%rsi),%r10d /* (NEXT STEP) X[3] */
mov $0xffffffff, %r11d
rol $6, %eax /* dst <<< s */
xor %ecx, %r11d /* (NEXT STEP) not z' = not %ecx */
add %ebx, %eax /* dst += x */
lea -1894986606(%edx,%r10d),%edx /* Const + dst + ... */
or %eax, %r11d /* x | ... */
xor %ebx, %r11d /* y ^ ... */
add %r11d, %edx /* dst += ... */
mov 10*4(%rsi),%r10d /* (NEXT STEP) X[10] */
mov $0xffffffff, %r11d
rol $10, %edx /* dst <<< s */
xor %ebx, %r11d /* (NEXT STEP) not z' = not %ebx */
add %eax, %edx /* dst += x */
lea -1051523(%ecx,%r10d),%ecx /* Const + dst + ... */
or %edx, %r11d /* x | ... */
xor %eax, %r11d /* y ^ ... */
add %r11d, %ecx /* dst += ... */
mov 1*4(%rsi),%r10d /* (NEXT STEP) X[1] */
mov $0xffffffff, %r11d
rol $15, %ecx /* dst <<< s */
xor %eax, %r11d /* (NEXT STEP) not z' = not %eax */
add %edx, %ecx /* dst += x */
lea -2054922799(%ebx,%r10d),%ebx /* Const + dst + ... */
or %ecx, %r11d /* x | ... */
xor %edx, %r11d /* y ^ ... */
add %r11d, %ebx /* dst += ... */
mov 8*4(%rsi),%r10d /* (NEXT STEP) X[8] */
mov $0xffffffff, %r11d
rol $21, %ebx /* dst <<< s */
xor %edx, %r11d /* (NEXT STEP) not z' = not %edx */
add %ecx, %ebx /* dst += x */
lea 1873313359(%eax,%r10d),%eax /* Const + dst + ... */
or %ebx, %r11d /* x | ... */
xor %ecx, %r11d /* y ^ ... */
add %r11d, %eax /* dst += ... */
mov 15*4(%rsi),%r10d /* (NEXT STEP) X[15] */
mov $0xffffffff, %r11d
rol $6, %eax /* dst <<< s */
xor %ecx, %r11d /* (NEXT STEP) not z' = not %ecx */
add %ebx, %eax /* dst += x */
lea -30611744(%edx,%r10d),%edx /* Const + dst + ... */
or %eax, %r11d /* x | ... */
xor %ebx, %r11d /* y ^ ... */
add %r11d, %edx /* dst += ... */
mov 6*4(%rsi),%r10d /* (NEXT STEP) X[6] */
mov $0xffffffff, %r11d
rol $10, %edx /* dst <<< s */
xor %ebx, %r11d /* (NEXT STEP) not z' = not %ebx */
add %eax, %edx /* dst += x */
lea -1560198380(%ecx,%r10d),%ecx /* Const + dst + ... */
or %edx, %r11d /* x | ... */
xor %eax, %r11d /* y ^ ... */
add %r11d, %ecx /* dst += ... */
mov 13*4(%rsi),%r10d /* (NEXT STEP) X[13] */
mov $0xffffffff, %r11d
rol $15, %ecx /* dst <<< s */
xor %eax, %r11d /* (NEXT STEP) not z' = not %eax */
add %edx, %ecx /* dst += x */
lea 1309151649(%ebx,%r10d),%ebx /* Const + dst + ... */
or %ecx, %r11d /* x | ... */
xor %edx, %r11d /* y ^ ... */
add %r11d, %ebx /* dst += ... */
mov 4*4(%rsi),%r10d /* (NEXT STEP) X[4] */
mov $0xffffffff, %r11d
rol $21, %ebx /* dst <<< s */
xor %edx, %r11d /* (NEXT STEP) not z' = not %edx */
add %ecx, %ebx /* dst += x */
lea -145523070(%eax,%r10d),%eax /* Const + dst + ... */
or %ebx, %r11d /* x | ... */
xor %ecx, %r11d /* y ^ ... */
add %r11d, %eax /* dst += ... */
mov 11*4(%rsi),%r10d /* (NEXT STEP) X[11] */
mov $0xffffffff, %r11d
rol $6, %eax /* dst <<< s */
xor %ecx, %r11d /* (NEXT STEP) not z' = not %ecx */
add %ebx, %eax /* dst += x */
lea -1120210379(%edx,%r10d),%edx /* Const + dst + ... */
or %eax, %r11d /* x | ... */
xor %ebx, %r11d /* y ^ ... */
add %r11d, %edx /* dst += ... */
mov 2*4(%rsi),%r10d /* (NEXT STEP) X[2] */
mov $0xffffffff, %r11d
rol $10, %edx /* dst <<< s */
xor %ebx, %r11d /* (NEXT STEP) not z' = not %ebx */
add %eax, %edx /* dst += x */
lea 718787259(%ecx,%r10d),%ecx /* Const + dst + ... */
or %edx, %r11d /* x | ... */
xor %eax, %r11d /* y ^ ... */
add %r11d, %ecx /* dst += ... */
mov 9*4(%rsi),%r10d /* (NEXT STEP) X[9] */
mov $0xffffffff, %r11d
rol $15, %ecx /* dst <<< s */
xor %eax, %r11d /* (NEXT STEP) not z' = not %eax */
add %edx, %ecx /* dst += x */
lea -343485551(%ebx,%r10d),%ebx /* Const + dst + ... */
or %ecx, %r11d /* x | ... */
xor %edx, %r11d /* y ^ ... */
add %r11d, %ebx /* dst += ... */
mov 0*4(%rsi),%r10d /* (NEXT STEP) X[0] */
mov $0xffffffff, %r11d
rol $21, %ebx /* dst <<< s */
xor %edx, %r11d /* (NEXT STEP) not z' = not %edx */
add %ecx, %ebx /* dst += x */
# add old values of A, B, C, D
add %r8d, %eax
add %r9d, %ebx
add %r14d, %ecx
add %r15d, %edx
# loop control
add $64, %rsi # ptr += 64
cmp %rdi, %rsi # cmp end with ptr
jb 2b # jmp if ptr < end
# END of loop over 16-word blocks
1:
mov %eax, 0*4(%rbp) # ctx->A = A
mov %ebx, 1*4(%rbp) # ctx->B = B
mov %ecx, 2*4(%rbp) # ctx->C = C
mov %edx, 3*4(%rbp) # ctx->D = D
pop %r15
pop %r14
pop %r13 # not really useful (r13 is unused)
pop %r12
pop %rbx
pop %rbp
ret
#endif /* } USE_MD5_ASM */

323
lib/md5.c Normal file
View File

@@ -0,0 +1,323 @@
/*
* RFC 1321 compliant MD5 implementation
*
* Copyright (C) 2001-2003 Christophe Devine
* Copyright (C) 2007-2022 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#if !defined USE_OPENSSL || USE_MD5_ASM /* { */
void md5_begin(md_context *ctx)
{
ctx->A = 0x67452301;
ctx->B = 0xEFCDAB89;
ctx->C = 0x98BADCFE;
ctx->D = 0x10325476;
ctx->totalN = ctx->totalN2 = 0;
}
static void md5_process(md_context *ctx, const uchar data[CSUM_CHUNK])
{
uint32 X[16], A, B, C, D;
A = ctx->A;
B = ctx->B;
C = ctx->C;
D = ctx->D;
X[0] = IVALu(data, 0);
X[1] = IVALu(data, 4);
X[2] = IVALu(data, 8);
X[3] = IVALu(data, 12);
X[4] = IVALu(data, 16);
X[5] = IVALu(data, 20);
X[6] = IVALu(data, 24);
X[7] = IVALu(data, 28);
X[8] = IVALu(data, 32);
X[9] = IVALu(data, 36);
X[10] = IVALu(data, 40);
X[11] = IVALu(data, 44);
X[12] = IVALu(data, 48);
X[13] = IVALu(data, 52);
X[14] = IVALu(data, 56);
X[15] = IVALu(data, 60);
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n)))
#define P(a,b,c,d,k,s,t) a += F(b,c,d) + X[k] + t, a = S(a,s) + b
#define F(x,y,z) (z ^ (x & (y ^ z)))
P(A, B, C, D, 0, 7, 0xD76AA478);
P(D, A, B, C, 1, 12, 0xE8C7B756);
P(C, D, A, B, 2, 17, 0x242070DB);
P(B, C, D, A, 3, 22, 0xC1BDCEEE);
P(A, B, C, D, 4, 7, 0xF57C0FAF);
P(D, A, B, C, 5, 12, 0x4787C62A);
P(C, D, A, B, 6, 17, 0xA8304613);
P(B, C, D, A, 7, 22, 0xFD469501);
P(A, B, C, D, 8, 7, 0x698098D8);
P(D, A, B, C, 9, 12, 0x8B44F7AF);
P(C, D, A, B, 10, 17, 0xFFFF5BB1);
P(B, C, D, A, 11, 22, 0x895CD7BE);
P(A, B, C, D, 12, 7, 0x6B901122);
P(D, A, B, C, 13, 12, 0xFD987193);
P(C, D, A, B, 14, 17, 0xA679438E);
P(B, C, D, A, 15, 22, 0x49B40821);
#undef F
#define F(x,y,z) (y ^ (z & (x ^ y)))
P(A, B, C, D, 1, 5, 0xF61E2562);
P(D, A, B, C, 6, 9, 0xC040B340);
P(C, D, A, B, 11, 14, 0x265E5A51);
P(B, C, D, A, 0, 20, 0xE9B6C7AA);
P(A, B, C, D, 5, 5, 0xD62F105D);
P(D, A, B, C, 10, 9, 0x02441453);
P(C, D, A, B, 15, 14, 0xD8A1E681);
P(B, C, D, A, 4, 20, 0xE7D3FBC8);
P(A, B, C, D, 9, 5, 0x21E1CDE6);
P(D, A, B, C, 14, 9, 0xC33707D6);
P(C, D, A, B, 3, 14, 0xF4D50D87);
P(B, C, D, A, 8, 20, 0x455A14ED);
P(A, B, C, D, 13, 5, 0xA9E3E905);
P(D, A, B, C, 2, 9, 0xFCEFA3F8);
P(C, D, A, B, 7, 14, 0x676F02D9);
P(B, C, D, A, 12, 20, 0x8D2A4C8A);
#undef F
#define F(x,y,z) (x ^ y ^ z)
P(A, B, C, D, 5, 4, 0xFFFA3942);
P(D, A, B, C, 8, 11, 0x8771F681);
P(C, D, A, B, 11, 16, 0x6D9D6122);
P(B, C, D, A, 14, 23, 0xFDE5380C);
P(A, B, C, D, 1, 4, 0xA4BEEA44);
P(D, A, B, C, 4, 11, 0x4BDECFA9);
P(C, D, A, B, 7, 16, 0xF6BB4B60);
P(B, C, D, A, 10, 23, 0xBEBFBC70);
P(A, B, C, D, 13, 4, 0x289B7EC6);
P(D, A, B, C, 0, 11, 0xEAA127FA);
P(C, D, A, B, 3, 16, 0xD4EF3085);
P(B, C, D, A, 6, 23, 0x04881D05);
P(A, B, C, D, 9, 4, 0xD9D4D039);
P(D, A, B, C, 12, 11, 0xE6DB99E5);
P(C, D, A, B, 15, 16, 0x1FA27CF8);
P(B, C, D, A, 2, 23, 0xC4AC5665);
#undef F
#define F(x,y,z) (y ^ (x | ~z))
P(A, B, C, D, 0, 6, 0xF4292244);
P(D, A, B, C, 7, 10, 0x432AFF97);
P(C, D, A, B, 14, 15, 0xAB9423A7);
P(B, C, D, A, 5, 21, 0xFC93A039);
P(A, B, C, D, 12, 6, 0x655B59C3);
P(D, A, B, C, 3, 10, 0x8F0CCC92);
P(C, D, A, B, 10, 15, 0xFFEFF47D);
P(B, C, D, A, 1, 21, 0x85845DD1);
P(A, B, C, D, 8, 6, 0x6FA87E4F);
P(D, A, B, C, 15, 10, 0xFE2CE6E0);
P(C, D, A, B, 6, 15, 0xA3014314);
P(B, C, D, A, 13, 21, 0x4E0811A1);
P(A, B, C, D, 4, 6, 0xF7537E82);
P(D, A, B, C, 11, 10, 0xBD3AF235);
P(C, D, A, B, 2, 15, 0x2AD7D2BB);
P(B, C, D, A, 9, 21, 0xEB86D391);
#undef F
ctx->A += A;
ctx->B += B;
ctx->C += C;
ctx->D += D;
}
#ifdef USE_MD5_ASM
#if CSUM_CHUNK != 64
#error The MD5 ASM code does not support CSUM_CHUNK != 64
#endif
extern void md5_process_asm(md_context *ctx, const void *data, size_t num);
#endif
void md5_update(md_context *ctx, const uchar *input, uint32 length)
{
uint32 left, fill;
if (!length)
return;
left = ctx->totalN & 0x3F;
fill = CSUM_CHUNK - left;
ctx->totalN += length;
ctx->totalN &= 0xFFFFFFFF;
if (ctx->totalN < length)
ctx->totalN2++;
if (left && length >= fill) {
memcpy(ctx->buffer + left, input, fill);
md5_process(ctx, ctx->buffer);
length -= fill;
input += fill;
left = 0;
}
#ifdef USE_MD5_ASM /* { */
if (length >= CSUM_CHUNK) {
uint32 chunks = length / CSUM_CHUNK;
md5_process_asm(ctx, input, chunks);
length -= chunks * CSUM_CHUNK;
input += chunks * CSUM_CHUNK;
}
#else /* } { */
while (length >= CSUM_CHUNK) {
md5_process(ctx, input);
length -= CSUM_CHUNK;
input += CSUM_CHUNK;
}
#endif /* } */
if (length)
memcpy(ctx->buffer + left, input, length);
}
static uchar md5_padding[CSUM_CHUNK] = { 0x80 };
void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN])
{
uint32 last, padn;
uint32 high, low;
uchar msglen[8];
high = (ctx->totalN >> 29)
| (ctx->totalN2 << 3);
low = (ctx->totalN << 3);
SIVALu(msglen, 0, low);
SIVALu(msglen, 4, high);
last = ctx->totalN & 0x3F;
padn = last < 56 ? 56 - last : 120 - last;
md5_update(ctx, md5_padding, padn);
md5_update(ctx, msglen, 8);
SIVALu(digest, 0, ctx->A);
SIVALu(digest, 4, ctx->B);
SIVALu(digest, 8, ctx->C);
SIVALu(digest, 12, ctx->D);
}
#endif /* } */
#ifdef TEST_MD5 /* { */
void get_md5(uchar *out, const uchar *input, int n)
{
md_context ctx;
md5_begin(&ctx);
md5_update(&ctx, input, n);
md5_result(&ctx, out);
}
#include <stdlib.h>
#include <stdio.h>
/*
* those are the standard RFC 1321 test vectors
*/
static struct {
char *str, *md5;
} tests[] = {
{ "",
"d41d8cd98f00b204e9800998ecf8427e" },
{ "a",
"0cc175b9c0f1b6a831c399e269772661" },
{ "abc",
"900150983cd24fb0d6963f7d28e17f72" },
{ "message digest",
"f96b697d7cb7938d525a2f31aaf161d0" },
{ "abcdefghijklmnopqrstuvwxyz",
"c3fcd3d76192e4007dfb496cca67e13b" },
{ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
"d174ab98d277d9f5a5611c2c9f419d9f" },
{ "12345678901234567890123456789012345678901234567890123456789012345678901234567890",
"57edf4a22be3c955ac49da2e2107b67a" },
{ NULL, NULL }
};
int main(int argc, char *argv[])
{
FILE *f;
int i, j;
char output[33];
md_context ctx;
uchar buf[1000];
uchar md5sum[MD5_DIGEST_LEN];
if (argc < 2) {
printf("\nMD5 Validation Tests:\n\n");
for (i = 0; tests[i].str; i++) {
char *str = tests[i].str;
char *chk = tests[i].md5;
printf(" Test %d ", i + 1);
get_md5(md5sum, str, strlen(str));
for (j = 0; j < MD5_DIGEST_LEN; j++)
sprintf(output + j * 2, "%02x", md5sum[j]);
if (memcmp(output, chk, 32)) {
printf("failed!\n");
return 1;
}
printf("passed.\n");
}
printf("\n");
return 0;
}
while (--argc) {
if (!(f = fopen(*++argv, "rb"))) {
perror("fopen");
return 1;
}
md5_begin(&ctx);
while ((i = fread(buf, 1, sizeof buf, f)) > 0)
md5_update(&ctx, buf, i);
md5_result(&ctx, md5sum);
for (j = 0; j < MD5_DIGEST_LEN; j++)
printf("%02x", md5sum[j]);
printf(" %s\n", *argv);
}
return 0;
}
#endif /* } */

View File

@@ -1,126 +1,100 @@
/*
Unix SMB/Netbios implementation.
Version 1.9.
a implementation of MD4 designed for use in the SMB authentication protocol
Copyright (C) Andrew Tridgell 1997-1998.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
* Unix SMB/Netbios implementation.
* Version 1.9.
* An implementation of MD4 designed for use in the SMB authentication protocol.
*
* Copyright (C) 1997-1998 Andrew Tridgell
* Copyright (C) 2005-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
/* NOTE: This code makes no attempt to be fast!
*
* It assumes that a int is at least 32 bits long. */
It assumes that a int is at least 32 bits long
*/
static md_context *m;
static struct mdfour *m;
#define MASK32 (0xffffffff)
static inline uint32 F(uint32 X, uint32 Y, uint32 Z)
{
return (X&Y) | ((~X)&Z);
}
#define F(X,Y,Z) ((((X)&(Y)) | ((~(X))&(Z))))
#define G(X,Y,Z) ((((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z))))
#define H(X,Y,Z) (((X)^(Y)^(Z)))
#define lshift(x,s) (((((x)<<(s))&MASK32) | (((x)>>(32-(s)))&MASK32)))
static inline uint32 G(uint32 X, uint32 Y, uint32 Z)
{
return (X&Y) | (X&Z) | (Y&Z);
}
static inline uint32 H(uint32 X, uint32 Y, uint32 Z)
{
return X^Y^Z;
}
static inline uint32 lshift(uint32 x, int s)
{
#ifdef LARGE_INT32
x &= 0xFFFFFFFF;
return ((x<<s)&0xFFFFFFFF) | (x>>(32-s));
#else
return ((x<<s) | (x>>(32-s)));
#endif
}
#define ROUND1(a,b,c,d,k,s) a = lshift(a + F(b,c,d) + X[k], s)
#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + 0x5A827999,s)
#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + 0x6ED9EBA1,s)
#define ROUND1(a,b,c,d,k,s) a = lshift((a + F(b,c,d) + M[k])&MASK32, s)
#define ROUND2(a,b,c,d,k,s) a = lshift((a + G(b,c,d) + M[k] + 0x5A827999)&MASK32,s)
#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s)
/* this applies md4 to 64 byte chunks */
static void mdfour64(uint32 *M)
{
int j;
uint32 AA, BB, CC, DD;
uint32 X[16];
uint32 A,B,C,D;
for (j=0;j<16;j++)
X[j] = M[j];
A = m->A; B = m->B; C = m->C; D = m->D;
AA = A; BB = B; CC = C; DD = D;
ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7);
ROUND1(C,D,A,B, 2, 11); ROUND1(B,C,D,A, 3, 19);
ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7);
ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7);
ROUND1(C,D,A,B, 6, 11); ROUND1(B,C,D,A, 7, 19);
ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7);
ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7);
ROUND1(C,D,A,B, 10, 11); ROUND1(B,C,D,A, 11, 19);
ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7);
ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7);
ROUND1(C,D,A,B, 14, 11); ROUND1(B,C,D,A, 15, 19);
ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5);
ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5);
ROUND2(C,D,A,B, 8, 9); ROUND2(B,C,D,A, 12, 13);
ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5);
ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5);
ROUND2(C,D,A,B, 9, 9); ROUND2(B,C,D,A, 13, 13);
ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5);
ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5);
ROUND2(C,D,A,B, 10, 9); ROUND2(B,C,D,A, 14, 13);
ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5);
ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5);
ROUND2(C,D,A,B, 11, 9); ROUND2(B,C,D,A, 15, 13);
ROUND3(A,B,C,D, 0, 3); ROUND3(D,A,B,C, 8, 9);
ROUND3(C,D,A,B, 4, 11); ROUND3(B,C,D,A, 12, 15);
ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9);
ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9);
ROUND3(C,D,A,B, 6, 11); ROUND3(B,C,D,A, 14, 15);
ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9);
ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9);
ROUND3(C,D,A,B, 5, 11); ROUND3(B,C,D,A, 13, 15);
ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9);
ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9);
ROUND3(C,D,A,B, 7, 11); ROUND3(B,C,D,A, 15, 15);
A += AA; B += BB; C += CC; D += DD;
A += AA; B += BB;
C += CC; D += DD;
#ifdef LARGE_INT32
A &= 0xFFFFFFFF; B &= 0xFFFFFFFF;
C &= 0xFFFFFFFF; D &= 0xFFFFFFFF;
#endif
for (j=0;j<16;j++)
X[j] = 0;
A &= MASK32; B &= MASK32;
C &= MASK32; D &= MASK32;
m->A = A; m->B = B; m->C = C; m->D = D;
}
static void copy64(uint32 *M, unsigned char *in)
static void copy64(uint32 *M, const uchar *in)
{
int i;
for (i=0;i<16;i++)
M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) |
(in[i*4+1]<<8) | (in[i*4+0]<<0);
for (i = 0; i < MD4_DIGEST_LEN; i++) {
M[i] = (in[i*4+3] << 24) | (in[i*4+2] << 16)
| (in[i*4+1] << 8) | (in[i*4+0] << 0);
}
}
static void copy4(unsigned char *out,uint32 x)
static void copy4(uchar *out,uint32 x)
{
out[0] = x&0xFF;
out[1] = (x>>8)&0xFF;
@@ -128,36 +102,57 @@ static void copy4(unsigned char *out,uint32 x)
out[3] = (x>>24)&0xFF;
}
void mdfour_begin(struct mdfour *md)
void mdfour_begin(md_context *md)
{
md->A = 0x67452301;
md->B = 0xefcdab89;
md->C = 0x98badcfe;
md->D = 0x10325476;
md->totalN = 0;
md->totalN2 = 0;
}
static void mdfour_tail(unsigned char *in, int n)
static void mdfour_tail(const uchar *in, uint32 length)
{
unsigned char buf[128];
uchar buf[128];
uint32 M[16];
uint32 b;
extern int protocol_version;
m->totalN += n;
b = m->totalN * 8;
/*
* Count total number of bits, modulo 2^64
*/
m->totalN += length << 3;
if (m->totalN < (length << 3))
m->totalN2++;
m->totalN2 += length >> 29;
memset(buf, 0, 128);
if (n) memcpy(buf, in, n);
buf[n] = 0x80;
if (length)
memcpy(buf, in, length);
buf[length] = 0x80;
if (n <= 55) {
copy4(buf+56, b);
if (length <= 55) {
copy4(buf+56, m->totalN);
/*
* Prior to protocol version 27 only the number of bits
* modulo 2^32 was included. MD4 requires the number
* of bits modulo 2^64, which was fixed starting with
* protocol version 27.
*/
if (protocol_version >= 27)
copy4(buf+60, m->totalN2);
copy64(M, buf);
mdfour64(M);
} else {
copy4(buf+120, b);
copy4(buf+120, m->totalN);
/*
* Prior to protocol version 27 only the number of bits
* modulo 2^32 was included. MD4 requires the number
* of bits modulo 2^64, which was fixed starting with
* protocol version 27.
*/
if (protocol_version >= 27)
copy4(buf+124, m->totalN2);
copy64(M, buf);
mdfour64(M);
copy64(M, buf+64);
@@ -165,52 +160,57 @@ static void mdfour_tail(unsigned char *in, int n)
}
}
void mdfour_update(struct mdfour *md, unsigned char *in, int n)
void mdfour_update(md_context *md, const uchar *in, uint32 length)
{
uint32 M[16];
if (n == 0) mdfour_tail(in, n);
m = md;
while (n >= 64) {
if (length == 0)
mdfour_tail(in, length);
while (length >= 64) {
copy64(M, in);
mdfour64(M);
in += 64;
n -= 64;
m->totalN += 64;
length -= 64;
m->totalN += 64 << 3;
if (m->totalN < 64 << 3)
m->totalN2++;
}
if (n) mdfour_tail(in, n);
if (length)
mdfour_tail(in, length);
}
void mdfour_result(struct mdfour *md, unsigned char *out)
void mdfour_result(md_context *md, uchar digest[MD4_DIGEST_LEN])
{
m = md;
copy4(out, m->A);
copy4(out+4, m->B);
copy4(out+8, m->C);
copy4(out+12, m->D);
}
void mdfour(unsigned char *out, unsigned char *in, int n)
{
struct mdfour md;
mdfour_begin(&md);
mdfour_update(&md, in, n);
mdfour_result(&md, out);
copy4(digest, m->A);
copy4(digest+4, m->B);
copy4(digest+8, m->C);
copy4(digest+12, m->D);
}
#ifdef TEST_MDFOUR
void mdfour(uchar digest[MD4_DIGEST_LEN], uchar *in, int length)
{
md_context md;
mdfour_begin(&md);
mdfour_update(&md, in, length);
mdfour_result(&md, digest);
}
int protocol_version = 28;
static void file_checksum1(char *fname)
{
int fd, i;
struct mdfour md;
unsigned char buf[64], sum[16];
int fd, i, was_multiple_of_64 = 1;
md_context md;
uchar buf[64*1024], sum[MD4_DIGEST_LEN];
fd = open(fname,O_RDONLY);
if (fd == -1) {
perror("fname");
@@ -220,59 +220,28 @@ static void file_checksum1(char *fname)
mdfour_begin(&md);
while (1) {
int n = read(fd, buf, sizeof(buf));
if (n <= 0) break;
int n = read(fd, buf, sizeof buf);
if (n <= 0)
break;
was_multiple_of_64 = !(n % 64);
mdfour_update(&md, buf, n);
}
if (was_multiple_of_64 && protocol_version >= 27)
mdfour_update(&md, buf, 0);
close(fd);
mdfour_result(&md, sum);
for (i=0;i<16;i++)
printf("%02X", sum[i]);
printf("\n");
}
#include "../md4.h"
static void file_checksum2(char *fname)
{
int fd, i;
MDstruct md;
unsigned char buf[64], sum[16];
fd = open(fname,O_RDONLY);
if (fd == -1) {
perror("fname");
exit(1);
}
MDbegin(&md);
while (1) {
int n = read(fd, buf, sizeof(buf));
if (n <= 0) break;
MDupdate(&md, buf, n*8);
}
if (!md.done) {
MDupdate(&md, buf, 0);
}
close(fd);
memcpy(sum, md.buffer, 16);
for (i=0;i<16;i++)
for (i = 0; i < MD4_DIGEST_LEN; i++)
printf("%02X", sum[i]);
printf("\n");
}
int main(int argc, char *argv[])
{
file_checksum1(argv[1]);
file_checksum2(argv[1]);
while (--argc)
file_checksum1(*++argv);
return 0;
}
#endif

View File

@@ -1,34 +0,0 @@
/*
Unix SMB/Netbios implementation.
Version 1.9.
a implementation of MD4 designed for use in the SMB authentication protocol
Copyright (C) Andrew Tridgell 1997-1998.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
struct mdfour {
uint32 A, B, C, D;
uint32 totalN;
};
void mdfour_begin(struct mdfour *md);
void mdfour_update(struct mdfour *md, unsigned char *in, int n);
void mdfour_result(struct mdfour *md, unsigned char *out);
void mdfour(unsigned char *out, unsigned char *in, int n);

30
lib/mdigest.h Normal file
View File

@@ -0,0 +1,30 @@
/* The include file for both the MD4 and MD5 routines. */
#ifdef USE_OPENSSL
#include "openssl/md4.h"
#include "openssl/md5.h"
#endif
#include "md-defines.h"
typedef struct {
uint32 A, B, C, D;
uint32 totalN; /* bit count, lower 32 bits */
uint32 totalN2; /* bit count, upper 32 bits */
uchar buffer[CSUM_CHUNK];
} md_context;
void mdfour_begin(md_context *md);
void mdfour_update(md_context *md, const uchar *in, uint32 length);
void mdfour_result(md_context *md, uchar digest[MD4_DIGEST_LEN]);
#if defined USE_OPENSSL && !defined USE_MD5_ASM
#define md5_context MD5_CTX
#define md5_begin MD5_Init
#define md5_update MD5_Update
#define md5_result(cptr, digest) MD5_Final(digest, cptr)
#else
#define md5_context md_context
void md5_begin(md_context *ctx);
void md5_update(md_context *ctx, const uchar *input, uint32 length);
void md5_result(md_context *ctx, uchar digest[MD5_DIGEST_LEN]);
#endif

65
lib/permstring.c Normal file
View File

@@ -0,0 +1,65 @@
/*
* A single utility routine.
*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2001 Martin Pool <mbp@samba.org>
* Copyright (C) 2003-2019 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
/* Produce a string representation of Unix mode bits like that used by ls(1).
* The "buf" buffer must be at least 11 characters. */
void permstring(char *perms, mode_t mode)
{
static const char *perm_map = "rwxrwxrwx";
int i;
strlcpy(perms, "----------", 11);
for (i = 0; i < 9; i++) {
if (mode & (1 << i))
perms[9-i] = perm_map[8-i];
}
/* Handle setuid/sticky bits. You might think the indices are
* off by one, but remember there's a type char at the
* start. */
if (mode & S_ISUID)
perms[3] = (mode & S_IXUSR) ? 's' : 'S';
if (mode & S_ISGID)
perms[6] = (mode & S_IXGRP) ? 's' : 'S';
#ifdef S_ISVTX
if (mode & S_ISVTX)
perms[9] = (mode & S_IXOTH) ? 't' : 'T';
#endif
if (S_ISDIR(mode))
perms[0] = 'd';
else if (S_ISLNK(mode))
perms[0] = 'l';
else if (S_ISBLK(mode))
perms[0] = 'b';
else if (S_ISCHR(mode))
perms[0] = 'c';
else if (S_ISSOCK(mode))
perms[0] = 's';
else if (S_ISFIFO(mode))
perms[0] = 'p';
}

3
lib/permstring.h Normal file
View File

@@ -0,0 +1,3 @@
#define PERMSTRING_SIZE 11
void permstring(char *perms, mode_t mode);

268
lib/pool_alloc.3 Normal file
View File

@@ -0,0 +1,268 @@
.ds d \-\^\-
.ds o \fR[\fP
.ds c \fR]\fP
.ds | \fR|\fP
.de D
\\.B \*d\\$1
..
.de DI
\\.BI \*d\\$1 \\$2
..
.de DR
\\.BR \*d\\$1 \\$2
..
.de Di
\\.BI \*d\\$1 " \\$2"
..
.de Db
\\.B \*d\\$1 " \\$2"
..
.de Df
\\.B \*d\*ono\*c\\$1
..
.de See
See \fB\\$1\fP for details.
..
.de SeeIn
See \fB\\$1\fP in \fB\\$2\fP for details.
..
.TH POOL_ALLOC 3
.SH NAME
pool_alloc, pool_free, pool_free_old, pool_talloc, pool_tfree, pool_create, pool_destroy, pool_boundary
\- Allocate and free memory in managed allocation pools.
.SH SYNOPSIS
.B #include "pool_alloc.h"
\fBstruct alloc_pool *pool_create(size_t \fIsize\fB, size_t \fIquantum\fB, void (*\fIbomb\fB)(char*,char*,int), int \fIflags\fB);
\fBvoid pool_destroy(struct alloc_pool *\fIpool\fB);
\fBvoid *pool_alloc(struct alloc_pool *\fIpool\fB, size_t \fIsize\fB, char *\fImsg\fB);
\fBvoid pool_free(struct alloc_pool *\fIpool\fB, size_t \fIsize\fB, void *\fIaddr\fB);
\fBvoid pool_free_old(struct alloc_pool *\fIpool\fB, void *\fIaddr\fB);
\fBvoid *pool_talloc(struct alloc_pool *\fIpool\fB, \fItype\fB), int \fIcount\fB, char *\fImsg\fB);
\fBvoid pool_tfree(struct alloc_pool *\fIpool\fB, \fItype\fB, int \fIcount\fB, void *\fIaddr\fB);
\fBvoid pool_boundary(struct alloc_pool *\fIpool\fB, sise_t \fIsize\fB);
.SH DESCRIPTION
.P
The pool allocation routines use
.B malloc()
for underlying memory management.
What allocation pools do is cause memory within a given pool
to be allocated in large contiguous blocks
(called extents) that will be reusable when freed. Unlike
.BR malloc() ,
the allocations are not managed individually.
Instead, each extent tracks the total free memory within the
extent. Each extent can either be used to allocate memory
or to manage the freeing of memory within that extent.
When an extent has less free memory than a given
allocation request, the current extent ceases to be used
for allocation. See also the
.B pool_boundary()
function.
.P
This form of memory management is suited to large numbers of small
related allocations that are held for a while
and then freed as a group.
Because the
underlying allocations are done in large contiguous extents,
when an extent is freed, it can release a large enough
contiguous block of memory to allow the memory to be returned
to the OS for use by whatever program needs it.
You can allocate from one or more memory pools and/or
.B malloc()
all at the same time without interfering with how pools work.
.P
.B pool_create()
Creates an allocation pool for subsequent calls to the pool
allocation functions.
When an extent is created for allocations it will be
.I size
bytes.
Allocations from the pool have their sizes rounded up to a
multiple of
.I quantum
bytes in length.
Specifying
.B 0
for
.I quantum
will produce a quantum that should meet maximal alignment
on most platforms.
Unless
.B POOL_NO_QALIGN
is set in the
.IR flags ,
allocations will be aligned to addresses that are a
multiple of
.IR quantum .
A
.B NULL
may be specified for the
.I bomb
function pointer if it is not needed. (See the
.B pool_alloc()
function for how it is used.)
If
.B POOL_CLEAR
is set in the
.IR flags ,
all allocations from the pool will be initialized to zeros.
If either
.B POOL_PREPEND
or
.B POOL_INTERN
is specified in the
.IR flags ,
each extent's data structure will be allocated at the start of the
.IR size -length
buffer (rather than as a separate, non-pool allocation), with the
former extending the
.I size
to hold the structure, and the latter subtracting the structure's
length from the indicated
.IR size .
.P
.B pool_destroy()
destroys an allocation
.I pool
and frees all its associated memory.
.P
.B pool_alloc()
allocates
.I size
bytes from the specified
.IR pool .
If
.I size
is
.BR 0 ,
.I quantum
bytes will be allocated.
If the pool has been created without
.BR POOL_NO_QALIGN ,
every chunk of memory that is returned will be suitably aligned.
You can use this with the default
.I quantum
size to ensure that all memory can store a variable of any type.
If the requested memory cannot be allocated, the
.I bomb()
function will be called with
.I msg
as its sole argument (if the function was defined at the time
the pool was created), and then a
.B NULL
address is returned (assuming that the bomb function didn't exit).
.P
.B pool_free()
frees
.I size
bytes pointed to by an
.I addr
that was previously allocated in the specified
.IR pool .
If
.I size
is
.BR 0 ,
.I quantum
bytes will be freed.
The memory freed within an extent will not be reusable until
all of the memory in that extent has been freed with one
exception: the most recent pool allocation may be freed back
into the pool prior to making any further allocations.
If enough free calls are made to indicate that an extent has no
remaining allocated objects (as computed by the total freed size for
an extent), its memory will be completely freed back to the system.
If
.I addr
is
.BR NULL ,
no memory will be freed, but subsequent allocations will come
from a new extent.
.P
.B pool_free_old()
takes a boundary
.I addr
value that was returned by
.B pool_boundary()
and frees up any extents in the
.I pool
that have data allocated from that point backward in time.
NOTE: you must NOT mix calls to both
.B pool_free
and
.B pool_free_old
on the same pool!
.P
.B pool_boundary()
asks for a boundary value that can be sent to
.B pool_free_old()
at a later time to free up all memory allocated prior to a particular
moment in time.
If the extent that holds the boundary point has allocations from after the
boundary point, it will not be freed until a future
.B pool_free_old()
call encompasses the entirety of the extent's data.
If
.I len
is non-zero, the call will also check if the active extent has at least
that much free memory available in it, and if not, it will mark the
extent as inactive, forcing a new extent to be used for future allocations.
(You can specify -1 for
.I len
if you want to force a new extent to start.)
.P
.B pool_talloc()
is a macro that takes a
.I type
and a
.I count
instead of a
.IR size .
It casts the return value to the correct pointer type.
.P
.B pool_tfree
is a macro that calls
.B pool_free
on memory that was allocated by
.BR pool_talloc() .
.SH RETURN VALUE
.B pool_create()
returns a pointer to
.BR "struct alloc_pool" .
.P
.B pool_alloc()
and
.B pool_talloc()
return pointers to the allocated memory,
or NULL if the request fails.
The return type of
.B pool_alloc()
will normally require casting to the desired type but
.B pool_talloc()
will returns a pointer of the requested
.IR type .
.P
.B pool_boundary()
returns a pointer that should only be used in a call to
.BR pool_free_old() .
.P
.BR pool_free() ,
.BR pool_free_old() ,
.B pool_tfree()
and
.B pool_destroy()
return no value.
.SH SEE ALSO
.nf
malloc(3)
.SH AUTHOR
pool_alloc was created by J.W. Schultz of Pegasystems Technologies.
.SH BUGS AND ISSUES

375
lib/pool_alloc.c Normal file
View File

@@ -0,0 +1,375 @@
#include "rsync.h"
#define POOL_DEF_EXTENT (32 * 1024)
#define POOL_QALIGN_P2 (1<<16) /* power-of-2 qalign */
struct alloc_pool
{
size_t size; /* extent size */
size_t quantum; /* allocation quantum */
struct pool_extent *extents; /* top extent is "live" */
void (*bomb)(); /* called if malloc fails */
int flags;
/* statistical data */
unsigned long e_created; /* extents created */
unsigned long e_freed; /* extents destroyed */
int64 n_allocated; /* calls to alloc */
int64 n_freed; /* calls to free */
int64 b_allocated; /* cum. bytes allocated */
int64 b_freed; /* cum. bytes freed */
};
struct pool_extent
{
struct pool_extent *next;
void *start; /* starting address */
size_t free; /* free bytecount */
size_t bound; /* trapped free bytes */
};
struct align_test {
uchar foo;
union {
int64 i;
void *p;
} bar;
};
#define MINALIGN offsetof(struct align_test, bar)
/* Temporarily cast a void* var into a char* var when adding an offset (to
* keep some compilers from complaining about the pointer arithmetic). */
#define PTR_ADD(b,o) ( (void*) ((char*)(b) + (o)) )
alloc_pool_t
pool_create(size_t size, size_t quantum, void (*bomb)(const char*, const char*, int), int flags)
{
struct alloc_pool *pool;
if ((MINALIGN & (MINALIGN - 1)) != (0)) {
if (bomb)
(*bomb)("Compiler error: MINALIGN is not a power of 2", __FILE__, __LINE__);
return NULL;
}
if (!(pool = new0(struct alloc_pool)))
return NULL;
if (!size)
size = POOL_DEF_EXTENT;
if (!quantum)
quantum = MINALIGN;
if (flags & POOL_INTERN) {
if (size <= sizeof (struct pool_extent))
size = quantum;
else
size -= sizeof (struct pool_extent);
flags |= POOL_PREPEND;
}
if (quantum <= 1)
flags = (flags | POOL_NO_QALIGN) & ~POOL_QALIGN_P2;
else if (!(flags & POOL_NO_QALIGN)) {
if (size % quantum)
size += quantum - size % quantum;
/* If quantum is a power of 2, we'll avoid using modulus. */
if (!(quantum & (quantum - 1)))
flags |= POOL_QALIGN_P2;
}
pool->size = size;
pool->quantum = quantum;
pool->bomb = bomb;
pool->flags = flags;
return pool;
}
void
pool_destroy(alloc_pool_t p)
{
struct alloc_pool *pool = (struct alloc_pool *) p;
struct pool_extent *cur, *next;
if (!pool)
return;
for (cur = pool->extents; cur; cur = next) {
next = cur->next;
if (pool->flags & POOL_PREPEND)
free(PTR_ADD(cur->start, -sizeof (struct pool_extent)));
else {
free(cur->start);
free(cur);
}
}
free(pool);
}
void *
pool_alloc(alloc_pool_t p, size_t len, const char *bomb_msg)
{
struct alloc_pool *pool = (struct alloc_pool *) p;
if (!pool)
return NULL;
if (!len)
len = pool->quantum;
else if (pool->flags & POOL_QALIGN_P2) {
if (len & (pool->quantum - 1))
len += pool->quantum - (len & (pool->quantum - 1));
} else if (!(pool->flags & POOL_NO_QALIGN)) {
if (len % pool->quantum)
len += pool->quantum - len % pool->quantum;
}
if (len > pool->size)
goto bomb_out;
if (!pool->extents || len > pool->extents->free) {
void *start;
size_t asize;
struct pool_extent *ext;
asize = pool->size;
if (pool->flags & POOL_PREPEND)
asize += sizeof (struct pool_extent);
if (!(start = new_array(char, asize)))
goto bomb_out;
if (pool->flags & POOL_CLEAR)
memset(start, 0, asize);
if (pool->flags & POOL_PREPEND) {
ext = start;
start = PTR_ADD(start, sizeof (struct pool_extent));
} else if (!(ext = new(struct pool_extent)))
goto bomb_out;
ext->start = start;
ext->free = pool->size;
ext->bound = 0;
ext->next = pool->extents;
pool->extents = ext;
pool->e_created++;
}
pool->n_allocated++;
pool->b_allocated += len;
pool->extents->free -= len;
return PTR_ADD(pool->extents->start, pool->extents->free);
bomb_out:
if (pool->bomb)
(*pool->bomb)(bomb_msg, __FILE__, __LINE__);
return NULL;
}
/* This function allows you to declare memory in the pool that you are done
* using. If you free all the memory in a pool's extent, that extent will
* be freed. */
void
pool_free(alloc_pool_t p, size_t len, void *addr)
{
struct alloc_pool *pool = (struct alloc_pool *)p;
struct pool_extent *cur, *prev;
if (!pool)
return;
if (!addr) {
/* A NULL addr starts a fresh extent for new allocations. */
if ((cur = pool->extents) != NULL && cur->free != pool->size) {
cur->bound += cur->free;
cur->free = 0;
}
return;
}
if (!len)
len = pool->quantum;
else if (pool->flags & POOL_QALIGN_P2) {
if (len & (pool->quantum - 1))
len += pool->quantum - (len & (pool->quantum - 1));
} else if (!(pool->flags & POOL_NO_QALIGN)) {
if (len % pool->quantum)
len += pool->quantum - len % pool->quantum;
}
pool->n_freed++;
pool->b_freed += len;
for (prev = NULL, cur = pool->extents; cur; prev = cur, cur = cur->next) {
if (addr >= cur->start
&& addr < PTR_ADD(cur->start, pool->size))
break;
}
if (!cur)
return;
if (!prev) {
/* The "live" extent is kept ready for more allocations. */
if (cur->free + cur->bound + len >= pool->size) {
if (pool->flags & POOL_CLEAR) {
memset(PTR_ADD(cur->start, cur->free), 0,
pool->size - cur->free);
}
cur->free = pool->size;
cur->bound = 0;
} else if (addr == PTR_ADD(cur->start, cur->free)) {
if (pool->flags & POOL_CLEAR)
memset(addr, 0, len);
cur->free += len;
} else
cur->bound += len;
} else {
cur->bound += len;
if (cur->free + cur->bound >= pool->size) {
prev->next = cur->next;
if (pool->flags & POOL_PREPEND)
free(PTR_ADD(cur->start, -sizeof (struct pool_extent)));
else {
free(cur->start);
free(cur);
}
pool->e_freed++;
} else if (prev != pool->extents) {
/* Move the extent to be the first non-live extent. */
prev->next = cur->next;
cur->next = pool->extents->next;
pool->extents->next = cur;
}
}
}
/* This allows you to declare that the given address marks the edge of some
* pool memory that is no longer needed. Any extents that hold only data
* older than the boundary address are freed. NOTE: You MUST NOT USE BOTH
* pool_free() and pool_free_old() on the same pool!! */
void
pool_free_old(alloc_pool_t p, void *addr)
{
struct alloc_pool *pool = (struct alloc_pool *)p;
struct pool_extent *cur, *prev, *next;
if (!pool || !addr)
return;
for (prev = NULL, cur = pool->extents; cur; prev = cur, cur = cur->next) {
if (addr >= cur->start
&& addr < PTR_ADD(cur->start, pool->size))
break;
}
if (!cur)
return;
if (addr == PTR_ADD(cur->start, cur->free)) {
if (prev) {
prev->next = NULL;
next = cur;
} else {
/* The most recent live extent can just be reset. */
if (pool->flags & POOL_CLEAR)
memset(addr, 0, pool->size - cur->free);
cur->free = pool->size;
cur->bound = 0;
next = cur->next;
cur->next = NULL;
}
} else {
next = cur->next;
cur->next = NULL;
}
while ((cur = next) != NULL) {
next = cur->next;
if (pool->flags & POOL_PREPEND)
free(PTR_ADD(cur->start, -sizeof (struct pool_extent)));
else {
free(cur->start);
free(cur);
}
pool->e_freed++;
}
}
/* If the current extent doesn't have "len" free space in it, mark it as full
* so that the next alloc will start a new extent. If len is (size_t)-1, this
* bump will always occur. The function returns a boundary address that can
* be used with pool_free_old(), or a NULL if no memory is allocated. */
void *
pool_boundary(alloc_pool_t p, size_t len)
{
struct alloc_pool *pool = (struct alloc_pool *)p;
struct pool_extent *cur;
if (!pool || !pool->extents)
return NULL;
cur = pool->extents;
if (cur->free < len) {
cur->bound += cur->free;
cur->free = 0;
}
return PTR_ADD(cur->start, cur->free);
}
#define FDPRINT(label, value) \
do { \
int len = snprintf(buf, sizeof buf, label, value); \
if (write(fd, buf, len) != len) \
ret = -1; \
} while (0)
#define FDEXTSTAT(ext) \
do { \
int len = snprintf(buf, sizeof buf, " %12ld %5ld\n", \
(long)ext->free, (long)ext->bound); \
if (write(fd, buf, len) != len) \
ret = -1; \
} while (0)
int
pool_stats(alloc_pool_t p, int fd, int summarize)
{
struct alloc_pool *pool = (struct alloc_pool *) p;
struct pool_extent *cur;
char buf[BUFSIZ];
int ret = 0;
if (!pool)
return ret;
FDPRINT(" Extent size: %12ld\n", (long) pool->size);
FDPRINT(" Alloc quantum: %12ld\n", (long) pool->quantum);
FDPRINT(" Extents created: %12ld\n", pool->e_created);
FDPRINT(" Extents freed: %12ld\n", pool->e_freed);
FDPRINT(" Alloc count: %12.0f\n", (double) pool->n_allocated);
FDPRINT(" Free Count: %12.0f\n", (double) pool->n_freed);
FDPRINT(" Bytes allocated: %12.0f\n", (double) pool->b_allocated);
FDPRINT(" Bytes freed: %12.0f\n", (double) pool->b_freed);
if (summarize)
return ret;
if (!pool->extents)
return ret;
if (write(fd, "\n", 1) != 1)
ret = -1;
for (cur = pool->extents; cur; cur = cur->next)
FDEXTSTAT(cur);
return ret;
}

21
lib/pool_alloc.h Normal file
View File

@@ -0,0 +1,21 @@
#include <stddef.h>
#define POOL_CLEAR (1<<0) /* zero fill allocations */
#define POOL_NO_QALIGN (1<<1) /* don't align data to quanta */
#define POOL_INTERN (1<<2) /* Allocate extent structures */
#define POOL_PREPEND (1<<3) /* or prepend to extent data */
typedef void *alloc_pool_t;
alloc_pool_t pool_create(size_t size, size_t quantum, void (*bomb)(const char*, const char*, int), int flags);
void pool_destroy(alloc_pool_t pool);
void *pool_alloc(alloc_pool_t pool, size_t size, const char *bomb_msg);
void pool_free(alloc_pool_t pool, size_t size, void *addr);
void pool_free_old(alloc_pool_t pool, void *addr);
void *pool_boundary(alloc_pool_t pool, size_t size);
#define pool_talloc(pool, type, count, bomb_msg) \
((type *)pool_alloc(pool, sizeof(type) * count, bomb_msg))
#define pool_tfree(pool, type, count, addr) \
(pool_free(pool, sizeof(type) * count, addr))

View File

File diff suppressed because it is too large Load Diff

2802
lib/sysacls.c Normal file
View File

File diff suppressed because it is too large Load Diff

307
lib/sysacls.h Normal file
View File

@@ -0,0 +1,307 @@
/*
* Unix SMB/Netbios implementation.
* Version 2.2.x
* Portable SMB ACL interface
* Copyright (C) Jeremy Allison 2000
* Copyright (C) 2007-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* with this program; if not, visit the http://fsf.org website.
*/
#ifdef SUPPORT_ACLS
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
#endif
#ifdef HAVE_ACL_LIBACL_H
#include <acl/libacl.h>
#endif
#define SMB_MALLOC(cnt) new_array(char, cnt)
#define SMB_MALLOC_P(obj) new_array(obj, 1)
#define SMB_MALLOC_ARRAY(obj, cnt) new_array(obj, cnt)
#define SMB_REALLOC(mem, cnt) realloc_array(mem, char, cnt)
#define slprintf snprintf
#if defined HAVE_POSIX_ACLS /*-----------------------------------------------*/
/* This is an identity mapping (just remove the SMB_). */
#define SMB_ACL_TAG_T acl_tag_t
#define SMB_ACL_TYPE_T acl_type_t
/* Types of ACLs. */
#define SMB_ACL_USER ACL_USER
#define SMB_ACL_USER_OBJ ACL_USER_OBJ
#define SMB_ACL_GROUP ACL_GROUP
#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
#define SMB_ACL_OTHER ACL_OTHER
#define SMB_ACL_MASK ACL_MASK
#define SMB_ACL_T acl_t
#define SMB_ACL_ENTRY_T acl_entry_t
#define SMB_ACL_FIRST_ENTRY ACL_FIRST_ENTRY
#define SMB_ACL_NEXT_ENTRY ACL_NEXT_ENTRY
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#elif defined HAVE_TRU64_ACLS /*---------------------------------------------*/
/* This is for DEC/Compaq Tru64 UNIX */
#define SMB_ACL_TAG_T acl_tag_t
#define SMB_ACL_TYPE_T acl_type_t
/* Types of ACLs. */
#define SMB_ACL_USER ACL_USER
#define SMB_ACL_USER_OBJ ACL_USER_OBJ
#define SMB_ACL_GROUP ACL_GROUP
#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
#define SMB_ACL_OTHER ACL_OTHER
#define SMB_ACL_MASK ACL_MASK
#define SMB_ACL_T acl_t
#define SMB_ACL_ENTRY_T acl_entry_t
#define SMB_ACL_FIRST_ENTRY 0
#define SMB_ACL_NEXT_ENTRY 1
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#elif defined HAVE_UNIXWARE_ACLS || defined HAVE_SOLARIS_ACLS /*-------------*/
/* Donated by Michael Davidson <md@sco.COM> for UnixWare / OpenUNIX.
* Modified by Toomas Soome <tsoome@ut.ee> for Solaris. */
/* SVR4.2 ES/MP ACLs */
typedef int SMB_ACL_TAG_T;
typedef int SMB_ACL_TYPE_T;
/* Types of ACLs. */
#define SMB_ACL_USER USER
#define SMB_ACL_USER_OBJ USER_OBJ
#define SMB_ACL_GROUP GROUP
#define SMB_ACL_GROUP_OBJ GROUP_OBJ
#define SMB_ACL_OTHER OTHER_OBJ
#define SMB_ACL_MASK CLASS_OBJ
typedef struct SMB_ACL_T {
int size;
int count;
int next;
struct acl acl[1];
} *SMB_ACL_T;
typedef struct acl *SMB_ACL_ENTRY_T;
#define SMB_ACL_FIRST_ENTRY 0
#define SMB_ACL_NEXT_ENTRY 1
#define SMB_ACL_TYPE_ACCESS 0
#define SMB_ACL_TYPE_DEFAULT 1
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#ifdef __CYGWIN__
#define SMB_ACL_LOSES_SPECIAL_MODE_BITS
#endif
#elif defined HAVE_HPUX_ACLS /*----------------------------------------------*/
/* Based on the Solaris & UnixWare code. */
#ifndef __TANDEM
#undef GROUP
#endif
#include <sys/aclv.h>
/* SVR4.2 ES/MP ACLs */
typedef int SMB_ACL_TAG_T;
typedef int SMB_ACL_TYPE_T;
/* Types of ACLs. */
#define SMB_ACL_USER USER
#define SMB_ACL_USER_OBJ USER_OBJ
#define SMB_ACL_GROUP GROUP
#define SMB_ACL_GROUP_OBJ GROUP_OBJ
#define SMB_ACL_OTHER OTHER_OBJ
#define SMB_ACL_MASK CLASS_OBJ
typedef struct SMB_ACL_T {
int size;
int count;
int next;
struct acl acl[1];
} *SMB_ACL_T;
typedef struct acl *SMB_ACL_ENTRY_T;
#define SMB_ACL_FIRST_ENTRY 0
#define SMB_ACL_NEXT_ENTRY 1
#define SMB_ACL_TYPE_ACCESS 0
#define SMB_ACL_TYPE_DEFAULT 1
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#elif defined HAVE_IRIX_ACLS /*----------------------------------------------*/
/* IRIX ACLs */
#define SMB_ACL_TAG_T acl_tag_t
#define SMB_ACL_TYPE_T acl_type_t
/* Types of ACLs. */
#define SMB_ACL_USER ACL_USER
#define SMB_ACL_USER_OBJ ACL_USER_OBJ
#define SMB_ACL_GROUP ACL_GROUP
#define SMB_ACL_GROUP_OBJ ACL_GROUP_OBJ
#define SMB_ACL_OTHER ACL_OTHER_OBJ
#define SMB_ACL_MASK ACL_MASK
typedef struct SMB_ACL_T {
int next;
BOOL freeaclp;
struct acl *aclp;
} *SMB_ACL_T;
#define SMB_ACL_ENTRY_T acl_entry_t
#define SMB_ACL_FIRST_ENTRY 0
#define SMB_ACL_NEXT_ENTRY 1
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_ACCESS
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#elif defined HAVE_AIX_ACLS /*-----------------------------------------------*/
/* Donated by Medha Date, mdate@austin.ibm.com, for IBM */
#include "/usr/include/acl.h"
struct acl_entry_link{
struct acl_entry_link *prevp;
struct new_acl_entry *entryp;
struct acl_entry_link *nextp;
int count;
};
struct new_acl_entry{
unsigned short ace_len;
unsigned short ace_type;
unsigned int ace_access;
struct ace_id ace_id[1];
};
#define SMB_ACL_ENTRY_T struct new_acl_entry*
#define SMB_ACL_T struct acl_entry_link*
#define SMB_ACL_TAG_T unsigned short
#define SMB_ACL_TYPE_T int
/* Types of ACLs. */
#define SMB_ACL_USER ACEID_USER
#define SMB_ACL_USER_OBJ 3
#define SMB_ACL_GROUP ACEID_GROUP
#define SMB_ACL_GROUP_OBJ 4
#define SMB_ACL_OTHER 5
#define SMB_ACL_MASK 6
#define SMB_ACL_FIRST_ENTRY 1
#define SMB_ACL_NEXT_ENTRY 2
#define SMB_ACL_TYPE_ACCESS 0
#define SMB_ACL_TYPE_DEFAULT 1
#define SMB_ACL_VALID_NAME_BITS (4 | 2 | 1)
#define SMB_ACL_VALID_OBJ_BITS (4 | 2 | 1)
#define SMB_ACL_NEED_SORT
#elif defined(HAVE_OSX_ACLS) /*----------------------------------------------*/
/* Special handling for OS X ACLs */
#define SMB_ACL_TAG_T acl_tag_t
#define SMB_ACL_TYPE_T acl_type_t
#define SMB_ACL_T acl_t
#define SMB_ACL_ENTRY_T acl_entry_t
#define SMB_ACL_USER 1
#define SMB_ACL_GROUP 2
#define SMB_ACL_FIRST_ENTRY ACL_FIRST_ENTRY
#define SMB_ACL_NEXT_ENTRY ACL_NEXT_ENTRY
#define SMB_ACL_TYPE_ACCESS ACL_TYPE_EXTENDED
#define SMB_ACL_TYPE_DEFAULT ACL_TYPE_DEFAULT
#define SMB_ACL_VALID_NAME_BITS ((1<<25)-1)
#define SMB_ACL_VALID_OBJ_BITS 0
/*#undef SMB_ACL_NEED_SORT*/
#else /*---------------------------------------------------------------------*/
/* Unknown platform. */
#error Cannot handle ACLs on this platform!
#endif
int sys_acl_get_entry(SMB_ACL_T the_acl, int entry_id, SMB_ACL_ENTRY_T *entry_p);
int sys_acl_get_tag_type(SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p);
int sys_acl_get_info(SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T *tag_type_p, uint32 *bits_p, id_t *u_g_id_p);
SMB_ACL_T sys_acl_get_file(const char *path_p, SMB_ACL_TYPE_T type);
SMB_ACL_T sys_acl_get_fd(int fd);
SMB_ACL_T sys_acl_init(int count);
int sys_acl_create_entry(SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry);
int sys_acl_set_info(SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T tagtype, uint32 bits, id_t u_g_id);
int sys_acl_set_access_bits(SMB_ACL_ENTRY_T entry, uint32 bits);
int sys_acl_valid(SMB_ACL_T theacl);
int sys_acl_set_file(const char *name, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
int sys_acl_set_fd(int fd, SMB_ACL_T theacl);
int sys_acl_delete_def_file(const char *name);
int sys_acl_free_acl(SMB_ACL_T the_acl);
int no_acl_syscall_error(int err);
#endif /* SUPPORT_ACLS */

301
lib/sysxattrs.c Normal file
View File

@@ -0,0 +1,301 @@
/*
* Extended attribute support for rsync.
*
* Copyright (C) 2004 Red Hat, Inc.
* Copyright (C) 2003-2022 Wayne Davison
* Written by Jay Fenlason.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "sysxattrs.h"
#ifdef SUPPORT_XATTRS
#ifdef HAVE_OSX_XATTRS
#define GETXATTR_FETCH_LIMIT (64*1024*1024)
#endif
#if defined HAVE_LINUX_XATTRS
ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
{
return lgetxattr(path, name, value, size);
}
ssize_t sys_fgetxattr(int filedes, const char *name, void *value, size_t size)
{
return fgetxattr(filedes, name, value, size);
}
int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size)
{
return lsetxattr(path, name, value, size, 0);
}
int sys_lremovexattr(const char *path, const char *name)
{
return lremovexattr(path, name);
}
ssize_t sys_llistxattr(const char *path, char *list, size_t size)
{
return llistxattr(path, list, size);
}
#elif HAVE_OSX_XATTRS
ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
{
ssize_t len = getxattr(path, name, value, size, 0, XATTR_NOFOLLOW);
/* If we're retrieving data, handle resource forks > 64MB specially */
if (value != NULL && len == GETXATTR_FETCH_LIMIT && (size_t)len < size) {
/* getxattr will only return 64MB of data at a time, need to call again with a new offset */
u_int32_t offset = len;
size_t data_retrieved = len;
while (data_retrieved < size) {
len = getxattr(path, name, (char*)value + offset, size - data_retrieved, offset, XATTR_NOFOLLOW);
if (len <= 0)
break;
data_retrieved += len;
offset += (u_int32_t)len;
}
len = data_retrieved;
}
return len;
}
ssize_t sys_fgetxattr(int filedes, const char *name, void *value, size_t size)
{
return fgetxattr(filedes, name, value, size, 0, 0);
}
int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size)
{
return setxattr(path, name, value, size, 0, XATTR_NOFOLLOW);
}
int sys_lremovexattr(const char *path, const char *name)
{
return removexattr(path, name, XATTR_NOFOLLOW);
}
ssize_t sys_llistxattr(const char *path, char *list, size_t size)
{
return listxattr(path, list, size, XATTR_NOFOLLOW);
}
#elif HAVE_FREEBSD_XATTRS
ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
{
return extattr_get_link(path, EXTATTR_NAMESPACE_USER, name, value, size);
}
ssize_t sys_fgetxattr(int filedes, const char *name, void *value, size_t size)
{
return extattr_get_fd(filedes, EXTATTR_NAMESPACE_USER, name, value, size);
}
int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size)
{
return extattr_set_link(path, EXTATTR_NAMESPACE_USER, name, value, size);
}
int sys_lremovexattr(const char *path, const char *name)
{
return extattr_delete_link(path, EXTATTR_NAMESPACE_USER, name);
}
ssize_t sys_llistxattr(const char *path, char *list, size_t size)
{
unsigned char keylen;
ssize_t off, len = extattr_list_link(path, EXTATTR_NAMESPACE_USER, list, size);
if (len <= 0 || (size_t)len > size)
return len;
/* FreeBSD puts a single-byte length before each string, with no '\0'
* terminator. We need to change this into a series of null-terminted
* strings. Since the size is the same, we can simply transform the
* output in place. */
for (off = 0; off < len; off += keylen + 1) {
keylen = ((unsigned char*)list)[off];
if (off + keylen >= len) {
/* Should be impossible, but kernel bugs happen! */
errno = EINVAL;
return -1;
}
memmove(list+off, list+off+1, keylen);
list[off+keylen] = '\0';
}
return len;
}
#elif HAVE_SOLARIS_XATTRS
static ssize_t read_xattr(int attrfd, void *buf, size_t buflen)
{
STRUCT_STAT sb;
ssize_t ret;
if (fstat(attrfd, &sb) < 0)
ret = -1;
else if (sb.st_size > SSIZE_MAX) {
errno = ERANGE;
ret = -1;
} else if (buflen == 0)
ret = sb.st_size;
else if (sb.st_size > buflen) {
errno = ERANGE;
ret = -1;
} else {
size_t bufpos;
for (bufpos = 0; bufpos < sb.st_size; ) {
ssize_t cnt = read(attrfd, (char*)buf + bufpos, sb.st_size - bufpos);
if (cnt <= 0) {
if (cnt < 0 && errno == EINTR)
continue;
bufpos = -1;
break;
}
bufpos += cnt;
}
ret = bufpos;
}
close(attrfd);
return ret;
}
ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size)
{
int attrfd;
if ((attrfd = attropen(path, name, O_RDONLY)) < 0) {
errno = ENOATTR;
return -1;
}
return read_xattr(attrfd, value, size);
}
ssize_t sys_fgetxattr(int filedes, const char *name, void *value, size_t size)
{
int attrfd;
if ((attrfd = openat(filedes, name, O_RDONLY|O_XATTR, 0)) < 0) {
errno = ENOATTR;
return -1;
}
return read_xattr(attrfd, value, size);
}
int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size)
{
int attrfd;
size_t bufpos;
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
if ((attrfd = attropen(path, name, O_CREAT|O_TRUNC|O_WRONLY, mode)) < 0)
return -1;
for (bufpos = 0; bufpos < size; ) {
ssize_t cnt = write(attrfd, (char*)value + bufpos, size);
if (cnt <= 0) {
if (cnt < 0 && errno == EINTR)
continue;
bufpos = -1;
break;
}
bufpos += cnt;
}
close(attrfd);
return bufpos > 0 ? 0 : -1;
}
int sys_lremovexattr(const char *path, const char *name)
{
int attrdirfd;
int ret;
if ((attrdirfd = attropen(path, ".", O_RDONLY)) < 0)
return -1;
ret = unlinkat(attrdirfd, name, 0);
close(attrdirfd);
return ret;
}
ssize_t sys_llistxattr(const char *path, char *list, size_t size)
{
int attrdirfd;
DIR *dirp;
struct dirent *dp;
ssize_t ret = 0;
if ((attrdirfd = attropen(path, ".", O_RDONLY)) < 0) {
errno = ENOTSUP;
return -1;
}
if ((dirp = fdopendir(attrdirfd)) == NULL) {
close(attrdirfd);
return -1;
}
while ((dp = readdir(dirp))) {
int len = strlen(dp->d_name);
if (dp->d_name[0] == '.' && (len == 1 || (len == 2 && dp->d_name[1] == '.')))
continue;
if (len == 11 && dp->d_name[0] == 'S' && strncmp(dp->d_name, "SUNWattr_r", 10) == 0
&& (dp->d_name[10] == 'o' || dp->d_name[10] == 'w'))
continue;
ret += len + 1;
if ((size_t)ret > size) {
if (size == 0)
continue;
ret = -1;
errno = ERANGE;
break;
}
memcpy(list, dp->d_name, len+1);
list += len+1;
}
closedir(dirp);
close(attrdirfd);
return ret;
}
#else
#error You need to create xattr compatibility functions.
#endif
#endif /* SUPPORT_XATTRS */

26
lib/sysxattrs.h Normal file
View File

@@ -0,0 +1,26 @@
#ifdef SUPPORT_XATTRS
#if defined HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#elif defined HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#elif defined HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
/* Linux 2.4 does not define this as a distinct errno value: */
#ifndef ENOATTR
#define ENOATTR ENODATA
#endif
ssize_t sys_lgetxattr(const char *path, const char *name, void *value, size_t size);
ssize_t sys_fgetxattr(int filedes, const char *name, void *value, size_t size);
int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size);
int sys_lremovexattr(const char *path, const char *name);
ssize_t sys_llistxattr(const char *path, char *list, size_t size);
#else
/* No xattrs available */
#endif

368
lib/wildmatch.c Normal file
View File

@@ -0,0 +1,368 @@
/*
** Do shell-style pattern matching for ?, \, [], and * characters.
** It is 8bit clean.
**
** Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986.
** Rich $alz is now <rsalz@bbn.com>.
**
** Modified by Wayne Davison to special-case '/' matching, to make '**'
** work differently than '*', and to fix the character-class code.
*/
#include "rsync.h"
/* What character marks an inverted character class? */
#define NEGATE_CLASS '!'
#define NEGATE_CLASS2 '^'
#define FALSE 0
#define TRUE 1
#define ABORT_ALL -1
#define ABORT_TO_STARSTAR -2
#define CC_EQ(class, len, litmatch) ((len) == sizeof (litmatch)-1 \
&& *(class) == *(litmatch) \
&& strncmp((char*)class, litmatch, len) == 0)
#if defined STDC_HEADERS || !defined isascii
# define ISASCII(c) 1
#else
# define ISASCII(c) isascii(c)
#endif
#ifdef isblank
# define ISBLANK(c) (ISASCII(c) && isblank(c))
#else
# define ISBLANK(c) ((c) == ' ' || (c) == '\t')
#endif
#ifdef isgraph
# define ISGRAPH(c) (ISASCII(c) && isgraph(c))
#else
# define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c))
#endif
#define ISPRINT(c) (ISASCII(c) && isprint(c))
#define ISDIGIT(c) (ISASCII(c) && isdigit(c))
#define ISALNUM(c) (ISASCII(c) && isalnum(c))
#define ISALPHA(c) (ISASCII(c) && isalpha(c))
#define ISCNTRL(c) (ISASCII(c) && iscntrl(c))
#define ISLOWER(c) (ISASCII(c) && islower(c))
#define ISPUNCT(c) (ISASCII(c) && ispunct(c))
#define ISSPACE(c) (ISASCII(c) && isspace(c))
#define ISUPPER(c) (ISASCII(c) && isupper(c))
#define ISXDIGIT(c) (ISASCII(c) && isxdigit(c))
#ifdef WILD_TEST_ITERATIONS
int wildmatch_iteration_count;
#endif
static int force_lower_case = 0;
/* Match pattern "p" against the a virtually-joined string consisting
* of "text" and any strings in array "a". */
static int dowild(const uchar *p, const uchar *text, const uchar*const *a)
{
uchar p_ch;
#ifdef WILD_TEST_ITERATIONS
wildmatch_iteration_count++;
#endif
for ( ; (p_ch = *p) != '\0'; text++, p++) {
int matched, special;
uchar t_ch, prev_ch;
while ((t_ch = *text) == '\0') {
if (*a == NULL) {
if (p_ch != '*')
return ABORT_ALL;
break;
}
text = *a++;
}
if (force_lower_case && ISUPPER(t_ch))
t_ch = tolower(t_ch);
switch (p_ch) {
case '\\':
/* Literal match with following character. Note that the test
* in "default" handles the p[1] == '\0' failure case. */
p_ch = *++p;
/* FALLTHROUGH */
default:
if (t_ch != p_ch)
return FALSE;
continue;
case '?':
/* Match anything but '/'. */
if (t_ch == '/')
return FALSE;
continue;
case '*':
if (*++p == '*') {
while (*++p == '*') {}
special = TRUE;
} else
special = FALSE;
if (*p == '\0') {
/* Trailing "**" matches everything. Trailing "*" matches
* only if there are no more slash characters. */
if (!special) {
do {
if (strchr((char*)text, '/') != NULL)
return FALSE;
} while ((text = *a++) != NULL);
}
return TRUE;
}
while (1) {
if (t_ch == '\0') {
if ((text = *a++) == NULL)
break;
t_ch = *text;
continue;
}
if ((matched = dowild(p, text, a)) != FALSE) {
if (!special || matched != ABORT_TO_STARSTAR)
return matched;
} else if (!special && t_ch == '/')
return ABORT_TO_STARSTAR;
t_ch = *++text;
}
return ABORT_ALL;
case '[':
p_ch = *++p;
#ifdef NEGATE_CLASS2
if (p_ch == NEGATE_CLASS2)
p_ch = NEGATE_CLASS;
#endif
/* Assign literal TRUE/FALSE because of "matched" comparison. */
special = p_ch == NEGATE_CLASS? TRUE : FALSE;
if (special) {
/* Inverted character class. */
p_ch = *++p;
}
prev_ch = 0;
matched = FALSE;
do {
if (!p_ch)
return ABORT_ALL;
if (p_ch == '\\') {
p_ch = *++p;
if (!p_ch)
return ABORT_ALL;
if (t_ch == p_ch)
matched = TRUE;
} else if (p_ch == '-' && prev_ch && p[1] && p[1] != ']') {
p_ch = *++p;
if (p_ch == '\\') {
p_ch = *++p;
if (!p_ch)
return ABORT_ALL;
}
if (t_ch <= p_ch && t_ch >= prev_ch)
matched = TRUE;
p_ch = 0; /* This makes "prev_ch" get set to 0. */
} else if (p_ch == '[' && p[1] == ':') {
const uchar *s;
int i;
for (s = p += 2; (p_ch = *p) && p_ch != ']'; p++) {} /*SHARED ITERATOR*/
if (!p_ch)
return ABORT_ALL;
i = p - s - 1;
if (i < 0 || p[-1] != ':') {
/* Didn't find ":]", so treat like a normal set. */
p = s - 2;
p_ch = '[';
if (t_ch == p_ch)
matched = TRUE;
continue;
}
if (CC_EQ(s,i, "alnum")) {
if (ISALNUM(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "alpha")) {
if (ISALPHA(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "blank")) {
if (ISBLANK(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "cntrl")) {
if (ISCNTRL(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "digit")) {
if (ISDIGIT(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "graph")) {
if (ISGRAPH(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "lower")) {
if (ISLOWER(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "print")) {
if (ISPRINT(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "punct")) {
if (ISPUNCT(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "space")) {
if (ISSPACE(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "upper")) {
if (ISUPPER(t_ch))
matched = TRUE;
} else if (CC_EQ(s,i, "xdigit")) {
if (ISXDIGIT(t_ch))
matched = TRUE;
} else /* malformed [:class:] string */
return ABORT_ALL;
p_ch = 0; /* This makes "prev_ch" get set to 0. */
} else if (t_ch == p_ch)
matched = TRUE;
} while (prev_ch = p_ch, (p_ch = *++p) != ']');
if (matched == special || t_ch == '/')
return FALSE;
continue;
}
}
do {
if (*text)
return FALSE;
} while ((text = *a++) != NULL);
return TRUE;
}
/* Match literal string "s" against the a virtually-joined string consisting
* of "text" and any strings in array "a". */
static int doliteral(const uchar *s, const uchar *text, const uchar*const *a)
{
for ( ; *s != '\0'; text++, s++) {
while (*text == '\0') {
if ((text = *a++) == NULL)
return FALSE;
}
if (*text != *s)
return FALSE;
}
do {
if (*text)
return FALSE;
} while ((text = *a++) != NULL);
return TRUE;
}
/* Return the last "count" path elements from the concatenated string.
* We return a string pointer to the start of the string, and update the
* array pointer-pointer to point to any remaining string elements. */
static const uchar *trailing_N_elements(const uchar*const **a_ptr, int count)
{
const uchar*const *a = *a_ptr;
const uchar*const *first_a = a;
while (*a)
a++;
while (a != first_a) {
const uchar *s = *--a;
s += strlen((char*)s);
while (--s >= *a) {
if (*s == '/' && !--count) {
*a_ptr = a+1;
return s+1;
}
}
}
if (count == 1) {
*a_ptr = a+1;
return *a;
}
return NULL;
}
/* Match the "pattern" against the "text" string. */
int wildmatch(const char *pattern, const char *text)
{
static const uchar *nomore[1]; /* A NULL pointer. */
#ifdef WILD_TEST_ITERATIONS
wildmatch_iteration_count = 0;
#endif
return dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE;
}
/* Match the "pattern" against the forced-to-lower-case "text" string. */
int iwildmatch(const char *pattern, const char *text)
{
static const uchar *nomore[1]; /* A NULL pointer. */
int ret;
#ifdef WILD_TEST_ITERATIONS
wildmatch_iteration_count = 0;
#endif
force_lower_case = 1;
ret = dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE;
force_lower_case = 0;
return ret;
}
/* Match pattern "p" against the a virtually-joined string consisting
* of all the pointers in array "texts" (which has a NULL pointer at the
* end). The int "where" can be 0 (normal matching), > 0 (match only
* the trailing N slash-separated filename components of "texts"), or < 0
* (match the "pattern" at the start or after any slash in "texts"). */
int wildmatch_array(const char *pattern, const char*const *texts, int where)
{
const uchar *p = (const uchar*)pattern;
const uchar*const *a = (const uchar*const*)texts;
const uchar *text;
int matched;
#ifdef WILD_TEST_ITERATIONS
wildmatch_iteration_count = 0;
#endif
if (where > 0)
text = trailing_N_elements(&a, where);
else
text = *a++;
if (!text)
return FALSE;
if ((matched = dowild(p, text, a)) != TRUE && where < 0
&& matched != ABORT_ALL) {
while (1) {
if (*text == '\0') {
if ((text = (uchar*)*a++) == NULL)
return FALSE;
continue;
}
if (*text++ == '/' && (matched = dowild(p, text, a)) != FALSE
&& matched != ABORT_TO_STARSTAR)
break;
}
}
return matched == TRUE;
}
/* Match literal string "s" against the a virtually-joined string consisting
* of all the pointers in array "texts" (which has a NULL pointer at the
* end). The int "where" can be 0 (normal matching), or > 0 (match
* only the trailing N slash-separated filename components of "texts"). */
int litmatch_array(const char *string, const char*const *texts, int where)
{
const uchar *s = (const uchar*)string;
const uchar*const *a = (const uchar* const*)texts;
const uchar *text;
if (where > 0)
text = trailing_N_elements(&a, where);
else
text = *a++;
if (!text)
return FALSE;
return doliteral(s, text, a) == TRUE;
}

6
lib/wildmatch.h Normal file
View File

@@ -0,0 +1,6 @@
/* wildmatch.h */
int wildmatch(const char *pattern, const char *text);
int iwildmatch(const char *pattern, const char *text);
int wildmatch_array(const char *pattern, const char*const *texts, int where);
int litmatch_array(const char *string, const char*const *texts, int where);

1007
loadparm.c
View File

File diff suppressed because it is too large Load Diff

1114
log.c
View File

File diff suppressed because it is too large Load Diff

22
m4/have_type.m4 Normal file
View File

@@ -0,0 +1,22 @@
dnl AC_HAVE_TYPE(TYPE,INCLUDES)
AC_DEFUN([AC_HAVE_TYPE], [
AC_REQUIRE([AC_HEADER_STDC])
cv=`echo "$1" | sed 'y%./+- %__p__%'`
AC_MSG_CHECKING(for $1)
AC_CACHE_VAL([ac_cv_type_$cv],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
AC_INCLUDES_DEFAULT
$2]],
[[$1 foo;]])],
[eval "ac_cv_type_$cv=yes"],
[eval "ac_cv_type_$cv=no"]))dnl
ac_foo=`eval echo \\$ac_cv_type_$cv`
AC_MSG_RESULT($ac_foo)
if test "$ac_foo" = yes; then
ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
if false; then
AC_CHECK_TYPES($1)
fi
AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
fi
])

27
m4/header_major_fixed.m4 Normal file
View File

@@ -0,0 +1,27 @@
AC_DEFUN([AC_HEADER_MAJOR_FIXED],
[AC_CACHE_CHECK(whether sys/types.h defines makedev,
ac_cv_header_sys_types_h_makedev,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[@%:@include <sys/types.h>]],
[[return makedev(0, 0);]])],
[if grep sys/sysmacros.h conftest.err >/dev/null; then
ac_cv_header_sys_types_h_makedev=no
else
ac_cv_header_sys_types_h_makedev=yes
fi],
[ac_cv_header_sys_types_h_makedev=no])
])
if test $ac_cv_header_sys_types_h_makedev = no; then
AC_CHECK_HEADER(sys/mkdev.h,
[AC_DEFINE(MAJOR_IN_MKDEV, 1,
[Define to 1 if `major', `minor', and `makedev' are
declared in <mkdev.h>.])])
if test $ac_cv_header_sys_mkdev_h = no; then
AC_CHECK_HEADER(sys/sysmacros.h,
[AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
[Define to 1 if `major', `minor', and `makedev'
are declared in <sysmacros.h>.])])
fi
fi
])

45
m4/socklen_t.m4 Normal file
View File

@@ -0,0 +1,45 @@
dnl Check for socklen_t: historically on BSD it is an int, and in
dnl POSIX 1g it is a type of its own, but some platforms use different
dnl types for the argument to getsockopt, getpeername, etc. So we
dnl have to test to find something that will work.
dnl This is no good, because passing the wrong pointer on C compilers is
dnl likely to only generate a warning, not an error. We don't call this at
dnl the moment.
AC_DEFUN([TYPE_SOCKLEN_T],
[
AC_CHECK_TYPE([socklen_t], ,[
AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([rsync_cv_socklen_t_equiv],
[
# Systems have either "struct sockaddr *" or
# "void *" as the second argument to getpeername
rsync_cv_socklen_t_equiv=
for arg2 in "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
int getpeername (int, $arg2 *, $t *);
]],[[
$t len;
getpeername(0,0,&len);
]])],[
rsync_cv_socklen_t_equiv="$t"
break
])
done
done
if test "x$rsync_cv_socklen_t_equiv" = x; then
AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
fi
])
AC_MSG_RESULT($rsync_cv_socklen_t_equiv)
AC_DEFINE_UNQUOTED(socklen_t, $rsync_cv_socklen_t_equiv,
[type to use in place of socklen_t if not defined])],
[#include <sys/types.h>
#include <sys/socket.h>])
])

View File

@@ -2,7 +2,7 @@ dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
dnl if the cache file is inconsistent with the current host,
dnl target and build system types, execute CMD or print a default
dnl error message.
AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
AC_DEFUN([AC_VALIDATE_CACHE_SYSTEM_TYPE], [
AC_REQUIRE([AC_CANONICAL_SYSTEM])
AC_MSG_CHECKING([config.cache system type])
if { test x"${ac_cv_host_system_type+set}" = x"set" &&

2064
main.c
View File

File diff suppressed because it is too large Load Diff

501
match.c
View File

@@ -1,221 +1,329 @@
/*
Copyright (C) Andrew Tridgell 1996
Copyright (C) Paul Mackerras 1996
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Block matching used by the file-transfer code.
*
* Copyright (C) 1996 Andrew Tridgell
* Copyright (C) 1996 Paul Mackerras
* Copyright (C) 2003-2020 Wayne Davison
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website.
*/
#include "rsync.h"
#include "inums.h"
extern int csum_length;
extern int checksum_seed;
extern int append_mode;
extern int xfersum_type;
extern int verbose;
extern int am_server;
extern int remote_version;
typedef unsigned short tag;
#define TABLESIZE (1<<16)
#define NULL_TAG (-1)
int updating_basis_file;
char sender_file_sum[MAX_DIGEST_LEN];
static int false_alarms;
static int tag_hits;
static int hash_hits;
static int matches;
static int64 data_transfer;
static int total_false_alarms;
static int total_tag_hits;
static int total_hash_hits;
static int total_matches;
extern struct stats stats;
struct target {
tag t;
int i;
};
#define TRADITIONAL_TABLESIZE (1<<16)
static struct target *targets;
static uint32 tablesize;
static int32 *hash_table;
static int *tag_table;
#define gettag2(s1,s2) (((s1) + (s2)) & 0xFFFF)
#define gettag(sum) gettag2((sum)&0xFFFF,(sum)>>16)
static int compare_targets(struct target *t1,struct target *t2)
{
return((int)t1->t - (int)t2->t);
}
#define SUM2HASH2(s1,s2) (((s1) + (s2)) & 0xFFFF)
#define SUM2HASH(sum) SUM2HASH2((sum)&0xFFFF,(sum)>>16)
#define BIG_SUM2HASH(sum) ((sum)%tablesize)
static void build_hash_table(struct sum_struct *s)
{
int i;
static uint32 alloc_size;
int32 i;
if (!tag_table)
tag_table = (int *)malloc(sizeof(tag_table[0])*TABLESIZE);
/* Dynamically calculate the hash table size so that the hash load
* for big files is about 80%. A number greater than the traditional
* size must be odd or s2 will not be able to span the entire set. */
tablesize = (uint32)(s->count/8) * 10 + 11;
if (tablesize < TRADITIONAL_TABLESIZE)
tablesize = TRADITIONAL_TABLESIZE;
if (tablesize > alloc_size || tablesize < alloc_size - 16*1024) {
if (hash_table)
free(hash_table);
hash_table = new_array(int32, tablesize);
alloc_size = tablesize;
}
targets = (struct target *)malloc(sizeof(targets[0])*s->count);
if (!tag_table || !targets)
out_of_memory("build_hash_table");
memset(hash_table, 0xFF, tablesize * sizeof hash_table[0]);
for (i=0;i<s->count;i++) {
targets[i].i = i;
targets[i].t = gettag(s->sums[i].sum1);
}
qsort(targets,s->count,sizeof(targets[0]),(int (*)())compare_targets);
for (i=0;i<TABLESIZE;i++)
tag_table[i] = NULL_TAG;
for (i=s->count-1;i>=0;i--) {
tag_table[targets[i].t] = i;
}
if (tablesize == TRADITIONAL_TABLESIZE) {
for (i = 0; i < s->count; i++) {
uint32 t = SUM2HASH(s->sums[i].sum1);
s->sums[i].chain = hash_table[t];
hash_table[t] = i;
}
} else {
for (i = 0; i < s->count; i++) {
uint32 t = BIG_SUM2HASH(s->sums[i].sum1);
s->sums[i].chain = hash_table[t];
hash_table[t] = i;
}
}
}
static OFF_T last_match;
static void matched(int f,struct sum_struct *s,struct map_struct *buf,
OFF_T offset,int i)
/* Transmit a literal and/or match token.
*
* This delightfully-named function is called either when we find a
* match and need to transmit all the unmatched data leading up to it,
* or when we get bored of accumulating literal data and just need to
* transmit it. As a result of this second case, it is called even if
* we have not matched at all!
*
* If i >= 0, the number of a matched token. If < 0, indicates we have
* only literal data. A -1 will send a 0-token-int too, and a -2 sends
* only literal data, w/o any token-int. */
static void matched(int f, struct sum_struct *s, struct map_struct *buf, OFF_T offset, int32 i)
{
OFF_T n = offset - last_match;
int j;
int32 n = (int32)(offset - last_match); /* max value: block_size (int32) */
int32 j;
if (verbose > 2 && i >= 0)
rprintf(FINFO,"match at %d last_match=%d j=%d len=%d n=%d\n",
(int)offset,(int)last_match,i,(int)s->sums[i].len,(int)n);
if (DEBUG_GTE(DELTASUM, 2) && i >= 0) {
rprintf(FINFO,
"match at %s last_match=%s j=%d len=%ld n=%ld\n",
big_num(offset), big_num(last_match), i,
(long)s->sums[i].len, (long)n);
}
send_token(f,i,buf,last_match,n,i<0?0:s->sums[i].len);
send_token(f, i, buf, last_match, n, i < 0 ? 0 : s->sums[i].len);
data_transfer += n;
if (i >= 0) {
stats.matched_data += s->sums[i].len;
n += s->sums[i].len;
}
for (j=0;j<n;j+=CHUNK_SIZE) {
int n1 = MIN(CHUNK_SIZE,n-j);
sum_update(map_ptr(buf,last_match+j,n1),n1);
}
for (j = 0; j < n; j += CHUNK_SIZE) {
int32 n1 = MIN(CHUNK_SIZE, n - j);
sum_update(map_ptr(buf, last_match + j, n1), n1);
}
if (i >= 0)
last_match = offset + s->sums[i].len;
else
last_match = offset;
if (buf)
show_progress(last_match, buf->size);
if (i == -1) end_progress();
if (buf && INFO_GTE(PROGRESS, 1))
show_progress(last_match, buf->file_size);
}
static void hash_search(int f,struct sum_struct *s,
struct map_struct *buf,OFF_T len)
struct map_struct *buf, OFF_T len)
{
OFF_T offset;
int j,k;
int end;
OFF_T offset, aligned_offset, end;
int32 k, want_i, aligned_i, backup;
char sum2[SUM_LENGTH];
uint32 s1, s2, sum;
uint32 s1, s2, sum;
int more;
schar *map;
if (verbose > 2)
rprintf(FINFO,"hash search b=%d len=%d\n",s->n,(int)len);
/* want_i is used to encourage adjacent matches, allowing the RLL
* coding of the output to work more efficiently. */
want_i = 0;
if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "hash search b=%ld len=%s\n",
(long)s->blength, big_num(len));
}
k = (int32)MIN(len, (OFF_T)s->blength);
map = (schar *)map_ptr(buf, 0, k);
k = MIN(len, s->n);
map = (schar *)map_ptr(buf,0,k);
sum = get_checksum1((char *)map, k);
s1 = sum & 0xFFFF;
s2 = sum >> 16;
if (verbose > 3)
rprintf(FINFO, "sum=%.8x k=%d\n", sum, k);
offset = 0;
if (DEBUG_GTE(DELTASUM, 3))
rprintf(FINFO, "sum=%.8x k=%ld\n", sum, (long)k);
offset = aligned_offset = aligned_i = 0;
end = len + 1 - s->sums[s->count-1].len;
if (verbose > 3)
rprintf(FINFO,"hash search s->n=%d len=%d count=%d\n",
s->n,(int)len,s->count);
if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO, "hash search s->blength=%ld len=%s count=%s\n",
(long)s->blength, big_num(len), big_num(s->count));
}
do {
tag t = gettag2(s1,s2);
int done_csum2 = 0;
j = tag_table[t];
if (verbose > 4)
rprintf(FINFO,"offset=%d sum=%08x\n",(int)offset,sum);
if (j == NULL_TAG) {
goto null_tag;
uint32 hash_entry;
int32 i, *prev;
if (DEBUG_GTE(DELTASUM, 4)) {
rprintf(FINFO, "offset=%s sum=%04x%04x\n",
big_num(offset), s2 & 0xFFFF, s1 & 0xFFFF);
}
sum = (s1 & 0xffff) | (s2 << 16);
tag_hits++;
for (; j<s->count && targets[j].t == t; j++) {
int i = targets[j].i;
if (sum != s->sums[i].sum1) continue;
if (verbose > 3)
rprintf(FINFO,"potential match at %d target=%d %d sum=%08x\n",
(int)offset,j,i,sum);
if (tablesize == TRADITIONAL_TABLESIZE) {
hash_entry = SUM2HASH2(s1,s2);
if ((i = hash_table[hash_entry]) < 0)
goto null_hash;
sum = (s1 & 0xffff) | (s2 << 16);
} else {
sum = (s1 & 0xffff) | (s2 << 16);
hash_entry = BIG_SUM2HASH(sum);
if ((i = hash_table[hash_entry]) < 0)
goto null_hash;
}
prev = &hash_table[hash_entry];
hash_hits++;
do {
int32 l;
/* When updating in-place, the chunk's offset must be
* either >= our offset or identical data at that offset.
* Remove any bypassed entries that we can never use. */
if (updating_basis_file && s->sums[i].offset < offset
&& !(s->sums[i].flags & SUMFLG_SAME_OFFSET)) {
*prev = s->sums[i].chain;
continue;
}
prev = &s->sums[i].chain;
if (sum != s->sums[i].sum1)
continue;
/* also make sure the two blocks are the same length */
l = (int32)MIN((OFF_T)s->blength, len-offset);
if (l != s->sums[i].len)
continue;
if (DEBUG_GTE(DELTASUM, 3)) {
rprintf(FINFO,
"potential match at %s i=%ld sum=%08x\n",
big_num(offset), (long)i, sum);
}
if (!done_csum2) {
int l = MIN(s->n,len-offset);
map = (schar *)map_ptr(buf,offset,l);
get_checksum2((char *)map,l,sum2);
done_csum2 = 1;
}
if (memcmp(sum2,s->sums[i].sum2,csum_length) != 0) {
if (memcmp(sum2,s->sums[i].sum2,s->s2length) != 0) {
false_alarms++;
continue;
}
/* When updating in-place, the best possible match is
* one with an identical offset, so we prefer that over
* the adjacent want_i optimization. */
if (updating_basis_file) {
/* All the generator's chunks start at blength boundaries. */
while (aligned_offset < offset) {
aligned_offset += s->blength;
aligned_i++;
}
if ((offset == aligned_offset
|| (sum == 0 && l == s->blength && aligned_offset + l <= len))
&& aligned_i < s->count) {
if (i != aligned_i) {
if (sum != s->sums[aligned_i].sum1
|| l != s->sums[aligned_i].len
|| memcmp(sum2, s->sums[aligned_i].sum2, s->s2length) != 0)
goto check_want_i;
i = aligned_i;
}
if (offset != aligned_offset) {
/* We've matched some zeros in a spot that is also zeros
* further along in the basis file, if we find zeros ahead
* in the sender's file, we'll output enough literal data
* to re-align with the basis file, and get back to seeking
* instead of writing. */
backup = (int32)(aligned_offset - last_match);
if (backup < 0)
backup = 0;
map = (schar *)map_ptr(buf, aligned_offset - backup, l + backup)
+ backup;
sum = get_checksum1((char *)map, l);
if (sum != s->sums[i].sum1)
goto check_want_i;
get_checksum2((char *)map, l, sum2);
if (memcmp(sum2, s->sums[i].sum2, s->s2length) != 0)
goto check_want_i;
/* OK, we have a re-alignment match. Bump the offset
* forward to the new match point. */
offset = aligned_offset;
}
/* This identical chunk is in the same spot in the old and new file. */
s->sums[i].flags |= SUMFLG_SAME_OFFSET;
want_i = i;
}
}
check_want_i:
/* we've found a match, but now check to see
* if want_i can hint at a better match. */
if (i != want_i && want_i < s->count
&& (!updating_basis_file || s->sums[want_i].offset >= offset
|| s->sums[want_i].flags & SUMFLG_SAME_OFFSET)
&& sum == s->sums[want_i].sum1
&& memcmp(sum2, s->sums[want_i].sum2, s->s2length) == 0) {
/* we've found an adjacent match - the RLL coder
* will be happy */
i = want_i;
}
want_i = i + 1;
matched(f,s,buf,offset,i);
offset += s->sums[i].len - 1;
k = MIN((len-offset), s->n);
map = (schar *)map_ptr(buf,offset,k);
k = (int32)MIN((OFF_T)s->blength, len-offset);
map = (schar *)map_ptr(buf, offset, k);
sum = get_checksum1((char *)map, k);
s1 = sum & 0xFFFF;
s2 = sum >> 16;
matches++;
break;
}
null_tag:
} while ((i = s->sums[i].chain) >= 0);
null_hash:
backup = (int32)(offset - last_match);
/* We sometimes read 1 byte prior to last_match... */
if (backup < 0)
backup = 0;
/* Trim off the first byte from the checksum */
map = (schar *)map_ptr(buf,offset,k+1);
more = offset + k < len;
map = (schar *)map_ptr(buf, offset - backup, k + more + backup) + backup;
s1 -= map[0] + CHAR_OFFSET;
s2 -= k * (map[0]+CHAR_OFFSET);
/* Add on the next byte (if there is one) to the checksum */
if (k < (len-offset)) {
s1 += (map[k]+CHAR_OFFSET);
if (more) {
s1 += map[k] + CHAR_OFFSET;
s2 += s1;
} else {
} else
--k;
}
/* By matching early we avoid re-reading the
data 3 times in the case where a token
@@ -223,67 +331,103 @@ static void hash_search(int f,struct sum_struct *s,
match. The 3 reads are caused by the
running match, the checksum update and the
literal send. */
if (offset-last_match >= CHUNK_SIZE+s->n &&
(end-offset > CHUNK_SIZE)) {
matched(f,s,buf,offset - s->n, -2);
}
if (backup >= s->blength+CHUNK_SIZE && end-offset > CHUNK_SIZE)
matched(f, s, buf, offset - s->blength, -2);
} while (++offset < end);
matched(f,s,buf,len,-1);
map_ptr(buf,len-1,1);
matched(f, s, buf, len, -1);
map_ptr(buf, len-1, 1);
}
void match_sums(int f,struct sum_struct *s,struct map_struct *buf,OFF_T len)
/**
* Scan through a origin file, looking for sections that match
* checksums from the generator, and transmit either literal or token
* data.
*
* Also calculates the MD4 checksum of the whole file, using the md
* accumulator. This is transmitted with the file as protection
* against corruption on the wire.
*
* @param s Checksums received from the generator. If <tt>s->count ==
* 0</tt>, then there are actually no checksums for this file.
*
* @param len Length of the file to send.
**/
void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
{
char file_sum[MD4_SUM_LENGTH];
int sum_len;
last_match = 0;
false_alarms = 0;
tag_hits = 0;
matches=0;
data_transfer=0;
hash_hits = 0;
matches = 0;
data_transfer = 0;
sum_init();
sum_init(xfersum_type, checksum_seed);
if (len > 0 && s->count>0) {
if (append_mode > 0) {
if (append_mode == 2) {
OFF_T j = 0;
for (j = CHUNK_SIZE; j < s->flength; j += CHUNK_SIZE) {
if (buf && INFO_GTE(PROGRESS, 1))
show_progress(last_match, buf->file_size);
sum_update(map_ptr(buf, last_match, CHUNK_SIZE),
CHUNK_SIZE);
last_match = j;
}
if (last_match < s->flength) {
int32 n = (int32)(s->flength - last_match);
if (buf && INFO_GTE(PROGRESS, 1))
show_progress(last_match, buf->file_size);
sum_update(map_ptr(buf, last_match, n), n);
}
}
last_match = s->flength;
s->count = 0;
}
if (len > 0 && s->count > 0) {
build_hash_table(s);
if (verbose > 2)
if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"built hash table\n");
hash_search(f,s,buf,len);
if (verbose > 2)
hash_search(f, s, buf, len);
if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"done hash search\n");
} else {
OFF_T j;
/* by doing this in pieces we avoid too many seeks */
for (j=0;j<(len-CHUNK_SIZE);j+=CHUNK_SIZE) {
int n1 = MIN(CHUNK_SIZE,(len-CHUNK_SIZE)-j);
matched(f,s,buf,j+n1,-2);
}
matched(f,s,buf,len,-1);
for (j = last_match + CHUNK_SIZE; j < len; j += CHUNK_SIZE)
matched(f, s, buf, j, -2);
matched(f, s, buf, len, -1);
}
sum_end(file_sum);
sum_len = sum_end(sender_file_sum);
if (remote_version >= 14) {
if (verbose > 2)
rprintf(FINFO,"sending file_sum\n");
write_buf(f,file_sum,MD4_SUM_LENGTH);
/* If we had a read error, send a bad checksum. We use all bits
* off as long as the checksum doesn't happen to be that, in
* which case we turn the last 0 bit into a 1. */
if (buf && buf->status != 0) {
int i;
for (i = 0; i < sum_len && sender_file_sum[i] == 0; i++) {}
memset(sender_file_sum, 0, sum_len);
if (i == sum_len)
sender_file_sum[i-1]++;
}
if (targets) {
free(targets);
targets=NULL;
if (DEBUG_GTE(DELTASUM, 2))
rprintf(FINFO,"sending file_sum\n");
write_buf(f, sender_file_sum, sum_len);
if (DEBUG_GTE(DELTASUM, 2)) {
rprintf(FINFO, "false_alarms=%d hash_hits=%d matches=%d\n",
false_alarms, hash_hits, matches);
}
if (verbose > 2)
rprintf(FINFO, "false_alarms=%d tag_hits=%d matches=%d\n",
false_alarms, tag_hits, matches);
total_tag_hits += tag_hits;
total_hash_hits += hash_hits;
total_false_alarms += false_alarms;
total_matches += matches;
stats.literal_data += data_transfer;
@@ -291,12 +435,11 @@ void match_sums(int f,struct sum_struct *s,struct map_struct *buf,OFF_T len)
void match_report(void)
{
if (verbose <= 1)
if (!DEBUG_GTE(DELTASUM, 1))
return;
rprintf(FINFO,
"total: matches=%d tag_hits=%d false_alarms=%d data=%.0f\n",
total_matches,total_tag_hits,
total_false_alarms,
(double)stats.literal_data);
"total: matches=%d hash_hits=%d false_alarms=%d data=%s\n",
total_matches, total_hash_hits, total_false_alarms,
big_num(stats.literal_data));
}

35
maybe-make-man Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/sh
if [ $# != 1 ]; then
echo "Usage: $0 NAME.NUM.md" 1>&2
exit 1
fi
inname="$1"
srcdir=`dirname "$0"`
flagfile="$srcdir/.md2man-works"
if [ ! -f "$flagfile" ]; then
# We test our smallest manpage just to see if the python setup works.
if "$srcdir/md-convert" --test "$srcdir/rsync-ssl.1.md" >/dev/null 2>&1; then
touch $flagfile
else
outname=`echo "$inname" | sed 's/\.md$//'`
if [ -f "$outname" ]; then
exit 0
elif [ -f "$srcdir/$outname" ]; then
echo "Copying $srcdir/$outname"
cp -p "$srcdir/$outname" .
exit 0
else
echo "ERROR: $outname cannot be created."
if [ -f "$HOME/build_farm/build_test.fns" ]; then
exit 0 # No exit errorno to avoid a build failure in the samba build farm
else
exit 1
fi
fi
fi
fi
"$srcdir/md-convert" "$srcdir/$inname"

630
md-convert Executable file
View File

@@ -0,0 +1,630 @@
#!/usr/bin/env python3
# This script transforms markdown files into html and (optionally) nroff. The
# output files are written into the current directory named for the input file
# without the .md suffix and either the .html suffix or no suffix.
#
# If the input .md file has a section number at the end of the name (e.g.,
# rsync.1.md) a nroff file is also output (PROJ.NUM.md -> PROJ.NUM).
#
# The markdown input format has one extra extension: if a numbered list starts
# at 0, it is turned into a description list. The dl's dt tag is taken from the
# contents of the first tag inside the li, which is usually a p, code, or
# strong tag.
#
# The cmarkgfm or commonmark lib is used to transforms the input file into
# html. Then, the html.parser is used as a state machine that lets us tweak
# the html and (optionally) output nroff data based on the html tags.
#
# If the string @USE_GFM_PARSER@ exists in the file, the string is removed and
# a github-flavored-markup parser is used to parse the file.
#
# The man-page .md files also get the vars @VERSION@, @BINDIR@, and @LIBDIR@
# substituted. Some of these values depend on the Makefile $(prefix) (see the
# generated Makefile). If the maintainer wants to build files for /usr/local
# while creating release-ready man-page files for /usr, use the environment to
# set RSYNC_OVERRIDE_PREFIX=/usr.
# Copyright (C) 2020 - 2021 Wayne Davison
#
# This program is freely redistributable.
import os, sys, re, argparse, subprocess, time
from html.parser import HTMLParser
VALID_PAGES = 'README INSTALL COPYING rsync.1 rrsync.1 rsync-ssl.1 rsyncd.conf.5'.split()
CONSUMES_TXT = set('h1 h2 h3 p li pre'.split())
HTML_START = """\
<html><head>
<title>%TITLE%</title>
<meta charset="UTF-8"/>
<link href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Mono&display=swap" rel="stylesheet">
<style>
body {
max-width: 50em;
margin: auto;
}
body, b, strong, u {
font-family: 'Roboto', sans-serif;
}
a.tgt { font-face: symbol; font-weight: 400; font-size: 70%; visibility: hidden; text-decoration: none; color: #ddd; padding: 0 4px; border: 0; }
a.tgt:after { content: '🔗'; }
a.tgt:hover { color: #444; background-color: #eaeaea; }
h1:hover > a.tgt, h2:hover > a.tgt, h3:hover > a.tgt, dt:hover > a.tgt { visibility: visible; }
code {
font-family: 'Roboto Mono', monospace;
font-weight: bold;
white-space: pre;
}
pre code {
display: block;
font-weight: normal;
}
blockquote pre code {
background: #f1f1f1;
}
dd p:first-of-type {
margin-block-start: 0em;
}
</style>
</head><body>
"""
TABLE_STYLE = """\
table {
border-color: grey;
border-spacing: 0;
}
tr {
border-top: 1px solid grey;
}
tr:nth-child(2n) {
background-color: #f6f8fa;
}
th, td {
border: 1px solid #dfe2e5;
text-align: center;
padding-left: 1em;
padding-right: 1em;
}
"""
MAN_HTML_END = """\
<div style="float: right"><p><i>%s</i></p></div>
"""
HTML_END = """\
</body></html>
"""
MAN_START = r"""
.TH "%s" "%s" "%s" "%s" "User Commands"
.\" prefix=%s
""".lstrip()
MAN_END = """\
"""
NORM_FONT = ('\1', r"\fP")
BOLD_FONT = ('\2', r"\fB")
UNDR_FONT = ('\3', r"\fI")
NBR_DASH = ('\4', r"\-")
NBR_SPACE = ('\xa0', r"\ ")
FILENAME_RE = re.compile(r'^(?P<fn>(?P<srcdir>.+/)?(?P<name>(?P<prog>[^/]+?)(\.(?P<sect>\d+))?)\.md)$')
ASSIGNMENT_RE = re.compile(r'^(\w+)=(.+)')
QUOTED_RE = re.compile(r'"(.+?)"')
VAR_REF_RE = re.compile(r'\$\{(\w+)\}')
VERSION_RE = re.compile(r' (\d[.\d]+)[, ]')
BIN_CHARS_RE = re.compile(r'[\1-\7]+')
SPACE_DOUBLE_DASH_RE = re.compile(r'\s--(\s)')
NON_SPACE_SINGLE_DASH_RE = re.compile(r'(^|\W)-')
WHITESPACE_RE = re.compile(r'\s')
CODE_BLOCK_RE = re.compile(r'[%s]([^=%s]+)[=%s]' % (BOLD_FONT[0], NORM_FONT[0], NORM_FONT[0]))
NBR_DASH_RE = re.compile(r'[%s]' % NBR_DASH[0])
INVALID_TARGET_CHARS_RE = re.compile(r'[^-A-Za-z0-9._]')
INVALID_START_CHAR_RE = re.compile(r'^([^A-Za-z0-9])')
MANIFY_LINESTART_RE = re.compile(r"^(['.])", flags=re.M)
md_parser = None
env_subs = { }
warning_count = 0
def main():
for mdfn in args.mdfiles:
parse_md_file(mdfn)
if args.test:
print("The test was successful.")
def parse_md_file(mdfn):
fi = FILENAME_RE.match(mdfn)
if not fi:
die('Failed to parse a md input file name:', mdfn)
fi = argparse.Namespace(**fi.groupdict())
fi.want_manpage = not not fi.sect
if fi.want_manpage:
fi.title = fi.prog + '(' + fi.sect + ') manpage'
else:
fi.title = fi.prog + ' for rsync'
if fi.want_manpage:
if not env_subs:
find_man_substitutions()
prog_ver = 'rsync ' + env_subs['VERSION']
if fi.prog != 'rsync':
prog_ver = fi.prog + ' from ' + prog_ver
fi.man_headings = (fi.prog, fi.sect, env_subs['date'], prog_ver, env_subs['prefix'])
with open(mdfn, 'r', encoding='utf-8') as fh:
txt = fh.read()
use_gfm_parser = '@USE_GFM_PARSER@' in txt
if use_gfm_parser:
txt = txt.replace('@USE_GFM_PARSER@', '')
if fi.want_manpage:
txt = (txt.replace('@VERSION@', env_subs['VERSION'])
.replace('@BINDIR@', env_subs['bindir'])
.replace('@LIBDIR@', env_subs['libdir']))
if use_gfm_parser:
if not gfm_parser:
die('Input file requires cmarkgfm parser:', mdfn)
fi.html_in = gfm_parser(txt)
else:
fi.html_in = md_parser(txt)
txt = None
TransformHtml(fi)
if args.test:
return
output_list = [ (fi.name + '.html', fi.html_out) ]
if fi.want_manpage:
output_list += [ (fi.name, fi.man_out) ]
for fn, txt in output_list:
if args.dest and args.dest != '.':
fn = os.path.join(args.dest, fn)
if os.path.lexists(fn):
os.unlink(fn)
print("Wrote:", fn)
with open(fn, 'w', encoding='utf-8') as fh:
fh.write(txt)
def find_man_substitutions():
srcdir = os.path.dirname(sys.argv[0]) + '/'
mtime = 0
git_dir = srcdir + '.git'
if os.path.lexists(git_dir):
mtime = int(subprocess.check_output(['git', '--git-dir', git_dir, 'log', '-1', '--format=%at']))
# Allow "prefix" to be overridden via the environment:
env_subs['prefix'] = os.environ.get('RSYNC_OVERRIDE_PREFIX', None)
if args.test:
env_subs['VERSION'] = '1.0.0'
env_subs['bindir'] = '/usr/bin'
env_subs['libdir'] = '/usr/lib/rsync'
else:
for fn in (srcdir + 'version.h', 'Makefile'):
try:
st = os.lstat(fn)
except OSError:
die('Failed to find', srcdir + fn)
if not mtime:
mtime = st.st_mtime
with open(srcdir + 'version.h', 'r', encoding='utf-8') as fh:
txt = fh.read()
m = QUOTED_RE.search(txt)
env_subs['VERSION'] = m.group(1)
with open('Makefile', 'r', encoding='utf-8') as fh:
for line in fh:
m = ASSIGNMENT_RE.match(line)
if not m:
continue
var, val = (m.group(1), m.group(2))
if var == 'prefix' and env_subs[var] is not None:
continue
while VAR_REF_RE.search(val):
val = VAR_REF_RE.sub(lambda m: env_subs[m.group(1)], val)
env_subs[var] = val
if var == 'srcdir':
break
env_subs['date'] = time.strftime('%d %b %Y', time.localtime(mtime))
def html_via_commonmark(txt):
return commonmark.HtmlRenderer().render(commonmark.Parser().parse(txt))
class TransformHtml(HTMLParser):
def __init__(self, fi):
HTMLParser.__init__(self, convert_charrefs=True)
self.fn = fi.fn
st = self.state = argparse.Namespace(
list_state = [ ],
p_macro = ".P\n",
at_first_tag_in_li = False,
at_first_tag_in_dd = False,
dt_from = None,
in_pre = False,
in_code = False,
html_out = [ HTML_START.replace('%TITLE%', fi.title) ],
man_out = [ ],
txt = '',
want_manpage = fi.want_manpage,
created_hashtags = set(),
derived_hashtags = set(),
referenced_hashtags = set(),
bad_hashtags = set(),
latest_targets = [ ],
opt_prefix = 'opt',
a_txt_start = None,
target_suf = '',
)
if st.want_manpage:
st.man_out.append(MAN_START % fi.man_headings)
if '</table>' in fi.html_in:
st.html_out[0] = st.html_out[0].replace('</style>', TABLE_STYLE + '</style>')
self.feed(fi.html_in)
fi.html_in = None
if st.want_manpage:
st.html_out.append(MAN_HTML_END % env_subs['date'])
st.html_out.append(HTML_END)
st.man_out.append(MAN_END)
fi.html_out = ''.join(st.html_out)
st.html_out = None
fi.man_out = ''.join(st.man_out)
st.man_out = None
for tgt, txt in st.derived_hashtags:
derived = txt2target(txt, tgt)
if derived not in st.created_hashtags:
txt = BIN_CHARS_RE.sub('', txt.replace(NBR_DASH[0], '-').replace(NBR_SPACE[0], ' '))
warn('Unknown derived hashtag link in', self.fn, 'based on:', (tgt, txt))
for bad in st.bad_hashtags:
if bad in st.created_hashtags:
warn('Missing "#" in hashtag link in', self.fn + ':', bad)
else:
warn('Unknown non-hashtag link in', self.fn + ':', bad)
for bad in st.referenced_hashtags - st.created_hashtags:
warn('Unknown hashtag link in', self.fn + ':', '#' + bad)
def handle_starttag(self, tag, attrs_list):
st = self.state
if args.debug:
self.output_debug('START', (tag, attrs_list))
if st.at_first_tag_in_li:
if st.list_state[-1] == 'dl':
st.dt_from = tag
if tag == 'p':
tag = 'dt'
else:
st.html_out.append('<dt>')
elif tag == 'p':
st.at_first_tag_in_dd = True # Kluge to suppress a .P at the start of an li.
st.at_first_tag_in_li = False
if tag == 'p':
if not st.at_first_tag_in_dd:
st.man_out.append(st.p_macro)
elif tag == 'li':
st.at_first_tag_in_li = True
lstate = st.list_state[-1]
if lstate == 'dl':
return
if lstate == 'o':
st.man_out.append(".IP o\n")
else:
st.man_out.append(".IP " + str(lstate) + ".\n")
st.list_state[-1] += 1
elif tag == 'blockquote':
st.man_out.append(".RS 4\n")
elif tag == 'pre':
st.in_pre = True
st.man_out.append(st.p_macro + ".nf\n")
elif tag == 'code' and not st.in_pre:
st.in_code = True
st.txt += BOLD_FONT[0]
elif tag == 'strong' or tag == 'b':
st.txt += BOLD_FONT[0]
elif tag == 'em' or tag == 'i':
if st.want_manpage:
tag = 'u' # Change it into underline to be more like the manpage
st.txt += UNDR_FONT[0]
elif tag == 'ol':
start = 1
for var, val in attrs_list:
if var == 'start':
start = int(val) # We only support integers.
break
if st.list_state:
st.man_out.append(".RS\n")
if start == 0:
tag = 'dl'
attrs_list = [ ]
st.list_state.append('dl')
else:
st.list_state.append(start)
st.man_out.append(st.p_macro)
st.p_macro = ".IP\n"
elif tag == 'ul':
st.man_out.append(st.p_macro)
if st.list_state:
st.man_out.append(".RS\n")
st.p_macro = ".IP\n"
st.list_state.append('o')
elif tag == 'hr':
st.man_out.append(".l\n")
st.html_out.append("<hr />")
return
elif tag == 'a':
st.a_href = None
for var, val in attrs_list:
if var == 'href':
if val.startswith(('https://', 'http://', 'mailto:', 'ftp:')):
pass # nothing to check
elif '#' in val:
pg, tgt = val.split('#', 2)
if pg and pg not in VALID_PAGES or '#' in tgt:
st.bad_hashtags.add(val)
elif tgt in ('', 'opt', 'dopt'):
st.a_href = val
elif pg == '':
st.referenced_hashtags.add(tgt)
if tgt in st.latest_targets:
warn('Found link to the current section in', self.fn + ':', val)
elif val not in VALID_PAGES:
st.bad_hashtags.add(val)
st.a_txt_start = len(st.txt)
st.html_out.append('<' + tag + ''.join(' ' + var + '="' + htmlify(val) + '"' for var, val in attrs_list) + '>')
st.at_first_tag_in_dd = False
def handle_endtag(self, tag):
st = self.state
if args.debug:
self.output_debug('END', (tag,))
if tag in CONSUMES_TXT or st.dt_from == tag:
txt = st.txt.strip()
st.txt = ''
else:
txt = None
add_to_txt = None
if tag == 'h1':
tgt = txt
target_suf = ''
if tgt.startswith('NEWS for '):
m = VERSION_RE.search(tgt)
if m:
tgt = m.group(1)
st.target_suf = '-' + tgt
self.add_targets(tag, tgt)
elif tag == 'h2':
st.man_out.append(st.p_macro + '.SH "' + manify(txt) + '"\n')
self.add_targets(tag, txt, st.target_suf)
st.opt_prefix = 'dopt' if txt == 'DAEMON OPTIONS' else 'opt'
elif tag == 'h3':
st.man_out.append(st.p_macro + '.SS "' + manify(txt) + '"\n')
self.add_targets(tag, txt, st.target_suf)
elif tag == 'p':
if st.dt_from == 'p':
tag = 'dt'
st.man_out.append('.IP "' + manify(txt) + '"\n')
if txt.startswith(BOLD_FONT[0]):
self.add_targets(tag, txt)
st.dt_from = None
elif txt != '':
st.man_out.append(manify(txt) + "\n")
elif tag == 'li':
if st.list_state[-1] == 'dl':
if st.at_first_tag_in_li:
die("Invalid 0. -> td translation")
tag = 'dd'
if txt != '':
st.man_out.append(manify(txt) + "\n")
st.at_first_tag_in_li = False
elif tag == 'blockquote':
st.man_out.append(".RE\n")
elif tag == 'pre':
st.in_pre = False
st.man_out.append(manify(txt) + "\n.fi\n")
elif (tag == 'code' and not st.in_pre):
st.in_code = False
add_to_txt = NORM_FONT[0]
elif tag == 'strong' or tag == 'b':
add_to_txt = NORM_FONT[0]
elif tag == 'em' or tag == 'i':
if st.want_manpage:
tag = 'u' # Change it into underline to be more like the manpage
add_to_txt = NORM_FONT[0]
elif tag == 'ol' or tag == 'ul':
if st.list_state.pop() == 'dl':
tag = 'dl'
if st.list_state:
st.man_out.append(".RE\n")
else:
st.p_macro = ".P\n"
st.at_first_tag_in_dd = False
elif tag == 'hr':
return
elif tag == 'a':
if st.a_href:
atxt = st.txt[st.a_txt_start:]
find = 'href="' + st.a_href + '"'
for j in range(len(st.html_out)-1, 0, -1):
if find in st.html_out[j]:
pg, tgt = st.a_href.split('#', 2)
derived = txt2target(atxt, tgt)
if pg == '':
if derived in st.latest_targets:
warn('Found link to the current section in', self.fn + ':', st.a_href)
st.derived_hashtags.add((tgt, atxt))
st.html_out[j] = st.html_out[j].replace(find, 'href="' + pg + '#' + derived + '"')
break
else:
die('INTERNAL ERROR: failed to find href in html data:', find)
st.html_out.append('</' + tag + '>')
if add_to_txt:
if txt is None:
st.txt += add_to_txt
else:
txt += add_to_txt
if st.dt_from == tag:
st.man_out.append('.IP "' + manify(txt) + '"\n')
st.html_out.append('</dt><dd>')
st.at_first_tag_in_dd = True
st.dt_from = None
elif tag == 'dt':
st.html_out.append('<dd>')
st.at_first_tag_in_dd = True
def handle_data(self, txt):
st = self.state
if '](' in txt:
warn('Malformed link in', self.fn + ':', txt)
if args.debug:
self.output_debug('DATA', (txt,))
if st.in_pre:
html = htmlify(txt)
else:
txt = SPACE_DOUBLE_DASH_RE.sub(NBR_SPACE[0] + r'--\1', txt).replace('--', NBR_DASH[0]*2)
txt = NON_SPACE_SINGLE_DASH_RE.sub(r'\1' + NBR_DASH[0], txt)
html = htmlify(txt)
if st.in_code:
txt = WHITESPACE_RE.sub(NBR_SPACE[0], txt)
html = html.replace(NBR_DASH[0], '-').replace(NBR_SPACE[0], ' ') # <code> is non-breaking in CSS
st.html_out.append(html.replace(NBR_SPACE[0], '&nbsp;').replace(NBR_DASH[0], '-&#8288;'))
st.txt += txt
def add_targets(self, tag, txt, suf=None):
st = self.state
tag = '<' + tag + '>'
targets = CODE_BLOCK_RE.findall(txt)
if not targets:
targets = [ txt ]
tag_pos = 0
for txt in targets:
txt = txt2target(txt, st.opt_prefix)
if not txt:
continue
if suf:
txt += suf
if txt in st.created_hashtags:
for j in range(2, 1000):
chk = txt + '-' + str(j)
if chk not in st.created_hashtags:
print('Made link target unique:', chk)
txt = chk
break
if tag_pos == 0:
tag_pos -= 1
while st.html_out[tag_pos] != tag:
tag_pos -= 1
st.html_out[tag_pos] = tag[:-1] + ' id="' + txt + '">'
st.html_out.append('<a href="#' + txt + '" class="tgt"></a>')
tag_pos -= 1 # take into account the append
else:
st.html_out[tag_pos] = '<span id="' + txt + '"></span>' + st.html_out[tag_pos]
st.created_hashtags.add(txt)
st.latest_targets = targets
def output_debug(self, event, extra):
import pprint
st = self.state
if args.debug < 2:
st = argparse.Namespace(**vars(st))
if len(st.html_out) > 2:
st.html_out = ['...'] + st.html_out[-2:]
if len(st.man_out) > 2:
st.man_out = ['...'] + st.man_out[-2:]
print(event, extra)
pprint.PrettyPrinter(indent=2).pprint(vars(st))
def txt2target(txt, opt_prefix):
txt = txt.strip().rstrip(':')
m = CODE_BLOCK_RE.search(txt)
if m:
txt = m.group(1)
txt = NBR_DASH_RE.sub('-', txt)
txt = BIN_CHARS_RE.sub('', txt)
txt = INVALID_TARGET_CHARS_RE.sub('_', txt)
if opt_prefix and txt.startswith('-'):
txt = opt_prefix + txt
else:
txt = INVALID_START_CHAR_RE.sub(r't\1', txt)
return txt
def manify(txt):
return MANIFY_LINESTART_RE.sub(r'\&\1', txt.replace('\\', '\\\\')
.replace(NBR_SPACE[0], NBR_SPACE[1])
.replace(NBR_DASH[0], NBR_DASH[1])
.replace(NORM_FONT[0], NORM_FONT[1])
.replace(BOLD_FONT[0], BOLD_FONT[1])
.replace(UNDR_FONT[0], UNDR_FONT[1]))
def htmlify(txt):
return txt.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
def warn(*msg):
print(*msg, file=sys.stderr)
global warning_count
warning_count += 1
def die(*msg):
warn(*msg)
sys.exit(1)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Output html and (optionally) nroff for markdown pages.", add_help=False)
parser.add_argument('--test', action='store_true', help="Just test the parsing without outputting any files.")
parser.add_argument('--dest', metavar='DIR', help="Put files into DIR instead of the current directory.")
parser.add_argument('--debug', '-D', action='count', default=0, help='Output copious info on the html parsing. Repeat for even more.')
parser.add_argument("--help", "-h", action="help", help="Output this help message and exit.")
parser.add_argument("mdfiles", nargs='+', help="The source .md files to convert.")
args = parser.parse_args()
try:
import cmarkgfm
md_parser = cmarkgfm.markdown_to_html
gfm_parser = cmarkgfm.github_flavored_markdown_to_html
except:
try:
import commonmark
md_parser = html_via_commonmark
except:
die("Failed to find cmarkgfm or commonmark for python3.")
gfm_parser = None
main()
if warning_count:
sys.exit(1)

Some files were not shown because too many files have changed in this diff Show More