Robert Helmer
2004-May-09 10:32 UTC
2.6.2 not displaying permissions errors on client side
Hello, Noticed this (bug?) while testing out rsync. For a little background, I need to push files real-time to some front-end servers, and I am thinking of switching from some custom shell scripts that do this job to rsync. I am thinking of running rsync as a daemon on the front-end servers, and doing an upload from the back-end server to push the data out as it comes in. So, here is the deal: If there is an error writing to the remote file due to a "permission denied" error, rsync 2.6.1's client exits with an error code of 23, and an informative error message. rsync 2.6.2 (and 2.5.7) exit with an error code of 0. For my current project, I really desire the response that 2.6.1 gives, is what 2.6.2 is doing a valid bug? If so I'll go through the diff between the release and send a patch back. I have a pretty simple test case to reproduce at this point: (in rsync-2.6.1 source directory) $ ./configure $ make $ sudo ./rsync --daemon --no-detach & $ ./rsync rsync3.txt rsync://localhost/root mkstemp "/.rsync3.txt.LVaWT1" (in root) failed: Permission denied rsync error: some files could not be transferred (code 23) at main.c(633) $ echo $? 23 (in rsync-2.6.0 source directory) $ ./configure $ make $ sudo ./rsync --daemon --no-detach & $ ./rsync rsync3.txt rsync://localhost/root $ echo $? 0 I have confirmed this behaviour on Debian Sid (unstable) and Solaris 8 (SunOS 5.8). Here is the /etc/rsyncd.conf used for all tests: # sample rsyncd.conf configuration file # GLOBAL OPTIONS #motd file=/etc/motd #log file=/var/log/rsyncd # for pid file, dont' use /var/run/rsync.pid unless you're not going to run # rsync out of the init.d script. The /var/run/rsyncd.pid below is OK. pid file=/var/run/rsyncd.pid #syslog facility=daemon #socket options # MODULE OPTIONS [root] comment = public archive path = /root use chroot = yes # max connections=10 lock file = /var/lock/rsyncd read only = no list = yes uid = nobody gid = nogroup # exclude = #specify any file in path not to be accessed # exclude from = # include # include from # auth users = #allow specific users to connect (besides anonymous) # secrets file = /etc/rsyncd.secrets # strict modes = yes #makes sure the secrets file has proper permissions # hosts allow # hosts deny ignore errors = no ignore nonreadable = no transfer logging = no # log format = %t: host %h (%a) %o %f (%l bytes). Total %b bytes. # timeout = 600 # refuse options = checksum, dry-run dont compress = *.gz *.tgz *.zip *.z *.rpm *.deb *.iso *.bz2 *.tbz
Robert Helmer
2004-May-09 11:11 UTC
2.6.2 not displaying permissions errors on client side
On Sun, 9 May 2004 3:45am, Robert Helmer wrote:> (in rsync-2.6.0 source directory)Sorry, small correction to my previous email - above should state "rsync-2.6.2" not "rsync-2.6.0" .. I did not test w/ the latter. The following is the valid output for 2.6.2 in my tests.> $ ./configure > $ make > $ sudo ./rsync --daemon --no-detach & > $ ./rsync rsync3.txt rsync://localhost/root > $ echo $? > 0
Wayne Davison
2004-May-09 15:05 UTC
2.6.2 not displaying permissions errors on client side
On Sun, May 09, 2004 at 03:35:47AM -0700, Robert Helmer wrote:> If there is an error writing to the remote file due to a "permission > denied" error, rsync 2.6.1's client exits with an error code of 23, and > an informative error message.... and no error message logged in the server's log file. Rsync has historically been hesitent to return error messages from a server to the client for fear of revealing too much information. The 2.6.0 and 2.6.1 releases were returning error messages but failing to log them in the server's log file. The 2.6.2 release reverts back to the historical way this was handled. A better solution for the future would be to log all errors to the server log and send some/most of them to the user as well. However, that will be a complex change, and it has not been worked on yet. A simpler solution would be to duplicate ALL the messages (the lack of selectivity make this change easy). The appended patch should do this, if you so desire to go that route. ..wayne.. -------------- next part -------------- --- log.c 29 Apr 2004 19:34:31 -0000 1.72 +++ log.c 9 May 2004 15:02:02 -0000 @@ -182,8 +182,8 @@ void rwrite(enum logcode code, char *buf send_msg((enum msgcode)code, buf, len); return; } - if (!am_daemon - && io_multiplex_write((enum msgcode)code, buf, len)) + if (io_multiplex_write((enum msgcode)code, buf, len) + && !am_daemon) return; }