[dovecot-cvs] dovecot/src/auth auth-request-handler.c, 1.20, 1.21 auth-request-handler.h, 1.7, 1.8 db-ldap.c, 1.56, 1.57 db-sql.c, 1.9, 1.10 main.c, 1.57, 1.58

tss at dovecot.org tss at dovecot.org
Fri Dec 15 16:55:31 UTC 2006


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

Modified Files:
	auth-request-handler.c auth-request-handler.h db-ldap.c 
	db-sql.c main.c 
Log Message:
Added context parameter type safety checks for most callback APIs.



Index: auth-request-handler.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request-handler.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- auth-request-handler.c	9 Dec 2006 15:11:48 -0000	1.20
+++ auth-request-handler.c	15 Dec 2006 16:55:29 -0000	1.21
@@ -29,6 +29,7 @@
 static buffer_t *auth_failures_buf;
 static struct timeout *to_auth_failures;
 
+#undef auth_request_handler_create
 struct auth_request_handler *
 auth_request_handler_create(struct auth *auth,
 			    auth_request_callback_t *callback, void *context,

Index: auth-request-handler.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request-handler.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- auth-request-handler.h	14 Jan 2006 18:47:20 -0000	1.7
+++ auth-request-handler.h	15 Dec 2006 16:55:29 -0000	1.8
@@ -10,6 +10,13 @@
 auth_request_handler_create(struct auth *auth,
 			    auth_request_callback_t *callback, void *context,
 			    auth_request_callback_t *master_callback);
+#ifdef CONTEXT_TYPE_SAFETY
+#  define auth_request_handler_create(auth, callback, context, master_callback)\
+	({(void)(1 ? 0 : callback(0, context)); \
+	  auth_request_handler_create(auth, \
+		(auth_request_callback_t *)callback, context, \
+		master_callback); })
+#endif
 void auth_request_handler_unref(struct auth_request_handler **handler);
 
 void auth_request_handler_set(struct auth_request_handler *handler,

Index: db-ldap.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-ldap.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- db-ldap.c	18 Nov 2006 13:41:39 -0000	1.56
+++ db-ldap.c	15 Dec 2006 16:55:29 -0000	1.57
@@ -684,7 +684,8 @@
 	conn->fd = -1;
 	conn->config_path = p_strdup(pool, config_path);
 	conn->set = default_ldap_settings;
-	if (!settings_read(config_path, NULL, parse_setting, NULL, conn))
+	if (!settings_read(config_path, NULL, parse_setting,
+			   null_settings_section_callback, conn))
 		exit(FATAL_DEFAULT);
 
 	if (conn->set.base == NULL)

Index: db-sql.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/db-sql.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- db-sql.c	8 Nov 2006 20:22:08 -0000	1.9
+++ db-sql.c	15 Dec 2006 16:55:29 -0000	1.10
@@ -78,7 +78,8 @@
 
 	conn->config_path = p_strdup(pool, config_path);
 	conn->set = default_sql_settings;
-	if (!settings_read(config_path, NULL, parse_setting, NULL, conn))
+	if (!settings_read(config_path, NULL, parse_setting,
+			   null_settings_section_callback, conn))
 		exit(FATAL_DEFAULT);
 
 	if (conn->set.driver == NULL) {

Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/main.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- main.c	10 Aug 2006 18:46:53 -0000	1.57
+++ main.c	15 Dec 2006 16:55:29 -0000	1.58
@@ -220,12 +220,12 @@
 	lib_signals_init();
         lib_signals_set_handler(SIGINT, TRUE, sig_die, NULL);
         lib_signals_set_handler(SIGTERM, TRUE, sig_die, NULL);
-        lib_signals_ignore(SIGPIPE);
-        lib_signals_set_handler(SIGALRM, FALSE, NULL, NULL);
+        lib_signals_ignore(SIGPIPE, TRUE);
+        lib_signals_ignore(SIGALRM, FALSE);
 
 	/* If auth caches aren't used, just ignore these signals */
-	lib_signals_ignore(SIGHUP);
-	lib_signals_ignore(SIGUSR2);
+	lib_signals_ignore(SIGHUP, TRUE);
+	lib_signals_ignore(SIGUSR2, TRUE);
 
 	mech_init();
 	auth_init(auth);



More information about the dovecot-cvs mailing list