[Bug 11656] New: Escaping broken with --files-from

samba-bugs at samba.org samba-bugs at samba.org
Wed Dec 30 22:25:12 UTC 2015


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

            Bug ID: 11656
           Summary: Escaping broken with --files-from
           Product: rsync
           Version: 3.1.1
          Hardware: x64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: core
          Assignee: wayned at samba.org
          Reporter: gennady.uraltsev+bugs at gmail.com
        QA Contact: rsync-qa at samba.org

The escaping mechanism in --files-from is broken when a file name contains a
carriage return. The problem is that a filename 'foo\nbar' gets written as
foo\#012bar by --out-format="%n" but gets transformed into foo\#134#012bar when
passing through the --files-from directive.

On my system 
LC_CTYPE=en_US.UTF-8
LANG=en_US.UTF-8

More in general it would be great to have consistent escaping in the output of
--out-format for example like with an option of 

ls --quoting-style=<style>

also to deal with space-containing names. Lots of people having problems with
that (will post links to serverfault questions when I find them again...)

EXAMPLE:

Make directories 'src' and 'dst' and in 'src' create the file 'foo\nbar'
$ mkdir src; mkdir dst; touch src/"$(echo -e 'foo\nbar')"

Suppose that I want to create a list of files that would copy the file
'foo\nbar' from src to dest via the command
$ rsync -v --files-from=filelist src/ dest

It seems there is no possible way of doing so. In particular one would want the
file list generated by the option --out-format="%n" to give the correct file

$ rsync -n --out-format='%n' src/* dst
foo\#012bar

But the following happens

$ rsync -n --out-format='%n' src/* dst | rsync -v --files-from=- src/ dst
building file list ... 
rsync: link_stat "/home/guraltsev/test/src/foo\#134#012bar" failed: No such
file or directory (2)
done

sent 16 bytes  received 12 bytes  56.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code
23) at main.c(1165) [sender=3.1.1]

-- 
You are receiving this mail because:
You are the QA Contact for the bug.



More information about the rsync mailing list