chroot and wrong user names

Riq Willitts riq at scs.co.uk
Thu Sep 19 08:55:00 EST 2002


I am using rsync 2.5.5 running as a daemon on the destination system, which 
is SuSE Linux 8.0. The source system is SuSE 7.3, also with rsync 2.5.5. 
With the default 'use chroot = true' and not using  --numeric-ids, I get 
the wrong user names on the destination files. I have tracked this down  to 
getpwnam() failing to return the user name from the passwd file. It does 
not fail when chroot() is not called ( by setting 'use chroot = false' in 
rsyncd.conf).

A simple test program calling chroot() followed by getpwnam() shows the 
same effect, so the problem is not really in rsync.

As I wasted quite a lot of time discovering this, it could be helpful to 
put a warning in the documentation of rsync.

For some reason errno is zero on return from getpwnam() in the above case, 
although in my test program it is set to 29 (no such file or directory). It 
would therefore not be very useful to test errno in the rsync code.

Regards

Riq Willitts
Technical Director
Scientific Computing Service Ltd.




More information about the rsync mailing list