+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
#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 *);
syslog(authorized ? LOG_INFO : LOG_ERR, "%s", buf);
if (result == 232)
- login(NULL);
+ login(NULL, result);
return;
}
}
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
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) {