Merge pull request #12771 from arenadata/ADQM-109

krb5 + cyrus-sasl + kerberized kafka
This commit is contained in:
alexey-milovidov 2020-08-20 20:13:01 +03:00 committed by GitHub
commit fb0e68f808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 2469 additions and 4 deletions

6
.gitmodules vendored
View File

@ -180,3 +180,9 @@
[submodule "contrib/stats"]
path = contrib/stats
url = https://github.com/kthohr/stats.git
[submodule "contrib/krb5"]
path = contrib/krb5
url = https://github.com/krb5/krb5
[submodule "contrib/cyrus-sasl"]
path = contrib/cyrus-sasl
url = https://github.com/cyrusimap/cyrus-sasl

View File

@ -378,7 +378,9 @@ include (cmake/find/ltdl.cmake) # for odbc
# openssl, zlib before poco
include (cmake/find/sparsehash.cmake)
include (cmake/find/re2.cmake)
include (cmake/find/krb5.cmake)
include (cmake/find/libgsasl.cmake)
include (cmake/find/cyrus-sasl.cmake)
include (cmake/find/rdkafka.cmake)
include (cmake/find/amqpcpp.cmake)
include (cmake/find/capnp.cmake)

View File

@ -0,0 +1,23 @@
if (${ENABLE_LIBRARIES} AND ${ENABLE_KRB5})
set (DEFAULT_ENABLE_CYRUS_SASL 1)
else()
set (DEFAULT_ENABLE_CYRUS_SASL 0)
endif()
OPTION(ENABLE_CYRUS_SASL "Enable cyrus-sasl" ${DEFAULT_ENABLE_CYRUS_SASL})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/cyrus-sasl/README")
message (WARNING "submodule contrib/cyrus-sasl is missing. to fix try run: \n git submodule update --init --recursive")
set (ENABLE_CYRUS_SASL 0)
endif ()
if (ENABLE_CYRUS_SASL)
set (USE_CYRUS_SASL 1)
set (CYRUS_SASL_LIBRARY sasl2)
set (CYRUS_SASL_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/cyrus-sasl/include")
endif ()
message (STATUS "Using cyrus-sasl: krb5=${USE_KRB5}: ${CYRUS_SASL_INCLUDE_DIR} : ${CYRUS_SASL_LIBRARY}")

25
cmake/find/krb5.cmake Normal file
View File

@ -0,0 +1,25 @@
OPTION(ENABLE_KRB5 "Enable krb5" ${ENABLE_LIBRARIES})
if (NOT EXISTS "${ClickHouse_SOURCE_DIR}/contrib/krb5/README")
message (WARNING "submodule contrib/krb5 is missing. to fix try run: \n git submodule update --init --recursive")
set (ENABLE_KRB5 0)
endif ()
if (NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
message (WARNING "krb5 disabled in non-Linux environments")
set (ENABLE_KRB5 0)
endif ()
if (ENABLE_KRB5)
set (USE_KRB5 1)
set (KRB5_LIBRARY krb5)
set (KRB5_INCLUDE_DIR
"${ClickHouse_SOURCE_DIR}/contrib/krb5/src/include"
"${ClickHouse_BINARY_DIR}/contrib/krb5-cmake/include"
)
endif ()
message (STATUS "Using krb5=${USE_KRB5}: ${KRB5_INCLUDE_DIR} : ${KRB5_LIBRARY}")

View File

@ -311,3 +311,10 @@ if (USE_STATS)
add_subdirectory (stats-cmake)
add_subdirectory (gcem)
endif()
if (USE_KRB5)
add_subdirectory (krb5-cmake)
if (USE_CYRUS_SASL)
add_subdirectory (cyrus-sasl-cmake)
endif()
endif()

1
contrib/cyrus-sasl vendored Submodule

@ -0,0 +1 @@
Subproject commit 6054630889fd1cd8d0659573d69badcee1e23a00

View File

@ -0,0 +1,69 @@
set(CYRUS_SASL_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/cyrus-sasl)
add_library(${CYRUS_SASL_LIBRARY})
target_sources(${CYRUS_SASL_LIBRARY} PRIVATE
${CYRUS_SASL_SOURCE_DIR}/plugins/gssapi.c
# ${CYRUS_SASL_SOURCE_DIR}/plugins/gssapiv2_init.c
${CYRUS_SASL_SOURCE_DIR}/common/plugin_common.c
${CYRUS_SASL_SOURCE_DIR}/lib/common.c
${CYRUS_SASL_SOURCE_DIR}/lib/canonusr.c
${CYRUS_SASL_SOURCE_DIR}/lib/server.c
${CYRUS_SASL_SOURCE_DIR}/lib/config.c
${CYRUS_SASL_SOURCE_DIR}/lib/auxprop.c
${CYRUS_SASL_SOURCE_DIR}/lib/saslutil.c
${CYRUS_SASL_SOURCE_DIR}/lib/external.c
${CYRUS_SASL_SOURCE_DIR}/lib/seterror.c
${CYRUS_SASL_SOURCE_DIR}/lib/md5.c
${CYRUS_SASL_SOURCE_DIR}/lib/dlopen.c
${CYRUS_SASL_SOURCE_DIR}/lib/client.c
${CYRUS_SASL_SOURCE_DIR}/lib/checkpw.c
)
target_include_directories(${CYRUS_SASL_LIBRARY} PUBLIC
${CMAKE_CURRENT_BINARY_DIR}
)
target_include_directories(${CYRUS_SASL_LIBRARY} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} # for config.h
${CYRUS_SASL_SOURCE_DIR}/plugins
${CYRUS_SASL_SOURCE_DIR}
${CYRUS_SASL_SOURCE_DIR}/include
${CYRUS_SASL_SOURCE_DIR}/lib
${CYRUS_SASL_SOURCE_DIR}/sasldb
${CYRUS_SASL_SOURCE_DIR}/common
${CYRUS_SASL_SOURCE_DIR}/saslauthd
${CYRUS_SASL_SOURCE_DIR}/sample
${CYRUS_SASL_SOURCE_DIR}/utils
${CYRUS_SASL_SOURCE_DIR}/tests
)
target_compile_definitions(${CYRUS_SASL_LIBRARY} PUBLIC
HAVE_CONFIG_H
# PLUGINDIR="/usr/local/lib/sasl2"
PLUGINDIR=""
# PIC
OBSOLETE_CRAM_ATTR=1
# SASLAUTHD_CONF_FILE_DEFAULT="/usr/local/etc/saslauthd.conf"
SASLAUTHD_CONF_FILE_DEFAULT=""
# CONFIGDIR="/usr/local/lib/sasl2:/usr/local/etc/sasl2"
CONFIGDIR=""
OBSOLETE_DIGEST_ATTR=1
LIBSASL_EXPORTS=1
)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sasl)
file(COPY
${CYRUS_SASL_SOURCE_DIR}/include/sasl.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/sasl
)
file(COPY
${CYRUS_SASL_SOURCE_DIR}/include/prop.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(${CYRUS_SASL_LIBRARY}
PUBLIC ${KRB5_LIBRARY}
)

View File

@ -0,0 +1,722 @@
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* acconfig.h - autoheader configuration input */
/*
* Copyright (c) 1998-2003 Carnegie Mellon University. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The name "Carnegie Mellon University" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For permission or any other legal
* details, please contact
* Office of Technology Transfer
* Carnegie Mellon University
* 5000 Forbes Avenue
* Pittsburgh, PA 15213-3890
* (412) 268-4387, fax: (412) 268-7395
* tech-transfer@andrew.cmu.edu
*
* 4. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by Computing Services
* at Carnegie Mellon University (http://www.cmu.edu/computing/)."
*
* CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
* FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef CONFIG_H
#define CONFIG_H
/* Include SASLdb Support */
/* #undef AUTH_SASLDB */
/* Do we need a leading _ for dlsym? */
/* #undef DLSYM_NEEDS_UNDERSCORE */
/* Should we build a shared plugin (via dlopen) library? */
#define DO_DLOPEN /**/
/* should we support sasl_checkapop? */
#define DO_SASL_CHECKAPOP /**/
/* should we support setpass() for SRP? */
/* #undef DO_SRP_SETPASS */
/* Define if your getpwnam_r()/getspnam_r() functions take 5 arguments */
#define GETXXNAM_R_5ARG 1
/* should we mutex-wrap calls into the GSS library? */
#define GSS_USE_MUTEXES /**/
/* Enable 'alwaystrue' password verifier? */
/* #undef HAVE_ALWAYSTRUE */
/* Define to 1 if you have the `asprintf' function. */
#define HAVE_ASPRINTF 1
/* Include support for Courier's authdaemond? */
#define HAVE_AUTHDAEMON /**/
/* Define to 1 if you have the <crypt.h> header file. */
#define HAVE_CRYPT_H 1
/* Define to 1 if you have the <des.h> header file. */
/* #undef HAVE_DES_H */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `dns_lookup' function. */
/* #undef HAVE_DNS_LOOKUP */
/* Define to 1 if you have the `dn_expand' function. */
/* #undef HAVE_DN_EXPAND */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Do we have a getaddrinfo? */
#define HAVE_GETADDRINFO /**/
/* Define to 1 if you have the `getdomainname' function. */
#define HAVE_GETDOMAINNAME 1
/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1
/* Do we have a getnameinfo() function? */
#define HAVE_GETNAMEINFO /**/
/* Define to 1 if you have the `getpassphrase' function. */
/* #undef HAVE_GETPASSPHRASE */
/* Define to 1 if you have the `getpwnam' function. */
#define HAVE_GETPWNAM 1
/* Define to 1 if you have the `getspnam' function. */
#define HAVE_GETSPNAM 1
/* do we have getsubopt()? */
#define HAVE_GETSUBOPT /**/
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Include GSSAPI/Kerberos 5 Support */
#define HAVE_GSSAPI /**/
/* Define to 1 if you have the <gssapi/gssapi_ext.h> header file. */
#define HAVE_GSSAPI_GSSAPI_EXT_H 1
/* Define if you have the gssapi/gssapi.h header file */
/* #undef HAVE_GSSAPI_GSSAPI_H */
/* Define to 1 if you have the <gssapi/gssapi_krb5.h> header file. */
#define HAVE_GSSAPI_GSSAPI_KRB5_H 1
/* Define if you have the gssapi.h header file */
#define HAVE_GSSAPI_H /**/
/* Define if your GSSAPI implementation defines
gsskrb5_register_acceptor_identity */
#define HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY 1
/* Define if your GSSAPI implementation defines GSS_C_NT_HOSTBASED_SERVICE */
#define HAVE_GSS_C_NT_HOSTBASED_SERVICE /**/
/* Define if your GSSAPI implementation defines GSS_C_NT_USER_NAME */
#define HAVE_GSS_C_NT_USER_NAME /**/
/* Define if your GSSAPI implementation defines GSS_C_SEC_CONTEXT_SASL_SSF */
#define HAVE_GSS_C_SEC_CONTEXT_SASL_SSF /**/
/* Define to 1 if you have the `gss_decapsulate_token' function. */
#define HAVE_GSS_DECAPSULATE_TOKEN 1
/* Define to 1 if you have the `gss_encapsulate_token' function. */
#define HAVE_GSS_ENCAPSULATE_TOKEN 1
/* Define to 1 if you have the `gss_get_name_attribute' function. */
#define HAVE_GSS_GET_NAME_ATTRIBUTE 1
/* Define if your GSSAPI implementation defines gss_inquire_sec_context_by_oid
*/
#define HAVE_GSS_INQUIRE_SEC_CONTEXT_BY_OID 1
/* Define to 1 if you have the `gss_oid_equal' function. */
#define HAVE_GSS_OID_EQUAL 1
/* Define if your GSSAPI implementation supports SPNEGO */
#define HAVE_GSS_SPNEGO /**/
/* Include HTTP form Support */
/* #undef HAVE_HTTPFORM */
/* Define to 1 if you have the `inet_aton' function. */
#define HAVE_INET_ATON 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `jrand48' function. */
#define HAVE_JRAND48 1
/* Do we have Kerberos 4 Support? */
/* #undef HAVE_KRB */
/* Define to 1 if you have the <krb5.h> header file. */
#define HAVE_KRB5_H 1
/* Define to 1 if you have the `krb_get_err_text' function. */
/* #undef HAVE_KRB_GET_ERR_TEXT */
/* Define to 1 if you have the <lber.h> header file. */
/* #undef HAVE_LBER_H */
/* Support for LDAP? */
/* #undef HAVE_LDAP */
/* Define to 1 if you have the <ldap.h> header file. */
/* #undef HAVE_LDAP_H */
/* Define to 1 if you have the `resolv' library (-lresolv). */
#define HAVE_LIBRESOLV 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
/* Define to 1 if you have the `memmem' function. */
#define HAVE_MEMMEM 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1
/* Do we have mysql support? */
/* #undef HAVE_MYSQL */
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Do we have OpenSSL? */
#define HAVE_OPENSSL /**/
/* Use OPIE for server-side OTP? */
/* #undef HAVE_OPIE */
/* Support for PAM? */
/* #undef HAVE_PAM */
/* Define to 1 if you have the <paths.h> header file. */
#define HAVE_PATHS_H 1
/* Do we have Postgres support? */
/* #undef HAVE_PGSQL */
/* Include Support for pwcheck daemon? */
/* #undef HAVE_PWCHECK */
/* Include support for saslauthd? */
#define HAVE_SASLAUTHD /**/
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Do we have SHA512? */
#define HAVE_SHA512 /**/
/* Include SIA Support */
/* #undef HAVE_SIA */
/* Does the system have snprintf()? */
#define HAVE_SNPRINTF /**/
/* Does sockaddr have an sa_len? */
/* #undef HAVE_SOCKADDR_SA_LEN */
/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1
/* Do we have a socklen_t? */
#define HAVE_SOCKLEN_T /**/
/* Do we have SQLite support? */
/* #undef HAVE_SQLITE */
/* Do we have SQLite3 support? */
/* #undef HAVE_SQLITE3 */
/* Is there an ss_family in sockaddr_storage? */
#define HAVE_SS_FAMILY /**/
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strlcat' function. */
/* #undef HAVE_STRLCAT */
/* Define to 1 if you have the `strlcpy' function. */
/* #undef HAVE_STRLCPY */
/* Define to 1 if you have the `strspn' function. */
#define HAVE_STRSPN 1
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Do we have struct sockaddr_stroage? */
#define HAVE_STRUCT_SOCKADDR_STORAGE /**/
/* Define to 1 if you have the <sysexits.h> header file. */
#define HAVE_SYSEXITS_H 1
/* Define to 1 if you have the `syslog' function. */
#define HAVE_SYSLOG 1
/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <varargs.h> header file. */
/* #undef HAVE_VARARGS_H */
/* Does the system have vsnprintf()? */
#define HAVE_VSNPRINTF /**/
/* Define to 1 if you have the <ws2tcpip.h> header file. */
/* #undef HAVE_WS2TCPIP_H */
/* Should we keep handle to DB open in SASLDB plugin? */
/* #undef KEEP_DB_OPEN */
/* Ignore IP Address in Kerberos 4 tickets? */
/* #undef KRB4_IGNORE_IP_ADDRESS */
/* Using Heimdal */
/* #undef KRB5_HEIMDAL */
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "cyrus-sasl"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "https://github.com/cyrusimap/cyrus-sasl/issues"
/* Define to the full name of this package. */
#define PACKAGE_NAME "cyrus-sasl"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "cyrus-sasl 2.1.27"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "cyrus-sasl"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.cyrusimap.org"
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.1.27"
/* Where do we look for Courier authdaemond's socket? */
#define PATH_AUTHDAEMON_SOCKET "/dev/null"
/* Where do we look for saslauthd's socket? */
#define PATH_SASLAUTHD_RUNDIR "/var/state/saslauthd"
/* Force a preferred mechanism */
/* #undef PREFER_MECH */
/* Location of pwcheck socket */
/* #undef PWCHECKDIR */
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Use BerkeleyDB for SASLdb */
/* #undef SASL_BERKELEYDB */
/* Path to default SASLdb database */
#define SASL_DB_PATH "/etc/sasldb2"
/* File to use for source of randomness */
#define SASL_DEV_RANDOM "/dev/urandom"
/* Use GDBM for SASLdb */
/* #undef SASL_GDBM */
/* Use LMDB for SASLdb */
/* #undef SASL_LMDB */
/* Use NDBM for SASLdb */
/* #undef SASL_NDBM */
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* Link ANONYMOUS Statically */
// #define STATIC_ANONYMOUS /**/
/* Link CRAM-MD5 Statically */
// #define STATIC_CRAMMD5 /**/
/* Link DIGEST-MD5 Statically */
// #define STATIC_DIGESTMD5 /**/
/* Link GSSAPI Statically */
#define STATIC_GSSAPIV2 /**/
/* User KERBEROS_V4 Staticly */
/* #undef STATIC_KERBEROS4 */
/* Link ldapdb plugin Statically */
/* #undef STATIC_LDAPDB */
/* Link LOGIN Statically */
/* #undef STATIC_LOGIN */
/* Link NTLM Statically */
/* #undef STATIC_NTLM */
/* Link OTP Statically */
// #define STATIC_OTP /**/
/* Link PASSDSS Statically */
/* #undef STATIC_PASSDSS */
/* Link PLAIN Staticly */
// #define STATIC_PLAIN /**/
/* Link SASLdb Staticly */
// #define STATIC_SASLDB /**/
/* Link SCRAM Statically */
// #define STATIC_SCRAM /**/
/* Link SQL plugin statically */
/* #undef STATIC_SQL */
/* Link SRP Statically */
/* #undef STATIC_SRP */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Should we try to dlopen() plugins while statically compiled? */
/* #undef TRY_DLOPEN_WHEN_STATIC */
/* use the doors IPC API for saslauthd? */
/* #undef USE_DOORS */
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Version number of package */
#define VERSION "2.1.27"
/* Use DES */
#define WITH_DES /**/
/* Linking against dmalloc? */
/* #undef WITH_DMALLOC */
/* Use RC4 */
#define WITH_RC4 /**/
/* Use OpenSSL DES Implementation */
#define WITH_SSL_DES /**/
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for `stat' and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Create a struct iovec if we need one */
#if !defined(_WIN32)
#if !defined(HAVE_SYS_UIO_H)
/* (win32 is handled in sasl.h) */
struct iovec {
char *iov_base;
long iov_len;
};
#else
#include <sys/types.h>
#include <sys/uio.h>
#endif
#endif
/* location of the random number generator */
#ifdef DEV_RANDOM
/* #undef DEV_RANDOM */
#endif
#define DEV_RANDOM SASL_DEV_RANDOM
/* if we've got krb_get_err_txt, we might as well use it;
especially since krb_err_txt isn't in some newer distributions
(MIT Kerb for Mac 4 being a notable example). If we don't have
it, we fall back to the krb_err_txt array */
#ifdef HAVE_KRB_GET_ERR_TEXT
#define get_krb_err_txt krb_get_err_text
#else
#define get_krb_err_txt(X) (krb_err_txt[(X)])
#endif
/* Make Solaris happy... */
#ifndef __EXTENSIONS__
#define __EXTENSIONS__ 1
#endif
/* Make Linux happy... */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
#define SASL_PATH_ENV_VAR "SASL_PATH"
#define SASL_CONF_PATH_ENV_VAR "SASL_CONF_PATH"
#include <stdlib.h>
#include <sys/types.h>
#ifndef WIN32
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
# ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
# endif
#else /* WIN32 */
# include <winsock2.h>
#endif /* WIN32 */
#include <string.h>
#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
#endif /* HAVE_SOCKLEN_T */
#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(WIN32)
#define _SS_MAXSIZE 128 /* Implementation specific max size */
#define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
struct sockaddr_storage {
struct sockaddr ss_sa;
char __ss_pad2[_SS_PADSIZE];
};
# define ss_family ss_sa.sa_family
#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
#ifndef AF_INET6
/* Define it to something that should never appear */
#define AF_INET6 AF_MAX
#endif
#ifndef HAVE_GETADDRINFO
#define getaddrinfo sasl_getaddrinfo
#define freeaddrinfo sasl_freeaddrinfo
#define gai_strerror sasl_gai_strerror
#endif
#ifndef HAVE_GETNAMEINFO
#define getnameinfo sasl_getnameinfo
#endif
#if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO)
#include "gai.h"
#endif
#ifndef AI_NUMERICHOST /* support glibc 2.0.x */
#define AI_NUMERICHOST 4
#define NI_NUMERICHOST 2
#define NI_NAMEREQD 4
#define NI_NUMERICSERV 8
#endif
#ifndef HAVE_SYSEXITS_H
#include "exits.h"
#else
#include "sysexits.h"
#endif
/* Get the correct time.h */
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifndef HIER_DELIMITER
#define HIER_DELIMITER '/'
#endif
#ifdef WIN32
#define SASL_ROOT_KEY "SOFTWARE\\Carnegie Mellon\\Project Cyrus\\SASL Library"
#define SASL_PLUGIN_PATH_ATTR "SearchPath"
#define SASL_CONF_PATH_ATTR "ConfFile"
#include <windows.h>
inline static unsigned int sleep(unsigned int seconds) {
Sleep(seconds * 1000);
return 0;
}
#endif
/* handy string manipulation functions */
#ifndef HAVE_STRLCPY
extern size_t saslauthd_strlcpy(char *dst, const char *src, size_t len);
#define strlcpy(x,y,z) saslauthd_strlcpy((x),(y),(z))
#endif
#ifndef HAVE_STRLCAT
extern size_t saslauthd_strlcat(char *dst, const char *src, size_t len);
#define strlcat(x,y,z) saslauthd_strlcat((x),(y),(z))
#endif
#ifndef HAVE_ASPRINTF
extern int asprintf(char **str, const char *fmt, ...);
#endif
#endif /* CONFIG_H */
#if defined __GNUC__ && __GNUC__ > 6
#define GCC_FALLTHROUGH __attribute__((fallthrough));
#else
#define GCC_FALLTHROUGH /* fall through */
#endif

1
contrib/krb5 vendored Submodule

@ -0,0 +1 @@
Subproject commit 99f7ad2831a01f264c07eed42a0a3a9336b86184

View File

@ -0,0 +1,670 @@
find_program(AWK_PROGRAM awk)
if(NOT AWK_PROGRAM)
message(FATAL_ERROR "You need the awk program to build ClickHouse with krb5 enabled.")
endif()
set(KRB5_SOURCE_DIR ${ClickHouse_SOURCE_DIR}/contrib/krb5/src)
set(ALL_SRCS
${KRB5_SOURCE_DIR}/util/et/et_name.c
${KRB5_SOURCE_DIR}/util/et/com_err.c
${KRB5_SOURCE_DIR}/util/et/error_message.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_names.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_rel_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_unwrap_aead.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_set_name_attr.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_glue.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_imp_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/gssd_pname_to_uid.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_authorize_localname.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_prf.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_acquire_cred_with_pw.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_set_cred_option.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_map_name_to_any.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_rel_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_seal.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_delete_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_context_time.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_get_name_attr.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_mech_invoke.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_unwrap_iov.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_exp_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_init_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_accept_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_verify.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_sign.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_mechname.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_mechattr.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_complete_auth_token.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_wrap_aead.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_cred_oid.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_rel_buffer.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_initialize.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_export_name_comp.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_set_context_option.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_acquire_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_acquire_cred_imp_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_imp_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_set_neg_mechs.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_export_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_oid_ops.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_inq_context_oid.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_del_name_attr.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_decapsulate_token.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_compare_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_rel_name_mapping.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_imp_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_dup_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_export_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_wrap_iov.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_rel_oid_set.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_unseal.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_store_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_buffer_set.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_canon_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_dsp_status.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_dsp_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_dsp_name_ext.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_saslname.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_process_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_encapsulate_token.c
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue/g_negoex.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/delete_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/lucid_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/duplicate_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/get_tkt_flags.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/set_allowable_enctypes.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5sealiov.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/gssapi_err_krb5.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/canon_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/inq_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/export_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/inq_names.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/prf.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5sealv3iov.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/store_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/import_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/export_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/naming_exts.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/s4u_gss_glue.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/rel_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5unsealiov.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/gssapi_krb5.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/disp_status.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/import_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5seal.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/accept_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/import_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/process_context_token.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/disp_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/wrap_size_limit.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/krb5_gss_glue.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/util_crypt.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/set_ccache.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/export_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/rel_oid.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/val_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/context_time.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/cred_store.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/iakerb.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/copy_ccache.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/init_sec_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/indicate_mechs.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/inq_context.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/util_seed.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/util_seqnum.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/compare_name.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/ser_sctx.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5sealv3.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/acquire_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/k5unseal.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/rel_cred.c
${KRB5_SOURCE_DIR}/lib/gssapi/krb5/util_cksum.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/disp_com_err_status.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/gssapi_generic.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/rel_oid_set.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/oid_ops.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_buffer.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_buffer_set.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_set.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_token.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/gssapi_err_generic.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/disp_major_status.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_seqstate.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/util_errmap.c
${KRB5_SOURCE_DIR}/lib/gssapi/generic/rel_buffer.c
${KRB5_SOURCE_DIR}/lib/gssapi/spnego/spnego_mech.c
${KRB5_SOURCE_DIR}/lib/gssapi/spnego/negoex_util.c
${KRB5_SOURCE_DIR}/lib/gssapi/spnego/negoex_ctx.c
# ${KRB5_SOURCE_DIR}/lib/gssapi/spnego/negoex_trace.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prng.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_dk_cmac.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/crc32.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_cbc.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enctype_util.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_etm.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/combine_keys.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/default_state.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/decrypt_iov.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_dk_cmac.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/etypes.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/old_api_glue.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/cksumtypes.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf_cmac.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_old.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/decrypt.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf_dk.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/s2k_des.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_unkeyed.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/crypto_length.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/block_size.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/string_to_key.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/verify_checksum.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/crypto_libinit.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/derive.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/random_to_key.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/verify_checksum_iov.c
# ${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_confounder.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_length.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_dk_hmac.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/make_checksum.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf_des.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/coll_proof_cksum.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_rc4.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/cf2.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/aead.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/encrypt_iov.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/cksumtype_to_string.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/key.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/enc_raw.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/keylengths.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_hmac_md5.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/keyed_cksum.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/keyed_checksum_types.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf_aes2.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/state.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_dk_hmac.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/encrypt.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/checksum_etm.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/make_random_key.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/string_to_cksumtype.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/mandatory_sumtype.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/make_checksum_iov.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/s2k_rc4.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/valid_cksumtype.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/nfold.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prng_fortuna.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/encrypt_length.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/cmac.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/keyblocks.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/prf_rc4.c
${KRB5_SOURCE_DIR}/lib/crypto/krb/s2k_pbkdf2.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/aes.c
# ${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/des.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/rc4.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/des3.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/enc_provider/camellia.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/sha256.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/hmac.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/pbkdf2.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/init.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/stubs.c
# ${KRB5_SOURCE_DIR}/lib/crypto/openssl/hash_provider/hash_crc32.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/hash_provider/hash_evp.c
${KRB5_SOURCE_DIR}/lib/crypto/openssl/des/des_keys.c
${KRB5_SOURCE_DIR}/util/support/fake-addrinfo.c
${KRB5_SOURCE_DIR}/util/support/k5buf.c
${KRB5_SOURCE_DIR}/util/support/hex.c
${KRB5_SOURCE_DIR}/util/support/threads.c
${KRB5_SOURCE_DIR}/util/support/utf8.c
${KRB5_SOURCE_DIR}/util/support/hashtab.c
${KRB5_SOURCE_DIR}/util/support/dir_filenames.c
${KRB5_SOURCE_DIR}/util/support/base64.c
${KRB5_SOURCE_DIR}/util/support/strerror_r.c
${KRB5_SOURCE_DIR}/util/support/plugins.c
${KRB5_SOURCE_DIR}/util/support/path.c
${KRB5_SOURCE_DIR}/util/support/init-addrinfo.c
${KRB5_SOURCE_DIR}/util/support/json.c
${KRB5_SOURCE_DIR}/util/support/errors.c
${KRB5_SOURCE_DIR}/util/support/utf8_conv.c
${KRB5_SOURCE_DIR}/util/support/strlcpy.c
${KRB5_SOURCE_DIR}/util/support/gmt_mktime.c
${KRB5_SOURCE_DIR}/util/support/zap.c
${KRB5_SOURCE_DIR}/util/support/bcmp.c
${KRB5_SOURCE_DIR}/util/support/secure_getenv.c
${KRB5_SOURCE_DIR}/util/profile/prof_tree.c
${KRB5_SOURCE_DIR}/util/profile/prof_file.c
${KRB5_SOURCE_DIR}/util/profile/prof_parse.c
${KRB5_SOURCE_DIR}/util/profile/prof_get.c
${KRB5_SOURCE_DIR}/util/profile/prof_set.c
${KRB5_SOURCE_DIR}/util/profile/prof_err.c
${KRB5_SOURCE_DIR}/util/profile/prof_init.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/fwd_tgt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/conv_creds.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/fast.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_adata.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_tick.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/enc_keyhelper.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_actx.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/init_ctx.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth2.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_princ.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/parse_host_string.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/pr_to_salt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_req.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/pac_sign.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_addrs.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/conv_princ.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_rep.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/str_conv.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gic_opt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/recvauth.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_cksum.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ai_authdata.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_ctx.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/appdefault.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/bld_princ.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/in_tkt_sky.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_creds.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/auth_con.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_key.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/kdc_rep_dc.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_cred.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gic_keytab.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_req_dec.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/set_realm.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth_sam2.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/libdef_parse.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/privsafe.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_auth.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/val_renew.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/addr_order.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/authdata_dec.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/walk_rtree.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gen_subkey.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_auth.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/chpw.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_req.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/allow_weak.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_rep.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_priv.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/s4u_authdata.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth_otp.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/init_keyblock.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_addr.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/encrypt_tk.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/s4u_creds.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/srv_dec_tkt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_priv.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/authdata_enc.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/authdata_exp.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/decode_kdc.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/decrypt_tk.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/enc_helper.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_req_ext.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_key.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth_encts.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/send_tgs.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_cksum.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/tgtname.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/encode_kdc.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_cred.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_safe.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth_pkinit.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/srv_rcache.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/chk_trans.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/etype_list.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/get_creds.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/ser_princ.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gic_pwd.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/authdata.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gen_save_subkey.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/vfy_increds.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/addr_comp.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/kfree.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/response_items.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/serialize.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/cammac_util.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gc_via_tkt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_ctx.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/sendauth.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/addr_srch.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_safe.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/preauth_ec.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/bld_pr_ext.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/random_str.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/sname_match.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/princ_comp.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/get_in_tkt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/gen_seqnum.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/cp_key_cnt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/mk_error.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_athctr.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/deltat.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/get_etype_info.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/plugin.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/kerrs.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/vic_opt.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/unparse.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/parse.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/rd_error.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/pac.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/valid_times.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/copy_data.c
${KRB5_SOURCE_DIR}/lib/krb5/krb/padata.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostrealm.c
${KRB5_SOURCE_DIR}/lib/krb5/os/thread_safe.c
${KRB5_SOURCE_DIR}/lib/krb5/os/krbfileio.c
${KRB5_SOURCE_DIR}/lib/krb5/os/toffset.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostaddr.c
${KRB5_SOURCE_DIR}/lib/krb5/os/ustime.c
${KRB5_SOURCE_DIR}/lib/krb5/os/timeofday.c
${KRB5_SOURCE_DIR}/lib/krb5/os/ccdefname.c
${KRB5_SOURCE_DIR}/lib/krb5/os/full_ipadr.c
${KRB5_SOURCE_DIR}/lib/krb5/os/read_pwd.c
${KRB5_SOURCE_DIR}/lib/krb5/os/trace.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localauth_k5login.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localauth_rule.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localaddr.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostrealm_dns.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostrealm_domain.c
${KRB5_SOURCE_DIR}/lib/krb5/os/sn2princ.c
${KRB5_SOURCE_DIR}/lib/krb5/os/net_write.c
${KRB5_SOURCE_DIR}/lib/krb5/os/gen_rname.c
${KRB5_SOURCE_DIR}/lib/krb5/os/net_read.c
${KRB5_SOURCE_DIR}/lib/krb5/os/accessor.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostrealm_profile.c
${KRB5_SOURCE_DIR}/lib/krb5/os/c_ustime.c
${KRB5_SOURCE_DIR}/lib/krb5/os/expand_path.c
${KRB5_SOURCE_DIR}/lib/krb5/os/port2ip.c
${KRB5_SOURCE_DIR}/lib/krb5/os/changepw.c
${KRB5_SOURCE_DIR}/lib/krb5/os/unlck_file.c
${KRB5_SOURCE_DIR}/lib/krb5/os/gen_port.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localauth_an2ln.c
${KRB5_SOURCE_DIR}/lib/krb5/os/genaddrs.c
${KRB5_SOURCE_DIR}/lib/krb5/os/init_os_ctx.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localauth.c
${KRB5_SOURCE_DIR}/lib/krb5/os/locate_kdc.c
${KRB5_SOURCE_DIR}/lib/krb5/os/prompter.c
${KRB5_SOURCE_DIR}/lib/krb5/os/ktdefname.c
${KRB5_SOURCE_DIR}/lib/krb5/os/realm_dom.c
${KRB5_SOURCE_DIR}/lib/krb5/os/dnssrv.c
${KRB5_SOURCE_DIR}/lib/krb5/os/mk_faddr.c
# ${KRB5_SOURCE_DIR}/lib/krb5/os/dnsglue.c
${KRB5_SOURCE_DIR}/lib/krb5/os/sendto_kdc.c
${KRB5_SOURCE_DIR}/lib/krb5/os/hostrealm_registry.c
${KRB5_SOURCE_DIR}/lib/krb5/os/write_msg.c
${KRB5_SOURCE_DIR}/lib/krb5/os/localauth_names.c
${KRB5_SOURCE_DIR}/lib/krb5/os/read_msg.c
${KRB5_SOURCE_DIR}/lib/krb5/os/lock_file.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccselect.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccselect_realm.c
# ${KRB5_SOURCE_DIR}/lib/krb5/ccache/ser_cc.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccdefops.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_retr.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccselect_k5identity.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cccopy.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccfns.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_file.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccbase.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cccursor.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccdefault.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_memory.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccmarshal.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccselect_hostname.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_dir.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_keyring.c
${KRB5_SOURCE_DIR}/lib/krb5/ccache/cc_kcm.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktadd.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktbase.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktdefault.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/kt_memory.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktfns.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktremove.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/read_servi.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/kt_file.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/read_servi.c
${KRB5_SOURCE_DIR}/lib/krb5/keytab/ktfr_entry.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/k5e1_err.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/kdb5_err.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/asn1_err.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/krb5_err.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/krb524_err.c
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/kv5m_err.c
${KRB5_SOURCE_DIR}/lib/krb5/rcache/rc_base.c
${KRB5_SOURCE_DIR}/lib/krb5/rcache/rc_dfl.c
${KRB5_SOURCE_DIR}/lib/krb5/rcache/rc_file2.c
${KRB5_SOURCE_DIR}/lib/krb5/rcache/rc_none.c
${KRB5_SOURCE_DIR}/lib/krb5/rcache/memrcache.c
${KRB5_SOURCE_DIR}/lib/krb5/unicode/ucdata/ucdata.c
${KRB5_SOURCE_DIR}/lib/krb5/unicode/ucstr.c
${KRB5_SOURCE_DIR}/lib/krb5/asn.1/asn1_encode.c
${KRB5_SOURCE_DIR}/lib/krb5/asn.1/asn1_k_encode.c
${KRB5_SOURCE_DIR}/lib/krb5/asn.1/ldap_key_seq.c
${KRB5_SOURCE_DIR}/lib/krb5/krb5_libinit.c
)
add_custom_command(
OUTPUT ${KRB5_SOURCE_DIR}/util/et/compile_et
COMMAND /bin/sh
./config_script
./compile_et.sh
"/usr/local/share/et"
${AWK_PROGRAM}
sed
>
compile_et
DEPENDS ${KRB5_SOURCE_DIR}/util/et/compile_et.sh ${KRB5_SOURCE_DIR}/util/et/config_script
WORKING_DIRECTORY "${KRB5_SOURCE_DIR}/util/et"
)
add_custom_target(
CREATE_COMPILE_ET ALL
DEPENDS ${KRB5_SOURCE_DIR}/util/et/compile_et
COMMENT "creating compile_et"
VERBATIM
)
file(GLOB_RECURSE ET_FILES
"${KRB5_SOURCE_DIR}/*.et"
)
function(preprocess_et out_var)
set(result)
foreach(in_f ${ARGN})
string(REPLACE
.et
.c
F_C
${in_f}
)
string(REPLACE
.et
.h
F_H
${in_f}
)
get_filename_component(ET_PATH ${in_f} DIRECTORY)
add_custom_command(OUTPUT ${F_C} ${F_H}
COMMAND perl ${KRB5_SOURCE_DIR}/util/et/compile_et -d "${KRB5_SOURCE_DIR}/util/et" ${in_f}
DEPENDS ${in_f} ${KRB5_SOURCE_DIR}/util/et/compile_et
WORKING_DIRECTORY ${ET_PATH}
COMMENT "Creating preprocessed file ${F_C}"
VERBATIM
)
list(APPEND result ${F_C})
endforeach()
set(${out_var} "${result}" PARENT_SCOPE)
endfunction()
add_custom_command(
OUTPUT ${KRB5_SOURCE_DIR}/lib/gssapi/krb5/error_map.h
COMMAND perl
-I../../../util
../../../util/gen-map.pl
-oerror_map.h
NAME=gsserrmap
KEY=OM_uint32
VALUE=char*
COMPARE=compare_OM_uint32
FREEVALUE=free_string
WORKING_DIRECTORY "${KRB5_SOURCE_DIR}/lib/gssapi/krb5"
)
add_custom_target(
ERROR_MAP_H ALL
DEPENDS ${KRB5_SOURCE_DIR}/lib/gssapi/krb5/error_map.h
COMMENT "generating error_map.h"
VERBATIM
)
add_custom_command(
OUTPUT ${KRB5_SOURCE_DIR}/lib/gssapi/generic/errmap.h
COMMAND perl -w -I../../../util ../../../util/gen.pl bimap errmap.h NAME=mecherrmap LEFT=OM_uint32 RIGHT=struct\ mecherror LEFTPRINT=print_OM_uint32 RIGHTPRINT=mecherror_print LEFTCMP=cmp_OM_uint32 RIGHTCMP=mecherror_cmp
WORKING_DIRECTORY "${KRB5_SOURCE_DIR}/lib/gssapi/generic"
)
add_custom_target(
ERRMAP_H ALL
DEPENDS ${KRB5_SOURCE_DIR}/lib/gssapi/generic/errmap.h
COMMENT "generating errmap.h"
VERBATIM
)
add_custom_target(
KRB_5_H ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/include/krb5/krb5.h
COMMENT "generating krb5.h"
VERBATIM
)
add_library(${KRB5_LIBRARY})
add_dependencies(
${KRB5_LIBRARY}
ERRMAP_H
ERROR_MAP_H
KRB_5_H
)
preprocess_et(processed_et_files ${ET_FILES})
add_custom_command(
OUTPUT ${KRB5_SOURCE_DIR}/lib/gssapi/generic/errmap.h
COMMAND perl -w -I../../../util ../../../util/gen.pl bimap errmap.h NAME=mecherrmap LEFT=OM_uint32 RIGHT=struct\ mecherror LEFTPRINT=print_OM_uint32 RIGHTPRINT=mecherror_print LEFTCMP=cmp_OM_uint32 RIGHTCMP=mecherror_cmp
WORKING_DIRECTORY "${KRB5_SOURCE_DIR}/lib/gssapi/generic"
)
target_sources(${KRB5_LIBRARY} PRIVATE
${ALL_SRCS}
)
file(MAKE_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/include/gssapi
)
file(GLOB GSSAPI_GENERIC_HEADERS
${KRB5_SOURCE_DIR}/lib/gssapi/generic/*.h
${KRB5_SOURCE_DIR}/lib/gssapi/generic/gssapi.hin
)
file(COPY ${GSSAPI_GENERIC_HEADERS}
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/gssapi/
)
file(RENAME
${CMAKE_CURRENT_BINARY_DIR}/include/gssapi/gssapi.hin
${CMAKE_CURRENT_BINARY_DIR}/include/gssapi/gssapi.h
)
file(COPY ${KRB5_SOURCE_DIR}/lib/gssapi/krb5/gssapi_krb5.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/gssapi/
)
file(COPY ${KRB5_SOURCE_DIR}/util/et/com_err.h
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/
)
file(MAKE_DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/include/krb5
)
SET(KRBHDEP
${KRB5_SOURCE_DIR}/include/krb5/krb5.hin
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/krb5_err.h
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/k5e1_err.h
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/kdb5_err.h
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/kv5m_err.h
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/krb524_err.h
${KRB5_SOURCE_DIR}/lib/krb5/error_tables/asn1_err.h
)
# cmake < 3.18 does not have 'cat' command
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/krb5/krb5.h
COMMAND cat ${KRBHDEP} > ${CMAKE_CURRENT_BINARY_DIR}/include/krb5/krb5.h
DEPENDS ${KRBHDEP}
)
target_include_directories(${KRB5_LIBRARY} PUBLIC
${KRB5_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
)
target_include_directories(${KRB5_LIBRARY} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} #for autoconf.h
${KRB5_SOURCE_DIR}
${KRB5_SOURCE_DIR}/include
${KRB5_SOURCE_DIR}/lib/gssapi/mechglue
${KRB5_SOURCE_DIR}/lib/
${KRB5_SOURCE_DIR}/lib/gssapi
${KRB5_SOURCE_DIR}/lib/gssapi/generic
${KRB5_SOURCE_DIR}/lib/gssapi/krb5
${KRB5_SOURCE_DIR}/lib/gssapi/spnego
${KRB5_SOURCE_DIR}/util/et
${KRB5_SOURCE_DIR}/lib/crypto/openssl
${KRB5_SOURCE_DIR}/lib/crypto/krb
${KRB5_SOURCE_DIR}/util/profile
${KRB5_SOURCE_DIR}/lib/krb5/ccache/ccapi
${KRB5_SOURCE_DIR}/lib/krb5/ccache
${KRB5_SOURCE_DIR}/lib/krb5/keytab
${KRB5_SOURCE_DIR}/lib/krb5/rcache
${KRB5_SOURCE_DIR}/lib/krb5/unicode
${KRB5_SOURCE_DIR}/lib/krb5/os
# ${OPENSSL_INCLUDE_DIR}
)
target_compile_definitions(${KRB5_LIBRARY} PRIVATE
KRB5_PRIVATE
_GSS_STATIC_LINK=1
KRB5_DEPRECATED=1
LOCALEDIR="/usr/local/share/locale"
BINDIR="/usr/local/bin"
SBINDIR="/usr/local/sbin"
LIBDIR="/usr/local/lib"
)
target_link_libraries(${KRB5_LIBRARY}
PRIVATE ${OPENSSL_CRYPTO_LIBRARY}
)

View File

@ -0,0 +1,764 @@
/* include/autoconf.h. Generated from autoconf.h.in by configure. */
/* include/autoconf.h.in. Generated from configure.in by autoheader. */
#ifndef KRB5_AUTOCONF_H
#define KRB5_AUTOCONF_H
/* Define if AES-NI support is enabled */
/* #undef AESNI */
/* Define if socket can't be bound to 0.0.0.0 */
/* #undef BROKEN_STREAMS_SOCKETS */
/* Define if va_list objects can be simply copied by assignment. */
/* #undef CAN_COPY_VA_LIST */
/* Define to reduce code size even if it means more cpu usage */
/* #undef CONFIG_SMALL */
/* Define if __attribute__((constructor)) works */
#define CONSTRUCTOR_ATTR_WORKS 1
/* Define to default ccache name */
#define DEFCCNAME "FILE:/tmp/krb5cc_%{uid}"
/* Define to default client keytab name */
#define DEFCKTNAME "FILE:/etc/krb5/user/%{euid}/client.keytab"
/* Define to default keytab name */
#define DEFKTNAME "FILE:/etc/krb5.keytab"
/* Define if library initialization should be delayed until first use */
#define DELAY_INITIALIZER 1
/* Define if __attribute__((destructor)) works */
#define DESTRUCTOR_ATTR_WORKS 1
/* Define to disable PKINIT plugin support */
/* #undef DISABLE_PKINIT */
/* Define if LDAP KDB support within the Kerberos library (mainly ASN.1 code)
should be enabled. */
/* #undef ENABLE_LDAP */
/* Define if translation functions should be used. */
#define ENABLE_NLS 1
/* Define if thread support enabled */
#define ENABLE_THREADS 1
/* Define as return type of endrpcent */
#define ENDRPCENT_TYPE void
/* Define if Fortuna PRNG is selected */
#define FORTUNA 1
/* Define to the type of elements in the array set by `getgroups'. Usually
this is either `int' or `gid_t'. */
#define GETGROUPS_T gid_t
/* Define if gethostbyname_r returns int rather than struct hostent * */
#define GETHOSTBYNAME_R_RETURNS_INT 1
/* Type of getpeername second argument. */
#define GETPEERNAME_ARG3_TYPE GETSOCKNAME_ARG3_TYPE
/* Define if getpwnam_r exists but takes only 4 arguments (e.g., POSIX draft 6
implementations like some Solaris releases). */
/* #undef GETPWNAM_R_4_ARGS */
/* Define if getpwnam_r returns an int */
#define GETPWNAM_R_RETURNS_INT 1
/* Define if getpwuid_r exists but takes only 4 arguments (e.g., POSIX draft 6
implementations like some Solaris releases). */
/* #undef GETPWUID_R_4_ARGS */
/* Define if getservbyname_r returns int rather than struct servent * */
#define GETSERVBYNAME_R_RETURNS_INT 1
/* Type of pointer target for argument 3 to getsockname */
#define GETSOCKNAME_ARG3_TYPE socklen_t
/* Define if gmtime_r returns int instead of struct tm pointer, as on old
HP-UX systems. */
/* #undef GMTIME_R_RETURNS_INT */
/* Define if va_copy macro or function is available. */
#define HAS_VA_COPY 1
/* Define to 1 if you have the `access' function. */
#define HAVE_ACCESS 1
/* Define to 1 if you have the <alloca.h> header file. */
#define HAVE_ALLOCA_H 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the `bswap16' function. */
/* #undef HAVE_BSWAP16 */
/* Define to 1 if you have the `bswap64' function. */
/* #undef HAVE_BSWAP64 */
/* Define to 1 if bswap_16 is available via byteswap.h */
#define HAVE_BSWAP_16 1
/* Define to 1 if bswap_64 is available via byteswap.h */
#define HAVE_BSWAP_64 1
/* Define if bt_rseq is available, for recursive btree traversal. */
#define HAVE_BT_RSEQ 1
/* Define to 1 if you have the <byteswap.h> header file. */
#define HAVE_BYTESWAP_H 1
/* Define to 1 if you have the `chmod' function. */
#define HAVE_CHMOD 1
/* Define if cmocka library is available. */
/* #undef HAVE_CMOCKA */
/* Define to 1 if you have the `compile' function. */
/* #undef HAVE_COMPILE */
/* Define if com_err has compatible gettext support */
#define HAVE_COM_ERR_INTL 1
/* Define to 1 if you have the <cpuid.h> header file. */
/* #undef HAVE_CPUID_H */
/* Define to 1 if you have the `daemon' function. */
#define HAVE_DAEMON 1
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#define HAVE_DECL_STRERROR_R 1
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `dn_skipname' function. */
#define HAVE_DN_SKIPNAME 0
/* Define to 1 if you have the <endian.h> header file. */
#define HAVE_ENDIAN_H 1
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `flock' function. */
#define HAVE_FLOCK 1
/* Define to 1 if you have the `fnmatch' function. */
#define HAVE_FNMATCH 1
/* Define to 1 if you have the <fnmatch.h> header file. */
#define HAVE_FNMATCH_H 1
/* Define if you have the getaddrinfo function */
#define HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `getenv' function. */
#define HAVE_GETENV 1
/* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1
/* Define if gethostbyname_r exists and its return type is known */
#define HAVE_GETHOSTBYNAME_R 1
/* Define to 1 if you have the `getnameinfo' function. */
#define HAVE_GETNAMEINFO 1
/* Define if system getopt should be used. */
#define HAVE_GETOPT 1
/* Define if system getopt_long should be used. */
#define HAVE_GETOPT_LONG 1
/* Define if getpwnam_r is available and useful. */
#define HAVE_GETPWNAM_R 1
/* Define if getpwuid_r is available and useful. */
#define HAVE_GETPWUID_R 1
/* Define if getservbyname_r exists and its return type is known */
#define HAVE_GETSERVBYNAME_R 1
/* Have the gettimeofday function */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `getusershell' function. */
#define HAVE_GETUSERSHELL 1
/* Define to 1 if you have the `gmtime_r' function. */
#define HAVE_GMTIME_R 1
/* Define to 1 if you have the <ifaddrs.h> header file. */
#define HAVE_IFADDRS_H 1
/* Define to 1 if you have the `inet_ntop' function. */
#define HAVE_INET_NTOP 1
/* Define to 1 if you have the `inet_pton' function. */
#define HAVE_INET_PTON 1
/* Define to 1 if the system has the type `int16_t'. */
#define HAVE_INT16_T 1
/* Define to 1 if the system has the type `int32_t'. */
#define HAVE_INT32_T 1
/* Define to 1 if the system has the type `int8_t'. */
#define HAVE_INT8_T 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <keyutils.h> header file. */
/* #undef HAVE_KEYUTILS_H */
/* Define to 1 if you have the <lber.h> header file. */
/* #undef HAVE_LBER_H */
/* Define to 1 if you have the <ldap.h> header file. */
/* #undef HAVE_LDAP_H */
/* Define to 1 if you have the `crypto' library (-lcrypto). */
#define HAVE_LIBCRYPTO 1
/* Define if building with libedit. */
/* #undef HAVE_LIBEDIT */
/* Define to 1 if you have the `nsl' library (-lnsl). */
/* #undef HAVE_LIBNSL */
/* Define to 1 if you have the `resolv' library (-lresolv). */
#define HAVE_LIBRESOLV 1
/* Define to 1 if you have the `socket' library (-lsocket). */
/* #undef HAVE_LIBSOCKET */
/* Define if the util library is available */
#define HAVE_LIBUTIL 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* Define to 1 if you have the <machine/byte_order.h> header file. */
/* #undef HAVE_MACHINE_BYTE_ORDER_H */
/* Define to 1 if you have the <machine/endian.h> header file. */
/* #undef HAVE_MACHINE_ENDIAN_H */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkstemp' function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define if netdb.h declares h_errno */
#define HAVE_NETDB_H_H_ERRNO 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the `ns_initparse' function. */
#define HAVE_NS_INITPARSE 0
/* Define to 1 if you have the `ns_name_uncompress' function. */
#define HAVE_NS_NAME_UNCOMPRESS 0
/* Define if OpenSSL supports cms. */
#define HAVE_OPENSSL_CMS 1
/* Define to 1 if you have the <paths.h> header file. */
#define HAVE_PATHS_H 1
/* Define if persistent keyrings are supported */
/* #undef HAVE_PERSISTENT_KEYRING */
/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1
/* Define if #pragma weak references work */
#define HAVE_PRAGMA_WEAK_REF 1
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
/* Define to 1 if you have the `pthread_once' function. */
/* #undef HAVE_PTHREAD_ONCE */
/* Have PTHREAD_PRIO_INHERIT. */
#define HAVE_PTHREAD_PRIO_INHERIT 1
/* Define to 1 if you have the `pthread_rwlock_init' function. */
/* #undef HAVE_PTHREAD_RWLOCK_INIT */
/* Define if pthread_rwlock_init is provided in the thread library. */
#define HAVE_PTHREAD_RWLOCK_INIT_IN_THREAD_LIB 1
/* Define to 1 if you have the <pwd.h> header file. */
#define HAVE_PWD_H 1
/* Define if building with GNU Readline. */
/* #undef HAVE_READLINE */
/* Define if regcomp exists and functions */
#define HAVE_REGCOMP 1
/* Define to 1 if you have the `regexec' function. */
#define HAVE_REGEXEC 1
/* Define to 1 if you have the <regexpr.h> header file. */
/* #undef HAVE_REGEXPR_H */
/* Define to 1 if you have the <regex.h> header file. */
#define HAVE_REGEX_H 1
/* Define to 1 if you have the `res_nclose' function. */
#define HAVE_RES_NCLOSE 1
/* Define to 1 if you have the `res_ndestroy' function. */
/* #undef HAVE_RES_NDESTROY */
/* Define to 1 if you have the `res_ninit' function. */
#define HAVE_RES_NINIT 1
/* Define to 1 if you have the `res_nsearch' function. */
#define HAVE_RES_NSEARCH 0
/* Define to 1 if you have the `res_search' function */
#define HAVE_RES_SEARCH 1
/* Define to 1 if you have the `re_comp' function. */
#define HAVE_RE_COMP 1
/* Define to 1 if you have the `re_exec' function. */
#define HAVE_RE_EXEC 1
/* Define to 1 if you have the <sasl/sasl.h> header file. */
/* #undef HAVE_SASL_SASL_H */
/* Define if struct sockaddr contains sa_len */
/* #undef HAVE_SA_LEN */
/* Define to 1 if you have the `setegid' function. */
#define HAVE_SETEGID 1
/* Define to 1 if you have the `setenv' function. */
#define HAVE_SETENV 1
/* Define to 1 if you have the `seteuid' function. */
#define HAVE_SETEUID 1
/* Define if setluid provided in OSF/1 security library */
/* #undef HAVE_SETLUID */
/* Define to 1 if you have the `setregid' function. */
#define HAVE_SETREGID 1
/* Define to 1 if you have the `setresgid' function. */
#define HAVE_SETRESGID 1
/* Define to 1 if you have the `setresuid' function. */
#define HAVE_SETRESUID 1
/* Define to 1 if you have the `setreuid' function. */
#define HAVE_SETREUID 1
/* Define to 1 if you have the `setsid' function. */
#define HAVE_SETSID 1
/* Define to 1 if you have the `setvbuf' function. */
#define HAVE_SETVBUF 1
/* Define if there is a socklen_t type. If not, probably use size_t */
#define HAVE_SOCKLEN_T 1
/* Define to 1 if you have the `srand' function. */
#define HAVE_SRAND 1
/* Define to 1 if you have the `srand48' function. */
#define HAVE_SRAND48 1
/* Define to 1 if you have the `srandom' function. */
#define HAVE_SRANDOM 1
/* Define to 1 if the system has the type `ssize_t'. */
#define HAVE_SSIZE_T 1
/* Define to 1 if you have the `stat' function. */
#define HAVE_STAT 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `step' function. */
/* #undef HAVE_STEP */
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the `strerror_r' function. */
#define HAVE_STRERROR_R 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
/* #undef HAVE_STRLCPY */
/* Define to 1 if you have the `strptime' function. */
#define HAVE_STRPTIME 1
/* Define to 1 if the system has the type `struct cmsghdr'. */
#define HAVE_STRUCT_CMSGHDR 1
/* Define if there is a struct if_laddrconf. */
/* #undef HAVE_STRUCT_IF_LADDRCONF */
/* Define to 1 if the system has the type `struct in6_pktinfo'. */
#define HAVE_STRUCT_IN6_PKTINFO 1
/* Define to 1 if the system has the type `struct in_pktinfo'. */
#define HAVE_STRUCT_IN_PKTINFO 1
/* Define if there is a struct lifconf. */
/* #undef HAVE_STRUCT_LIFCONF */
/* Define to 1 if the system has the type `struct rt_msghdr'. */
/* #undef HAVE_STRUCT_RT_MSGHDR */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_MTIMENSEC */
/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */
/* #undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC */
/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
/* Define to 1 if you have the <sys/bswap.h> header file. */
/* #undef HAVE_SYS_BSWAP_H */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define if sys_errlist in libc */
#define HAVE_SYS_ERRLIST 1
/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/filio.h> header file. */
/* #undef HAVE_SYS_FILIO_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/sockio.h> header file. */
/* #undef HAVE_SYS_SOCKIO_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define if tcl.h found */
/* #undef HAVE_TCL_H */
/* Define if tcl/tcl.h found */
/* #undef HAVE_TCL_TCL_H */
/* Define to 1 if you have the `timegm' function. */
#define HAVE_TIMEGM 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `unsetenv' function. */
#define HAVE_UNSETENV 1
/* Define to 1 if the system has the type `u_char'. */
#define HAVE_U_CHAR 1
/* Define to 1 if the system has the type `u_int'. */
#define HAVE_U_INT 1
/* Define to 1 if the system has the type `u_int16_t'. */
#define HAVE_U_INT16_T 1
/* Define to 1 if the system has the type `u_int32_t'. */
#define HAVE_U_INT32_T 1
/* Define to 1 if the system has the type `u_int8_t'. */
#define HAVE_U_INT8_T 1
/* Define to 1 if the system has the type `u_long'. */
#define HAVE_U_LONG 1
/* Define to 1 if you have the `vasprintf' function. */
#define HAVE_VASPRINTF 1
/* Define to 1 if you have the `vsnprintf' function. */
#define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `vsprintf' function. */
#define HAVE_VSPRINTF 1
/* Define to 1 if the system has the type `__int128_t'. */
#define HAVE___INT128_T 1
/* Define to 1 if the system has the type `__uint128_t'. */
#define HAVE___UINT128_T 1
/* Define if errno.h declares perror */
/* #undef HDR_HAS_PERROR */
/* May need to be defined to enable IPv6 support, for example on IRIX */
/* #undef INET6 */
/* Define if MIT Project Athena default configuration should be used */
/* #undef KRB5_ATHENA_COMPAT */
/* Define for DNS support of locating realms and KDCs */
#undef KRB5_DNS_LOOKUP
/* Define to enable DNS lookups of Kerberos realm names */
/* #undef KRB5_DNS_LOOKUP_REALM */
/* Define if the KDC should return only vague error codes to clients */
/* #undef KRBCONF_VAGUE_ERRORS */
/* define if the system header files are missing prototype for daemon() */
/* #undef NEED_DAEMON_PROTO */
/* Define if in6addr_any is not defined in libc */
/* #undef NEED_INSIXADDR_ANY */
/* define if the system header files are missing prototype for
ss_execute_command() */
/* #undef NEED_SS_EXECUTE_COMMAND_PROTO */
/* define if the system header files are missing prototype for strptime() */
/* #undef NEED_STRPTIME_PROTO */
/* define if the system header files are missing prototype for swab() */
/* #undef NEED_SWAB_PROTO */
/* Define if need to declare sys_errlist */
/* #undef NEED_SYS_ERRLIST */
/* define if the system header files are missing prototype for vasprintf() */
/* #undef NEED_VASPRINTF_PROTO */
/* Define if the KDC should use no lookaside cache */
/* #undef NOCACHE */
/* Define if references to pthread routines should be non-weak. */
/* #undef NO_WEAK_PTHREADS */
/* Define if lex produes code with yylineno */
/* #undef NO_YYLINENO */
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "krb5-bugs@mit.edu"
/* Define to the full name of this package. */
#define PACKAGE_NAME "Kerberos 5"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Kerberos 5 1.17.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "krb5"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.17.1"
/* Define if setjmp indicates POSIX interface */
/* #undef POSIX_SETJMP */
/* Define if POSIX signal handling is used */
#define POSIX_SIGNALS 1
/* Define if POSIX signal handlers are used */
#define POSIX_SIGTYPE 1
/* Define if termios.h exists and tcsetattr exists */
#define POSIX_TERMIOS 1
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* Define as the return type of signal handlers (`int' or `void'). */
#define RETSIGTYPE void
/* Define as return type of setrpcent */
#define SETRPCENT_TYPE void
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 8
/* The size of `time_t', as computed by sizeof. */
#define SIZEOF_TIME_T 8
/* Define to use OpenSSL for SPAKE preauth */
#define SPAKE_OPENSSL 1
/* Define for static plugin linkage */
/* #undef STATIC_PLUGINS */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
#define STRERROR_R_CHAR_P 1
/* Define if sys_errlist is defined in errno.h */
#define SYS_ERRLIST_DECLARED 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define if no TLS implementation is selected */
/* #undef TLS_IMPL_NONE */
/* Define if TLS implementation is OpenSSL */
#define TLS_IMPL_OPENSSL 1
/* Define if you have dirent.h functionality */
#define USE_DIRENT_H 1
/* Define if dlopen should be used */
#define USE_DLOPEN 1
/* Define if the keyring ccache should be enabled */
/* #undef USE_KEYRING_CCACHE */
/* Define if link-time options for library finalization will be used */
/* #undef USE_LINKER_FINI_OPTION */
/* Define if link-time options for library initialization will be used */
/* #undef USE_LINKER_INIT_OPTION */
/* Define if sigprocmask should be used */
#define USE_SIGPROCMASK 1
/* Define if wait takes int as a argument */
#define WAIT_USES_INT 1
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#define YYTEXT_POINTER 1
/* Define to enable extensions in glibc */
#define _GNU_SOURCE 1
/* Define to enable C11 extensions */
#define __STDC_WANT_LIB_EXT1__ 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define krb5_sigtype to type of signal handler */
#define krb5_sigtype void
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `long' if <sys/types.h> does not define. */
/* #undef time_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
#if defined(__GNUC__) && !defined(inline)
/* Silence gcc pedantic warnings about ANSI C. */
# define inline __inline__
#endif
#endif /* KRB5_AUTOCONF_H */

141
contrib/krb5-cmake/osconf.h Normal file
View File

@ -0,0 +1,141 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 1990,1991,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
/* Site- and OS- dependent configuration */
#ifndef KRB5_OSCONF__
#define KRB5_OSCONF__
#if !defined(_WIN32)
/* Don't try to pull in autoconf.h for Windows, since it's not used */
#ifndef KRB5_AUTOCONF__
#define KRB5_AUTOCONF__
#include "autoconf.h"
#endif
#endif
#if defined(__MACH__) && defined(__APPLE__)
# include <TargetConditionals.h>
#endif
#if defined(_WIN32)
#define DEFAULT_PROFILE_FILENAME "krb5.ini"
#else /* !_WINDOWS */
#if TARGET_OS_MAC
#define DEFAULT_SECURE_PROFILE_PATH "/Library/Preferences/edu.mit.Kerberos:/etc/krb5.conf:/usr/local/etc/krb5.conf"
#define DEFAULT_PROFILE_PATH ("~/Library/Preferences/edu.mit.Kerberos" ":" DEFAULT_SECURE_PROFILE_PATH)
#define KRB5_PLUGIN_BUNDLE_DIR "/System/Library/KerberosPlugins/KerberosFrameworkPlugins"
#define KDB5_PLUGIN_BUNDLE_DIR "/System/Library/KerberosPlugins/KerberosDatabasePlugins"
#define KRB5_AUTHDATA_PLUGIN_BUNDLE_DIR "/System/Library/KerberosPlugins/KerberosAuthDataPlugins"
#else
#define DEFAULT_SECURE_PROFILE_PATH "/etc/krb5.conf:/usr/local/etc/krb5.conf"
#define DEFAULT_PROFILE_PATH DEFAULT_SECURE_PROFILE_PATH
#endif
#endif /* _WINDOWS */
#ifdef _WIN32
#define DEFAULT_PLUGIN_BASE_DIR "%{LIBDIR}\\plugins"
#else
#define DEFAULT_PLUGIN_BASE_DIR "/usr/local/lib/krb5/plugins"
#endif
#if defined(_WIN64)
#define PLUGIN_EXT "64.dll"
#elif defined(_WIN32)
#define PLUGIN_EXT "32.dll"
#else
#define PLUGIN_EXT ".so"
#endif
#define KDC_DIR "/usr/local/var/krb5kdc"
#define KDC_RUN_DIR "/run/krb5kdc"
#define DEFAULT_KDB_FILE KDC_DIR "/principal"
#define DEFAULT_KEYFILE_STUB KDC_DIR "/.k5."
#define KRB5_DEFAULT_ADMIN_ACL KDC_DIR "/krb5_adm.acl"
/* Used by old admin server */
#define DEFAULT_ADMIN_ACL KDC_DIR "/kadm_old.acl"
/* Location of KDC profile */
#define DEFAULT_KDC_PROFILE KDC_DIR "/kdc.conf"
#define KDC_PROFILE_ENV "KRB5_KDC_PROFILE"
#if TARGET_OS_MAC
#define DEFAULT_KDB_LIB_PATH { KDB5_PLUGIN_BUNDLE_DIR, "/usr/local/lib/krb5/plugins/kdb", NULL }
#else
#define DEFAULT_KDB_LIB_PATH { "/usr/local/lib/krb5/plugins/kdb", NULL }
#endif
#define DEFAULT_KDC_ENCTYPE ENCTYPE_AES256_CTS_HMAC_SHA1_96
#define KDCRCACHE "dfl:krb5kdc_rcache"
#define KDC_PORTNAME "kerberos" /* for /etc/services or equiv. */
#define KRB5_DEFAULT_PORT 88
#define DEFAULT_KPASSWD_PORT 464
#define DEFAULT_KDC_UDP_PORTLIST "88"
#define DEFAULT_KDC_TCP_PORTLIST "88"
#define DEFAULT_TCP_LISTEN_BACKLOG 5
/*
* Defaults for the KADM5 admin system.
*/
#define DEFAULT_KADM5_KEYTAB KDC_DIR "/kadm5.keytab"
#define DEFAULT_KADM5_ACL_FILE KDC_DIR "/kadm5.acl"
#define DEFAULT_KADM5_PORT 749 /* assigned by IANA */
#define KRB5_DEFAULT_SUPPORTED_ENCTYPES \
"aes256-cts-hmac-sha1-96:normal " \
"aes128-cts-hmac-sha1-96:normal"
#define MAX_DGRAM_SIZE 65536
#define RCTMPDIR "/var/tmp" /* directory to store replay caches */
#define KRB5_PATH_TTY "/dev/tty"
#define KRB5_PATH_LOGIN "/usr/local/sbin/login.krb5"
#define KRB5_PATH_RLOGIN "/usr/local/bin/rlogin"
#define KRB5_ENV_CCNAME "KRB5CCNAME"
/*
* krb5 replica support follows
*/
#define KPROP_DEFAULT_FILE KDC_DIR "/replica_datatrans"
#define KPROPD_DEFAULT_FILE KDC_DIR "/from_master"
#define KPROPD_DEFAULT_KDB5_UTIL "/usr/local/sbin/kdb5_util"
#define KPROPD_DEFAULT_KPROP "/usr/local/sbin/kprop"
#define KPROPD_DEFAULT_KRB_DB DEFAULT_KDB_FILE
#define KPROPD_ACL_FILE KDC_DIR "/kpropd.acl"
/*
* GSS mechglue
*/
#define MECH_CONF "/usr/local/etc/gss/mech"
#define MECH_LIB_PREFIX "/usr/local/lib/gss/"
#endif /* KRB5_OSCONF__ */

View File

@ -0,0 +1,2 @@
#include "util/profile/profile.hin"
#include "util/profile/prof_err.h"

View File

@ -49,7 +49,6 @@ set(SRCS
${RDKAFKA_SOURCE_DIR}/rdkafka_request.c
${RDKAFKA_SOURCE_DIR}/rdkafka_roundrobin_assignor.c
${RDKAFKA_SOURCE_DIR}/rdkafka_sasl.c
# ${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_cyrus.c # needed to support Kerberos, requires cyrus-sasl
${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_oauthbearer.c
${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_plain.c
${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_scram.c
@ -77,12 +76,34 @@ set(SRCS
${RDKAFKA_SOURCE_DIR}/rdgz.c
)
if(${ENABLE_CYRUS_SASL})
message (STATUS "librdkafka with SASL support")
set(SRCS
${SRCS}
${RDKAFKA_SOURCE_DIR}/rdkafka_sasl_cyrus.c # needed to support Kerberos, requires cyrus-sasl
)
endif()
add_library(rdkafka ${SRCS})
target_compile_options(rdkafka PRIVATE -fno-sanitize=undefined)
target_include_directories(rdkafka SYSTEM PUBLIC include)
# target_include_directories(rdkafka SYSTEM PUBLIC include)
target_include_directories(rdkafka SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) # for "librdkafka/rdkafka.h"
target_include_directories(rdkafka SYSTEM PUBLIC ${RDKAFKA_SOURCE_DIR}) # Because weird logic with "include_next" is used.
target_include_directories(rdkafka SYSTEM PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/auxdir) # for "../config.h"
target_include_directories(rdkafka SYSTEM PRIVATE ${ZSTD_INCLUDE_DIR}/common) # Because wrong path to "zstd_errors.h" is used.
target_link_libraries(rdkafka PRIVATE lz4 ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY} ${LIBGSASL_LIBRARY})
target_link_libraries(rdkafka PRIVATE lz4 ${ZLIB_LIBRARIES} ${ZSTD_LIBRARY})
if(OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY)
target_link_libraries(rdkafka PRIVATE ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
endif()
if(${ENABLE_CYRUS_SASL})
target_link_libraries(rdkafka PRIVATE ${CYRUS_SASL_LIBRARY})
set(WITH_SASL_CYRUS 1)
endif()
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/auxdir)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/config.h"
IMMEDIATE @ONLY
)

View File

@ -1,4 +1,4 @@
// Automatically generated by ./configure
// Originally generated by ./configure
#ifndef _CONFIG_H_
#define _CONFIG_H_
#define ARCH "x86_64"
@ -65,6 +65,7 @@
#define WITH_SASL_SCRAM 1
// WITH_SASL_OAUTHBEARER
#define WITH_SASL_OAUTHBEARER 1
#cmakedefine WITH_SASL_CYRUS 1
// crc32chw
#if !defined(__PPC__)
#define WITH_CRC32C_HW 1

View File

@ -262,6 +262,8 @@ target_link_libraries(clickhouse_common_io
roaring
)
if (USE_RDKAFKA)
dbms_target_link_libraries(PRIVATE ${CPPKAFKA_LIBRARY} ${RDKAFKA_LIBRARY})
if(NOT USE_INTERNAL_RDKAFKA_LIBRARY)
@ -273,6 +275,14 @@ if (USE_AMQPCPP)
dbms_target_link_libraries(PUBLIC amqp-cpp)
endif()
if (USE_CYRUS_SASL)
dbms_target_link_libraries(PRIVATE ${CYRUS_SASL_LIBRARY})
endif()
if (USE_KRB5)
dbms_target_link_libraries(PRIVATE ${KRB5_LIBRARY})
endif()
if(RE2_INCLUDE_DIR)
target_include_directories(clickhouse_common_io SYSTEM BEFORE PUBLIC ${RE2_INCLUDE_DIR})
endif()