summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:14:51 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-12-23 02:14:51 +0000
commitc276c1208e43ed4305d723004ddf602fbe99513b (patch)
tree4beac5b4f2c42126e646c09842f768027113fa63
parentacaac975cad5a45c14da53f1e61e5c6d133de85d (diff)
- 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@
-rw-r--r--ChangeLog6
-rw-r--r--scp.c10
-rw-r--r--sftp.c4
-rw-r--r--ssh.c6
4 files changed, 15 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index f9e7fa386..1745e7c99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,10 @@
36 - stevesk@cvs.openbsd.org 2002/11/26 02:38:54 36 - stevesk@cvs.openbsd.org 2002/11/26 02:38:54
37 [canohost.c] 37 [canohost.c]
38 KNF, comment and error message repair; ok markus@ 38 KNF, comment and error message repair; ok markus@
39 - markus@cvs.openbsd.org 2002/11/27 17:53:35
40 [scp.c sftp.c ssh.c]
41 allow usernames with embedded '@', e.g. scp user@vhost@realhost:file /tmp;
42 http://bugzilla.mindrot.org/show_bug.cgi?id=447; ok mouring@, millert@
39 43
4020021205 4420021205
41 - (djm) PERL-free fixpaths from stuge-openssh-unix-dev@cdy.org 45 - (djm) PERL-free fixpaths from stuge-openssh-unix-dev@cdy.org
@@ -871,4 +875,4 @@
871 save auth method before monitor_reset_key_state(); bugzilla bug #284; 875 save auth method before monitor_reset_key_state(); bugzilla bug #284;
872 ok provos@ 876 ok provos@
873 877
874$Id: ChangeLog,v 1.2525 2002/12/23 02:13:37 mouring Exp $ 878$Id: ChangeLog,v 1.2526 2002/12/23 02:14:51 mouring Exp $
diff --git a/scp.c b/scp.c
index 73ab0de81..4214e0c53 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.93 2002/11/26 00:45:03 wcobb Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.94 2002/11/27 17:53:35 markus Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -370,7 +370,7 @@ toremote(targ, argc, argv)
370 if (*targ == 0) 370 if (*targ == 0)
371 targ = "."; 371 targ = ".";
372 372
373 if ((thost = strchr(argv[argc - 1], '@'))) { 373 if ((thost = strrchr(argv[argc - 1], '@'))) {
374 /* user@host */ 374 /* user@host */
375 *thost++ = 0; 375 *thost++ = 0;
376 tuser = argv[argc - 1]; 376 tuser = argv[argc - 1];
@@ -391,7 +391,7 @@ toremote(targ, argc, argv)
391 *src++ = 0; 391 *src++ = 0;
392 if (*src == 0) 392 if (*src == 0)
393 src = "."; 393 src = ".";
394 host = strchr(argv[i], '@'); 394 host = strrchr(argv[i], '@');
395 len = strlen(ssh_program) + strlen(argv[i]) + 395 len = strlen(ssh_program) + strlen(argv[i]) +
396 strlen(src) + (tuser ? strlen(tuser) : 0) + 396 strlen(src) + (tuser ? strlen(tuser) : 0) +
397 strlen(thost) + strlen(targ) + 397 strlen(thost) + strlen(targ) +
@@ -470,7 +470,7 @@ tolocal(argc, argv)
470 *src++ = 0; 470 *src++ = 0;
471 if (*src == 0) 471 if (*src == 0)
472 src = "."; 472 src = ".";
473 if ((host = strchr(argv[i], '@')) == NULL) { 473 if ((host = strrchr(argv[i], '@')) == NULL) {
474 host = argv[i]; 474 host = argv[i];
475 suser = NULL; 475 suser = NULL;
476 } else { 476 } else {
@@ -1036,7 +1036,7 @@ okname(cp0)
1036 if (c & 0200) 1036 if (c & 0200)
1037 goto bad; 1037 goto bad;
1038 if (!isalpha(c) && !isdigit(c) && 1038 if (!isalpha(c) && !isdigit(c) &&
1039 c != '_' && c != '-' && c != '.' && c != '+') 1039 c != '@' && c != '_' && c != '-' && c != '.' && c != '+')
1040 goto bad; 1040 goto bad;
1041 } while (*++cp); 1041 } while (*++cp);
1042 return (1); 1042 return (1);
diff --git a/sftp.c b/sftp.c
index c4055b91e..c173e58cb 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26 26
27RCSID("$OpenBSD: sftp.c,v 1.31 2002/07/25 01:16:59 mouring Exp $"); 27RCSID("$OpenBSD: sftp.c,v 1.32 2002/11/27 17:53:35 markus Exp $");
28 28
29/* XXX: short-form remote directory listings (like 'ls -C') */ 29/* XXX: short-form remote directory listings (like 'ls -C') */
30 30
@@ -197,7 +197,7 @@ main(int argc, char **argv)
197 file1 = cp; 197 file1 = cp;
198 } 198 }
199 199
200 if ((host = strchr(userhost, '@')) == NULL) 200 if ((host = strrchr(userhost, '@')) == NULL)
201 host = userhost; 201 host = userhost;
202 else { 202 else {
203 *host++ = '\0'; 203 *host++ = '\0';
diff --git a/ssh.c b/ssh.c
index ac1c1db4a..c6beb1bcf 100644
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: ssh.c,v 1.187 2002/11/21 23:04:33 markus Exp $"); 43RCSID("$OpenBSD: ssh.c,v 1.188 2002/11/27 17:53:35 markus Exp $");
44 44
45#include <openssl/evp.h> 45#include <openssl/evp.h>
46#include <openssl/err.h> 46#include <openssl/err.h>
@@ -495,9 +495,9 @@ again:
495 av += optind; 495 av += optind;
496 496
497 if (ac > 0 && !host && **av != '-') { 497 if (ac > 0 && !host && **av != '-') {
498 if (strchr(*av, '@')) { 498 if (strrchr(*av, '@')) {
499 p = xstrdup(*av); 499 p = xstrdup(*av);
500 cp = strchr(p, '@'); 500 cp = strrchr(p, '@');
501 if (cp == NULL || cp == p) 501 if (cp == NULL || cp == p)
502 usage(); 502 usage();
503 options.user = p; 503 options.user = p;