diff options
Diffstat (limited to 'security/ssh/patches/patch-ai')
-rw-r--r-- | security/ssh/patches/patch-ai | 136 |
1 files changed, 8 insertions, 128 deletions
diff --git a/security/ssh/patches/patch-ai b/security/ssh/patches/patch-ai index dfbecc62bbe..6189cc955b5 100644 --- a/security/ssh/patches/patch-ai +++ b/security/ssh/patches/patch-ai @@ -1,8 +1,8 @@ -$NetBSD: patch-ai,v 1.5 1999/12/25 05:28:35 kim Exp $ +$NetBSD: patch-ai,v 1.6 2000/03/20 02:25:50 itojun Exp $ ---- scp.c.orig Wed May 12 07:19:28 1999 -+++ scp.c Fri Dec 24 21:54:17 1999 -@@ -180,6 +180,19 @@ +--- scp.c- Wed May 12 20:19:28 1999 ++++ scp.c Mon Mar 20 09:53:06 2000 +@@ -180,6 +180,11 @@ #define STDERR_FILENO 2 #endif @@ -11,36 +11,10 @@ $NetBSD: patch-ai,v 1.5 1999/12/25 05:28:35 kim Exp $ +int nofwd = 0; +#endif /* AFS */ + -+/* This is set to non-zero if IPv4 is desired. */ -+int IPv4 = 0; -+ -+#ifdef ENABLE_IPV6 -+/* This is set to non-zero if IPv6 is desired. */ -+int IPv6 = 0; -+#endif -+ /* This is set to non-zero to enable verbose mode. */ int verbose = 0; -@@ -295,8 +308,17 @@ - } - args[i++] = "-x"; - args[i++] = "-a"; -+#ifdef ENABLE_ANOTHER_PORT_TRY -+ args[i++] = "-A"; -+#endif /* ENABLE_ANOTHER_PORT_TRY */ - args[i++] = "-oFallBackToRsh no"; - args[i++] = "-oClearAllForwardings yes"; -+ if (IPv4) -+ args[i++] = "-4"; -+#ifdef ENABLE_IPV6 -+ if (IPv6) -+ args[i++] = "-6"; -+#endif - if (verbose) - args[i++] = "-v"; - if (compress) -@@ -305,6 +327,10 @@ +@@ -305,6 +310,10 @@ args[i++] = "-P"; if (batchmode) args[i++] = "-oBatchMode yes"; @@ -51,32 +25,20 @@ $NetBSD: patch-ai,v 1.5 1999/12/25 05:28:35 kim Exp $ if (cipher != NULL) { args[i++] = "-c"; -@@ -441,8 +467,23 @@ +@@ -441,7 +450,11 @@ statistics = 0; fflag = tflag = 0; - while ((ch = getopt(argc, argv, "aAqQdfprtvBCL1c:i:P:o:S:")) != EOF) -+ while ((ch = getopt(argc, argv, "aAqQdfprtvBCL1c:i:P:o:S:4" ++ while ((ch = getopt(argc, argv, "aAqQdfprtvBCL1c:i:P:o:S" +#ifdef AFS + "k" +#endif -+#ifdef ENABLE_IPV6 -+ "6" -+#endif + )) != EOF) switch(ch) { /* User-visible flags. */ -+ case '4': -+ IPv4 = 1; -+ break; -+#ifdef ENABLE_IPV6 -+ case '6': -+ IPv6 = 1; -+ break; -+#endif case 'S': ssh_program = optarg; - break; -@@ -490,6 +531,11 @@ +@@ -490,6 +503,11 @@ case 'r': iamrecursive = 1; break; @@ -88,85 +50,3 @@ $NetBSD: patch-ai,v 1.5 1999/12/25 05:28:35 kim Exp $ /* Server options. */ case 'd': targetshouldbedirectory = 1; -@@ -589,6 +635,17 @@ - exit(errs != 0); - } - -+char * -+cleanhostname(host) -+ char *host; -+{ -+ if (*host == '[' && host[strlen(host) - 1] == ']') { -+ host[strlen(host) - 1] = '\0'; -+ return (host + 1); -+ } else -+ return host; -+} -+ - void - toremote(targ, argc, argv) - char *targ, *argv[]; -@@ -644,6 +701,7 @@ - bp = xmalloc(len); - if (host) { - *host++ = 0; -+ host = cleanhostname(host); - suser = argv[i]; - if (*suser == '\0') - suser = pwd->pw_name; -@@ -655,13 +713,15 @@ - suser, host, cmd, src, - tuser ? tuser : "", tuser ? "@" : "", - thost, targ); -- } else -+ } else { -+ host = cleanhostname(argv[i]); - (void)snprintf(bp, len, - "exec %s%s %s -x -o'FallBackToRsh no' -o'ClearAllForwardings yes' -n %s %s %s '%s%s%s:%s'", - ssh_program, verbose ? " -v" : "", options, -- argv[i], cmd, src, -+ host, cmd, src, - tuser ? tuser : "", tuser ? "@" : "", - thost, targ); -+ } - if (verbose) - fprintf(stderr, "Executing: %s\n", bp); - if (system(bp)) errs++; -@@ -671,7 +731,7 @@ - len = strlen(targ) + CMDNEEDS + 20; - bp = xmalloc(len); - (void)snprintf(bp, len, "%s -t %s", cmd, targ); -- host = thost; -+ host = cleanhostname(thost); - if (do_cmd(host, tuser, - bp, &remin, &remout) < 0) - exit(1); -@@ -721,6 +781,7 @@ - else if (!okname(suser)) - continue; - } -+ host = cleanhostname(host); - len = strlen(src) + CMDNEEDS + 20; - bp = xmalloc(len); - (void)snprintf(bp, len, "%s -f %s", cmd, src); -@@ -1365,11 +1426,19 @@ - colon(cp) - char *cp; - { -+ int flag = 0; -+ - if (*cp == ':') /* Leading colon is part of file name. */ - return (0); -+ if (*cp == '[') -+ flag = 1; - - for (; *cp; ++cp) { -- if (*cp == ':') -+ if (*cp == '@' && *(cp+1) == '[') -+ flag = 1; -+ if (*cp == ']' && *(cp+1) == ':' && flag) -+ return (cp+1); -+ if (*cp == ':' && !flag) - return (cp); - if (*cp == '/') - return (0); |