1 --- cyrus-sasl-2.1.17/configure.in.orig 2003-11-28 19:37:10.000000000 +0100
2 +++ cyrus-sasl-2.1.17/configure.in 2003-12-03 22:45:24.790632560 +0100
4 AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir", [Runtime plugin location])
7 +AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
8 + be found [/etc/sasl] ],
10 + configdir=/etc/sasl)
11 +AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir", [Runtime config files location])
14 dnl look for rc4 libraries. we accept the CMU one or one from openSSL
15 AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ],
20 #define SASL_PATH_ENV_VAR "SASL_PATH"
21 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
24 #include <sys/types.h>
25 diff -durN cyrus-sasl-2.1.10.orig/include/sasl.h cyrus-sasl-2.1.10/include/sasl.h
26 --- cyrus-sasl-2.1.10.orig/include/sasl.h Fri Dec 6 17:23:59 2002
27 +++ cyrus-sasl-2.1.10/include/sasl.h Thu Jan 9 11:44:00 2003
29 const char *file, sasl_verify_type_t type);
30 #define SASL_CB_VERIFYFILE 4
32 +/* getconfpath callback -- this allows applications to specify the
33 + * colon-separated path to search for config files (by default,
34 + * taken from the SASL_CONF_PATH environment variable).
36 + * context -- getconfpath context from the callback record
38 + * path -- colon seperated path (allocated on the heap; the
39 + * library will free it using the sasl_free_t *
40 + * passed to sasl_set_callback, or the standard free()
43 + * SASL_OK -- no error
44 + * SASL_FAIL -- error
46 +typedef int sasl_getconfpath_t(void * context,
49 +#define SASL_CB_GETCONFPATH (5)
51 /* client/user interaction callbacks:
53 diff -durN cyrus-sasl-2.1.10.orig/lib/common.c cyrus-sasl-2.1.10/lib/common.c
54 --- cyrus-sasl-2.1.10.orig/lib/common.c Thu Dec 5 15:00:38 2002
55 +++ cyrus-sasl-2.1.10/lib/common.c Thu Jan 9 11:42:29 2003
56 @@ -1040,6 +1040,20 @@
60 +_sasl_getconfpath(void *context __attribute__((unused)),
66 + return SASL_BADPARAM;
67 + path = getenv(SASL_CONF_PATH_ENV_VAR);
70 + return _sasl_strdup(path, path_dest, NULL);
74 _sasl_verifyfile(void *context __attribute__((unused)),
75 char *file __attribute__((unused)),
76 int type __attribute__((unused)))
77 @@ -1147,6 +1161,10 @@
78 *pproc = (int (*)()) &_sasl_getpath;
81 + case SASL_CB_GETCONFPATH:
82 + *pproc = (int (*)()) &_sasl_getconfpath;
85 case SASL_CB_AUTHNAME:
86 *pproc = (int (*)()) &_sasl_getsimple;
88 @@ -1475,6 +1493,30 @@
91 const sasl_callback_t *
92 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
94 + static const sasl_callback_t default_getconfpath_cb = {
95 + SASL_CB_GETCONFPATH,
101 + while (callbacks->id != SASL_CB_LIST_END)
103 + if (callbacks->id == SASL_CB_GETCONFPATH)
111 + return &default_getconfpath_cb;
115 +const sasl_callback_t *
116 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
118 static const sasl_callback_t default_verifyfile_cb = {
119 diff -durN cyrus-sasl-2.1.10.orig/lib/saslint.h cyrus-sasl-2.1.10/lib/saslint.h
120 --- cyrus-sasl-2.1.10.orig/lib/saslint.h Thu Dec 5 05:16:59 2002
121 +++ cyrus-sasl-2.1.10/lib/saslint.h Thu Jan 9 11:42:29 2003
123 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
125 extern const sasl_callback_t *
126 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
128 +extern const sasl_callback_t *
129 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
131 extern int _sasl_common_init(void);
132 --- cyrus-sasl-2.1.17/lib/server.c.orig 2003-11-14 17:49:07.000000000 +0100
133 +++ cyrus-sasl-2.1.17/lib/server.c 2003-12-03 22:48:32.585083464 +0100
134 @@ -436,15 +436,15 @@
136 char *config_filename=NULL;
138 - const sasl_callback_t *getpath_cb=NULL;
139 + const sasl_callback_t *getconfpath_cb=NULL;
141 /* get the path to the plugins; for now the config file will reside there */
142 - getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
143 - if (getpath_cb==NULL) return SASL_BADPARAM;
144 + getconfpath_cb=_sasl_find_getconfpath_callback( global_callbacks.callbacks );
145 + if (getconfpath_cb==NULL) return SASL_BADPARAM;
147 - /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
148 + /* getconfpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
150 - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
151 + result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
153 if (result!=SASL_OK) goto done;
154 if (path_to_config == NULL) path_to_config = "";
155 diff -durN cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3
156 --- cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 Thu Jan 1 01:00:00 1970
157 +++ cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3 Thu Jan 9 11:42:29 2003
159 +.\" Hey Emacs! This file is -*- nroff -*- source.
161 +.\" This manpage is Copyright (C) 1999 Tim Martin
163 +.\" Permission is granted to make and distribute verbatim copies of this
164 +.\" manual provided the copyright notice and this permission notice are
165 +.\" preserved on all copies.
167 +.\" Permission is granted to copy and distribute modified versions of this
168 +.\" manual under the conditions for verbatim copying, provided that the
169 +.\" entire resulting derived work is distributed under the terms of a
170 +.\" permission notice identical to this one
172 +.\" Formatted or processed versions of this manual, if unaccompanied by
173 +.\" the source, must acknowledge the copyright and authors of this work.
176 +.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
178 +sasl_getconfpath_t \- The SASL callback to indicate location of the config files
183 +.B #include <sasl.h>
186 +.BI "int sasl_getconfpath_t(void " *context ", "
187 +.BI " char ** " path ")";
192 +.B sasl_getconfpath_t
193 +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.
198 +SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
203 +.BR other sasl stuff
206 --- cyrus-sasl-2.1.17/win32/include/config.h.orig 2003-11-28 19:38:00.000000000 +0100
207 +++ cyrus-sasl-2.1.17/win32/include/config.h 2003-12-03 22:50:39.916726112 +0100
209 #define HAVE_MEMCPY 1
211 #define SASL_PATH_ENV_VAR "SASL_PATH"
212 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
213 #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
214 +#define CONFIGDIR "\\sasl-configs"
216 /* Windows calls these functions something else