Wayne Davison [Fri, 30 Jul 2004 20:07:52 +0000 (20:07 +0000)]
If someone is denied access to a "list = no" module, lie and tell them
that the module is "Unknown" (so the user can't probe to find unlisted
modules).
Wayne Davison [Fri, 30 Jul 2004 20:05:37 +0000 (20:05 +0000)]
Don't ignore case in lp_number() because the rest of the daemon code
can't handle the case where the module name doesn't exactly match the
string the user provided.
Wayne Davison [Fri, 30 Jul 2004 07:02:37 +0000 (07:02 +0000)]
If we reject a name due to a server-exclude, someone is trying to hack
rsync (because the generator would not have included this file). Respond
with an exit.
Wayne Davison [Thu, 29 Jul 2004 07:09:46 +0000 (07:09 +0000)]
If we fail writing to the socket and we're receiving error messages
from the other side via a multiplexed input, read the socket to see
if we get some errors that would explain why they went away.
Wayne Davison [Wed, 28 Jul 2004 10:04:06 +0000 (10:04 +0000)]
- Explicitly save the stat()'s errno so that we can be sure we're
testing the right thing lower down (and so that future code doesn't
always have to remember to save it off and restore it).
- Improved a chunk of link_dest code.
- Handle the removal of a non-regular file without so much duplicated
code.
Wayne Davison [Sat, 24 Jul 2004 16:38:49 +0000 (16:38 +0000)]
Added write_stream_flags() to write the state of certain flags into
the batchfile and read_stream_flags() to read and twiddle the same
flags. This ensures that the batchfile reading doesn't get confused
about what data to expect from the socket.
Wayne Davison [Thu, 22 Jul 2004 22:52:39 +0000 (22:52 +0000)]
If we sucessfully renamed a file that has multiple links to it, unlink()
it to ensure that rename() didn't lie to us (which it does if you try to
rename() a file over another link to the same file).
Wayne Davison [Thu, 22 Jul 2004 04:15:18 +0000 (04:15 +0000)]
Added a warning message when a file fails to verify, letting the user
know if we retained it or discarded it. Especially useful for batch-
reading mode where the old code could look like it did the update when
it really silently failed.
Wayne Davison [Wed, 21 Jul 2004 23:59:37 +0000 (23:59 +0000)]
In read_batch mode, we read ints from the new batch_gen_fd pipe and
only process the updates from the batch file when the generator has
indicated that it is ready (which ensures that all the necessary
dirs have been created).
Wayne Davison [Wed, 21 Jul 2004 23:59:31 +0000 (23:59 +0000)]
Setup for read_batch mode a little differently:
- Avoid calling local_child().
- Create a pipe that lets the generator send us index values.
- Set batch_gen_fd for the receiver to read the pipe.
Wayne Davison [Wed, 21 Jul 2004 23:59:25 +0000 (23:59 +0000)]
In read_batch mode, we now let the code write out the index value
to the f_out pipe before we return from recv_generator(). This gives
the receiver something to sync with so that it doesn't rush ahead of
us (which could be bad if we didn't have a chance to create the
destination dirs yet).
Wayne Davison [Tue, 20 Jul 2004 21:35:55 +0000 (21:35 +0000)]
- Call map_file() with the new block_size arg (had to delay the
call to map_file() until the block size was known).
- Got rid of the setting of max_map_size.
Wayne Davison [Tue, 20 Jul 2004 21:35:52 +0000 (21:35 +0000)]
- Added a new block_size arg to map_file(). Use it to set the
new def_window_size member variable.
- Got rid of max_map_size global (we use def_window_size now).
Wayne Davison [Mon, 19 Jul 2004 16:37:30 +0000 (16:37 +0000)]
- Don't allow some crafty user to try to force us to update a
server-excluded file.
- If get_tmpname() fails we need to discard the update using
receive_data().
Wayne Davison [Mon, 19 Jul 2004 08:27:17 +0000 (08:27 +0000)]
Do a better job of writing out the BATCH.sh file (i.e. quote special
characters and spaces in args, omit all the source args, omit the
include/exclude args if we can).
Wayne Davison [Sat, 17 Jul 2004 15:20:00 +0000 (15:20 +0000)]
Revamped some of the io variables and calls to make the various I/O
functions seemlessly work on fds that aren't for the main socket. This
involved changing some fd-variable names (to make them clearer), adding
io_set_sock_fds(), and making input buffering have a better enabled
flag (via an allocated buffer, just like the output buffering). I also
got rid of the fd arg to some functions where the fd arg could only
specify the input or output fd for the socket (which we already know).
Wayne Davison [Fri, 16 Jul 2004 18:04:23 +0000 (18:04 +0000)]
- Limit the maximum block size we compute for a file.
- Set max_map_size based on the current file's block size (so that
map_ptr() is more efficient with large blocks).