]> git.pld-linux.org Git - packages/cyrus-sasl.git/blame - cyrus-sasl-configdir.patch
- rel 0.3 to rebuild with new db
[packages/cyrus-sasl.git] / cyrus-sasl-configdir.patch
CommitLineData
1fb26136
JK
1diff -durN cyrus-sasl-2.1.10.orig/acconfig.h cyrus-sasl-2.1.10/acconfig.h
2--- cyrus-sasl-2.1.10.orig/acconfig.h Tue Sep 10 19:17:32 2002
3+++ cyrus-sasl-2.1.10/acconfig.h Thu Jan 9 11:42:29 2003
4@@ -78,6 +78,9 @@
12071c60
AF
5 /* This is where plugins will live at runtime */
6 #undef PLUGINDIR
7
8+/* This is where config files will live at runtime */
9+#undef CONFIGDIR
10+
11 /* Make autoheader happy */
12 #undef WITH_SYMBOL_UNDERSCORE
13
1fb26136 14@@ -247,6 +250,7 @@
12071c60
AF
15 #endif
16
17 #define SASL_PATH_ENV_VAR "SASL_PATH"
18+#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
19
20 #include <stdlib.h>
21 #include <sys/types.h>
1fb26136
JK
22diff -durN cyrus-sasl-2.1.10.orig/configure.in cyrus-sasl-2.1.10/configure.in
23--- cyrus-sasl-2.1.10.orig/configure.in Fri Dec 6 17:23:56 2002
24+++ cyrus-sasl-2.1.10/configure.in Thu Jan 9 11:42:29 2003
25@@ -664,6 +664,13 @@
12071c60
AF
26 AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir")
27 AC_SUBST(plugindir)
28
29+AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
30+ be found [/etc/sasl] ],
31+ configdir=$withval,
32+ configdir=/etc/sasl)
33+AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir")
34+AC_SUBST(configdir)
35+
36 dnl look for rc4 libraries. we accept the CMU one or one from openSSL
1fb26136 37 AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ],
12071c60 38 with_rc4=$withval,
1fb26136
JK
39diff -durN cyrus-sasl-2.1.10.orig/include/sasl.h cyrus-sasl-2.1.10/include/sasl.h
40--- cyrus-sasl-2.1.10.orig/include/sasl.h Fri Dec 6 17:23:59 2002
41+++ cyrus-sasl-2.1.10/include/sasl.h Thu Jan 9 11:44:00 2003
42@@ -467,6 +467,24 @@
43 const char *file, sasl_verify_type_t type);
44 #define SASL_CB_VERIFYFILE 4
12071c60 45
12071c60
AF
46+/* getconfpath callback -- this allows applications to specify the
47+ * colon-separated path to search for config files (by default,
48+ * taken from the SASL_CONF_PATH environment variable).
49+ * inputs:
50+ * context -- getconfpath context from the callback record
51+ * outputs:
52+ * path -- colon seperated path (allocated on the heap; the
53+ * library will free it using the sasl_free_t *
54+ * passed to sasl_set_callback, or the standard free()
55+ * library call).
56+ * returns:
57+ * SASL_OK -- no error
58+ * SASL_FAIL -- error
59+ */
60+typedef int sasl_getconfpath_t(void * context,
61+ char ** path);
62+
63+#define SASL_CB_GETCONFPATH (5)
64
1fb26136
JK
65 /* client/user interaction callbacks:
66 */
67diff -durN cyrus-sasl-2.1.10.orig/lib/common.c cyrus-sasl-2.1.10/lib/common.c
68--- cyrus-sasl-2.1.10.orig/lib/common.c Thu Dec 5 15:00:38 2002
69+++ cyrus-sasl-2.1.10/lib/common.c Thu Jan 9 11:42:29 2003
70@@ -1040,6 +1040,20 @@
12071c60
AF
71 }
72
73 static int
74+_sasl_getconfpath(void *context __attribute__((unused)),
75+ char ** path_dest)
76+{
77+ char *path;
78+
79+ if (! path_dest)
80+ return SASL_BADPARAM;
81+ path = getenv(SASL_CONF_PATH_ENV_VAR);
82+ if (! path)
83+ path = CONFIGDIR;
84+ return _sasl_strdup(path, path_dest, NULL);
85+}
86+
87+static int
88 _sasl_verifyfile(void *context __attribute__((unused)),
89 char *file __attribute__((unused)),
90 int type __attribute__((unused)))
1fb26136 91@@ -1147,6 +1161,10 @@
12071c60
AF
92 *pproc = (int (*)()) &_sasl_getpath;
93 *pcontext = NULL;
94 return SASL_OK;
95+ case SASL_CB_GETCONFPATH:
96+ *pproc = (int (*)()) &_sasl_getconfpath;
97+ *pcontext = NULL;
98+ return SASL_OK;
99 case SASL_CB_AUTHNAME:
100 *pproc = (int (*)()) &_sasl_getsimple;
101 *pcontext = conn;
1fb26136 102@@ -1475,6 +1493,30 @@
12071c60 103 }
1fb26136
JK
104
105 const sasl_callback_t *
12071c60
AF
106+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
107+{
108+ static const sasl_callback_t default_getconfpath_cb = {
109+ SASL_CB_GETCONFPATH,
110+ &_sasl_getconfpath,
111+ NULL
112+ };
113+
114+ if (callbacks)
115+ while (callbacks->id != SASL_CB_LIST_END)
116+ {
117+ if (callbacks->id == SASL_CB_GETCONFPATH)
118+ {
119+ return callbacks;
120+ } else {
121+ ++callbacks;
122+ }
123+ }
124+
125+ return &default_getconfpath_cb;
126+}
127+
1fb26136
JK
128+
129+const sasl_callback_t *
12071c60 130 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
1fb26136
JK
131 {
132 static const sasl_callback_t default_verifyfile_cb = {
2abe5362
JB
133diff -durN cyrus-sasl-2.1.10.orig/lib/saslint.h cyrus-sasl-2.1.10/lib/saslint.h
134--- cyrus-sasl-2.1.10.orig/lib/saslint.h Thu Dec 5 05:16:59 2002
135+++ cyrus-sasl-2.1.10/lib/saslint.h Thu Jan 9 11:42:29 2003
136@@ -356,6 +356,9 @@
137 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
138
139 extern const sasl_callback_t *
140+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
1fb26136 141+
2abe5362
JB
142+extern const sasl_callback_t *
143 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
144
145 extern int _sasl_common_init(void);
146diff -durN cyrus-sasl-2.1.10.orig/lib/server.c cyrus-sasl-2.1.10/lib/server.c
147--- cyrus-sasl-2.1.10.orig/lib/server.c Thu Dec 5 05:16:59 2002
148+++ cyrus-sasl-2.1.10/lib/server.c Thu Jan 9 11:42:29 2003
149@@ -379,15 +379,15 @@
150 char *c;
151 char *config_filename=NULL;
152 int len;
153- const sasl_callback_t *getpath_cb=NULL;
154+ const sasl_callback_t *getconfpath_cb=NULL;
155
156 /* get the path to the plugins; for now the config file will reside there */
157- getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
158- if (getpath_cb==NULL) return SASL_BADPARAM;
159+ getconfpath_cb=_sasl_find_getconfpath_callback( global_callbacks.callbacks );
160+ if (getconfpath_cb==NULL) return SASL_BADPARAM;
161
162- /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
163+ /* getconfpath_cb->proc MUST be a sasl_getconfpath_t; if only c had a type
164 system */
165- result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
166+ result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
167 &path_to_config);
168 if (result!=SASL_OK) goto done;
169 if (path_to_config == NULL) path_to_config = "";
1fb26136
JK
170diff -durN cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3
171--- cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 Thu Jan 1 01:00:00 1970
172+++ cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3 Thu Jan 9 11:42:29 2003
12071c60
AF
173@@ -0,0 +1,47 @@
174+.\" Hey Emacs! This file is -*- nroff -*- source.
175+.\"
176+.\" This manpage is Copyright (C) 1999 Tim Martin
177+.\"
178+.\" Permission is granted to make and distribute verbatim copies of this
179+.\" manual provided the copyright notice and this permission notice are
180+.\" preserved on all copies.
181+.\"
182+.\" Permission is granted to copy and distribute modified versions of this
183+.\" manual under the conditions for verbatim copying, provided that the
184+.\" entire resulting derived work is distributed under the terms of a
185+.\" permission notice identical to this one
186+.\"
187+.\" Formatted or processed versions of this manual, if unaccompanied by
188+.\" the source, must acknowledge the copyright and authors of this work.
189+.\"
190+.\"
191+.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
192+.SH NAME
193+sasl_getconfpath_t \- The SASL callback to indicate location of the config files
194+
195+
196+.SH SYNOPSIS
197+.nf
198+.B #include <sasl.h>
199+
200+.sp
201+.BI "int sasl_getconfpath_t(void " *context ", "
202+.BI " char ** " path ")";
203+
204+.fi
205+.SH DESCRIPTION
206+
207+.B sasl_getconfpath_t
208+is used if the application wishes to use a different location for the SASL cofiguration files. If this callback is not used SASL will either use the location in the enviornment variable SASL_CONF_PATH or /etc/sasl by default.
209+.PP
210+
211+.SH "RETURN VALUE"
212+
213+SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
214+
215+.SH "CONFORMING TO"
216+RFC 2222
217+.SH "SEE ALSO"
218+.BR other sasl stuff
219+.BR
220+.BR
221\ No newline at end of file
1fb26136
JK
222diff -durN cyrus-sasl-2.1.10.orig/win32/include/config.h cyrus-sasl-2.1.10/win32/include/config.h
223--- cyrus-sasl-2.1.10.orig/win32/include/config.h Fri Dec 6 17:24:48 2002
224+++ cyrus-sasl-2.1.10/win32/include/config.h Thu Jan 9 11:44:41 2003
225@@ -96,7 +96,9 @@
12071c60
AF
226 #define HAVE_MEMCPY 1
227
228 #define SASL_PATH_ENV_VAR "SASL_PATH"
229+#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
1fb26136 230 #define PLUGINDIR "C:\\SASL-PLUGINS"
12071c60
AF
231+#define CONFIGDIR "\\sasl-configs"
232
233 /* Windows calls these functions something else
234 */
This page took 0.061456 seconds and 4 git commands to generate.