Commit Graph

236 Commits

Author SHA1 Message Date
Andrew Tridgell
298c10d5bb some code reformatting 1998-07-17 07:42:04 +00:00
Andrew Tridgell
1f658d4207 fixed a problem with rsync buffering the debug output when redirected
to a file.
1998-07-17 07:07:23 +00:00
Andrew Tridgell
d3bc0b68ab make a function static 1998-07-17 05:38:51 +00:00
Andrew Tridgell
067857e0ac the recv_generator can be static 1998-07-02 01:27:51 +00:00
Andrew Tridgell
eb86d661d7 added --progress option which shows the progress of transfers. This
gives bored users something to watch.
1998-07-02 00:47:13 +00:00
Andrew Tridgell
fe055c718a - only keep a partial file if some literal data has been transferred,
this prevents a second interrupted transfer from reducing the size of
the transferred file.

- set SIGUSR1 to SIG_IGN early to prevent a race condition that
prevents the --partial code from working properly
1998-07-01 11:03:50 +00:00
Andrew Tridgell
c95da96a0c added a --partial option which tells rsync to keep partially
transferred files if the transfer is interrupted.

added a "options summary" section to the man page
1998-07-01 03:36:03 +00:00
Andrew Tridgell
46831d6fcf fixed chmod bug pointed out by Han Holl <jeholl@euronet.nl> 1998-06-18 13:26:10 +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
e81da93e86 if as non-root we failed to update the group of a file then don't
print the file name.
1998-06-18 10:03:44 +00:00
Andrew Tridgell
667e72a195 change the order of chmod and chown calls so that setuid bits don't
get removed by chown calls.
1998-06-18 09:36:24 +00:00
Andrew Tridgell
ddecf7060b if the user passes a block size on the command line then don't adapt
the block size.
1998-06-03 02:35:51 +00:00
Andrew Tridgell
a800434a82 added --stats option for verbose stats on the file transfer 1998-06-01 03:42:14 +00:00
Andrew Tridgell
1d3754aede cosmetic fix.
reset offset to 0 at the start of each loop so the filenames get
printed correctly when sending directories followed by local names.
1998-05-30 02:03:29 +00:00
Andrew Tridgell
fe8c0a9824 use Realloc instead of realloc 1998-05-28 06:40:25 +00:00
Andrew Tridgell
05848a2cc7 don't do recursive deletion if the recurse option is not selected. 1998-05-28 05:05:26 +00:00
Andrew Tridgell
4c36ddbeec heaps of cleanup in the io code.
we no longer use non-blocking IO, instead it uses select a lot more,
being careful to always allow for reading whenever a valid read fd is
available and chcking timeouts.

also split the file io calls into fileio.c
1998-05-27 12:37:22 +00:00
Andrew Tridgell
7b1ce0d746 fixed a race condition in the --delete handling code. The bug led to
spurious error messages about not be able to delete some files.

this fix also makes --delete processing more efficient
1998-05-27 06:30:50 +00:00
Andrew Tridgell
943882a289 - don't allow chown for the group of a file if running as a daemon and
uid!=0

- reset am_root after startup as a daemon
1998-05-23 05:57:08 +00:00
Andrew Tridgell
23e43fceeb fix shadowed variable 1998-05-22 12:07:23 +00:00
Andrew Tridgell
8d9dc9f99d this is a large commit which adds io multiplexing, thus giving error
messages from the server when using the socket code.

I've doen a fair bit of testing and I don't seem to have broken
anything, but it is a very complex change. More testing needed!
1998-05-18 08:20:26 +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
eb697c999b fixed a bug in the new . filename code 1998-05-11 12:29:19 +00:00
Andrew Tridgell
d4ebe7a7b1 changed the name of the temporary filename to include a leading . so
that it appears hidden while being transferred. This should be useful
when using rsync for mirroring so users accessing via ftp don't get
confused by the temporary files.
1998-05-10 13:45:03 +00:00
Andrew Tridgell
7a6421fa76 split the options parsing code into options.c
added the --port and --config options

use strlcpy() instead of strncpy()

