]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- markus@cvs.openbsd.org 2002/11/27 17:53:35
authorBen Lindstrom <mouring@eviladmin.org>
Mon, 23 Dec 2002 02:14:51 +0000 (02:14 +0000)
committerBen Lindstrom <mouring@eviladmin.org>
Mon, 23 Dec 2002 02:14:51 +0000 (02:14 +0000)
     [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@

ChangeLog
scp.c
sftp.c
ssh.c

index f9e7fa38642f86e7e9ae4e7ffda6892b74a7f2fd..1745e7c995ff5aa23813b366f4e3064197c95d0f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
    - stevesk@cvs.openbsd.org 2002/11/26 02:38:54
      [canohost.c]
      KNF, comment and error message repair; ok markus@
+   - 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@
 
 20021205
  - (djm) PERL-free fixpaths from stuge-openssh-unix-dev@cdy.org
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-$Id: ChangeLog,v 1.2525 2002/12/23 02:13:37 mouring Exp $
+$Id: ChangeLog,v 1.2526 2002/12/23 02:14:51 mouring Exp $
diff --git a/scp.c b/scp.c
index 73ab0de812cde8832a824d8f6134181028d6a112..4214e0c53dc61c28a44ed855da1ce19eb2c1dff0 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -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);
diff --git a/sftp.c b/sftp.c
index c4055b91ee47f7c2d5f19756354f4240f212d3d0..c173e58cb6b12ae40abc03d516a204b3495fa3cf 100644 (file)
--- a/sftp.c
+++ b/sftp.c
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.31 2002/07/25 01:16:59 mouring Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.32 2002/11/27 17:53:35 markus Exp $");
 
 /* XXX: short-form remote directory listings (like 'ls -C') */
 
@@ -197,7 +197,7 @@ main(int argc, char **argv)
                        file1 = cp;
                }
 
-               if ((host = strchr(userhost, '@')) == NULL)
+               if ((host = strrchr(userhost, '@')) == NULL)
                        host = userhost;
                else {
                        *host++ = '\0';
diff --git a/ssh.c b/ssh.c
index ac1c1db4afc323beb90ce2cb65e99deb76be2bf9..c6beb1bcf4cdde3fd380d9d9db36c081b8fda43e 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.187 2002/11/21 23:04:33 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.188 2002/11/27 17:53:35 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -495,9 +495,9 @@ again:
        av += optind;
 
        if (ac > 0 && !host && **av != '-') {
-               if (strchr(*av, '@')) {
+               if (strrchr(*av, '@')) {
                        p = xstrdup(*av);
-                       cp = strchr(p, '@');
+                       cp = strrchr(p, '@');
                        if (cp == NULL || cp == p)
                                usage();
                        options.user = p;