dovecot-2.2: ldap auth: Removed base() wrapper around @dn values.

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 19 12:13:41 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/5b975ddc1c9a
changeset: 16041:5b975ddc1c9a
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 19 12:13:33 2013 +0200
description:
ldap auth: Removed base() wrapper around @dn values.
The idea was to provide extensibility, but it can better be done with LDAP
URLs.

diffstat:

 src/auth/db-ldap.c |  24 +++---------------------
 1 files changed, 3 insertions(+), 21 deletions(-)

diffs (41 lines):

diff -r 70dd78cd89ab -r 5b975ddc1c9a src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Tue Mar 19 11:52:15 2013 +0200
+++ b/src/auth/db-ldap.c	Tue Mar 19 12:13:33 2013 +0200
@@ -546,24 +546,6 @@
 	return NULL;
 }
 
-static int db_ldap_dn_parse(struct auth_request *auth_request,
-			    struct ldap_request_named_result *named_res,
-			    const char *name, const char *value)
-{
-	unsigned int len = strlen(value);
-
-	/* in future we could also have a filter() in here and maybe some
-	   options.. of course, in future the whole ldap configuration will
-	   probably be redesigned to become simpler.. */
-	if (strncmp(value, "base(", 5) != 0 || value[len-1] != ')') {
-		auth_request_log_error(auth_request, "ldap",
-			"Invalid @%s value '%s'", name, value);
-		return -1;
-	}
-	named_res->dn = p_strndup(auth_request->pool, value+5, len-5-1);
-	return 0;
-}
-
 static int db_ldap_fields_get_dn(struct ldap_connection *conn,
 				 struct ldap_request_search *request)
 {
@@ -582,9 +564,9 @@
 		array_foreach_modifiable(&request->named_results, named_res) {
 			if (strcmp(named_res->field->name, name) != 0)
 				continue;
-			if (db_ldap_dn_parse(auth_request, named_res,
-					     name, values[0]) < 0)
-				return -1;
+			/* In future we could also support LDAP URLs here */
+			named_res->dn = p_strdup(auth_request->pool,
+						 values[0]);
 		}
 	}
 	db_ldap_result_iterate_deinit(&ldap_iter);


More information about the dovecot-cvs mailing list