From c57d45f6bd9447e2b8912e24252d48c521deeed7 Mon Sep 17 00:00:00 2001 From: Geoffrey King Date: Fri, 28 Aug 1998 22:56:36 +0000 Subject: [PATCH] * cmds.c (user): Replace "oldlevel" with the more descriptive "oldclevel". Also, replace all occurrences of "dlevel" in this function with "clevel". * ftp.c (login): Test whether or not the server actually requires "PASS dummy" by first sending "PWD" and checking the return value. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10898 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftp/ChangeLog | 9 +++++++++ src/appl/gssftp/ftp/cmds.c | 8 ++++---- src/appl/gssftp/ftp/ftp.c | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/appl/gssftp/ftp/ChangeLog b/src/appl/gssftp/ftp/ChangeLog index 6c0321c06..d389d990a 100644 --- a/src/appl/gssftp/ftp/ChangeLog +++ b/src/appl/gssftp/ftp/ChangeLog @@ -1,3 +1,12 @@ +Fri Aug 28 18:46:35 1998 Geoffrey King + + * cmds.c (user): Replace "oldlevel" with the more descriptive + "oldclevel". Also, replace all occurrences of "dlevel" in this + function with "clevel". + + * ftp.c (login): Test whether or not the server actually requires + "PASS dummy" by first sending "PWD" and checking the return value. + Wed Aug 12 02:26:26 1998 Geoffrey King * ftp.c, cmds.c, cmdtab.c, main.c, secure.c, ftp_var.h: Replace diff --git a/src/appl/gssftp/ftp/cmds.c b/src/appl/gssftp/ftp/cmds.c index d1dfc9c09..4d1a8206a 100644 --- a/src/appl/gssftp/ftp/cmds.c +++ b/src/appl/gssftp/ftp/cmds.c @@ -1564,17 +1564,17 @@ user(argc, argv) n = command("PASS dummy"); else if (n == CONTINUE) { #ifndef NOENCRYPTION - int oldlevel; + int oldclevel; #endif - if (argc < 3 ) + if (argc < 3) argv[2] = mygetpass("Password: "), argc++; #ifndef NOENCRYPTION - if ((oldlevel = dlevel) == PROT_S) dlevel = PROT_P; + if ((oldclevel = clevel) == PROT_S) clevel = PROT_P; #endif n = command("PASS %s", argv[2]); #ifndef NOENCRYPTION /* level may have changed */ - if (dlevel == PROT_P) dlevel = oldlevel; + if (clevel == PROT_P) clevel = oldclevel; #endif } if (n == CONTINUE) { diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c index b2e7ebd3b..f6fb15677 100644 --- a/src/appl/gssftp/ftp/ftp.c +++ b/src/appl/gssftp/ftp/ftp.c @@ -289,8 +289,18 @@ login(host) user = tmp; } n = command("USER %s", user); - if (n == COMPLETE) - n = command("PASS dummy"); + if (n == COMPLETE) { + /* determine if we need to send a dummy password */ + int oldverbose = verbose; + + verbose = 0; + if (command("PWD") != COMPLETE) { + verbose = oldverbose; + command("PASS dummy"); + } else { + verbose = oldverbose; + } + } else if (n == CONTINUE) { #ifndef NOENCRYPTION int oldclevel; -- 2.26.2