From 4990e45639df60485b90ccf4715908267a71cee9 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Tue, 8 Jan 2002 23:49:54 +0000 Subject: [PATCH] fix bug with inconsistent result codes when homedir isn't accessible but / is git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14092 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftpd/ChangeLog | 8 ++++++++ src/appl/gssftp/ftpd/ftpd.c | 16 ++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 7577d5697..8bb355b86 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,11 @@ +2002-01-08 Ken Raeburn + + * ftpd.c (login): New argument LOGINCODE, optional result code to + override local use of success code 230 when homedir is not + accessible but root directory is. + (user): Pass result code 232 to login. + (pass): Pass result code 0 to login. + 2001-11-30 Tom Yu * ftpcmd.y (pathname): Handle returns from ftpglob() better so diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index 1aaa8f011..7c2ea70cd 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -254,7 +254,7 @@ FILE *dataconn(); #endif static void dolog(struct sockaddr_in *); static int receive_data(FILE *, FILE *); -static void login(char *passwd); +static void login(char *passwd, int logincode); static void end_login(void); static int disallowed_user(char *); static int restricted_user(char *); @@ -815,7 +815,7 @@ user(name) syslog(authorized ? LOG_INFO : LOG_ERR, "%s", buf); if (result == 232) - login(NULL); + login(NULL, result); return; } @@ -1088,13 +1088,14 @@ pass(passwd) } login_attempts = 0; /* this time successful */ - login(passwd); + login(passwd, 0); return; } static void -login(passwd) +login(passwd, logincode) char *passwd; + int logincode; { if (have_creds) { #ifdef GSSAPI @@ -1152,8 +1153,11 @@ login(passwd) reply(530, "User %s: can't change directory to %s.", pw->pw_name, pw->pw_dir); goto bad; - } else - lreply(230, "No directory! Logging in with home=/"); + } else { + if (!logincode) + logincode = 230; + lreply(logincode, "No directory! Logging in with home=/"); + } } } if (guest) { -- 2.26.2