Bug 2561 - rsync crashes when using the "exclude from" option on server side.
rsync crashes when using the "exclude from" option on server side.
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
2.6.4
x86 Linux
: P3 major
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-31 11:52 UTC by Mike Klinkert
Modified: 2005-06-03 01:39 UTC (History)
0 users

See Also:


Attachments
Fix crash when module-path is "/" and excludes are anchored. (578 bytes, patch)
2005-03-31 17:18 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Klinkert 2005-03-31 11:52:23 UTC
2.6.4 seems to have broken the "exclude from" option on server site. This is 
the setup (works flawlessy with 2.6.3):

client call: 'rsync -a -K -H -e "ssh -i /root/.ssh/rsync/id_dsa -l root" --
delete --delete-excluded --force --numeric-ids'

ssh command on server: 'rsync --server --daemon --config=/root/rsync/conf .'

/root/rsync/conf contains:
==========================
log file   = /var/log/rsyncd.log
pid file   = /var/run/rsyncd.pid
use chroot = no

[rootfs]
path             = /
max connections  = 1
list             = no
uid              = root
include from     = /root/rsync/include
exclude from     = /root/rsync/exclude
hosts allow      = <IP>,127.0.0.1
transfer logging = yes
refuse options   = delete*
==========================

/root/rsync/include is empty (but does exist)

/root/rsync/exclude contains:
=============================
/jail/backup/*
/jail/ftpproxy/cache/0*
/jail/webproxy/cache/*
/media/*
/mnt/*
/parts/*
/proc/*
/sys/*
/tmp/*
/usr/src/linux-*-vanilla
/var/lib/YaST2/you/*
/var/run/*.pid
/var/run/rsyncd.lock
/var/spool/MailScanner/archive/*
/var/spool/MailScanner/incoming/*
/var/spool/MailScanner/quarantine/*
===================================

rsync crashes with following message:
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(420)

When I change the ssh command on the server to the following (strace is 
added): 'strace rsync --server --daemon --config=/root/rsync/conf .', strace 
logs this (last 10 lines):
===============================================================================
open("/root/rsync/include", O_RDONLY|O_LARGEFILE) = 5
fstat64(5, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7fb7000
read(5, "", 131072)                     = 0
close(5)                                = 0
munmap(0xb7fb7000, 131072)              = 0
open("/root/rsync/exclude", O_RDONLY|O_LARGEFILE) = 5
fstat64(5, {st_mode=S_IFREG|0600, st_size=294, ...}) = 0
mmap2(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xb7fb7000
read(5, "/jail/backup/*\n/jail/ftpproxy/ca"..., 131072) = 294
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
=========================

When the "exclude from" option is commented out (or deleted) 
in /root/rsync/conf, rsync works. However, rsync still crashes when only 
entries in /root/rsync/exclude are commented out (with the "exclude from" 
option in /root/rsync/conf in tact).
Comment 1 Wayne Davison 2005-03-31 15:57:03 UTC
This only happens when a module has a path of "/" and chroot is disabled.  So,
the easiest fix is to turn on chroot.  I'll be looking into a fix for when
chroot is disabled.
Comment 2 Wayne Davison 2005-03-31 17:18:27 UTC
Created attachment 1129 [details]
Fix crash when module-path is "/" and excludes are anchored.

This patch should be the correct fix for this bug when chroot is disabled.
Comment 3 Mike Klinkert 2005-04-01 09:22:32 UTC
Patch fixes the problem. Thanks for the fast response.