1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
From: LaMont Jones <lamont@debian.org>
Date: Fri, 5 Feb 2016 22:47:00 +0200
Subject: sasl config
---
src/xsasl/xsasl_cyrus_client.c | 3 +++
src/xsasl/xsasl_cyrus_common.h | 5 +++++
src/xsasl/xsasl_cyrus_log.c | 14 ++++++++++++++
src/xsasl/xsasl_cyrus_server.c | 3 +++
4 files changed, 25 insertions(+)
diff --git a/src/xsasl/xsasl_cyrus_client.c b/src/xsasl/xsasl_cyrus_client.c
index fc799c9..e76f0db 100644
--- a/src/xsasl/xsasl_cyrus_client.c
+++ b/src/xsasl/xsasl_cyrus_client.c
@@ -229,6 +229,9 @@ XSASL_CLIENT_IMPL *xsasl_cyrus_client_init(const char *unused_client_type,
*/
static sasl_callback_t callbacks[] = {
{SASL_CB_LOG, (XSASL_CYRUS_CB) &xsasl_cyrus_log, 0},
+#ifdef SASL_CB_GETCONFPATH
+{SASL_CB_GETCONFPATH, (XSASL_CYRUS_CB) &xsasl_getconfpath, 0},
+#endif
{SASL_CB_LIST_END, 0, 0}
};
diff --git a/src/xsasl/xsasl_cyrus_common.h b/src/xsasl/xsasl_cyrus_common.h
index 5447378..1cd2251 100644
--- a/src/xsasl/xsasl_cyrus_common.h
+++ b/src/xsasl/xsasl_cyrus_common.h
@@ -16,12 +16,17 @@
*/
#if defined(USE_SASL_AUTH) && defined(USE_CYRUS_SASL)
+#include <sasl.h>
+
#define NO_SASL_LANGLIST ((const char *) 0)
#define NO_SASL_OUTLANG ((const char **) 0)
#define xsasl_cyrus_strerror(status) \
sasl_errstring((status), NO_SASL_LANGLIST, NO_SASL_OUTLANG)
extern int xsasl_cyrus_log(void *, int, const char *);
extern int xsasl_cyrus_security_parse_opts(const char *);
+#ifdef SASL_CB_GETCONFPATH
+extern int xsasl_getconfpath(void * context, char ** path);
+#endif
#endif
diff --git a/src/xsasl/xsasl_cyrus_log.c b/src/xsasl/xsasl_cyrus_log.c
index 7bf25c3..6d1e413 100644
--- a/src/xsasl/xsasl_cyrus_log.c
+++ b/src/xsasl/xsasl_cyrus_log.c
@@ -28,10 +28,16 @@
/* System library. */
#include <sys_defs.h>
+#include <string.h>
/* Utility library. */
#include <msg.h>
+#include <stringops.h>
+
+/* Global library. */
+
+#include <mail_params.h>
/* Application-specific */
@@ -101,4 +107,12 @@ int xsasl_cyrus_log(void *unused_context, int priority,
return (SASL_OK);
}
+#ifdef SASL_CB_GETCONFPATH
+int xsasl_getconfpath(void * context, char ** path)
+{
+ *path = concatenate(var_config_dir, "/", "sasl:/usr/lib/sasl", (char *) 0);
+ return SASL_OK;
+}
+#endif
+
#endif
diff --git a/src/xsasl/xsasl_cyrus_server.c b/src/xsasl/xsasl_cyrus_server.c
index 89e1fc9..8f5edae 100644
--- a/src/xsasl/xsasl_cyrus_server.c
+++ b/src/xsasl/xsasl_cyrus_server.c
@@ -181,6 +181,9 @@ static const char *xsasl_cyrus_server_get_username(XSASL_SERVER *);
static sasl_callback_t callbacks[] = {
{SASL_CB_LOG, (XSASL_CYRUS_CB) &xsasl_cyrus_log, NO_CALLBACK_CONTEXT},
+#ifdef SASL_CB_GETCONFPATH
+ {SASL_CB_GETCONFPATH, (XSASL_CYRUS_CB) &xsasl_getconfpath, 0},
+#endif
{SASL_CB_LIST_END, 0, 0}
};
|