]> git.pld-linux.org Git - packages/cyrus-sasl.git/blob - cyrus-sasl-configdir.patch
mysql and ldap direct auth, building fix for saslauthd
[packages/cyrus-sasl.git] / cyrus-sasl-configdir.patch
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
4 @@ -64,6 +64,9 @@
5  /* This is where plugins will live at runtime */
6  #undef PLUGINDIR
7  
8 +/* This is where config files will live at runtime */
9 +#undef CONFIGDIR
10 +
11  /* Make autoheader happy */
12  #undef WITH_SYMBOL_UNDERSCORE
13  
14 @@ -152,6 +155,7 @@
15  #endif
16  
17  #define SASL_PATH_ENV_VAR "SASL_PATH"
18 +#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
19  
20  #include <stdlib.h>
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
25 @@ -583,6 +583,13 @@
26  AC_DEFINE_UNQUOTED(PLUGINDIR, "$plugindir")
27  AC_SUBST(plugindir)
28  
29 +AC_ARG_WITH(configdir, [   --with-configdir=DIR    set the directory where config files will
30 +                          be found [/etc/sasl] ],
31 +  configdir=$withval,
32 +  configdir=/etc/sasl)
33 +AC_DEFINE_UNQUOTED(CONFIGDIR, "$configdir")
34 +AC_SUBST(configdir)
35 +
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] ],
38         with_rc4=$withval,
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
42 @@ -14,6 +14,7 @@
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
50 @@ -401,6 +402,25 @@
51                                const char * file, const int type);
52  
53  #define SASL_CB_VERIFYFILE  (4)
54 +
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).
58 + * inputs:
59 + *  context     -- getconfpath context from the callback record
60 + * outputs:
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()
64 + *                 library call).
65 + * returns:
66 + *  SASL_OK     -- no error
67 + *  SASL_FAIL   -- error
68 + */
69 +typedef int sasl_getconfpath_t(void * context,
70 +                          char ** path);
71 +
72 +#define SASL_CB_GETCONFPATH        (5)
73  
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
79 @@ -666,6 +666,20 @@
80  }
81  
82  static int
83 +_sasl_getconfpath(void *context __attribute__((unused)),
84 +             char ** path_dest)
85 +{
86 +  char *path;
87 +
88 +  if (! path_dest)
89 +    return SASL_BADPARAM;
90 +  path = getenv(SASL_CONF_PATH_ENV_VAR);
91 +  if (! path)
92 +    path = CONFIGDIR;
93 +  return _sasl_strdup(path, path_dest, NULL);
94 +}
95 +
96 +static int
97  _sasl_verifyfile(void *context __attribute__((unused)),
98                  char *file  __attribute__((unused)),
99                  int type  __attribute__((unused)))
100 @@ -768,6 +782,10 @@
101      *pproc = (int (*)()) &_sasl_getpath;
102      *pcontext = NULL;
103      return SASL_OK;
104 +  case SASL_CB_GETCONFPATH:
105 +    *pproc = (int (*)()) &_sasl_getconfpath;
106 +    *pcontext = NULL;
107 +    return SASL_OK;
108    case SASL_CB_AUTHNAME:
109      *pproc = (int (*)()) &_sasl_getsimple;
110      *pcontext = conn;
111 @@ -1093,6 +1111,30 @@
112    
113    return &default_getpath_cb;
114  }
115 +
116 +const sasl_callback_t *
117 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks)
118 +{
119 +  static const sasl_callback_t default_getconfpath_cb = {
120 +    SASL_CB_GETCONFPATH,
121 +    &_sasl_getconfpath,
122 +    NULL
123 +  };
124 +
125 +  if (callbacks)
126 +    while (callbacks->id != SASL_CB_LIST_END)
127 +    {
128 +      if (callbacks->id == SASL_CB_GETCONFPATH)
129 +      {
130 +       return callbacks;
131 +      } else {
132 +       ++callbacks;
133 +      }
134 +    }
135 +  
136 +  return &default_getconfpath_cb;
137 +}
138 +
139  
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
145 @@ -59,6 +59,9 @@
146  _sasl_find_getpath_callback(const sasl_callback_t *callbacks);
147  
148  extern const sasl_callback_t *
149 +_sasl_find_getconfpath_callback(const sasl_callback_t *callbacks);
150 +
151 +extern const sasl_callback_t *
152  _sasl_find_verifyfile_callback(const sasl_callback_t *callbacks);
153  
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;
161    int len;
162 -  const sasl_callback_t *getpath_cb=NULL;
163 +  const sasl_callback_t *getconfpath_cb=NULL;
164  
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;
170  
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
173       system */
174 -  result = ((sasl_getpath_t *)(getpath_cb->proc))(getpath_cb->context,
175 +  result = ((sasl_getconfpath_t *)(getconfpath_cb->proc))(getconfpath_cb->context,
176                                                   &path_to_config);
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
182 @@ -0,0 +1,47 @@
183 +.\" Hey Emacs! This file is -*- nroff -*- source.
184 +.\"
185 +.\" This manpage is Copyright (C) 1999 Tim Martin
186 +.\"
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.
190 +.\"
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
195 +.\" 
196 +.\" Formatted or processed versions of this manual, if unaccompanied by
197 +.\" the source, must acknowledge the copyright and authors of this work.
198 +.\"
199 +.\"
200 +.TH sasl_getpath_t "26 March 2000" SASL "SASL man pages"
201 +.SH NAME
202 +sasl_getconfpath_t \- The SASL callback to indicate location of the config files
203 +
204 +
205 +.SH SYNOPSIS
206 +.nf
207 +.B #include <sasl.h>
208 +
209 +.sp
210 +.BI "int sasl_getconfpath_t(void " *context ", "
211 +.BI "                  char ** " path ")";
212 +
213 +.fi
214 +.SH DESCRIPTION
215 +
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.
218 +.PP
219 +
220 +.SH "RETURN VALUE"
221 +
222 +SASL callback functions should return SASL return codes. See sasl.h for a complete list. SASL_OK indicates success.
223 +
224 +.SH "CONFORMING TO"
225 +RFC 2222
226 +.SH "SEE ALSO"
227 +.BR other sasl stuff
228 +.BR 
229 +.BR 
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
234 @@ -72,7 +72,9 @@
235  #define HAVE_MEMCPY 1
236  
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"
241  
242  /* Windows calls these functions something else
243   */
244
This page took 0.269697 seconds and 3 git commands to generate.