Wayne Davison [Tue, 9 May 2006 18:31:10 +0000 (18:31 +0000)]
- Use the new logfile_* variables that are set by the --log-file
option instead of the old daemon_log_* variables.
- Renamed the "logfile" variable "logfile_fp".
- Enhanced the logic in rwrite() to handle client-side FLOG output.
Wayne Davison [Tue, 9 May 2006 17:38:47 +0000 (17:38 +0000)]
If the --partial-dir value is an absolute path and we use a file in
it as an alternate basis file, make sure that we delete it when the
associated destination file is successfully updated.
Wayne Davison [Fri, 5 May 2006 16:00:33 +0000 (16:00 +0000)]
- Moved the sanitizing of the partial_dir value here from options.c.
- Call die_on_unsafe_path() in a few needed places.
- Handle the server-excluded checks for an absolute partial_dir and
the --*-dest options.
Wayne Davison [Fri, 5 May 2006 05:55:40 +0000 (05:55 +0000)]
Added a new function named die_on_unsafe_path(). This is used
by a non-chroot daemon to ensure that a user-supplied path does
not contain an unsafe symlink element.
Wayne Davison [Fri, 5 May 2006 05:53:36 +0000 (05:53 +0000)]
- Don't check HAVE_LINK directly, use SUPPORT_HARD_LINKS instead.
- Tweaked Paul's recent change just a tad.
- Fixed the output of --compare-dest when SUPPORT_HARD_LINKS is
not defined.
Paul Green [Thu, 4 May 2006 19:00:37 +0000 (19:00 +0000)]
Fix generator.c to avoid calling do_link() on systems that do not support
the link() function. The changes test OK on SuSE Linux and on my own
Stratus VOS system, but I would be grateful if other folks could
double-check this change. Paul G.
Wayne Davison [Wed, 3 May 2006 16:17:49 +0000 (16:17 +0000)]
Use send_msg() when forwarding a log message, not io_multiplex_write().
This allows send_msg() to decide if the message should be sent right
away, or should be deferred.
Wayne Davison [Wed, 3 May 2006 16:17:46 +0000 (16:17 +0000)]
Changed read_msg_fd() to always use send_msg()/rwrite() instead of
sometimes calling io_multiplex_write()/rwrite() or msg_list_add().
This simplifies the code that does the defer_forwarding_messages
checking because it can now be done in just one place, in send_msg()
(because rwrite() also calls send_msg() now when forwarding a msg).
Wayne Davison [Wed, 3 May 2006 05:19:01 +0000 (05:19 +0000)]
Fixed a bug where deferred MSG_INFO/MSG_ERROR/MSG_LOG messages were
not being forwarded from the generator to the sender using rwrite()
(and MSG_LOG messages didn't need to be deferred at all).
Wayne Davison [Wed, 3 May 2006 00:48:32 +0000 (00:48 +0000)]
- Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Got rid of startdir_depth code (in favor of util.c's curr_dir_depth).
- Use the new calling syntax for sanitize_path().
Wayne Davison [Wed, 3 May 2006 00:48:29 +0000 (00:48 +0000)]
- Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Don't sanitize the string of a symlink -- just use it verbatim.
Wayne Davison [Wed, 3 May 2006 00:48:26 +0000 (00:48 +0000)]
- Call safe_stat() instead of do_stat() when a sanitizing daemon might
need to ensure that it doesn't follow any unsafe symlinks.
- Use the new calling syntax for sanitize_path().
Wayne Davison [Wed, 3 May 2006 00:48:23 +0000 (00:48 +0000)]
- Added curr_dir_depth, a variable that keeps track of the depth past
the module root when a sanitizing daemon is running.
- Use the new calling syntax for sanitize_path().
- Updated count_dir_elements() to not count a . component.
- Improved sanitize_path() so that it can take a symlink target string
and combine it with the symlink's name when the target is relative.
When working with a symlink, the routine also returns NULL if any ..
elements try to escape past the module root.
- The new routine safe_stat(), is used when sanitizing paths (i.e. when
the daemon does not have chroot enabled). This manually follows a
chain of symlinks, ensuring they don't try to escape the module.
Wayne Davison [Tue, 2 May 2006 16:46:48 +0000 (16:46 +0000)]
Fixed a problem in the --link-dest processing where -I (--ignore-times)
or --size-only could adversely affect our ability to find identical
files to hard-link.
Wayne Davison [Tue, 2 May 2006 16:36:07 +0000 (16:36 +0000)]
Got rid of the sanitizing of a symlink's link string because it
is happening too early to work correctly (before we know what
our destination-directory's depth in the module will be).
Wayne Davison [Tue, 25 Apr 2006 20:23:34 +0000 (20:23 +0000)]
- Updated the address for the FSF in the opening comment.
- Standardized the format of the opening comment, including adding a
brief description of what's in the file for those that lacked it.
- Added some missing copyright lines.
- Some minor whitespace tweaks (in a few of the files).
Wayne Davison [Fri, 21 Apr 2006 16:40:19 +0000 (16:40 +0000)]
- Got rid of the (mostly useless) io_read_phase and io_write_phase
variables. In the future it might be useful to get rsync to
mention what kind of a message it was trying to write, but the
'phase "unknown"' output was ubiquitous and confusing.
- Got rid of the completely unused write_int_named() function.
Wayne Davison [Tue, 18 Apr 2006 05:48:46 +0000 (05:48 +0000)]
- Fixed --copy-dest behavior on a system where CAN_HARDLINK_SYMLINK
and/or CAN_HARDLINK_SPECIAL is not defined.
- Changed --link-dest behavior on such systems to work just like
--copy-dest for the non-hard-linkable files.
Wayne Davison [Sat, 8 Apr 2006 16:03:16 +0000 (16:03 +0000)]
Moved the calls to client_addr() and client_name() below the lp_load()
call so that their potential to output log messages can't cause the
log-file to initialize before we know what "log name" to use.