Commit Graph

156 Commits

Author SHA1 Message Date
Wayne Davison
4366d2c428 In delete_files(), handle new DEL_NO_RECURSE flag (and use
renamed DEL_FORCE_RECURSE flag.
2005-01-25 12:07:13 +00:00
Wayne Davison
82471e68a8 Honor the new omit_dir_times var. 2005-01-24 00:51:34 +00:00
Wayne Davison
11781089d1 In delete_file(): got rid of DEL_NO_RECURSE code and added
DEL_RECURSE code.  Improved the verbose output of a recursively
deleted directory when --dry-run is specified.
2005-01-20 23:51:57 +00:00
Wayne Davison
f227ffe4b9 Moved the dry_run check in set_perms() so that it only triggers if
we don't have a stat-buffer (and returns 1, not 0).
2005-01-20 23:01:34 +00:00
Wayne Davison
dd096ae080 - Updated delete_file() to take a flag arg that makes it more
flexible.  Optimized away a stat() call since the caller knows
  if the item to delete is a directory or not.
- Tweaked delete_file()'s "deleting ..." messages to include a
  trailing slash when we're deleting a directory.
- No need for conditional code around do_lstat() anymore.
2005-01-19 20:11:03 +00:00
Wayne Davison
997d9ea67f Added a "overwriting_basis" arg to finish_transfer(). 2005-01-10 10:03:12 +00:00
Wayne Davison
70a2c84cd2 If lchown() is not available, we only skip the call to chown() for a
symlink if it will try to follow the symlink (as a normal OS should).
2005-01-03 22:47:55 +00:00
Wayne Davison
a41a1e8718 If there is no lchown(), don't try to set the user & group of a symlink. 2005-01-03 21:05:39 +00:00
Wayne Davison
e484f0cc04 W mustn't backup an inplace file in finish_transfer(). 2004-09-07 20:37:36 +00:00
Wayne Davison
ebeacb36fb Set each file's permissions and modtime before it gets renamed. 2004-08-09 20:57:10 +00:00
Wayne Davison
81b07870c8 One call to link_stat() (in set_perms()) needed to honor the setting
of keep_dirlinks if the current item is a directory.
2004-07-31 16:15:41 +00:00
Wayne Davison
ecc81fce17 Use the new safe_fname() function. 2004-07-26 16:36:59 +00:00
Wayne Davison
077e59b769 The inplace handling in finish_transfer() now passes PERMS_SKIP_MTIME
to set_perms() if ok_to_set_time wasn't specified.
2004-07-22 15:30:04 +00:00
Wayne Davison
a3221d2ac1 My version of Mark Curtis's --inplace option. 2004-07-16 20:06:24 +00:00
Wayne Davison
da38e779ea Moved the verbose message about renaming the finished file down into
finish_transfer() so that it only gets output when we're actually going
to rename the file.
2004-07-02 18:13:53 +00:00
Wayne Davison
373ef16010 Call link_stat() with its new arg (for --keep-dirlinks support). 2004-06-11 07:40:45 +00:00
Wayne Davison
ee1df1ccae If --backup was specified without a --backup-dir, don't preserve the
directory timestamps.
2004-05-21 08:43:03 +00:00
Wayne Davison
d62bcc17f3 Changed rprintf() calls that included strerror() to use rsyserr(). 2004-05-15 19:31:10 +00:00
Wayne Davison
384431886a Changed PERMS_SKIP_TIME to PERMS_SKIP_MTIME. 2004-05-13 18:51:22 +00:00
Wayne Davison
82b302d928 Got rid of some useless externs. 2004-05-13 18:41:17 +00:00
Wayne Davison
4ecc9e6b64 The finish_transfer() call takes an arg that specifies if we should set the
modtime or not on the finished file.  It calls set_perms(), which now takes a
flag arg that allows us to specify if we want to skip the modtime modification.
2004-05-13 07:08:25 +00:00
Wayne Davison
a7ed6ca618 A few formatting tweaks in delete_file(). 2004-03-23 16:16:15 +00:00
Wayne Davison
3d06165389 Check robust_rename()'s return value using < 0. 2004-03-13 20:18:03 +00:00
Wayne Davison
a174e1ed0f Tweaked some comments and some whitespace. 2004-02-25 21:20:59 +00:00
Wayne Davison
62c9e6b3a5 Moved the EXDEV handling into robust_rename(). 2004-02-17 23:13:10 +00:00
Wayne Davison
ce37eb2d83 If verbose > 2, mention it if we're setting the uid or the gid. 2004-02-03 20:00:35 +00:00
Wayne Davison
c3e5e5851b New function: who_am_i() returns "sender", "receiver", or "generator". 2004-01-27 23:13:13 +00:00
Wayne Davison
a7725e6df9 Use new pathjoin() function. 2004-01-20 04:53:59 +00:00
Wayne Davison
baa4212ae1 If the do_lchown() fails and we weren't trying to change the user,
the error now says that chgrp failed, not chown.
2004-01-15 07:08:00 +00:00
J.W. Schultz
a60e2dca6b Create GID_NONE for use gid test readability. 2004-01-03 13:17:32 +00:00
Wayne Davison
7352b8736b Moved the is_in_group() function to uidlist.c. 2004-01-02 16:52:29 +00:00
Wayne Davison
d5a0b48379 Do a small msleep() in the sig_int() handler before shutting down.
This kluge allows things like SIGINT to find our children before
we go throwing around SIGUSR1's at them.
2003-12-19 06:52:02 +00:00
Wayne Davison
58cadc8608 Merged in the security fixes from 2.5.7. 2003-12-06 21:07:27 +00:00
Wayne Davison
7a2fd68b96 Tweaked the just-added error message to use my new full_fname()
function.  Also removed some trailing whitespace from lines.
2003-09-16 05:33:09 +00:00
J.W. Schultz
6a7cc46cb2 Detect and report when open or opendir succeed but read and
readdir fail caused by network filesystems issues and
truncated files.
			Thanks to David Norwood and Michael Brown
2003-09-16 02:49:59 +00:00
Wayne Davison
ea42541fe0 Improved file-related error messages by using the new
full_fname() function.
2003-09-11 04:53:05 +00:00
Paul Green
b0d791bb35 Patch from Roderick Schertler (roderick at argon.org) to ignore
non-POSIX directory mode bits that are used by AIX.
2003-02-18 18:07:36 +00:00
David Dykstra
f389ac80a9 Removed debugging statement that was added to sig_int() by the rsync+ patch
integration.  It was causing the format of the daemon log to be messed up
because of the leading \n.
2001-12-20 15:33:13 +00:00
Martin Pool
6902ed178b Merge across rsync+ patch; add a little documentation to the manpage. More documentation would be better. 2001-08-14 02:04:47 +00:00
Andrew Tridgell
8950ac03f8 imported new snprintf.c from samba, got rid of slprintf 2001-05-07 06:59:37 +00:00
Martin Pool
e327acece4 Better error messages when unlink fails 2000-11-08 09:32:11 +00:00
Andrew Tridgell
5b56cc19fb added --modify-window option from David Bolen <db3l@fitlinxx.com> 2000-09-06 02:12:13 +00:00
Andrew Tridgell
65d0a49f5c removed spurious error message 2000-09-06 00:48:52 +00:00
Andrew Tridgell
1d2c275fff I can't believe it - solaris allows unlink of a non-empty directory as
root, leaving a corrupt filesystem. Are those guys on drugs?

try to avoid the problem as best we can.
2000-01-24 09:13:39 +00:00
Andrew Tridgell
66203a982b added --backup-dir option from Bob Edwards
this is very useful for incremental backups
2000-01-24 04:58:53 +00:00
Andrew Tridgell
e30f065766 make --address work for a client connecting to a server 2000-01-10 04:49:51 +00:00
Andrew Tridgell
a5827a28d2 when we do a lchown() on a file we have to flush the cached perms on
the file if the file has the setuid or setgid bits set as the chown
has a side effect of removing the setuid and setgid bits.
we re-do the stat in this case
2000-01-06 00:26:00 +00:00
David Dykstra
128cf58433 When writing to a daemon with read only = false and uid = root and -g,
was not preserving group permisions.  Bug was introduced March 1 in
version 1.100 of rsync.c with an error in re-ordering of the boolean
expressions.  In order to completely preserve the earlier semantics,
change_gid should depend on "(am_root || !am_daemon)", but I don't see why
group ownership should behave differently in a non-root daemon.
1999-12-29 20:50:48 +00:00
Andrew Tridgell
f08baea3dd removed ACCESSPERMS mask when transferring a file without perms
copy. This makes us match GNU cp more closely.
1999-11-08 10:47:14 +00:00
Andrew Tridgell
3d19b4c83e separated out the make_backup code in preparation for some patches
from Bob Edwards
1999-08-30 08:19:47 +00:00