Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > 02c6bebeaa6d19f1c4a8b9bc04580dbc > files > 10

postfix-2.3.6-1.1mdv2007.0.src.rpm

--- postfix-2.3.2/src/xsasl/xsasl_cyrus_server.c.orig	2006-08-03 17:30:34.000000000 -0300
+++ postfix-2.3.2/src/xsasl/xsasl_cyrus_server.c	2006-08-03 17:31:04.000000000 -0300
@@ -173,6 +173,9 @@
 #define NO_CALLBACK_CONTEXT	0
 
 static sasl_callback_t callbacks[] = {
+#if SASL_VERSION_MAJOR >= 2
+    {SASL_CB_VERIFYFILE, &smtpd_sasl_verifyfile, NO_CALLBACK_CONTEXT},
+#endif
     {SASL_CB_LOG, &xsasl_cyrus_log, NO_CALLBACK_CONTEXT},
     {SASL_CB_LIST_END, 0, 0}
 };
--- postfix-2.3.2/src/xsasl/xsasl_cyrus_common.h.orig	2006-08-03 17:58:16.000000000 -0300
+++ postfix-2.3.2/src/xsasl/xsasl_cyrus_common.h	2006-08-03 17:58:17.000000000 -0300
@@ -21,6 +21,7 @@
 #define xsasl_cyrus_strerror(status) \
 	sasl_errstring((status), NO_SASL_LANGLIST, NO_SASL_OUTLANG)
 extern int xsasl_cyrus_log(void *, int, const char *);
+static int smtpd_sasl_verifyfile(void *, const char *, sasl_verify_type_t);
 extern int xsasl_cyrus_security_parse_opts(const char *);
 
 #endif
--- postfix-2.3.2/src/xsasl/xsasl_cyrus_log.c.sasl_logging	2005-12-20 15:48:22.000000000 -0200
+++ postfix-2.3.2/src/xsasl/xsasl_cyrus_log.c	2006-08-03 18:21:09.000000000 -0300
@@ -35,12 +35,45 @@
 
 /* Application-specific */
 
+#include <sasl.h>
+#include <saslutil.h>
+
 #include <xsasl_cyrus_common.h>
 
 #if defined(USE_SASL_AUTH) && defined(USE_CYRUS_SASL)
 
-#include <sasl.h>
-#include <saslutil.h>
+#if SASL_VERSION_MAJOR >= 2
+
+/* smtpd_sasl_verifyfile - SASL verifyfile callback */
+/* We are called here for each file, the sasl-lib tries to open */
+/* The Conf File will be printed if -v is given */
+/* The Other Files are only printed if -vv is given */
+
+static int smtpd_sasl_verifyfile(void *context,
+                                const char *file, sasl_verify_type_t type)
+{
+    switch (type) {
+        case SASL_VRFY_PLUGIN:       /* a DLL/shared library plug-in */
+           if (msg_verbose > 1)
+              msg_info("SASL verifyfile plugin: %s", file);
+           break;
+        case SASL_VRFY_CONF:         /* a configuration file */
+           if (msg_verbose)
+              msg_info("SASL verifyfile conf: %s", file);
+           break;
+        case SASL_VRFY_PASSWD:       /* a password storage file/db */
+           if (msg_verbose > 1)
+              msg_info("SASL verifyfile passwd: %s", file);
+           break;
+        case SASL_VRFY_OTHER:
+           if (msg_verbose > 1)
+              msg_info("SASL verifyfile other: %s", file);
+           break;
+    }
+    return SASL_OK;
+}
+
+#endif /* SASL_VERSION_MAJOR >= 2 */
 
 /* xsasl_cyrus_log - logging callback */