Commit a946ab0a a946ab0a40525d966e8447f4e2c64badd3e5197e by Alain Magloire

minor nits in POP corrected.

1 parent c02f8c0e
......@@ -39,7 +39,7 @@
int
main(int argc, char **argv)
{
mailbox_t mbox;
mailbox_t mbox = NULL;
size_t i;
size_t count = 0;
char *mailbox_name = NULL;
......
......@@ -104,6 +104,8 @@ mailbox_create (mailbox_t *pmbox, const char *name, int id)
else
*pmbox = mbox;
}
else
status = ENOENT;
return status;
}
......
......@@ -364,11 +364,11 @@ pop_user (authority_t auth)
CHECK_ERROR_CLOSE (mbox, mpd, EACCES);
}
status = pop_writeline (mpd, "PASS %s\r\n", mpd->passwd);
CHECK_ERROR_CLOSE (mbox, mpd, status);
/* We have to nuke the passwd. */
memset (mpd->passwd, 0, strlen (mpd->passwd));
free (mpd->passwd);
mpd->passwd = NULL;
CHECK_ERROR_CLOSE (mbox, mpd, status);
MAILBOX_DEBUG0 (mbox, MU_DEBUG_PROT, "PASS *\n");
mpd->state = POP_AUTH_PASS;
......@@ -497,9 +497,12 @@ pop_open (mailbox_t mbox, int flags)
}
case POP_AUTH:
case POP_AUTH_USER:
case POP_AUTH_USER_ACK:
case POP_AUTH_PASS:
case POP_AUTH_PASS_ACK:
status = authority_authenticate (mbox->authority);
if (status != 0)
return status;
CHECK_EAGAIN (mpd, status);
case POP_AUTH_DONE:
break;
......
......@@ -98,7 +98,6 @@ main (int argc, char **argv)
registrar_get_list (&bookie);
list_append (bookie, mbox_record);
list_append (bookie, path_record);
list_append (bookie, pop_record);
}
/* Set the signal handlers */
......