Commit Graph

35 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
654175798b patch from Alberto Accomazzi <aaccomazzi@cfa.harvard.edu> to add
different exit codes for different conditions.
1998-11-03 07:08:27 +00:00
David Dykstra
587cb08dc4 Fix bug in --include and --include-from which didn't work as advertised;
could only include files before if "+ " was explicitly prefixed on files
from any exclude or include option.  Also simplified the code by removing
the "orig" exclude_struct element, and reduced the number of bytes
transferred from client to server by never including "- " prefixes in the
transmitted exclude list because exclusion is the default.
1998-10-26 22:03:18 +00:00
David Dykstra
2bca43f627 Optimize server for special case of a long list of includes ("+") followed
by a match-all exclude "- *".
1998-10-26 21:45:23 +00:00
Andrew Tridgell
fe8c0a9824 use Realloc instead of realloc 1998-05-28 06:40:25 +00:00
Andrew Tridgell
ea2111d10a - always flush the IO write buffer when reading
- handle start of line in exclude properly
1998-05-27 13:05:05 +00:00
Andrew Tridgell
2b6b4d539b added support for --include, --include-from and the +/- syntax 1998-05-27 11:02:33 +00:00
Andrew Tridgell
e42c9458c2 use strlcat() strlcpy() and slprintf() whenever possible to avoid any
chance of a buffer overflow
1998-05-15 09:26:01 +00:00
Andrew Tridgell
8f3a2d54a6 added "exclude" and "exclude from" options to rsyncd.conf.
This is useful for mirroring a web site when you don't want users to
mirror everything.
1998-05-15 01:02:49 +00:00
Andrew Tridgell
9486289ce4 some large systematic changes to make socket conversion easier. The
biggest one is the use of rprintf() instead of fprintf()
1998-05-07 14:50:22 +00:00
Andrew Tridgell
0944563eb9 a leading / in a pattern now means "use a absolute path match". This
allows you to exclude root directories without excluding
subdirectories of the same name.
1998-05-05 11:23:51 +00:00
Andrew Tridgell
575f2fca9a fixed a string termination bug in the uidlist handling code. I've also
added a read_sbuf() routine that fixes this kind of bug generically to
avoid similar problems in future.
1998-04-01 05:20:19 +00:00
Andrew Tridgell
6ba9279fb2 - added an internal io_error flag. Whenever an io error occurs (such
as not being able to open a directory) this flag is set and propogated
to the other end. When this flag is set the --delete code is
disabled. This prevents the problem that io or permission errors could
cause files to be incorrectly deleted on the destination.

- added a --timeout option. This allows you to set an IO timeout in
seconds. If no io occurs in that time then rsync exits with a timeout
error.

- changed some FERROR fds to FINFO
1998-03-26 04:18:47 +00:00
Andrew Tridgell
3a6a366fc5 finished 64 bit file offset support. Hopefully rsync can now transfer
files up to 2^64 bytes in size. Now I just need to find enough disk
space to test this :-)

The 64 bit offset code only works if off_t is 64 bits (or bigger!) on
both ends of the link. If one end tries to send a file greater than
2^31 in size and the other end doesn't support it then rsync will
abort.

This commit also cleans up some static declarations so they are in a
unitinitialised segment to save load time.
1998-03-23 12:52:57 +00:00
Andrew Tridgell
13a1f7929e some people are now using rsync as a public server, using various
patches or wrappers. One problem with this is that rsync was not
written with this in mind and wasn't very careful about possible stack
overflows etc which could lead to security breaches. This wasn't a
problem when run in the traditional way as any user that can run rsync
can login anyway and cause much more damage that way.
This patch attempts to close possible stack overflow problems. I've
checked for all strcpy(), strcat(), sprintf() and memcpy()
overflows. I would appreciate it if someone else with a devious mind
could also go through the rsync source code and see if there are any
other stack overflows possible. Let me know if you do.
1997-12-15 21:35:37 +00:00
Andrew Tridgell
dc5ddbccac - hard links
- better sparse handling
- FERROR and FINFO
1996-06-30 03:57:22 +00:00
Andrew Tridgell
34ccb63e71 new exit/cleanup code 1996-06-28 13:55:41 +00:00
Andrew Tridgell
720b47f261 went to full non-blocking writes for the send_files() process 1996-06-26 01:35:13 +00:00
Andrew Tridgell
c627d61324 Initial revision 1996-06-22 05:04:20 +00:00