char username[SIZ];
int found_user;
struct recptypes *valid = NULL;
+ struct passwd *p = NULL;
if (trythisname == NULL) return login_not_found;
safestrncpy(username, trythisname, sizeof username);
found_user = getuser(&CC->user,
valid->recp_local);
}
- phree(valid);
+ free(valid);
}
}
+#ifdef ENABLE_AUTOLOGIN
+ /* If we haven't found the account yet, and the supplied name
+ * is a login name on the underlying host system, create the
+ * account.
+ */
+ if (found_user != 0) {
+ p = (struct passwd *) getpwnam(username);
+ if (p != NULL) {
+ create_user(username, 0);
+ found_user = getuser(&CC->user, username);
+ }
+ }
+#endif /* ENABLE_AUTOLOGIN */
+
/* Did we find something? */
if (found_user == 0) {
if (((CC->nologin)) && (CC->user.axlevel < 6)) {
case login_not_found:
cprintf("%d %s not found.\n", ERROR + NO_SUCH_USER, username);
return;
+ default:
cprintf("%d Internal error\n", ERROR + INTERNAL_ERROR);
}
}
lprintf(CTDL_NOTICE, "Deleting user <%s>\n", pname);
/* Perform any purge functions registered by server extensions */
- PerformUserHooks(usbuf.fullname, usbuf.usernum, EVT_PURGEUSER);
+ PerformUserHooks(&usbuf, EVT_PURGEUSER);
/* delete any existing user/room relationships */
cdb_delete(CDB_VISIT, &usbuf.usernum, sizeof(long));
lputroom(&qrbuf);
}
+ /* Perform any create functions registered by server extensions */
+ PerformUserHooks(&usbuf, EVT_NEWUSER);
+
/* Everything below this line can be bypassed if administratively
- creating a user, instead of doing self-service account creation
+ * creating a user, instead of doing self-service account creation
*/
if (become_user) {
cdbfr = cdb_fetch(CDB_MSGLISTS, &mailbox.QRnumber, sizeof(long));
if (cdbfr != NULL) {
- msglist = mallok(cdbfr->len);
+ msglist = malloc(cdbfr->len);
memcpy(msglist, cdbfr->ptr, cdbfr->len);
num_msgs = cdbfr->len / sizeof(long);
cdb_free(cdbfr);
}
}
if (msglist != NULL)
- phree(msglist);
+ free(msglist);
return (num_newmsgs);
}