2.6.2 not displaying permissions errors on client side

Robert Helmer
Sun, 09 May 2004 10:32:35 -0000

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