]> git.pld-linux.org Git - packages/cyrus-sasl.git/blame - cyrus-sasl-configdir.patch
- release 2 to rebuild with new openldap
[packages/cyrus-sasl.git] / cyrus-sasl-configdir.patch
CommitLineData
4a9135ba
JB
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
3@@ -710,6 +710,13 @@
4 AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir", [Runtime plugin location])
12071c60
AF
5 AC_SUBST(plugindir)
6
7+AC_ARG_WITH(configdir, [ --with-configdir=DIR set the directory where config files will
8+ be found [/etc/sasl] ],
9+ configdir=$withval,
10+ configdir=/etc/sasl)
4a9135ba 11+AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir", [Runtime config files location])
12071c60
AF
12+AC_SUBST(configdir)
13+
14 dnl look for rc4 libraries. we accept the CMU one or one from openSSL
1fb26136 15 AC_ARG_WITH(rc4, [ --with-rc4 use internal rc4 routines [yes] ],
12071c60 16 with_rc4=$withval,
4a9135ba
JB
17@@ -1006,6 +1013,7 @@
18 #endif
19
20 #define SASL_PATH_ENV_VAR "SASL_PATH"
21+#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
22
23 #include <stdlib.h>
24 #include <sys/types.h>
1fb26136
JK
25diff -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
28@@ -467,6 +467,24 @@
29 const char *file, sasl_verify_type_t type);
30 #define SASL_CB_VERIFYFILE 4
12071c60 31
12071c60
AF
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).
35+ * inputs:
36+ * context -- getconfpath context from the callback record
37+ * outputs:
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()
41+ * library call).
42+ * returns:
43+ * SASL_OK -- no error
44+ * SASL_FAIL -- error
45+ */
46+typedef int sasl_getconfpath_t(void * context,
47+ char ** path);
48+
49+#define SASL_CB_GETCONFPATH (5)
50
1fb26136
JK
51 /* client/user interaction callbacks:
52 */
53diff -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 @@
12071c60
AF
57 }
58
59 static int
60+_sasl_getconfpath(void *context __attribute__((unused)),
61+ char ** path_dest)
62+{
63+ char *path;
64+
65+ if (! path_dest)
66+ return SASL_BADPARAM;
67+ path = getenv(SASL_CONF_PATH_ENV_VAR);
68+ if (! path)
69+ path = CONFIGDIR;
70+ return _sasl_strdup(path, path_dest, NULL);
71+}
72+
73+static int
74 _sasl_verifyfile(void *context __attribute__((unused)),
75 char *file __attribute__((unused)),
76 int type __attribute__((unused)))
1fb26136 77@@ -1147,6 +1161,10 @@
12071c60
AF
78 *pproc = (int (*)()) &_sasl_getpath;
79 *pcontext = NULL;
80 return SASL_OK;
81+ case SASL_CB_GETCONFPATH:
82+ *pproc = (int (*)()) &_sasl_getconfpath;
83+ *pcontext = NULL;
84+ return SASL_OK;
85 case SASL_CB_AUTHNAME:
86 *pproc = (int (*)()) &_sasl_getsimple;
87 *pcontext = conn;
1fb26136 88@@ -1475,6 +1493,30 @@
12071c60 89 }
1fb26136
JK
90
91 const sasl_callback_t *
12071c60
AF
92+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
93+{
94+ static const sasl_callback_t default_getconfpath_cb = {
95+ SASL_CB_GETCONFPATH,
96+ &_sasl_getconfpath,
97+ NULL
98+ };
99+
100+ if (callbacks)
101+ while (callbacks->id != SASL_CB_LIST_END)
102+ {
103+ if (callbacks->id == SASL_CB_GETCONFPATH)
104+ {
105+ return callbacks;
106+ } else {
107+ ++callbacks;
108+ }
109+ }
110+
111+ return &default_getconfpath_cb;
112+}
113+
1fb26136
JK
114+
115+const sasl_callback_t *
12071c60 116 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
1fb26136
JK
117 {
118 static const sasl_callback_t default_verifyfile_cb = {
2abe5362
JB
119diff -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
122@@ -356,6 +356,9 @@
123 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
124
125 extern const sasl_callback_t *
126+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
1fb26136 127+
2abe5362
JB
128+extern const sasl_callback_t *
129 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
130
131 extern int _sasl_common_init(void);
4a9135ba
JB
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 @@
135 size_t path_len;
2abe5362 136 char *config_filename=NULL;
4a9135ba 137 size_t len;
2abe5362
JB
138- const sasl_callback_t *getpath_cb=NULL;
139+ const sasl_callback_t *getconfpath_cb=NULL;
140
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;
146
147- /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
4a9135ba 148+ /* getconfpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
2abe5362
JB
149 system */
150- result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
151+ result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
152 &path_to_config);
153 if (result!=SASL_OK) goto done;
154 if (path_to_config == NULL) path_to_config = "";
1fb26136
JK
155diff -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
12071c60
AF
158@@ -0,0 +1,47 @@
159+.\" Hey Emacs! This file is -*- nroff -*- source.
160+.\"
161+.\" This manpage is Copyright (C) 1999 Tim Martin
162+.\"
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.
166+.\"
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
171+.\"
172+.\" Formatted or processed versions of this manual, if unaccompanied by
173+.\" the source, must acknowledge the copyright and authors of this work.
174+.\"
175+.\"
176+.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
177+.SH NAME
178+sasl_getconfpath_t \- The SASL callback to indicate location of the config files
179+
180+
181+.SH SYNOPSIS
182+.nf
183+.B #include <sasl.h>
184+
185+.sp
186+.BI "int sasl_getconfpath_t(void " *context ", "
187+.BI " char ** " path ")";
188+
189+.fi
190+.SH DESCRIPTION
191+
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.
194+.PP
195+
196+.SH "RETURN VALUE"
197+
198+SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
199+
200+.SH "CONFORMING TO"
201+RFC 2222
202+.SH "SEE ALSO"
203+.BR other sasl stuff
204+.BR
205+.BR
4a9135ba
JB
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
208@@ -91,7 +91,9 @@
12071c60
AF
209 #define HAVE_MEMCPY 1
210
211 #define SASL_PATH_ENV_VAR "SASL_PATH"
212+#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
4a9135ba 213 #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
12071c60
AF
214+#define CONFIGDIR "\\sasl-configs"
215
216 /* Windows calls these functions something else
217 */
This page took 0.121788 seconds and 4 git commands to generate.