[dovecot-cvs] dovecot/src/auth passdb-passwd.c, 1.17.2.2, 1.17.2.3 passdb-shadow.c, 1.18.2.2, 1.18.2.3
tss at dovecot.org
tss at dovecot.org
Mon Mar 26 19:15:05 EEST 2007
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv2001
Modified Files:
Tag: branch_1_0
passdb-passwd.c passdb-shadow.c
Log Message:
Verify the password with auth_request_password_verify() so passwd and shadow
can be used as master and deny passdbs.
Index: passdb-passwd.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-passwd.c,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.3
diff -u -d -r1.17.2.2 -r1.17.2.3
--- passdb-passwd.c 22 Mar 2007 01:36:41 -0000 1.17.2.2
+++ passdb-passwd.c 26 Mar 2007 16:15:03 -0000 1.17.2.3
@@ -6,7 +6,6 @@
#include "safe-memset.h"
#include "passdb.h"
-#include "mycrypt.h"
#include <pwd.h>
@@ -18,7 +17,7 @@
verify_plain_callback_t *callback)
{
struct passwd *pw;
- bool result;
+ int ret;
auth_request_log_debug(request, "passwd", "lookup");
@@ -41,13 +40,13 @@
PASSWD_PASS_SCHEME);
/* check if the password is valid */
- result = strcmp(mycrypt(password, pw->pw_passwd), pw->pw_passwd) == 0;
+ ret = auth_request_password_verify(request, password, pw->pw_passwd,
+ PASSWD_PASS_SCHEME, "passwd");
/* clear the passwords from memory */
safe_memset(pw->pw_passwd, 0, strlen(pw->pw_passwd));
- if (!result) {
- auth_request_log_info(request, "passwd", "password mismatch");
+ if (ret <= 0) {
callback(PASSDB_RESULT_PASSWORD_MISMATCH, request);
return;
}
Index: passdb-shadow.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-shadow.c,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -d -r1.18.2.2 -r1.18.2.3
--- passdb-shadow.c 22 Mar 2007 01:36:41 -0000 1.18.2.2
+++ passdb-shadow.c 26 Mar 2007 16:15:03 -0000 1.18.2.3
@@ -6,7 +6,6 @@
#include "safe-memset.h"
#include "passdb.h"
-#include "mycrypt.h"
#include <shadow.h>
@@ -18,7 +17,7 @@
verify_plain_callback_t *callback)
{
struct spwd *spw;
- bool result;
+ int ret;
auth_request_log_debug(request, "shadow", "lookup");
@@ -41,13 +40,13 @@
SHADOW_PASS_SCHEME);
/* check if the password is valid */
- result = strcmp(mycrypt(password, spw->sp_pwdp), spw->sp_pwdp) == 0;
+ ret = auth_request_password_verify(request, password, spw->sp_pwdp,
+ SHADOW_PASS_SCHEME, "shadow");
/* clear the passwords from memory */
safe_memset(spw->sp_pwdp, 0, strlen(spw->sp_pwdp));
- if (!result) {
- auth_request_log_info(request, "shadow", "password mismatch");
+ if (ret <= 0) {
callback(PASSDB_RESULT_PASSWORD_MISMATCH, request);
return;
}
More information about the dovecot-cvs
mailing list