summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-01-19 22:25:34 +0000
committerJeremy Allison <jra@samba.org>2003-01-19 22:25:34 +0000
commita45db02a82a42d6ac616c3a1efe73272ccbd69b5 (patch)
tree8096328fbebc576fc187d612111b1b217daaa94e /source3
parent52b65f70caa1c6ac3f978cd3a349de921fe1eea7 (diff)
downloadsamba-a45db02a82a42d6ac616c3a1efe73272ccbd69b5.tar.gz
samba-a45db02a82a42d6ac616c3a1efe73272ccbd69b5.tar.bz2
samba-a45db02a82a42d6ac616c3a1efe73272ccbd69b5.zip
Merge in more of the SuSE patches for Heimdal. These changes show how
to add a function without an explicit #ifdef HEIMDAL which I'm trying to avoid. Jeremy. (This used to be commit 77aeb262ef7c7cd3d206afe2d5445caaca943dfd)
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/configure190
-rw-r--r--source3/configure.in4
-rw-r--r--source3/include/config.h.in9
-rw-r--r--source3/include/includes.h12
-rw-r--r--source3/libsmb/clikrb5.c29
5 files changed, 244 insertions, 0 deletions
diff --git a/source3/configure b/source3/configure
index d1088d1f3f..76aa3a671a 100755
--- a/source3/configure
+++ b/source3/configure
@@ -21086,6 +21086,196 @@ if test $ac_cv_lib_asn1_copy_Authenticator = yes; then
LIBS="$LIBS -lasn1 -lroken"
fi
+ echo "$as_me:$LINENO: checking for krb5_set_real_time in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_set_real_time in -lkrb5... $ECHO_C" >&6
+if test "${ac_cv_lib_krb5_krb5_set_real_time+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char krb5_set_real_time ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+krb5_set_real_time ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_krb5_krb5_set_real_time=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_krb5_krb5_set_real_time=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_set_real_time" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_set_real_time" >&6
+if test $ac_cv_lib_krb5_krb5_set_real_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5_SET_REAL_TIME 1
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for krb5_set_default_in_tkt_etypes in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_set_default_in_tkt_etypes in -lkrb5... $ECHO_C" >&6
+if test "${ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char krb5_set_default_in_tkt_etypes ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+krb5_set_default_in_tkt_etypes ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes" >&6
+if test $ac_cv_lib_krb5_krb5_set_default_in_tkt_etypes = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES 1
+_ACEOF
+
+fi
+
+ echo "$as_me:$LINENO: checking for krb5_set_default_tgs_ktypes in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_set_default_tgs_ktypes in -lkrb5... $ECHO_C" >&6
+if test "${ac_cv_lib_krb5_krb5_set_default_tgs_ktypes+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5 $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char krb5_set_default_tgs_ktypes ();
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+krb5_set_default_tgs_ktypes ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_krb5_krb5_set_default_tgs_ktypes=yes
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_krb5_krb5_set_default_tgs_ktypes=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_set_default_tgs_ktypes" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_set_default_tgs_ktypes" >&6
+if test $ac_cv_lib_krb5_krb5_set_default_tgs_ktypes = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_KRB5_SET_DEFAULT_TGS_KTYPES 1
+_ACEOF
+
+fi
+
+
########################################################
# now see if we can find the krb5 libs in standard paths
diff --git a/source3/configure.in b/source3/configure.in
index 4daba5a647..d324a2ed6e 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -2094,6 +2094,10 @@ fi
# Heimdal checks.
AC_CHECK_LIB(crypto, des_set_key, [LIBS="$LIBS -lcrypto"])
AC_CHECK_LIB(asn1, copy_Authenticator, [LIBS="$LIBS -lasn1 -lroken"])
+ AC_CHECK_LIB(krb5, krb5_set_real_time, [AC_DEFINE(HAVE_KRB5_SET_REAL_TIME,1,[Whether krb5_set_real_time is available])])
+ AC_CHECK_LIB(krb5, krb5_set_default_in_tkt_etypes, [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES,1,[Whether krb5_set_default_in_tkt_etypes, is available])])
+ AC_CHECK_LIB(krb5, krb5_set_default_tgs_ktypes, [AC_DEFINE(HAVE_KRB5_SET_DEFAULT_TGS_KTYPES,1,[Whether krb5_set_default_tgs_ktypes is available])])
+
########################################################
# now see if we can find the krb5 libs in standard paths
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index db9cd86cca..46ccf911d1 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -552,6 +552,15 @@
/* Define to 1 if you have the <krb5.h> header file. */
#undef HAVE_KRB5_H
+/* Whether krb5_set_default_in_tkt_etypes, is available */
+#undef HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES
+
+/* Whether krb5_set_default_tgs_ktypes is available */
+#undef HAVE_KRB5_SET_DEFAULT_TGS_KTYPES
+
+/* Whether krb5_set_real_time is available */
+#undef HAVE_KRB5_SET_REAL_TIME
+
/* Define to 1 if you have the <lastlog.h> header file. */
#undef HAVE_LASTLOG_H
diff --git a/source3/include/includes.h b/source3/include/includes.h
index eb89d6f2af..0142dab724 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -1208,5 +1208,17 @@ time_t timegm(struct tm *tm);
#define VXFS_QUOTA
#endif
+#if defined(HAVE_KRB5)
+
+#ifndef KRB5_SET_REAL_TIME
+krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds);
+#endif
+
+#ifndef HAVE_KRB5_SET_DEFAULT_TGS_KTYPES
+krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype *enc);
+#endif
+
+#endif /* HAVE_KRB5 */
+
#endif /* _INCLUDES_H */
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index cca2a9cd3a..20d0906e71 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -2,6 +2,7 @@
Unix SMB/CIFS implementation.
simple kerberos5 routines for active directory
Copyright (C) Andrew Tridgell 2001
+ Copyright (C) Luke Howard 2002
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,6 +22,34 @@
#include "includes.h"
#ifdef HAVE_KRB5
+
+#ifndef KRB5_SET_REAL_TIME
+/*
+ * This function is not in the Heimdal mainline.
+ */
+krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds)
+{
+ krb5_error_code ret;
+ int32_t sec, usec;
+
+ ret = krb5_us_timeofday(context, &sec, &usec);
+ if (ret)
+ return ret;
+
+ context->kdc_sec_offset = seconds - sec;
+ context->kdc_usec_offset = microseconds - usec;
+
+ return 0;
+}
+#endif
+
+#if defined(HAVE_KRB5_SET_DEFAULT_IN_TKT_ETYPES) && !defined(HAVE_KRB5_SET_DEFAULT_TGS_KTYPES)
+krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype *enc)
+{
+ return krb5_set_default_in_tkt_etypes(ctx, enc);
+}
+#endif
+
/*
we can't use krb5_mk_req because w2k wants the service to be in a particular format
*/