Commit Graph

149 Commits

Author SHA1 Message Date
Andrew Tridgell
6c82f74b6f don't treat intermediate link directories as links in the relative
path code
1998-05-23 03:13:46 +00:00
Andrew Tridgell
130b4ae447 strip any leading / off absolute paths when using relative path names 1998-05-18 14:11:43 +00:00
Andrew Tridgell
29110570f8 removed some debug code 1998-05-15 14:01:04 +00:00
Andrew Tridgell
3e607d2354 got rid of "EOF in map_ptr" problem. If a file shrinks mid transfer
then we supply a zero filled buffer at the end and rely on the
checksum to cause a retry. This is really the best we can do as there
is no correct semantics for copying a changing file!
1998-05-15 14:00:12 +00:00
Andrew Tridgell
1a016bfdec - changed the log messages to show the requested path
- some more paranoid buffer size checks
- separate open syslog call
- handle systems without LOG_NDELAY
1998-05-15 10:34:07 +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
d6dead6bb1 added write buffering during the file list sending. This makes things
a bit more efficient (less system calls)
1998-05-15 07:34:19 +00:00
Andrew Tridgell
e45e009309 changed a couple of places to use strlcpy() 1998-05-10 12:37:26 +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
1250f24ed2 fixed a bug in handling the -c option and non-regular files. It hadn't
turned up before because Linux had a bug in the handling of NULL
pointers to read()/write() on pipes, so I never noticed the bug in my
testing.

I've also sent a patch to Linus.
1998-04-09 00:38:40 +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
17faa41c7d added some debugging code 1998-03-26 05:48:37 +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
0c5f37d9db when using -x to stop at filesystem boundaries, include the mount
points but not their contents.

I did this by calling stat() on the directory above the current
directory and checking to see if it has the correct st_dev. Hopefully
this will work for most systems.

Note that the permissions and ownership on the mount point cannot be
copied correctly as they are unavailable while the filesystem is
mounted. Instead rsync will set the permissions and ownership to those
of the root directory of the mounted filesystem (ie. the apparent
permissions/ownership of the directory)
1998-03-26 00:11:50 +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
649d65edf3 - fixed a bug wth the handling of duplicate names with the new fist
structures

- send intermediate directories when using --relative to ensure the
  permissions are set correctly
1998-03-25 03:34:52 +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
2d0bb8eb0f save some more memory by only allocating the checksum when needed 1998-03-23 07:25:21 +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
f6c347425a *** empty log message *** 1998-01-13 15:57:26 +00:00
Andrew Tridgell
3b3a2fbcf0 *** empty log message *** 1998-01-06 16:53:52 +00:00
Andrew Tridgell
95a38e8684 cosmetic changes only
- minor correction to --update docs
- don't print "building file list" stuff when building a local file
list for use in the --delete code.
- remove some spaces at the end of lines in Makefile.in
1998-01-05 23:30:44 +00:00
Andrew Tridgell
684b4e3113 buffer overflow patches from mhpower@mit.edu (Matt Power) 1997-12-30 17:36:58 +00:00
Andrew Tridgell
e3cd198f8e - fixed spelling errors in man page
- fixed bug in hard link handling that could lead to spurious hard
links.
- fixed bug in the string handling in flist.c
1997-12-28 22:13:40 +00:00
Andrew Tridgell
82306bf6d6 *** empty log message *** 1997-12-17 11:07:17 +00:00
Andrew Tridgell
cbbe489208 handle things more grecefully when one machine supports hard links and
the other doesn't or one machine supports soft links and the other
doesn't.
1997-12-16 23:09:22 +00:00
Andrew Tridgell
6dd1782c42 - check for setlinebuf() in autoconf. Apparently HPUX doesn't have it
- use @exec_prefix@ and @prefix@ in more useful ways in Makefile.in
1997-12-16 22:39:55 +00:00
Andrew Tridgell
d966ee254a fixed a nasty bug in the handling of the --delete option when there
are duplicate file names in the list of files to be transferred
(eg. the user specifies the same file twice).
1997-12-16 17:59:49 +00:00
Andrew Tridgell
9a52223bce - fixed the "write exception" error. I was resetting got_select at the
wrong point
- fixed a seg fault error in flist.c
- only print hlink debug messages when using -v
1997-12-16 08:48:36 +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
628ba800e4 bugfix from Kenji Miyake <kenjim@fix.co.jp>
this fixes a off by 1 error that could cause rsync to crash when used
with --delete
1997-12-15 18:01:15 +00:00
Andrew Tridgell
f9c5162020 be a bit more friendly on systems that behave badly (consume lots of
ram) when you realloc() up by a small amount at a time
1997-12-15 17:29:51 +00:00
Andrew Tridgell
6574b4f7d9 added a --relative (== -R) option. This is what Anthony Thyssen
suggested on the list recently. See the man page entry for details but
basically it changes the behaviour so that paths are not stripped,
thus allowing you to specify a single rsync command to sync lots of
directories/files while preserving the full path name of each file.
also fixed a bug in the handling of umasks when both the source and
destination machines are local. We need to reset the umask before the
exec to ensure that the child gets a correct umask.
1997-12-15 14:43:27 +00:00
Andrew Tridgell
e9d4e304ea send "." filenames so the other end knows that a directory was sent 1997-10-30 08:07:28 +00:00
Andrew Tridgell
8bf737494f - check for sys/select.h
- check for and use lchown if possible

- fix problem with root directory on source and destination
1996-10-01 06:40:36 +00:00
Andrew Tridgell
a06d19e3fc *** empty log message *** 1996-07-05 04:49:32 +00:00
Andrew Tridgell
d89322c446 - fixed file time bug
- doc updates
1996-07-03 06:24:34 +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
43a481dc55 added csum-length option 1996-06-27 05:16:15 +00:00
Andrew Tridgell
4fe159a81d - improved filename packing
- fixed sunos EAGAIN bug
1996-06-27 04:22:19 +00:00
Andrew Tridgell
9f3541e632 *** empty log message *** 1996-06-26 13:43:26 +00:00
Andrew Tridgell
182dca5c80 more byte efficient flist routines 1996-06-26 13:37:05 +00:00
Andrew Tridgell
c627d61324 Initial revision 1996-06-22 05:04:20 +00:00