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

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


https://bugzilla.samba.org/show_bug.cgi?id=4757

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


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

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

[module]
        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
/home/matt/test/daemon-log-paths
[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/
rsync://user@localhost:3142/module/subdir/
Password: 
[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
3142
2007/07/01 21:05:17 [8499] connect from localhost (127.0.0.1)
2007/07/01 21:05:18 [8499] rsync to module/subdir/ from user at localhost
(127.0.0.1)
2007/07/01 21:05:18 [8499] receiving file list
2007/07/01 21:05:18 [8499] *deleting
me/matt/test/daemon-log-paths/daemon/dir/subdir/b
2007/07/01 21:05:18 [8499] .d..t......
me/matt/test/daemon-log-paths/daemon/dir/subdir/.
2007/07/01 21:05:18 [8499] >f+++++++++
me/matt/test/daemon-log-paths/daemon/dir/subdir/a
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 http://lists.samba.org/archive/rsync/2007-June/017896.html ,
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: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- 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