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,22 @@
60 +_sasl_getconfpath(void *context __attribute__((unused)),
66 + return SASL_BADPARAM;
67 + /* Honor external variable only in a safe environment */
68 + if (getuid() == geteuid() && getgid() == getegid())
69 + path = getenv(SASL_CONF_PATH_ENV_VAR);
72 + return _sasl_strdup(path, path_dest, NULL);
76 _sasl_verifyfile(void *context __attribute__((unused)),
77 char *file __attribute__((unused)),
78 int type __attribute__((unused)))
79 @@ -1147,6 +1163,10 @@
80 *pproc = (int (*)()) &_sasl_getpath;
83 + case SASL_CB_GETCONFPATH:
84 + *pproc = (int (*)()) &_sasl_getconfpath;
87 case SASL_CB_AUTHNAME:
88 *pproc = (int (*)()) &_sasl_getsimple;
90 @@ -1475,6 +1495,30 @@
93 const sasl_callback_t *
94 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
96 + static const sasl_callback_t default_getconfpath_cb = {
97 + SASL_CB_GETCONFPATH,
103 + while (callbacks->id != SASL_CB_LIST_END)
105 + if (callbacks->id == SASL_CB_GETCONFPATH)
113 + return &default_getconfpath_cb;
117 +const sasl_callback_t *
118 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
120 static const sasl_callback_t default_verifyfile_cb = {
121 diff -durN cyrus-sasl-2.1.10.orig/lib/saslint.h cyrus-sasl-2.1.10/lib/saslint.h
122 --- cyrus-sasl-2.1.10.orig/lib/saslint.h Thu Dec 5 05:16:59 2002
123 +++ cyrus-sasl-2.1.10/lib/saslint.h Thu Jan 9 11:42:29 2003
125 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
127 extern const sasl_callback_t *
128 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
130 +extern const sasl_callback_t *
131 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
133 extern int _sasl_common_init(void);
134 --- cyrus-sasl-2.1.19/lib/server.c.orig 2004-07-06 15:42:23.000000000 +0200
135 +++ cyrus-sasl-2.1.19/lib/server.c 2004-07-25 18:46:12.483590936 +0200
138 char *config_filename=NULL;
140 - const sasl_callback_t *getpath_cb=NULL;
141 + const sasl_callback_t *getconfpath_cb=NULL;
143 /* If appname was not provided, behave as if there is no config file
144 (see also sasl_config_init() */
145 @@ -471,12 +471,12 @@
148 /* get the path to the plugins; for now the config file will reside there */
149 - getpath_cb=_sasl_find_getpath_callback( global_callbacks.callbacks );
150 - if (getpath_cb==NULL) return SASL_BADPARAM;
151 + getconfpath_cb=_sasl_find_getconfpath_callback( global_callbacks.callbacks );
152 + if (getconfpath_cb==NULL) return SASL_BADPARAM;
154 - /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
155 + /* getconfpath_cb->proc MUST be a sasl_getconfpath_t; if only c had a type
157 - result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
158 + result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
160 if (result!=SASL_OK) goto done;
161 if (path_to_config == NULL) path_to_config = "";
162 diff -durN cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3
163 --- cyrus-sasl-2.1.10.orig/man/sasl_getconfpath_t.3 Thu Jan 1 01:00:00 1970
164 +++ cyrus-sasl-2.1.10/man/sasl_getconfpath_t.3 Thu Jan 9 11:42:29 2003
166 +.\" Hey Emacs! This file is -*- nroff -*- source.
168 +.\" This manpage is Copyright (C) 1999 Tim Martin
170 +.\" Permission is granted to make and distribute verbatim copies of this
171 +.\" manual provided the copyright notice and this permission notice are
172 +.\" preserved on all copies.
174 +.\" Permission is granted to copy and distribute modified versions of this
175 +.\" manual under the conditions for verbatim copying, provided that the
176 +.\" entire resulting derived work is distributed under the terms of a
177 +.\" permission notice identical to this one
179 +.\" Formatted or processed versions of this manual, if unaccompanied by
180 +.\" the source, must acknowledge the copyright and authors of this work.
183 +.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
185 +sasl_getconfpath_t \- The SASL callback to indicate location of the config files
190 +.B #include <sasl.h>
193 +.BI "int sasl_getconfpath_t(void " *context ", "
194 +.BI " char ** " path ")";
199 +.B sasl_getconfpath_t
200 +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.
205 +SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
210 +.BR other sasl stuff
213 --- cyrus-sasl-2.1.17/win32/include/config.h.orig 2003-11-28 19:38:00.000000000 +0100
214 +++ cyrus-sasl-2.1.17/win32/include/config.h 2003-12-03 22:50:39.916726112 +0100
216 #define HAVE_MEMCPY 1
218 #define SASL_PATH_ENV_VAR "SASL_PATH"
219 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
220 #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
221 +#define CONFIGDIR "\\sasl-configs"
223 /* Windows calls these functions something else