some cleanups and formatting changes
1998-05-10 07:25:40 +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
d6e6ecbdbf handle broken readdir() on Solaris 2.6 (it returns the name offset by
2 characters!)
1998-05-06 07:00:38 +00:00
Andrew Tridgell
bcacc18bdf added support for 64 bit file offsets under Solaris 2.6. Not tested
yet.
1998-05-06 05:43:36 +00:00
Andrew Tridgell
3333ffbd43 revamped the -delete code. The last few bugs with it revealed that it
had a fundamental flaw in the way it detected duplicate deletion
scanning (which is very important when -R is used). I now store
inode/device numbers and use those to do the detection. This should be
a much less fragile method.
1998-04-17 06:07:23 +00:00
Andrew Tridgell
0a25de67e9 fixed a bug in the handling of -R with --delete
I introduced this bug in the last version as a side effect of fixing
the permissions on intermediate directories with -R. drat.
1998-04-13 06:39:33 +00:00
Andrew Tridgell
d867229ba0 handle sparse files more efficiently 1998-04-05 06:43:38 +00:00
Andrew Tridgell
1b2d733af2 a couple more system calls wrapped in syscall.c 1998-04-05 06:26:24 +00:00
Andrew Tridgell
98ae8c3e38 Solaris uses EEXIST instead of ENOTEMPTY. 1998-03-27 03:04:34 +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
5fb543d587 if rsync fails to update the group of a file but nothing else then
don't report a problem. On most OSes non-root users can't change the
group of a file.
1998-03-26 00:32:51 +00:00
Andrew Tridgell
71c4617611 - on systems (such as intel linux) where off_t is 32 bits but "long long"
is 64 bits use long long to get the totals right when transferring
  more than 2^32 bytes of data.

- use inline on flist_up if the compiler supports it
1998-03-25 11:08:32 +00:00
Andrew Tridgell
3cb6f5d6cb added a --force option.
This options tells rsync to delete directories even if they are not
empty. This applies to both the --delete option and to cases where
rsync tries to copy a normal file but the destination contains a
directory of the same name. Normally rsync will refuse to do a
recursive directory deletion in such cases, by using --force the
recursive deletion will be done.
1998-03-25 06:05:47 +00:00
Andrew Tridgell
7796395a0a don't show basedir in printed path (a aesthetic change only) 1998-03-25 01:59:23 +00:00
Andrew Tridgell
7308bd66e0 added chmod() and chown() to syscall.c 1998-03-24 06:39:16 +00:00
Andrew Tridgell
31e125226d added wrappers around all the system calls that can change what is on
disk. The wrappers check for dry_run.
1998-03-23 13:25:30 +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
0b91056090 started to add some 64 bit file offset support - not complete yet 1998-03-23 08:49:48 +00:00
Andrew Tridgell
e7ebc36c70 if the file changes during transfer then don't loop forever trying to
update it
1998-03-23 07:11:51 +00:00
Andrew Tridgell
1aa71c8d57 don't adapt the block size to above half the chunk size 1998-03-23 06:26:08 +00:00
Andrew Tridgell
3ba62a8308 - keep a list of pids and send them a SIGUSR1 for cleanup rather than
using setpgrp()

- adapt the block size for really large files to reduce the checksum
  size and memory overheads
1998-03-23 04:44:44 +00:00
Andrew Tridgell
3ec4dd9781 a large change to make rsync much more memory efficient. This is done
in 3 ways:

1) the realloc is done on a list of pointers, not a list of structures
2) only the basename of the file is now kept in the file struct an a
   util function f_name() is now used to access the full name when
   required.
3) pointers to directory names are re-used

hopefully I haven't broken anything. This will need lots of testing.
1998-03-23 03:45:02 +00:00
Andrew Tridgell
6bbbc08b83 *** empty log message *** 1998-01-13 19:25:59 +00:00
Andrew Tridgell
13dc412d76 *** empty log message *** 1998-01-13 19:19:48 +00:00
Andrew Tridgell
950ab32d38 *** empty log message *** 1998-01-13 18:35:10 +00:00
Andrew Tridgell
3b3a2fbcf0 *** empty log message *** 1998-01-06 16:53:52 +00:00