[PATCH] Use krb5-config if avaialable for Kerberos parameters

Darren Tucker dtucker at zip.com.au
Sat Nov 12 19:34:28 EST 2005


Hi.

I've had this patch a while (and I posted an earlier version a while
back): it tries to use krb5-config to obtain the Kerberos build options.
If it's not available, or isn't in the path specified to --with-kerberos5
then the existing behaviour is kept.

It seems to work for me with MIT and Heimdal.  I got some feedback from one
person, would any of the Kerberos-using folk care to comment on it?

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
Index: configure.ac
===================================================================
RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/configure.ac,v
retrieving revision 1.307
diff -u -p -r1.307 configure.ac
--- configure.ac	12 Nov 2005 07:42:37 -0000	1.307
+++ configure.ac	12 Nov 2005 08:25:35 -0000
@@ -2812,19 +2812,25 @@ AC_ARG_WITH(kerberos5,
 	[  --with-kerberos5=PATH   Enable Kerberos 5 support],
 	[ if test "x$withval" != "xno" ; then
 		if test "x$withval" = "xyes" ; then
-			KRB5ROOT="/usr/local"
+			# Check for a krb5-config in the path, if found use it
+			AC_PATH_PROG(KRB5CONF, krb5-config)
+			if test -x "$KRB5CONF" ; then
+				KRB5ROOT="`$KRB5CONF --path`"
+			else
+				KRB5ROOT="/usr/local"
+				KRB5CONF="/usr/local/bin/krb5-config"
+			fi
 		else
 			KRB5ROOT=${withval}
+			KRB5CONF="${withval}/bin/krb5-config"
 		fi
 
 		AC_DEFINE(KRB5, 1, [Define if you want Kerberos 5 support])
 		KRB5_MSG="yes"
 
-		AC_MSG_CHECKING(for krb5-config)
-		if test -x  $KRB5ROOT/bin/krb5-config ; then
-			KRB5CONF=$KRB5ROOT/bin/krb5-config
-			AC_MSG_RESULT($KRB5CONF)
-
+		AC_MSG_CHECKING(if $KRB5CONF is usable)
+		if test -x "$KRB5CONF" ; then
+			AC_MSG_RESULT(yes)
 			AC_MSG_CHECKING(for gssapi support)
 			if $KRB5CONF | grep gssapi >/dev/null ; then
 				AC_MSG_RESULT(yes)


More information about the openssh-unix-dev mailing list