1
0

patch-aclocal_kerberos5_m4 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- nfs-utils-1.1.4.orig/aclocal/kerberos5.m4 2008-10-17 16:20:09.000000000 +0200
  3. +++ nfs-utils-1.1.4/aclocal/kerberos5.m4 2009-01-30 16:24:45.000000000 +0100
  4. @@ -1,112 +1,48 @@
  5. -dnl Checks for Kerberos
  6. -dnl NOTE: while we intend to do generic gss-api, currently we
  7. -dnl have a requirement to get an initial Kerberos machine
  8. -dnl credential. Thus, the requirement for Kerberos.
  9. -dnl The Kerberos gssapi library will be dynamically loaded?
  10. AC_DEFUN([AC_KERBEROS_V5],[
  11. + K5CONFIG="krb5-config"
  12. AC_MSG_CHECKING(for Kerberos v5)
  13. - AC_ARG_WITH(krb5,
  14. - [AC_HELP_STRING([--with-krb5=DIR], [use Kerberos v5 installation in DIR])],
  15. + AC_ARG_WITH(krb5-config,
  16. + [AC_HELP_STRING([--with-krb5-config=PATH], [Full Path to krb5-config.])],
  17. [ case "$withval" in
  18. yes|no)
  19. - krb5_with=""
  20. + K5CONFIG="krb5-config"
  21. ;;
  22. *)
  23. - krb5_with="$withval"
  24. + K5CONFIG="$withval"
  25. ;;
  26. esac ]
  27. )
  28. - for dir in $krb5_with /usr /usr/kerberos /usr/local /usr/local/krb5 \
  29. - /usr/krb5 /usr/heimdal /usr/local/heimdal /usr/athena ; do
  30. - dnl This ugly hack brought on by the split installation of
  31. - dnl MIT Kerberos on Fedora Core 1
  32. - K5CONFIG=""
  33. - if test -f $dir/bin/krb5-config; then
  34. - K5CONFIG=$dir/bin/krb5-config
  35. - elif test -f "/usr/kerberos/bin/krb5-config"; then
  36. - K5CONFIG="/usr/kerberos/bin/krb5-config"
  37. - elif test -f "/usr/lib/mit/bin/krb5-config"; then
  38. - K5CONFIG="/usr/lib/mit/bin/krb5-config"
  39. - fi
  40. if test "$K5CONFIG" != ""; then
  41. KRBCFLAGS=`$K5CONFIG --cflags`
  42. KRBLIBS=`$K5CONFIG --libs gssapi`
  43. - K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
  44. - AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
  45. - if test -f $dir/include/gssapi/gssapi_krb5.h -a \
  46. - \( -f $dir/lib/libgssapi_krb5.a -o \
  47. - -f $dir/lib64/libgssapi_krb5.a -o \
  48. - -f $dir/lib64/libgssapi_krb5.so -o \
  49. - -f $dir/lib/libgssapi_krb5.so \) ; then
  50. + if $K5CONFIG --version | grep -q -e heimdal; then
  51. + K5VERS=`$K5CONFIG --version | head -n 1 | cut -f2 -d ' ' | tr -d '.'`
  52. + AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
  53. + gssapi_lib=gssapi
  54. + KRBIMPL="heimdal"
  55. + elif $K5CONFIG --version | grep -q -e Kerberos; then
  56. + K5VERS=`$K5CONFIG --version | head -n 1 | cut -f4 -d ' ' | tr -d '.'`
  57. AC_DEFINE(HAVE_KRB5, 1, [Define this if you have MIT Kerberos libraries])
  58. - KRBDIR="$dir"
  59. - dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
  60. - dnl private function (gss_krb5_ccache_name) to get correct
  61. - dnl behavior of changing the ccache used by gssapi.
  62. - dnl Starting in 1.3.2, we *DO NOT* want to use
  63. - dnl gss_krb5_ccache_name, instead we want to set KRB5CCNAME
  64. - dnl to get gssapi to use a different ccache
  65. if test $K5VERS -le 131; then
  66. AC_DEFINE(USE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the private function, gss_krb5_cache_name, must be used to tell the Kerberos library which credentials cache to use. Otherwise, this is done by setting the KRB5CCNAME environment variable])
  67. fi
  68. gssapi_lib=gssapi_krb5
  69. - break
  70. - dnl The following ugly hack brought on by the split installation
  71. - dnl of Heimdal Kerberos on SuSe
  72. - elif test \( -f $dir/include/heim_err.h -o\
  73. - -f $dir/include/heimdal/heim_err.h \) -a \
  74. - -f $dir/lib/libroken.a; then
  75. - AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
  76. - KRBDIR="$dir"
  77. - gssapi_lib=gssapi
  78. - break
  79. - fi
  80. - fi
  81. - done
  82. - dnl We didn't find a usable Kerberos environment
  83. - if test "x$KRBDIR" = "x"; then
  84. - if test "x$krb5_with" = "x"; then
  85. - AC_MSG_ERROR(Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5=)
  86. + KRBIMPL="mit-krb5"
  87. else
  88. - AC_MSG_ERROR(Kerberos v5 with GSS support not found at $krb5_with)
  89. - fi
  90. + AC_MSG_ERROR(Unknown Kerberos 5 Implementation. Is neither heimdal or mit-krb5.)
  91. + KRBIMPL="unknown"
  92. fi
  93. - AC_MSG_RESULT($KRBDIR)
  94. -
  95. - dnl Check if -rpath=$(KRBDIR)/lib is needed
  96. - echo "The current KRBDIR is $KRBDIR"
  97. - if test "$KRBDIR/lib" = "/lib" -o "$KRBDIR/lib" = "/usr/lib" \
  98. - -o "$KRBDIR/lib" = "//lib" -o "$KRBDIR/lib" = "/usr//lib" ; then
  99. - KRBLDFLAGS="";
  100. - elif /sbin/ldconfig -p | grep > /dev/null "=> $KRBDIR/lib/"; then
  101. - KRBLDFLAGS="";
  102. - else
  103. - KRBLDFLAGS="-Wl,-rpath=$KRBDIR/lib"
  104. + AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
  105. fi
  106. + AC_MSG_RESULT($KRBIMPL)
  107. - dnl Now check for functions within gssapi library
  108. - AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context,
  109. - AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
  110. - AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes,
  111. - AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
  112. - AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name,
  113. - AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
  114. -
  115. - dnl Check for newer error message facility
  116. - AC_CHECK_LIB($gssapi_lib, krb5_get_error_message,
  117. - AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
  118. -
  119. - dnl Check for function to specify addressless tickets
  120. - AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless,
  121. - AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
  122. -
  123. - dnl If they specified a directory and it didn't work, give them a warning
  124. - if test "x$krb5_with" != "x" -a "$krb5_with" != "$KRBDIR"; then
  125. - AC_MSG_WARN(Using $KRBDIR instead of requested value of $krb5_with for Kerberos!)
  126. - fi
  127. + AC_CHECK_LIB($gssapi_lib, gss_krb5_export_lucid_sec_context, AC_DEFINE(HAVE_LUCID_CONTEXT_SUPPORT, 1, [Define this if the Kerberos GSS library supports gss_krb5_export_lucid_sec_context]), ,$KRBLIBS)
  128. + AC_CHECK_LIB($gssapi_lib, gss_krb5_set_allowable_enctypes, AC_DEFINE(HAVE_SET_ALLOWABLE_ENCTYPES, 1, [Define this if the Kerberos GSS library supports gss_krb5_set_allowable_enctypes]), ,$KRBLIBS)
  129. + AC_CHECK_LIB($gssapi_lib, gss_krb5_ccache_name, AC_DEFINE(HAVE_GSS_KRB5_CCACHE_NAME, 1, [Define this if the Kerberos GSS library supports gss_krb5_ccache_name]), ,$KRBLIBS)
  130. + AC_CHECK_LIB($gssapi_lib, krb5_get_error_message, AC_DEFINE(HAVE_KRB5_GET_ERROR_MESSAGE, 1, [Define this if the function krb5_get_error_message is available]), ,$KRBLIBS)
  131. + AC_CHECK_LIB($gssapi_lib, krb5_get_init_creds_opt_set_addressless, AC_DEFINE(HAVE_KRB5_GET_INIT_CREDS_OPT_SET_ADDRESSLESS, 1, [Define this if the function krb5_get_init_creds_opt_set_addressless is available]), ,$KRBLIBS)
  132. - AC_SUBST([KRBDIR])
  133. AC_SUBST([KRBLIBS])
  134. AC_SUBST([KRBCFLAGS])
  135. AC_SUBST([KRBLDFLAGS])