passdb-vpopmail.c revision d1ea0d2a39dbfde5a61b59c38fd0414b9a56f1f9
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen/* Copyright (C) 2002-2003 Timo Sirainen */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen/* Thanks to Courier-IMAP for showing how the vpopmail API should be used */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenvpopmail_verify_plain(struct auth_request *request, const char *password,
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen char vpop_user[VPOPMAIL_LIMIT], vpop_domain[VPOPMAIL_LIMIT];
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen vpw = vpopmail_lookup_vqp(request, vpop_user, vpop_domain);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen callback(PASSDB_RESULT_USER_UNKNOWN, request);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen callback(PASSDB_RESULT_USER_DISABLED, request);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen if (scheme == NULL) scheme = passdb_vpopmail.default_pass_scheme;
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen ret = password_verify(password, crypted_pass, scheme, request->user);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen safe_memset(vpw->pw_passwd, 0, strlen(vpw->pw_passwd));
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen "password mismatch");
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen callback(PASSDB_RESULT_PASSWORD_MISMATCH, request);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen const char *host = net_ip2addr(&request->remote_ip);
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen /* use putenv() directly rather than env_put() which
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen would leak memory every time we got here. use a
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen static buffer for putenv() as SUSv2 requirements
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainen would otherwise corrupt our environment later. */
9294b9ad2eb112258c247906b53010664f84e57bTimo Sirainenstatic void vpopmail_deinit(void)