xref: /illumos-gate/usr/src/lib/libsasl/include/config.h (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
1 /*
2  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * Copyright (c) 1998-2003 Carnegie Mellon University.  All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in
18  *    the documentation and/or other materials provided with the
19  *    distribution.
20  *
21  * 3. The name "Carnegie Mellon University" must not be used to
22  *    endorse or promote products derived from this software without
23  *    prior written permission. For permission or any other legal
24  *    details, please contact
25  *      Office of Technology Transfer
26  *      Carnegie Mellon University
27  *      5000 Forbes Avenue
28  *      Pittsburgh, PA  15213-3890
29  *      (412) 268-4387, fax: (412) 268-7395
30  *      tech-transfer@andrew.cmu.edu
31  *
32  * 4. Redistributions of any form whatsoever must retain the following
33  *    acknowledgment:
34  *    "This product includes software developed by Computing Services
35  *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
36  *
37  * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
38  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
39  * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
40  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
41  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
42  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
43  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44  */
45 
46 #ifndef CONFIG_H
47 #define CONFIG_H
48 
49 #include <sys/types.h>
50 
51 /* Define to empty if the keyword does not work.  */
52 /* #undef const */
53 
54 /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
55 #define HAVE_SYS_WAIT_H 1
56 
57 /* Define as __inline if that's what the C compiler calls it.  */
58 /* #undef inline */
59 
60 /* Define to `int' if <sys/types.h> doesn't define.  */
61 /* #undef mode_t */
62 
63 /* Define to `int' if <sys/types.h> doesn't define.  */
64 /* #undef pid_t */
65 
66 /* Define as the return type of signal handlers (int or void).  */
67 #define RETSIGTYPE void
68 
69 /* Define if you have the ANSI C header files.  */
70 #define STDC_HEADERS 1
71 
72 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
73 #define TIME_WITH_SYS_TIME 1
74 
75 /* Set to the database name you want SASL to use for
76  * username->secret lookups */
77 /* #undef SASL_DB_PATH */
78 
79 /* what db package are we using? */
80 /* #undef SASL_GDBM */
81 /* #undef SASL_NDBM */
82 /* #undef SASL_BERKELEYDB */
83 
84 /* which mechs can we link staticly? */
85 /* #undef STATIC_ANONYMOUS */
86 /* #undef STATIC_CRAMMD5 */
87 /* #undef STATIC_DIGESTMD5 */
88 /* #undef STATIC_GSSAPIV2 */
89 /* #undef STATIC_KERBEROS4 */
90 /* #undef STATIC_LOGIN */
91 /* #undef STATIC_MYSQL */
92 /* #undef STATIC_NTLM */
93 /* #undef STATIC_OTP */
94 /* #undef STATIC_PLAIN */
95 /* #undef STATIC_SASLDB */
96 /* #undef STATIC_SRP */
97 
98 /* This is where plugins will live at runtime */
99 #ifdef _LP64
100 #if defined(__sparcv9)
101 #define PLUGINDIR "/usr/lib/sasl/sparcv9"
102 #elif defined(__amd64)
103 #define PLUGINDIR "/usr/lib/sasl/amd64"
104 #else
105 #error Unsupported 64-bit architecture!
106 #endif
107 #else
108 #define PLUGINDIR "/usr/lib/sasl"
109 #endif
110 
111 #define SASL_CONFDIR "/etc/sasl"
112 
113 /* should we use the internal rc4 library? */
114 /* This may be defined in digestmd5 makefile */
115 /* #undef WITH_RC4 */
116 
117 /* do we have des available? */
118 /* This may be defined in digestmd5 makefile */
119 /* #undef WITH_DES */
120 /* #undef WITH_SSL_DES */
121 
122 /* what about OpenSSL? */
123 /* #undef HAVE_OPENSSL */
124 
125 /* should we support srp_setpass */
126 /* #undef DO_SRP_SETPASS */
127 
128 /* do we have OPIE for server-side OTP support? */
129 /* #undef HAVE_OPIE */
130 
131 /* Do we have kerberos for plaintext password checking? */
132 /* #undef HAVE_KRB */
133 
134 /* do we have PAM for plaintext password checking? */
135 #define HAVE_PAM 1
136 
137 /* do we have getsubopt()? */
138 #define HAVE_GETSUBOPT 1
139 
140 /* Does your system have the snprintf() call? */
141 #define HAVE_SNPRINTF 1
142 
143 /* Does your system have the vsnprintf() call? */
144 #define HAVE_VSNPRINTF 1
145 
146 /* should we include support for the pwcheck daemon? */
147 /* #undef HAVE_PWCHECK */
148 
149 /* where do we look for the pwcheck daemon? */
150 /* #undef PWCHECKDIR */
151 
152 /* should we include support for the saslauth daemon? */
153 /* #undef HAVE_SASLAUTHD */
154 
155 /* where does saslauthd look for the communication socket? */
156 /* #undef PATH_SASLAUTHD_RUNDIR */
157 
158 /* do we want alwaystrue (discouraged)? */
159 /* #undef HAVE_ALWAYSTRUE */
160 
161 /* are we linking against DMALLOC? */
162 /* #undef WITH_DMALLOC */
163 
164 /* should we support sasl_checkapop */
165 #define DO_SASL_CHECKAPOP 1
166 
167 /* do we pay attention to IP addresses in the kerberos 4 tickets? */
168 /* #undef KRB4_IGNORE_IP_ADDRESS */
169 
170 /* do we have a preferred mechanism, or should we just pick the highest ssf? */
171 /* #undef PREFER_MECH */
172 
173 /* Do we need a leading _ for dlsym? */
174 /* #undef DLSYM_NEEDS_UNDERSCORE */
175 
176 /* Does libtool support shared libs on this system? */
177 #define HAVE_DLFCN_H 1
178 #define DO_DLOPEN 1
179 
180 /* Should we try to dlopen stuff when we are staticly compiled? */
181 /* #undef TRY_DLOPEN_WHEN_STATIC */
182 
183 /* define if your system has getaddrinfo() */
184 #define HAVE_GETADDRINFO 1
185 #define HAVE_INET_ATON 1
186 
187 /* define if your system has getnameinfo() */
188 #define HAVE_GETNAMEINFO 1
189 
190 /* define if your system has struct sockaddr_storage */
191 #define HAVE_STRUCT_SOCKADDR_STORAGE 1
192 
193 /* Define if you have ss_family in struct sockaddr_storage. */
194 #define HAVE_SS_FAMILY 1
195 
196 /* do we have socklen_t? */
197 #define HAVE_SOCKLEN_T 1
198 
199 /* #undef HAVE_SOCKADDR_SA_LEN */
200 
201 /* do we use doors for IPC? */
202 /* #undef USE_DOORS */
203 
204 /* Define if you have the dn_expand function.  */
205 #define HAVE_DN_EXPAND 1
206 
207 /* Define if you have the dns_lookup function.  */
208 /* #undef HAVE_DNS_LOOKUP */
209 
210 /* Define if you have the getdomainname function.  */
211 /* #undef HAVE_GETDOMAINNAME */
212 
213 /* Define if you have the gethostname function.  */
214 #define HAVE_GETHOSTNAME 1
215 
216 /* Define if you have the getpwnam function.  */
217 #define HAVE_GETPWNAM 1
218 
219 /* Define if you have the getspnam function.  */
220 #define HAVE_GETSPNAM 1
221 
222 /* Define if you have the gettimeofday function.  */
223 #define HAVE_GETTIMEOFDAY 1
224 
225 /* Define if you have the gsskrb5_register_acceptor_identity function.  */
226 /* #undef HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY */
227 
228 /* Define if you have the jrand48 function.  */
229 #define HAVE_JRAND48 1
230 
231 /* Define if you have the krb_get_err_text function.  */
232 /* #undef HAVE_KRB_GET_ERR_TEXT */
233 
234 /* Define if you have the memcpy function.  */
235 #define HAVE_MEMCPY 1
236 
237 /* Define if you have the mkdir function.  */
238 #define HAVE_MKDIR 1
239 
240 /* Define if you have the select function.  */
241 #define HAVE_SELECT 1
242 
243 /* Define if you have the socket function.  */
244 #define HAVE_SOCKET 1
245 
246 /* Define if you have the strchr function.  */
247 #define HAVE_STRCHR 1
248 
249 /* Define if you have the strdup function.  */
250 #define HAVE_STRDUP 1
251 
252 /* Define if you have the strerror function.  */
253 #define HAVE_STRERROR 1
254 
255 /* Define if you have the strspn function.  */
256 #define HAVE_STRSPN 1
257 
258 /* Define if you have the strstr function.  */
259 #define HAVE_STRSTR 1
260 
261 /* Define if you have the strtol function.  */
262 #define HAVE_STRTOL 1
263 
264 /* Define if you have the syslog function.  */
265 #define HAVE_SYSLOG 1
266 
267 /* Define if you have the <dirent.h> header file.  */
268 #define HAVE_DIRENT_H 1
269 
270 /* Define if you have the <dlfcn.h> header file.  */
271 #define HAVE_DLFCN_H 1
272 
273 /* Define if you have the <fcntl.h> header file.  */
274 #define HAVE_FCNTL_H 1
275 
276 /* Define if you have the <inttypes.h> header file.  */
277 #define HAVE_INTTYPES_H 1
278 
279 /* Define if you have the <limits.h> header file.  */
280 #define HAVE_LIMITS_H 1
281 
282 /* Define if you have the <malloc.h> header file.  */
283 #define HAVE_MALLOC_H 1
284 
285 /* Define if you have the <ndir.h> header file.  */
286 /* #undef HAVE_NDIR_H */
287 
288 /* Define if you have the <paths.h> header file.  */
289 /* #undef HAVE_PATHS_H */
290 
291 /* Define if you have the <stdarg.h> header file.  */
292 #define HAVE_STDARG_H 1
293 
294 /* Define if you have the <strings.h> header file.  */
295 #define HAVE_STRINGS_H 1
296 
297 /* Define if you have the <sys/dir.h> header file.  */
298 /* #undef HAVE_SYS_DIR_H */
299 
300 /* Define if you have the <sys/file.h> header file.  */
301 #define HAVE_SYS_FILE_H 1
302 
303 /* Define if you have the <sys/ndir.h> header file.  */
304 /* #undef HAVE_SYS_NDIR_H */
305 
306 /* Define if you have the <sys/param.h> header file.  */
307 #define HAVE_SYS_PARAM_H 1
308 
309 /* Define if you have the <sys/time.h> header file.  */
310 #define HAVE_SYS_TIME_H 1
311 
312 /* Define if you have the <sys/uio.h> header file.  */
313 #define HAVE_SYS_UIO_H 1
314 
315 /* Define if you have the <sysexits.h> header file.  */
316 #define HAVE_SYSEXITS_H 1
317 
318 /* Define if you have the <syslog.h> header file.  */
319 #define HAVE_SYSLOG_H 1
320 
321 /* Define if you have the <unistd.h> header file.  */
322 #define HAVE_UNISTD_H 1
323 
324 /* Define if you have the <varargs.h> header file.  */
325 #define HAVE_VARARGS_H 1
326 
327 /* Define if you have the db library (-ldb).  */
328 /* #undef HAVE_LIBDB */
329 
330 /* Define if you have the resolv library (-lresolv).  */
331 #define HAVE_LIBRESOLV 1
332 
333 /* Name of package */
334 /* #define PACKAGE "cyrus-sasl" */
335 
336 /* Version number of package */
337 /* #undef VERSION */
338 
339 /* define if your compiler has __attribute__ */
340 /* #undef HAVE___ATTRIBUTE__ */
341 
342 /* Define if you have the gssapi.h header file */
343 /* #undef HAVE_GSSAPI_H */
344 
345 /* Define if your GSSAPI implimentation defines GSS_C_NT_HOSTBASED_SERVICE */
346 #define HAVE_GSS_C_NT_HOSTBASED_SERVICE
347 
348 
349 /* Create a struct iovec if we need one */
350 #if !defined(_WIN32) && !defined(HAVE_SYS_UIO_H)
351 /* (win32 is handled in sasl.h) */
352 struct iovec {
353     char *iov_base;
354     long iov_len;
355 };
356 #else
357 #include <sys/uio.h>
358 #endif
359 
360 /* location of the random number generator */
361 #ifndef DEV_RANDOM
362 #define DEV_RANDOM "/dev/urandom"
363 #endif
364 #define _DEV_URANDOM "/dev/urandom"
365 
366 /* if we've got krb_get_err_txt, we might as well use it;
367    especially since krb_err_txt isn't in some newer distributions
368    (MIT Kerb for Mac 4 being a notable example). If we don't have
369    it, we fall back to the krb_err_txt array */
370 #ifdef HAVE_KRB_GET_ERR_TEXT
371 #define get_krb_err_txt krb_get_err_text
372 #else
373 #define get_krb_err_txt(X) (krb_err_txt[(X)])
374 #endif
375 
376 /* Make Solaris happy... */
377 #ifndef __EXTENSIONS__
378 #define __EXTENSIONS__
379 #endif
380 
381 /* Make Linux happy... */
382 #ifndef _GNU_SOURCE
383 #define _GNU_SOURCE
384 #endif
385 
386 #ifndef HAVE___ATTRIBUTE__
387 /* Can't use attributes... */
388 #define __attribute__(foo)
389 #endif
390 
391 #define SASL_PATH_ENV_VAR "SASL_PATH"
392 
393 #include <stdlib.h>
394 #include <sys/socket.h>
395 #ifndef WIN32
396 # include <netdb.h>
397 # ifdef HAVE_SYS_PARAM_H
398 #  include <sys/param.h>
399 # endif
400 #else /* WIN32 */
401 # include <winsock.h>
402 #endif /* WIN32 */
403 
404 #include <string.h>
405 
406 #include <netinet/in.h>
407 
408 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
409 #define	_SS_MAXSIZE	128	/* Implementation specific max size */
410 #define	_SS_PADSIZE	(_SS_MAXSIZE - sizeof (struct sockaddr))
411 
412 struct sockaddr_storage {
413 	struct	sockaddr ss_sa;
414 	char		__ss_pad2[_SS_PADSIZE];
415 };
416 # define ss_family ss_sa.sa_family
417 #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
418 
419 #ifndef AF_INET6
420 /* Define it to something that should never appear */
421 #define	AF_INET6	AF_MAX
422 #endif
423 
424 #ifndef HAVE_GETADDRINFO
425 #define	getaddrinfo	sasl_getaddrinfo
426 #define	freeaddrinfo	sasl_freeaddrinfo
427 #define	getnameinfo	sasl_getnameinfo
428 #define	gai_strerror	sasl_gai_strerror
429 #include "gai.h"
430 #endif
431 
432 /* Defined in RFC 1035. max strlen is only 253 due to length bytes. */
433 #ifndef MAXHOSTNAMELEN
434 #define        MAXHOSTNAMELEN  255
435 #endif
436 
437 #ifndef HAVE_SYSEXITS_H
438 #include "exits.h"
439 #else
440 #include "sysexits.h"
441 #endif
442 
443 #ifndef	NI_WITHSCOPEID
444 #define	NI_WITHSCOPEID	0
445 #endif
446 
447 /* Get the correct time.h */
448 #if TIME_WITH_SYS_TIME
449 # include <sys/time.h>
450 # include <time.h>
451 #else
452 # if HAVE_SYS_TIME_H
453 #  include <sys/time.h>
454 # else
455 #  include <time.h>
456 # endif
457 #endif
458 
459 #include <libintl.h>
460 /*
461  * We use gettext() so that xgettext will build msg database. libsasl and
462  * plugins will actually use dgettext in the appropriate subroutine -
463  * depending on SASL_CB_LANGUAGE or the specified language.
464  */
465 #define gettext(x) (x)
466 
467 #define USE_PTHREADS 1
468 #include <pthread.h>
469 #define	DEFINE_STATIC_MUTEX(x) \
470 	static pthread_mutex_t x = PTHREAD_MUTEX_INITIALIZER
471 
472 #define	LOCK_MUTEX(x)	pthread_mutex_lock(x)
473 #define	UNLOCK_MUTEX(x)	pthread_mutex_unlock(x)
474 
475 #define	DO_DLOPEN 1
476 #define	TRY_DLOPEN_WHEN_STATIC 1
477 #define	HAVE_DLFCN_H 1
478 
479 /* HAVE_GSS_C_NT_USER_NAME is not needed for Solaris 10 since libgss has been
480  * updated.
481  */
482 #undef HAVE_GSS_C_NT_USER_NAME
483 
484 #define	HAVE_RPC_GSS_MECH_TO_OID 1
485 
486 #define	_SUN_SDK_ 1
487 
488 #define _INTEGRATED_SOLARIS_ 1
489 #define _HAVE_LIB_MD5 1
490 
491 #include "md5global.h"
492 #include "md5_private.h"
493 
494 #endif /* CONFIG_H */
495