1 diff -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
5 /* This is where plugins will live at runtime */
8 +/* This is where config files will live at runtime */
11 /* Make autoheader happy */
12 #undef WITH_SYMBOL_UNDERSCORE
17 #define SASL_PATH_ENV_VAR "SASL_PATH"
18 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
21 #include <sys/types.h>
22 diff -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
26 AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir")
29 +AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
30 + be found [/etc/sasl] ],
32 + configdir=/etc/sasl)
33 +AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir")
36 dnl look for rc4 libraries. we accept the CMU one or one from openSSL
37 AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ],
39 diff -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
43 const char *file, sasl_verify_type_t type);
44 #define SASL_CB_VERIFYFILE 4
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).
50 + * context -- getconfpath context from the callback record
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()
57 + * SASL_OK -- no error
58 + * SASL_FAIL -- error
60 +typedef int sasl_getconfpath_t(void * context,
63 +#define SASL_CB_GETCONFPATH (5)
65 /* client/user interaction callbacks:
67 diff -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 @@
74 +_sasl_getconfpath(void *context __attribute__((unused)),
80 + return SASL_BADPARAM;
81 + path = getenv(SASL_CONF_PATH_ENV_VAR);
84 + return _sasl_strdup(path, path_dest, NULL);
88 _sasl_verifyfile(void *context __attribute__((unused)),
89 char *file __attribute__((unused)),
90 int type __attribute__((unused)))
91 @@ -1147,6 +1161,10 @@
92 *pproc = (int (*)()) &_sasl_getpath;
95 + case SASL_CB_GETCONFPATH:
96 + *pproc = (int (*)()) &_sasl_getconfpath;
99 case SASL_CB_AUTHNAME:
100 *pproc = (int (*)()) &_sasl_getsimple;
102 @@ -1475,6 +1493,30 @@
105 const sasl_callback_t *
106 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
108 + static const sasl_callback_t default_getconfpath_cb = {
109 + SASL_CB_GETCONFPATH,
110 + &_sasl_getconfpath,
115 + while (callbacks->id != SASL_CB_LIST_END)
117 + if (callbacks->id == SASL_CB_GETCONFPATH)
125 + return &default_getconfpath_cb;
129 +const sasl_callback_t *
130 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
132 static const sasl_callback_t default_verifyfile_cb = {
133 diff -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
137 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
139 extern const sasl_callback_t *
140 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
142 +extern const sasl_callback_t *
143 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
145 extern int _sasl_common_init(void);
146 diff -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 @@
151 char *config_filename=NULL;
153 - const sasl_callback_t *getpath_cb=NULL;
154 + const sasl_callback_t *getconfpath_cb=NULL;
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;
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
165 - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
166 + result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
168 if (result!=SASL_OK) goto done;
169 if (path_to_config == NULL) path_to_config = "";
170 diff -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
174 +.\" Hey Emacs! This file is -*- nroff -*- source.
176 +.\" This manpage is Copyright (C) 1999 Tim Martin
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.
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
187 +.\" Formatted or processed versions of this manual, if unaccompanied by
188 +.\" the source, must acknowledge the copyright and authors of this work.
191 +.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
193 +sasl_getconfpath_t \- The SASL callback to indicate location of the config files
198 +.B #include <sasl.h>
201 +.BI "int sasl_getconfpath_t(void " *context ", "
202 +.BI " char ** " path ")";
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.
213 +SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
218 +.BR other sasl stuff
221 \ No newline at end of file
222 diff -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
226 #define HAVE_MEMCPY 1
228 #define SASL_PATH_ENV_VAR "SASL_PATH"
229 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
230 #define PLUGINDIR "C:\\SASL-PLUGINS"
231 +#define CONFIGDIR "\\sasl-configs"
233 /* Windows calls these functions something else