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