[dovecot-cvs] dovecot/src/auth db-ldap.c, 1.62, 1.63 db-sql.c, 1.12, 1.13

tss at dovecot.org tss at dovecot.org
Sat Mar 31 07:40:48 EEST 2007


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv10269/auth

Modified Files:
	db-ldap.c db-sql.c 
Log Message:
Added type checks to setting defines.



Index: db-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-ldap.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- db-ldap.c	19 Jan 2007 15:27:43 -0000	1.62
+++ db-ldap.c	31 Mar 2007 04:40:42 -0000	1.63
@@ -41,32 +41,33 @@
 #  define LDAP_OPT_SUCCESS LDAP_SUCCESS
 #endif
 
-#define DEF(type, name) \
-	{ type, #name, offsetof(struct ldap_settings, name) }
+#define DEF_STR(name) DEF_STRUCT_STR(name, ldap_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, ldap_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, ldap_settings)
 
 static struct setting_def setting_defs[] = {
-	DEF(SET_STR, hosts),
-	DEF(SET_STR, uris),
-	DEF(SET_STR, dn),
-	DEF(SET_STR, dnpass),
-	DEF(SET_BOOL, auth_bind),
-	DEF(SET_STR, auth_bind_userdn),
-	DEF(SET_BOOL, tls),
-	DEF(SET_BOOL, sasl_bind),
-	DEF(SET_STR, sasl_mech),
-	DEF(SET_STR, sasl_realm),
-	DEF(SET_STR, sasl_authz_id),
-	DEF(SET_STR, deref),
-	DEF(SET_STR, scope),
-	DEF(SET_STR, base),
-	DEF(SET_INT, ldap_version),
-	DEF(SET_STR, user_attrs),
-	DEF(SET_STR, user_filter),
-	DEF(SET_STR, pass_attrs),
-	DEF(SET_STR, pass_filter),
-	DEF(SET_STR, default_pass_scheme),
-	DEF(SET_STR, user_global_uid),
-	DEF(SET_STR, user_global_gid),
+	DEF_STR(hosts),
+	DEF_STR(uris),
+	DEF_STR(dn),
+	DEF_STR(dnpass),
+	DEF_BOOL(auth_bind),
+	DEF_STR(auth_bind_userdn),
+	DEF_BOOL(tls),
+	DEF_BOOL(sasl_bind),
+	DEF_STR(sasl_mech),
+	DEF_STR(sasl_realm),
+	DEF_STR(sasl_authz_id),
+	DEF_STR(deref),
+	DEF_STR(scope),
+	DEF_STR(base),
+	DEF_INT(ldap_version),
+	DEF_STR(user_attrs),
+	DEF_STR(user_filter),
+	DEF_STR(pass_attrs),
+	DEF_STR(pass_filter),
+	DEF_STR(default_pass_scheme),
+	DEF_STR(user_global_uid),
+	DEF_STR(user_global_gid),
 
 	{ 0, NULL, 0 }
 };

Index: db-sql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-sql.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- db-sql.c	30 Mar 2007 14:12:46 -0000	1.12
+++ db-sql.c	31 Mar 2007 04:40:42 -0000	1.13
@@ -11,16 +11,18 @@
 #include <stddef.h>
 #include <stdlib.h>
 
-#define DEF(type, name) { type, #name, offsetof(struct sql_settings, name) }
+#define DEF_STR(name) DEF_STRUCT_STR(name, sql_settings)
+#define DEF_INT(name) DEF_STRUCT_INT(name, sql_settings)
+#define DEF_BOOL(name) DEF_STRUCT_BOOL(name, sql_settings)
 
 static struct setting_def setting_defs[] = {
-	DEF(SET_STR, driver),
-	DEF(SET_STR, connect),
-	DEF(SET_STR, password_query),
-	DEF(SET_STR, user_query),
- 	DEF(SET_STR, update_query),
-	DEF(SET_STR, default_pass_scheme),
-	DEF(SET_BOOL, allow_multiple_rows),
+	DEF_STR(driver),
+	DEF_STR(connect),
+	DEF_STR(password_query),
+	DEF_STR(user_query),
+ 	DEF_STR(update_query),
+	DEF_STR(default_pass_scheme),
+	DEF_INT(allow_multiple_rows),
 
 	{ 0, NULL, 0 }
 };



More information about the dovecot-cvs mailing list