dovecot: Support changing default password scheme for passdb pas...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jul 3 04:11:48 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/3f3c12bfdba6
changeset: 5880:3f3c12bfdba6
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jul 03 04:11:41 2007 +0300
description:
Support changing default password scheme for passdb passwd-file.

diffstat:

2 files changed, 15 insertions(+), 2 deletions(-)
dovecot-example.conf          |    2 +-
src/auth/passdb-passwd-file.c |   15 ++++++++++++++-

diffs (44 lines):

diff -r f7cdede45a88 -r 3f3c12bfdba6 dovecot-example.conf
--- a/dovecot-example.conf	Tue Jul 03 04:05:28 2007 +0300
+++ b/dovecot-example.conf	Tue Jul 03 04:11:41 2007 +0300
@@ -874,7 +874,7 @@ auth default {
   # passwd-like file with specified location
   # <doc/wiki/AuthDatabase.PasswdFile.txt>
   #passdb passwd-file {
-    # Path for passwd-file
+    # [scheme=<default password scheme>] <Path for passwd-file>
     #args = 
   #}
 
diff -r f7cdede45a88 -r 3f3c12bfdba6 src/auth/passdb-passwd-file.c
--- a/src/auth/passdb-passwd-file.c	Tue Jul 03 04:05:28 2007 +0300
+++ b/src/auth/passdb-passwd-file.c	Tue Jul 03 04:11:41 2007 +0300
@@ -116,6 +116,19 @@ passwd_file_preinit(struct auth_passdb *
 passwd_file_preinit(struct auth_passdb *auth_passdb, const char *args)
 {
 	struct passwd_file_passdb_module *module;
+	const char *p, *scheme = PASSWD_FILE_DEFAULT_SCHEME;
+
+	if (strncmp(args, "scheme=", 7) == 0) {
+		scheme = args + 7;
+		p = strchr(scheme, ' ');
+		if (p == NULL)
+			args = "";
+		else {
+			scheme = p_strdup_until(auth_passdb->auth->pool,
+						scheme, p);
+			args = p + 1;
+		}
+	}
 
 	module = p_new(auth_passdb->auth->pool,
 		       struct passwd_file_passdb_module, 1);
@@ -133,7 +146,7 @@ passwd_file_preinit(struct auth_passdb *
 							 NULL));
 	}
 
-	module->module.default_pass_scheme = PASSWD_FILE_DEFAULT_SCHEME;
+	module->module.default_pass_scheme = scheme;
 	return &module->module;
 }
 


More information about the dovecot-cvs mailing list