Wayne Davison [Wed, 7 Jun 2006 23:05:17 +0000 (23:05 +0000)]
- Pass "module_id" to the two log-related settings that are no longer
global.
- Added a "restart" arg to log_init() that lets us request that logging
be reinitialized if the log-file/syslog-facility params changed.
Wayne Davison [Thu, 1 Jun 2006 08:04:43 +0000 (08:04 +0000)]
- Got rid of the FNAME logcode enum.
- rwrite() no longer supports newlines at the start of the string.
- maybe_log_item() avoids outputting a non-significant update to
the log file if the log-file-format doesn't include %i.
Wayne Davison [Tue, 30 May 2006 18:26:17 +0000 (18:26 +0000)]
Authorize the current host in the rsyncd.conf file in addition
to localhost and 127.0.0.1 (which will hopefully fix the failing
of the daemon tests on FreeBSD).
Wayne Davison [Tue, 30 May 2006 17:47:20 +0000 (17:47 +0000)]
- Added the --log-file-format option to the daemon section.
- Updated and improved the --out-format section.
- Moved and improved the description of the non-daemon --log-file and
--log-file-format options.
Wayne Davison [Tue, 30 May 2006 17:14:17 +0000 (17:14 +0000)]
- Allow the --log-file-format option to override the "log format"
setting when starting a daemon.
- Make a daemon refuse all --log-file* options.
- Don't use refuse logic on daemon-mode options given to a daemon
module -- reject them via their own message.
Wayne Davison [Mon, 29 May 2006 22:56:48 +0000 (22:56 +0000)]
- Use the renamed stdout_format_has_i, stdout_format_has_o_or_i, and
stdout_format variables.
- In rwrite(), make FNAME output only go to the client.
- Added an arg to log_item() that indicates what kind of output is
desired: FNAME (stdout only), FLOG (log file only), or FINFO (both).
Wayne Davison [Mon, 29 May 2006 22:56:45 +0000 (22:56 +0000)]
- Renamed log_format -> stdout_format.
- Renamed log_format_has_i -> stdout_format_has_i.
- Renamed log_format_has_o_or_i -> stdout_format_has_o_or_i.
- Changed the --log-format to --out-format (though we still accept
the old option, and still send it as well).
- Added the --log-file-format option (and got rid of the code that
made --out-format sometimes affect the log-file's format).
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.