'@' in username

Terrel Shumway tshumway at uci.edu
Wed Aug 21 12:12:01 EST 2002


The code in main.c causes rsh/ssh to fail if there is an "@" in the 
login name

e.g. 
  username: fulano at mydomain.net
  host: shell.isp.net

=>
  rsync foo fulano at mydomain.net@shell.isp.net:

tries to log in with 
 rsh -l fulano mydomain.net at shell.isp.net
or even worse with -e ssh
 ssh -l fulano mydomain.net at shell.isp.net
ssh ignores the -l option and uses 'mydomain.net' as the username

The fix is simple: use the last "@" as the delimiter instead of the 
first "@". (RFC 1035 does not allow "@" in domain names.)

--- main.c~     Tue Mar 26 21:10:44 2002
+++ main.c      Wed Aug 21 13:47:40 2002
@@ -743,7 +743,7 @@
        }

        if (shell_machine) {
-               p = strchr(shell_machine,'@');
+               p = strrchr(shell_machine,'@');
                if (p) {
                        *p = 0;
                        shell_user = shell_machine;





More information about the rsync mailing list