1 diff -urN cyrus-sasl-1.5.21.orig/acconfig.h cyrus-sasl-1.5.21/acconfig.h
2 --- cyrus-sasl-1.5.21.orig/acconfig.h Tue Mar 7 06:19:51 2000
3 +++ cyrus-sasl-1.5.21/acconfig.h Thu Jun 1 13:08:35 2000
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 -urN cyrus-sasl-1.5.21.orig/configure.in cyrus-sasl-1.5.21/configure.in
23 --- cyrus-sasl-1.5.21.orig/configure.in Tue May 9 19:52:53 2000
24 +++ cyrus-sasl-1.5.21/configure.in Thu Jun 1 13:48:11 2000
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=DIR use rc4 (look in DIR) [yes] ],
39 diff -urN cyrus-sasl-1.5.21.orig/include/sasl.h cyrus-sasl-1.5.21/include/sasl.h
40 --- cyrus-sasl-1.5.21.orig/include/sasl.h Tue May 9 19:52:53 2000
41 +++ cyrus-sasl-1.5.21/include/sasl.h Thu Jun 1 13:04:48 2000
43 * sasl_getopt_t client/server: Get an option value
44 * sasl_log_t client/server: Log message handler
45 * sasl_getpath_t client/server: Get path to search for mechanisms
46 + * sasl_getconfpath_t server: Get path to search for config file
47 * sasl_getsimple_t client: Get user/language list
48 * sasl_getsecret_t client: Get authentication secret
49 * sasl_chalprompt_t client: Display challenge and prompt for response
51 const char * file, const int type);
53 #define SASL_CB_VERIFYFILE (4)
55 +/* getconfpath callback -- this allows applications to specify the
56 + * colon-separated path to search for config files (by default,
57 + * taken from the SASL_CONF_PATH environment variable).
59 + * context -- getconfpath context from the callback record
61 + * path -- colon seperated path (allocated on the heap; the
62 + * library will free it using the sasl_free_t *
63 + * passed to sasl_set_callback, or the standard free()
66 + * SASL_OK -- no error
67 + * SASL_FAIL -- error
69 +typedef int sasl_getconfpath_t(void * context,
72 +#define SASL_CB_GETCONFPATH (5)
74 /* these are the types of files libsasl will ask about */
75 #define SASL_VRFY_PLUGIN (1)
76 diff -urN cyrus-sasl-1.5.21.orig/lib/common.c cyrus-sasl-1.5.21/lib/common.c
77 --- cyrus-sasl-1.5.21.orig/lib/common.c Fri May 5 14:41:42 2000
78 +++ cyrus-sasl-1.5.21/lib/common.c Thu Jun 1 12:53:19 2000
83 +_sasl_getconfpath(void *context __attribute__((unused)),
89 + return SASL_BADPARAM;
90 + path = getenv(SASL_CONF_PATH_ENV_VAR);
93 + return _sasl_strdup(path, path_dest, NULL);
97 _sasl_verifyfile(void *context __attribute__((unused)),
98 char *file __attribute__((unused)),
99 int type __attribute__((unused)))
101 *pproc = (int (*)()) &_sasl_getpath;
104 + case SASL_CB_GETCONFPATH:
105 + *pproc = (int (*)()) &_sasl_getconfpath;
108 case SASL_CB_AUTHNAME:
109 *pproc = (int (*)()) &_sasl_getsimple;
111 @@ -1093,6 +1111,30 @@
113 return &default_getpath_cb;
116 +const sasl_callback_t *
117 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
119 + static const sasl_callback_t default_getconfpath_cb = {
120 + SASL_CB_GETCONFPATH,
121 + &_sasl_getconfpath,
126 + while (callbacks->id != SASL_CB_LIST_END)
128 + if (callbacks->id == SASL_CB_GETCONFPATH)
136 + return &default_getconfpath_cb;
140 const sasl_callback_t *
141 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
142 diff -urN cyrus-sasl-1.5.21.orig/lib/saslint.h cyrus-sasl-1.5.21/lib/saslint.h
143 --- cyrus-sasl-1.5.21.orig/lib/saslint.h Wed Mar 29 06:45:21 2000
144 +++ cyrus-sasl-1.5.21/lib/saslint.h Thu Jun 1 12:56:37 2000
146 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
148 extern const sasl_callback_t *
149 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
151 +extern const sasl_callback_t *
152 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
154 extern int _sasl_done_with_plugin(void *plugin);
155 diff -urN cyrus-sasl-1.5.21.orig/lib/server.c cyrus-sasl-1.5.21/lib/server.c
156 --- cyrus-sasl-1.5.21.orig/lib/server.c Tue May 9 19:52:53 2000
157 +++ cyrus-sasl-1.5.21/lib/server.c Thu Jun 1 12:59:03 2000
158 @@ -540,15 +540,15 @@
159 char *path_to_config=NULL, *c;
160 char *config_filename=NULL;
162 - const sasl_callback_t *getpath_cb=NULL;
163 + const sasl_callback_t *getconfpath_cb=NULL;
165 /* get the path to the plugins; for now the config file will reside there */
166 - getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
167 - if (getpath_cb==NULL) return SASL_BADPARAM;
168 + getconfpath_cb=_sasl_find_getconfpath_callback( global_callbacks.callbacks );
169 + if (getconfpath_cb==NULL) return SASL_BADPARAM;
171 - /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
172 + /* getconfpath_cb->proc MUST be a sasl_getconfpath_t; if only c had a type
174 - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
175 + result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
177 if (result!=SASL_OK) goto done;
178 if (path_to_config == NULL) path_to_config = "";
179 diff -urN cyrus-sasl-1.5.21.orig/man/sasl_getconfpath_t.3 cyrus-sasl-1.5.21/man/sasl_getconfpath_t.3
180 --- cyrus-sasl-1.5.21.orig/man/sasl_getconfpath_t.3 Thu Jan 1 01:00:00 1970
181 +++ cyrus-sasl-1.5.21/man/sasl_getconfpath_t.3 Thu Jun 1 13:54:07 2000
183 +.\" Hey Emacs! This file is -*- nroff -*- source.
185 +.\" This manpage is Copyright (C) 1999 Tim Martin
187 +.\" Permission is granted to make and distribute verbatim copies of this
188 +.\" manual provided the copyright notice and this permission notice are
189 +.\" preserved on all copies.
191 +.\" Permission is granted to copy and distribute modified versions of this
192 +.\" manual under the conditions for verbatim copying, provided that the
193 +.\" entire resulting derived work is distributed under the terms of a
194 +.\" permission notice identical to this one
196 +.\" Formatted or processed versions of this manual, if unaccompanied by
197 +.\" the source, must acknowledge the copyright and authors of this work.
200 +.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
202 +sasl_getconfpath_t \- The SASL callback to indicate location of the config files
207 +.B #include <sasl.h>
210 +.BI "int sasl_getconfpath_t(void " *context ", "
211 +.BI " char ** " path ")";
216 +.B sasl_getconfpath_t
217 +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.
222 +SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
227 +.BR other sasl stuff
230 \ No newline at end of file
231 diff -urN cyrus-sasl-1.5.21.orig/win32/include/config.h cyrus-sasl-1.5.21/win32/include/config.h
232 --- cyrus-sasl-1.5.21.orig/win32/include/config.h Tue May 9 19:52:53 2000
233 +++ cyrus-sasl-1.5.21/win32/include/config.h Thu Jun 1 13:07:47 2000
235 #define HAVE_MEMCPY 1
237 #define SASL_PATH_ENV_VAR "SASL_PATH"
238 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
239 #define PLUGINDIR "\\sasl-plugins"
240 +#define CONFIGDIR "\\sasl-configs"
242 /* Windows calls these functions something else