Commit Graph

159 Commits

Author SHA1 Message Date
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
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
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
a358449ab1 Set rsync version in configure.in
Show IPv6 availability in --version.
2001-11-24 04:57:41 +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
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
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
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
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
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
e420b9d854 Change from getopt to popt.
Add comment.
2001-02-23 01:02:55 +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
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
82980a2384 fixed timing problem with cleanup and io_flush() by using non-blocking
waitpid()
2000-08-16 08:34:18 +00:00
Andrew Tridgell
3d38277706 optimisations from Rich Salz <rsalz@caveosystems.com> 2000-07-29 04:52:05 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Andrew Tridgell
f7632fc60d if no local destination is provided for the transfer then provide
a "ls -l" style listing of the files that would be transferred
1998-11-02 00:52:01 +00:00
Andrew Tridgell
7b3d425783 check for a broken inet_ntoa() on IRIX 1998-10-30 02:50:02 +00:00
Andrew Tridgell
e08bfe1248 added "log format" option to allow admins to choose the format for
rsyncd log file entries
1998-10-30 02:24:47 +00:00
Andrew Tridgell
f3737e0648 some minor optimisations 1998-10-29 06:39:43 +00:00
Andrew Tridgell
8de330a387 changes to get rsync working on a CRAY J90. This machine doesn't have
a 4 byte integer type (short is 8 bytes). I needed to use a new md4
implementation (I used the portable one I wrote for Samba).
1998-10-29 05:01:47 +00:00
Andrew Tridgell
11a5a3c704 and I thought I wasn't going to do any rsync coding for a while ...
Jason Andrade convinced me to add ftpd style logging of transfers,
enabled with a "transfer logging" option in rsyncd.conf

you can customise the format in log.c
1998-10-28 03:28:30 +00:00
Andrew Tridgell
b280a1f47e handle OSes (such as Unicos) which use a different value for S_IFLNK 1998-10-27 14:09:28 +00:00
Andrew Tridgell
932be9aa52 handle sstem (sco 3) with glob but not glob.h 1998-09-09 06:31:13 +00:00
Andrew Tridgell
c29ee43dbd handle hard links on systems with 16 bit ino_t 1998-07-17 14:42:59 +00:00
Andrew Tridgell
6ed67e6dd5 moved getopt.h above unistd.h to prevent problems with uwin on NT 1998-07-17 07:17:11 +00:00
Andrew Tridgell
22b1933287 fixed a race condition in rsync that opened a security hole. The
temporary files were being created with the same permissions as the
original file. So if the file was setuid but not owned by the user
doing the transfer then there was a window of opportunity for a
malicious user to execute it with the wrong permissions while it was
being transferred.

Thanks to snabb@epipe.fi for pointing this out.
1998-06-18 12:17:23 +00:00
Andrew Tridgell
f578043391 for consistency use memcpy/memset everywhere instead of bcopy/bzero 1998-06-18 09:51:44 +00:00