Bug 4944 - Iconv-patch does not convert command-line args
Summary: Iconv-patch does not convert command-line args
Status: CLOSED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.0
Hardware: x86 Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-31 06:12 UTC by Andre Raabe
Modified: 2008-07-26 10:12 UTC (History)
1 user (show)

See Also:


Attachments
Proposed patch for converting command-line args (3.03 KB, text/plain)
2007-08-31 06:16 UTC, Andre Raabe
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Raabe 2007-08-31 06:12:01 UTC
Latest rsync archive tarball (http://rsync.samba.org/ftp/rsync/nightly/rsync-HEAD-20070821-0504GMT.tar.gz) does not convert command-line args if iconv support is enabled.

See also bug #3764, #2790.
Comment 1 Andre Raabe 2007-08-31 06:16:38 UTC
Created attachment 2909 [details]
Proposed patch for converting command-line args 

This patch will only convert command-line args regarding source and/or destination, it does not fix includes nor exclude lists.
Comment 2 Wayne Davison 2007-09-03 02:13:49 UTC
Your patch appears to only translate the client's charset into UTF-8 before sending the command via the remote shell.  This doesn't work for a number of reasons.  The biggest is that the remote side needs to translate the args into its local charset.  It also needs to do this before the shell sees it so that wildcards matching can take place.

The solution I have contemplated for this would be to have --iconv send a minimal amount of command-line args to get rsync running in server mode, and then have it perform an arg-sending step to get a replacement set of command-line args.  This would work in a similar way as the files-from support (and could probably share much of the same code), but would need to take place prior to that handling, and the received args would need to be converted from UTF-8 into the local charset and then wild-card expanded into a new arg list (there is already code for this that is used in daemon mode).

For the moment, rsync requires the user to be in control of specifying exactly what they want in a way that the remote system can deal with.
Comment 3 Wayne Davison 2007-09-22 17:03:34 UTC
The version in CVS now has a command-line option that causes the filename args and (various options too) to be sent over the socket to the remote rsync instead of to the shell that runs rsync.  Combining this option with --iconv=OPT will convert the names that are sent.