DO NOT REPLY [Bug 4757] New: Daemon mis-logs paths if module path in rsyncd.conf is relative

samba-bugs at samba-bugs at
Mon Jul 2 01:14:37 GMT 2007

           Summary: Daemon mis-logs paths if module path in rsyncd.conf is
           Product: rsync
           Version: 3.0.0
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: hashproduct+rsync at
         QAContact: rsync-qa at

I set up an rsync daemon in /home/matt/test/daemon-log-paths/daemon with this

log file = rsyncd.log
transfer logging = yes
log format = %i %f
pid file =
port = 3142
use chroot = no

        path = dir/
        read only = false
        auth users = user
        secrets file = module.secrets

Then I pushed a directory to it as follows:

[matt at mattlaptop2 daemon-log-paths]$ pwd
[matt at mattlaptop2 daemon-log-paths]$ ls -l src
total 0
-rw------- 1 matt matt 0 2007-07-01 18:06 a
[matt at mattlaptop2 daemon-log-paths]$ ls -l daemon/dir/subdir
total 0
-rw------- 1 matt matt 0 2007-07-01 18:06 b
[matt at mattlaptop2 daemon-log-paths]$ ~/rsync/rsync/rsync -rt --del src/
[matt at mattlaptop2 daemon-log-paths]$ 

The resulting rsyncd.log was:

2007/07/01 21:04:23 [8458] rsyncd version 3.0.0cvs starting, listening on port
2007/07/01 21:05:17 [8499] connect from localhost (
2007/07/01 21:05:18 [8499] rsync to module/subdir/ from user at localhost
2007/07/01 21:05:18 [8499] receiving file list
2007/07/01 21:05:18 [8499] *deleting
2007/07/01 21:05:18 [8499] .d..t......
2007/07/01 21:05:18 [8499] >f+++++++++
2007/07/01 21:05:18 [8499] sent 96 bytes  received 183 bytes  total size 0

I expected the logged paths to be relative to the root of the module as per
Wayne's remarks at ,
but instead they are absolute paths missing the first few characters.

The trouble is that rsync sets module_dirlen to the length of the module path
as given in rsyncd.conf at line 371 of clientserver.c but then uses it as an
index into curr_dir at line 535 of log.c .  curr_dir begins with the absolute,
symlink-free path of the module, but if the path in rsyncd.conf is relative or
uses symlinks, skipping its length in curr_dir is meaningless.  To fix the bug,
rsync needs to set module_dirlen to the length of its current directory right
after it chdirs into the module.

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list