batch-mode fixes [was: [PATCH] fix read-batch SEGFAULT]

Chris Shoemaker chris.shoemaker at
Fri May 7 22:54:32 GMT 2004

On Fri, May 07, 2004 at 02:29:12AM -0400, Chris Shoemaker wrote:
> > Status update: I've just finished tracing through the client behavior
> > related to the apparent hang.  All seems to go well with client/server
> > negotiation, until the client tries to receive the file list (calling
> > recv_file_list).  This just times out, recalling select() every 60
> > seconds.  I'm guessing that the server just isn't sending the file list 
> > at the right time (or at all).  Strange, that this only happens with 
> > --write-batch.  I would think that protocol should be pretty much 
> > unaffected by batch-mode, since any conflicting options would already 
> > have been complained about.
> > 
> > I think I'll have to setup an rsync server and trace it during a 
> > --write-batch connection to find the problem.... maybe tomorrow night...
> Initial examination makes a suspect of the batch-mode handling of 
> exclude lists.... 

  Indeed, the basic problem is that the server waits to read the 
exclude list at the same the the client waits to read the file 
list.  They both go nowhere.

  I am still confused by several sections of code -- conditional
statements that determine whether or not the exclude list is to be
sent/received.  There seems to be some subtle interaction with --delete
and --delete-exclude, too.  IMHO, whether or not to communicate the
exclude list is too important a part of the protocol to be unclear.  I
recommend collecting in one place the complete conditional, so that
client and server can easily agree on whether or not to send/receive the
exclude list.

  As it is, I'm not sure if exclude lists are supposed to be mutually
exclusive with batch-mode or not.  Currently, I'm proceeding with the
assumption that they don't need to be exclusive.  So, I went:

/* if (!write_batch) */

at main.c:641.

  This seems to work better, because things get further.  The exclude
list is sent (empty, I guess) and the file list is sent and received.

  Things still don't complete, though.  Now, I'm getting permission
denied errors when opening the file pfx.rsync_flist.  I'm not sure why. 
I know that the client has setuid(nobody), but even when the current
directory is mode 777, permission is denied.  Perhaps there's a chroot


More information about the rsync mailing list