David Dykstra [Thu, 18 Feb 1999 17:23:44 +0000 (17:23 +0000)]
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.
David Dykstra [Thu, 18 Feb 1999 16:27:36 +0000 (16:27 +0000)]
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>
David Dykstra [Wed, 17 Feb 1999 19:34:40 +0000 (19:34 +0000)]
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".
David Dykstra [Fri, 12 Feb 1999 17:27:22 +0000 (17:27 +0000)]
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.
David Dykstra [Wed, 10 Feb 1999 22:16:32 +0000 (22:16 +0000)]
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).
David Dykstra [Wed, 10 Feb 1999 19:33:05 +0000 (19:33 +0000)]
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.
David Dykstra [Wed, 10 Feb 1999 18:44:25 +0000 (18:44 +0000)]
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.
David Dykstra [Wed, 10 Feb 1999 18:03:59 +0000 (18:03 +0000)]
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.
David Dykstra [Tue, 9 Feb 1999 22:31:52 +0000 (22:31 +0000)]
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>
David Dykstra [Tue, 9 Feb 1999 19:27:15 +0000 (19:27 +0000)]
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
David Dykstra [Tue, 9 Feb 1999 18:35:29 +0000 (18:35 +0000)]
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
David Dykstra [Wed, 3 Feb 1999 15:38:06 +0000 (15:38 +0000)]
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.
David Dykstra [Wed, 3 Feb 1999 15:15:56 +0000 (15:15 +0000)]
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.
David Dykstra [Wed, 3 Feb 1999 15:11:40 +0000 (15:11 +0000)]
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.
David Dykstra [Thu, 21 Jan 1999 17:10:32 +0000 (17:10 +0000)]
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.
Andrew Tridgell [Fri, 8 Jan 1999 07:51:25 +0000 (07:51 +0000)]
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)
Andrew Tridgell [Tue, 5 Jan 1999 06:31:58 +0000 (06:31 +0000)]
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 :)
Andrew Tridgell [Tue, 5 Jan 1999 01:15:32 +0000 (01:15 +0000)]
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.
David Dykstra [Mon, 7 Dec 1998 18:48:46 +0000 (18:48 +0000)]
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.
Andrew Tridgell [Sat, 5 Dec 1998 01:56:45 +0000 (01:56 +0000)]
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 :)
David Dykstra [Wed, 25 Nov 1998 15:37:50 +0000 (15:37 +0000)]
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.
David Dykstra [Tue, 24 Nov 1998 22:03:16 +0000 (22:03 +0000)]
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 = *".
David Dykstra [Tue, 24 Nov 1998 21:26:38 +0000 (21:26 +0000)]
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 "*".
David Dykstra [Tue, 24 Nov 1998 19:52:35 +0000 (19:52 +0000)]
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>
David Dykstra [Fri, 6 Nov 1998 17:07:07 +0000 (17:07 +0000)]
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.
David Dykstra [Wed, 4 Nov 1998 16:47:33 +0000 (16:47 +0000)]
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.
Andrew Tridgell [Mon, 2 Nov 1998 04:17:56 +0000 (04:17 +0000)]
Jason told me that's its very important for his site to log exactly
how many bytes were needed to be transferred for each file. I added %b
and %c log format options to cover this. See the man page for details.