diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-12-23 02:14:51 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-12-23 02:14:51 +0000 |
commit | c276c1208e43ed4305d723004ddf602fbe99513b (patch) | |
tree | 4beac5b4f2c42126e646c09842f768027113fa63 /scp.c | |
parent | acaac975cad5a45c14da53f1e61e5c6d133de85d (diff) | |
download | openssh-git-c276c1208e43ed4305d723004ddf602fbe99513b.tar.gz |
- markus@cvs.openbsd.org 2002/11/27 17:53:35
[scp.c sftp.c ssh.c]
allow usernames with embedded '@', e.g. scp user@vhost@realhost:file /tmp;
http://bugzilla.mindrot.org/show_bug.cgi?id=447; ok mouring@, millert@
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -75,7 +75,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.93 2002/11/26 00:45:03 wcobb Exp $"); +RCSID("$OpenBSD: scp.c,v 1.94 2002/11/27 17:53:35 markus Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -370,7 +370,7 @@ toremote(targ, argc, argv) if (*targ == 0) targ = "."; - if ((thost = strchr(argv[argc - 1], '@'))) { + if ((thost = strrchr(argv[argc - 1], '@'))) { /* user@host */ *thost++ = 0; tuser = argv[argc - 1]; @@ -391,7 +391,7 @@ toremote(targ, argc, argv) *src++ = 0; if (*src == 0) src = "."; - host = strchr(argv[i], '@'); + host = strrchr(argv[i], '@'); len = strlen(ssh_program) + strlen(argv[i]) + strlen(src) + (tuser ? strlen(tuser) : 0) + strlen(thost) + strlen(targ) + @@ -470,7 +470,7 @@ tolocal(argc, argv) *src++ = 0; if (*src == 0) src = "."; - if ((host = strchr(argv[i], '@')) == NULL) { + if ((host = strrchr(argv[i], '@')) == NULL) { host = argv[i]; suser = NULL; } else { @@ -1036,7 +1036,7 @@ okname(cp0) if (c & 0200) goto bad; if (!isalpha(c) && !isdigit(c) && - c != '_' && c != '-' && c != '.' && c != '+') + c != '@' && c != '_' && c != '-' && c != '.' && c != '+') goto bad; } while (*++cp); return (1); |