Autoconfiscate GSS-API support, including support for manually disabling it.
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Nov 2008 22:49:27 +0000 (22:49 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Nov 2008 22:49:27 +0000 (22:49 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@8318 cda61777-01e9-0310-a592-d414129be87e

unix/configure.ac
unix/uxgss.c

index 846a35c..3e1ed00 100644 (file)
@@ -14,9 +14,15 @@ if test "X$GCC" = Xyes; then
     CFLAGS="$CFLAGS -Wall -Werror"
 fi
 
+AC_ARG_WITH(gssapi,
+[  --without-gssapi        disable GSS-API support])
+
 AC_CHECK_HEADERS([utmpx.h sys/select.h],,,[
 #include <sys/types.h>
 #include <utmp.h>])
+if test "$with_gssapi" != "no"; then
+  AC_CHECK_HEADERS([gssapi/gssapi.h])
+fi
 
 # Look for both GTK 1 and GTK 2.
 AM_PATH_GTK([1.2.0], [gtk=1], [gtk=none])
@@ -38,6 +44,9 @@ fi
 AC_SUBST([all_targets])
 
 AC_SEARCH_LIBS([socket], [xnet])
+if test "$with_gssapi" != "no"; then
+  AC_SEARCH_LIBS([gss_init_sec_context], [gss gssapi gssapi_krb5])
+fi
 
 AC_CHECK_FUNCS([getaddrinfo ptsname setresuid strsignal updwtmpx])
 
@@ -70,4 +79,7 @@ AH_BOTTOM([
 #ifndef HAVE_PANGO_FONT_MAP_LIST_FAMILIES
 # define PANGO_PRE_1POINT6
 #endif
+#ifndef HAVE_GSSAPI_GSSAPI_H
+# define NO_GSSAPI
+#endif
 ])
index ce898d8..1a6668e 100644 (file)
@@ -1,10 +1,11 @@
-#ifndef NO_GSSAPI
-
 #include <string.h>
 #include <gssapi/gssapi.h>
+#include "putty.h"
 #include "sshgss.h"
 #include "misc.h"
 
+#ifndef NO_GSSAPI
+
 static gss_OID_desc gss_mech_krb5_desc =
     { 9, (void *)"\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" };
 static gss_OID const gss_mech_krb5 = &gss_mech_krb5_desc;