]> git.pld-linux.org Git - packages/cyrus-sasl.git/blame - cyrus-sasl-configdir.patch
- fixed pam_tally usage
[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
6b79d42c 56@@ -1040,6 +1040,22 @@
12071c60
AF
57 }
58
59 static int
60+_sasl_getconfpath(void *context __attribute__((unused)),
61+ char ** path_dest)
62+{
6b79d42c 63+ char *path = NULL;
12071c60
AF
64+
65+ if (! path_dest)
66+ return SASL_BADPARAM;
6b79d42c
JB
67+ /* Honor external variable only in a safe environment */
68+ if (getuid() == geteuid() && getgid() == getegid())
69+ path = getenv(SASL_CONF_PATH_ENV_VAR);
12071c60
AF
70+ if (! path)
71+ path = CONFIGDIR;
72+ return _sasl_strdup(path, path_dest, NULL);
73+}
74+
75+static int
76 _sasl_verifyfile(void *context __attribute__((unused)),
77 char *file __attribute__((unused)),
78 int type __attribute__((unused)))
6b79d42c 79@@ -1147,6 +1163,10 @@
12071c60
AF
80 *pproc = (int (*)()) &_sasl_getpath;
81 *pcontext = NULL;
82 return SASL_OK;
83+ case SASL_CB_GETCONFPATH:
84+ *pproc = (int (*)()) &_sasl_getconfpath;
85+ *pcontext = NULL;
86+ return SASL_OK;
87 case SASL_CB_AUTHNAME:
88 *pproc = (int (*)()) &_sasl_getsimple;
89 *pcontext = conn;
6b79d42c 90@@ -1475,6 +1495,30 @@
12071c60 91 }
1fb26136
JK
92
93 const sasl_callback_t *
12071c60
AF
94+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
95+{
96+ static const sasl_callback_t default_getconfpath_cb = {
97+ SASL_CB_GETCONFPATH,
98+ &_sasl_getconfpath,
99+ NULL
100+ };
101+
102+ if (callbacks)
103+ while (callbacks->id != SASL_CB_LIST_END)
104+ {
105+ if (callbacks->id == SASL_CB_GETCONFPATH)
106+ {
107+ return callbacks;
108+ } else {
109+ ++callbacks;
110+ }
111+ }
112+
113+ return &default_getconfpath_cb;
114+}
115+
1fb26136
JK
116+
117+const sasl_callback_t *
12071c60 118 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks)
1fb26136
JK
119 {
120 static const sasl_callback_t default_verifyfile_cb = {
2abe5362
JB
121diff -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
124@@ -356,6 +356,9 @@
125 _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
126
127 extern const sasl_callback_t *
128+_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
1fb26136 129+
2abe5362
JB
130+extern const sasl_callback_t *
131 _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
132
133 extern int _sasl_common_init(void);
e34660aa
JB
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
136@@ -462,7 +462,7 @@
4a9135ba 137 size_t path_len;
2abe5362 138 char *config_filename=NULL;
4a9135ba 139 size_t len;
2abe5362
JB
140- const sasl_callback_t *getpath_cb=NULL;
141+ const sasl_callback_t *getconfpath_cb=NULL;
142
e34660aa
JB
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 @@
146 }
147
2abe5362
JB
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;
153
154- /* getpath_cb->proc MUST be a sasl_getpath_t; if only c had a type
6b79d42c 155+ /* getconfpath_cb->proc MUST be a sasl_getconfpath_t; if only c had a type
2abe5362
JB
156 system */
157- result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
158+ result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
159 &path_to_config);
160 if (result!=SASL_OK) goto done;
161 if (path_to_config == NULL) path_to_config = "";
1fb26136
JK
162diff -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
12071c60
AF
165@@ -0,0 +1,47 @@
166+.\" Hey Emacs! This file is -*- nroff -*- source.
167+.\"
168+.\" This manpage is Copyright (C) 1999 Tim Martin
169+.\"
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.
173+.\"
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
178+.\"
179+.\" Formatted or processed versions of this manual, if unaccompanied by
180+.\" the source, must acknowledge the copyright and authors of this work.
181+.\"
182+.\"
183+.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
184+.SH NAME
185+sasl_getconfpath_t \- The SASL callback to indicate location of the config files
186+
187+
188+.SH SYNOPSIS
189+.nf
190+.B #include <sasl.h>
191+
192+.sp
193+.BI "int sasl_getconfpath_t(void " *context ", "
194+.BI " char ** " path ")";
195+
196+.fi
197+.SH DESCRIPTION
198+
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.
201+.PP
202+
203+.SH "RETURN VALUE"
204+
205+SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
206+
207+.SH "CONFORMING TO"
208+RFC 2222
209+.SH "SEE ALSO"
210+.BR other sasl stuff
211+.BR
212+.BR
4a9135ba
JB
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
215@@ -91,7 +91,9 @@
12071c60
AF
216 #define HAVE_MEMCPY 1
217
218 #define SASL_PATH_ENV_VAR "SASL_PATH"
219+#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
4a9135ba 220 #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
12071c60
AF
221+#define CONFIGDIR "\\sasl-configs"
222
223 /* Windows calls these functions something else
224 */
This page took 0.086737 seconds and 4 git commands to generate.