[Dovecot] passdb-sql.c default scheme patch (for Zoong PHAM &Timo)
Andrew Hutchings
info at a-wing.co.uk
Wed Apr 6 22:51:26 EEST 2005
Here is a working temporary patch for the 'Received reply from worker
without password scheme' bug in passdb-sql.c until Timo can re-write it
in better code than my 5 minute hash job :)
Timo:
blocking code scheme detect doesn't take into account schemes that
cannot be detected and are not in the password string (in
{SCHEME}password form). This patch adds {SCHEME} to the password string
if default is required.
--- passdb-sql.c 2005-03-29 09:39:33.000000000 +0100
+++ /root/dovecot-1.0-test66/src/auth/passdb-sql.c 2005-04-06
20:38:42.297163120 +0100
@@ -14,6 +14,7 @@
#include "db-sql.h"
#include "passdb.h"
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -54,6 +55,7 @@
struct auth_request *auth_request = sql_request->auth_request;
enum passdb_result passdb_result;
const char *user, *password, *scheme;
+ char tmp[50];
int ret;
passdb_result = PASSDB_RESULT_INTERNAL_FAILURE;
@@ -87,6 +89,8 @@
scheme = password_get_scheme(&password);
if (scheme == NULL) {
scheme = passdb_sql_conn->set.default_pass_scheme;
+ sprintf(tmp,"{%s}%s",scheme,password);
+ auth_request->passdb_password = tmp;
i_assert(scheme != NULL);
}
--
Andrew Hutchings (A-Wing)
Linux Guru - Netserve Consultants Ltd. - www.domaincity.co.uk
Random BOFH excuse: Browser's cookie is corrupted -- someone's been
nibbling on it.
More information about the dovecot
mailing list