From 430edda8ea3dc8807424158ad99eedf9549e573c Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Mon, 7 Oct 2002 17:14:41 +0000 Subject: [PATCH] From trunk: cvs up -j1.87 -j1.88 scp.c [svn merge -r1993:1994] Fix code which was clobbering people's -P arguments in PSCP (moved it to before the deferred command line processing). Also removed a couple of unused variables. [originally from svn r1995] --- scp.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scp.c b/scp.c index cc67a625..5ebcfd2c 100644 --- a/scp.c +++ b/scp.c @@ -83,10 +83,8 @@ static int recursive = 0; static int preserve = 0; static int targetshouldbedirectory = 0; static int statistics = 1; -static int portnumber = 0; static int prev_stats_len = 0; static int scp_unsafe_mode = 0; -static char *password = NULL; static int errs = 0; /* GUI Adaptation - Sept 2000 */ #define NAME_STR_MAX 2048 @@ -449,7 +447,15 @@ static void do_cmd(char *host, char *user, char *cmd) do_defaults(NULL, &cfg); strncpy(cfg.host, host, sizeof(cfg.host) - 1); cfg.host[sizeof(cfg.host) - 1] = '\0'; - cfg.port = 22; + } + + /* + * Force use of SSH. (If they got the protocol wrong we assume the + * port is useless too.) + */ + if (cfg.protocol != PROT_SSH) { + cfg.protocol = PROT_SSH; + cfg.port = 22; } /* @@ -500,12 +506,6 @@ static void do_cmd(char *host, char *user, char *cmd) free(user); } - if (cfg.protocol != PROT_SSH) - cfg.port = 22; - - if (portnumber) - cfg.port = portnumber; - /* * Disable scary things which shouldn't be enabled for simple * things like SCP and SFTP: agent forwarding, port forwarding, -- 2.45.2