Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.2.7: Not enough or too much encoding conversion lead to "rejecting unrequested file-list name" #657

Open
phdru opened this issue Oct 28, 2024 · 0 comments

Comments

@phdru
Copy link

phdru commented Oct 28, 2024

Client and server: Debian 12 bookworm. Client: locale ru_RU.KOI8-R, FS encoding koi8-r. Server: locale ru_RU.UTF-8, FS encoding utf-8.

$ rsync --version
rsync  version 3.2.7  protocol version 31

Preparing a test file (its name is "test" in Russian):

$ ssh server "touch `echo тест | iconv -f koi8-r -t utf-8`"
$ ssh server "ls `echo тест | iconv -f koi8-r -t utf-8`" 
я┌п╣я│я┌

The last line is mojibake — it's Russian "test" in utf-8 shown in koi8-r font:

$ echo тест | iconv -f koi8-r -t utf-8                
я┌п╣я│я┌

No problem so far. Now let's rsync it:

$ rsync --iconv=koi8-r,utf-8 server:тест
rsync: [sender] link_stat "/home/phd/тест" failed: No such file or directory (2)

Hmm, pity. IWBN if rsync properly converts file names. But I can live without that. There is a worse problem:

$ rsync --iconv=koi8-r,utf-8 server:"`echo тест | iconv -f koi8-r -t utf-8`"
ERROR: rejecting unrequested file-list name: тест
rsync error: requested action not supported (code 4) at flist.c(1000) [Receiver=3.2.7]

Client rejects the name тест because it originally asked for я┌п╣я│я┌.

IMO it's a bug. Either rsync --iconv=koi8-r,utf-8 should encode file names on sending so that rsync --iconv=koi8-r,utf-8 server:тест works. Or it should check not encoded file names when receiving so that encoded file names passed through the check.

Currently the workaround is to turn off the check:

$ rsync --iconv=koi8-r,utf-8 --trust-sender server:"`echo тест | iconv -f koi8-r -t utf-8`"
-rw-------              0 2024/10/29 00:32:36 тест

--old-args also works. But IMO that are only workarounds.

Upd. For me the best solution would be proper file name encoding in both direction so this would work:

$ rsync --iconv=koi8-r,utf-8 server:тест
-rw-------              0 2024/10/29 00:32:36 тест
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant