fix bug with inconsistent result codes when homedir isn't accessible but / is
authorKen Raeburn <raeburn@mit.edu>
Tue, 8 Jan 2002 23:49:54 +0000 (23:49 +0000)
committerKen Raeburn <raeburn@mit.edu>
Tue, 8 Jan 2002 23:49:54 +0000 (23:49 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14092 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index 7577d5697b6f588e795f2baa989a911a50cf2b2b..8bb355b8634428cce75419d71e4e26fa5c3cffc2 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-08  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <tlyu@mit.edu>
 
        * ftpcmd.y (pathname): Handle returns from ftpglob() better so
index 1aaa8f0115a195fd083fcc2d86beb23a2c8311f6..7c2ea70cd6a701f06a4b287f6efdf830174affb7 100644 (file)
@@ -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) {