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.
Wayne Davison [Tue, 21 Mar 2006 18:06:26 +0000 (18:06 +0000)]
A nice file-attribute maintenance script that lets you restore
permissions, ownership, and group-info on files that may be
different than the originals.
Wayne Davison [Thu, 16 Mar 2006 20:02:36 +0000 (20:02 +0000)]
Make sure that the --relative test creates the implied directories
with user-write permission, and turns any symlinks in the implied
dirs into real dirs.
Wayne Davison [Thu, 16 Mar 2006 00:57:54 +0000 (00:57 +0000)]
- Optimized the msg_list_item structure to make the buffer an
integral part of the structure instead of pointer to a
separately allocated buffer.
- Improved the code that was ensuring that no messages from the
receiver could be merged into the middle of a partially written
buffer from the generator. The new code ensures that we never
avoid reading the messages from the receiver (like we used to).
This ensures that the generator will not hang when the receiver
got a read error on the socket, sent us a message about it, but
the socket in the generator never becomes writable for it to get
a similar error (now we are assured of getting the receiver's
note about their read error, and we know to shut things down).