Index: src/Makefile.in
--- src/Makefile.in.orig	2007-09-18 05:38:17 +0200
+++ src/Makefile.in	2007-10-25 16:33:31 +0200
@@ -4,9 +4,8 @@
 myfulldir=.
 mydir=.
 # Don't build sample by default: plugins/locate/python plugins/preauth/wpse plugins/preauth/cksum_body
-SUBDIRS=util include lib @krb524@ kdc kadmin @ldap_plugin_dir@ slave clients \
+SUBDIRS=util include lib @krb524@ kdc kadmin slave clients \
 	plugins/kdb/db2 \
-	plugins/preauth/pkinit \
 	appl tests \
 	config-files gen-manpages
 BUILDTOP=$(REL)$(C)
@@ -100,10 +99,6 @@
 	done
 	(w=`pwd`; cd util && $(MAKE) install DESTDIR="$$w/util/fakedest")
 	(w=`pwd`; cd lib && $(MAKE) install DESTDIR="$$w/util/fakedest")
-	(w=`pwd`; cd plugins/kdb/db2 && $(MAKE) install DESTDIR="$$w/util/fakedest")
-	if test -r plugins/preauth/pkinit/Makefile; then \
-	  (w=`pwd`; cd plugins/preauth/pkinit && $(MAKE) install DESTDIR="$$w/util/fakedest"); \
-	fi
 
 #	(w=`pwd`; cd plugins/locate/python && $(MAKE) install DESTDIR="$$w/util/fakedest")
 
Index: src/appl/Makefile.in
--- src/appl/Makefile.in.orig	2004-03-08 08:20:55 +0100
+++ src/appl/Makefile.in	2007-10-25 16:34:05 +0200
@@ -3,5 +3,6 @@
 mydir=.
 BUILDTOP=$(REL)..
 
-LOCAL_SUBDIRS= sample simple user_user gss-sample
+LOCAL_SUBDIRS= gss-sample
+MY_SUBDIRS= gss-sample
 
Index: src/appl/configure
--- src/appl/configure.orig	2007-10-22 05:35:00 +0200
+++ src/appl/configure	2007-10-25 16:34:43 +0200
@@ -315,7 +315,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subdirs_all="$ac_subdirs_all libpty bsd gssftp telnet"
+ac_subdirs_all="$ac_subdirs_all libpty"
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EXTRA_FILES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT HAVE_GCC CPP LD KRB4_INCLUDES KRB4_LIBPATH KRB4_LIB KRB4_DEPLIB KRB_ERR_H_DEP DES425_DEPLIB DES425_LIB compile_et COM_ERR_VERSION SS_LIB SS_VERSION DB_HEADER DB_LIB DB_VERSION DB_HEADER_VERSION KDB5_DB_LIB HESIOD_DEFS HESIOD_LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CONFIG_RELTOPDIR subdirs OPENLDAP_PLUGIN build build_cpu build_vendor build_os host host_cpu host_vendor host_os krb5_cv_host acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS THREAD_SUPPORT DL_LIB EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA GEN_LIB CC_LINK RPATH_FLAG DEPLIBEXT LIBOBJS LTLIBOBJS'
 ac_subst_files='lib_frag libobj_frag libnover_frag'
 
@@ -7626,7 +7626,7 @@
 
 
 
-subdirs="$subdirs libpty bsd gssftp telnet"
+subdirs="$subdirs libpty"
 
 
            ac_config_files="$ac_config_files ./Makefile:$srcdir/../config/pre.in:./Makefile.in:$srcdir/../config/post.in"
Index: src/config/pre.in
--- src/config/pre.in.orig	2006-10-15 20:19:28 +0200
+++ src/config/pre.in	2007-10-25 16:35:13 +0200
@@ -187,7 +187,7 @@
 INSTALL_SCRIPT=@INSTALL_PROGRAM@
 INSTALL_DATA=@INSTALL_DATA@
 INSTALL_SHLIB=@INSTALL_SHLIB@
-INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 4755 -o root
+INSTALL_SETUID=$(INSTALL) $(INSTALL_STRIP) -m 755
 ## This is needed because autoconf will sometimes define @exec_prefix@ to be
 ## ${prefix}.
 prefix=@prefix@
Index: src/configure
--- src/configure.orig	2007-10-22 05:35:16 +0200
+++ src/configure	2007-10-25 16:38:25 +0200
@@ -317,8 +317,7 @@
 
 ac_subdirs_all="$ac_subdirs_all plugins/preauth/pkinit"
 ac_subdirs_all="$ac_subdirs_all util/ss"
-ac_subdirs_all="$ac_subdirs_all plugins/kdb/ldap/libkdb_ldap"
-ac_subdirs_all="$ac_subdirs_all lib/apputils plugins/kdb/db2 plugins/preauth/wpse plugins/preauth/cksum_body appl tests"
+ac_subdirs_all="$ac_subdirs_all lib/apputils plugins/preauth/wpse plugins/preauth/cksum_body appl tests"
 ac_subdirs_all="$ac_subdirs_all plugins/locate/python"
 ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EXTRA_FILES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT HAVE_GCC CPP LD KRB4_INCLUDES KRB4_LIBPATH KRB4_LIB KRB4_DEPLIB KRB_ERR_H_DEP DES425_DEPLIB DES425_LIB compile_et COM_ERR_VERSION SS_LIB SS_VERSION DB_HEADER DB_LIB DB_VERSION DB_HEADER_VERSION KDB5_DB_LIB HESIOD_DEFS HESIOD_LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CONFIG_RELTOPDIR subdirs OPENLDAP_PLUGIN build build_cpu build_vendor build_os host host_cpu host_vendor host_os krb5_cv_host acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS THREAD_SUPPORT DL_LIB EGREP KRB5_VERSION TCL_INCLUDES TCL_LIBS TCL_LIBPATH TCL_RPATH TCL_MAYBE_RPATH KRB4 krb524 OBJLISTS STOBJEXT SHOBJEXT PFOBJEXT PICFLAGS PROFFLAGS LN_S RANLIB ac_ct_RANLIB ARCHIVE ARADD INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR PERL LIBLIST LIBLINKS MAKE_SHLIB_COMMAND SHLIB_EXPFLAGS SHLIB_EXPORT_FILE_DEP DYNOBJ_EXPDEPS DYNOBJ_EXPFLAGS INSTALL_SHLIB STLIBEXT SHLIBEXT SHLIBVEXT SHLIBSEXT DEPLIBEXT PFLIBEXT LIBINSTLIST DYNOBJEXT MAKE_DYNOBJ_COMMAND GEN_LIB CC_LINK RPATH_FLAG LIBUTIL AWK FAKEKA KRB5_RUN_ENV LEX LEXLIB LEX_OUTPUT_ROOT KSU_LIBS SETENVOBJ KRB5_RCTMPDIR maybe_kerberosIV DO_TCL YACC have_RUNTEST have_PERL DO_TEST DO_V4_TEST RBUILD S_TOP PERL_PATH EXPECT DO_ALL PRIOCNTL_HACK RUNTEST KRB_ERR_TXT KRB_ERR KRB_ERR_C include_stdint include_inttypes include_xom rpcent_define GSSRPC__SYS_SELECT_H GSSRPC__SYS_TIME_H GSSRPC__UNISTD_H GSSRPC__SYS_PARAM_H GSSRPC__NETDB_H GSSRPC__STDINT_H GSSRPC__INTTYPES_H GSSRPC__FAKE_UINT32 GSSRPC__BSD_TYPEALIASES PASS HOST_TYPE SUPPORTLIB_MAJOR ldap_plugin_dir LIBOBJS LTLIBOBJS'
 ac_subst_files='lib_frag libobj_frag libnover_frag'
@@ -20475,9 +20474,7 @@
   LIBS="$old_LIBS"
 
 
-subdirs="$subdirs plugins/kdb/ldap/libkdb_ldap"
 
-            ac_config_files="$ac_config_files plugins/kdb/ldap/Makefile:$srcdir/./config/pre.in:plugins/kdb/ldap/Makefile.in:$srcdir/./config/post.in"
 
 
 
@@ -20491,7 +20488,7 @@
 
 
 
-subdirs="$subdirs lib/apputils plugins/kdb/db2 plugins/preauth/wpse plugins/preauth/cksum_body appl tests"
+subdirs="$subdirs lib/apputils plugins/preauth/wpse plugins/preauth/cksum_body appl tests"
 
 if false; then
 
Index: src/krb5-config.in
--- src/krb5-config.in.orig	2006-06-16 02:26:49 +0200
+++ src/krb5-config.in	2007-10-25 16:39:36 +0200
@@ -217,7 +217,7 @@
     fi
 
     if test $library = 'krb5'; then
-	lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB $LIBS $DL_LIB"
+	lib_flags="$lib_flags -lkrb5 -lk5crypto -lkrb5support -lcom_err $GEN_LIB $LIBS $DL_LIB"
     fi
 
     echo $lib_flags
Index: src/lib/krb5/os/hst_realm.c
--- src/lib/krb5/os/hst_realm.c.orig	2007-04-10 23:52:23 +0200
+++ src/lib/krb5/os/hst_realm.c	2007-10-25 16:40:34 +0200
@@ -302,7 +302,7 @@
 	return EAFNOSUPPORT;
     case EAI_MEMORY:
 	return ENOMEM;
-#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
+#if (defined EAI_NODATA) && (defined EAI_NONAME) && (EAI_NODATA != EAI_NONAME)
     case EAI_NODATA:
 	return KRB5_EAI_NODATA;
 #endif
Index: src/lib/krb5/os/locate_kdc.c
--- src/lib/krb5/os/locate_kdc.c.orig	2007-04-10 23:52:23 +0200
+++ src/lib/krb5/os/locate_kdc.c	2007-10-25 16:41:08 +0200
@@ -157,7 +157,7 @@
 #ifdef EAI_ADDRFAMILY
     case EAI_ADDRFAMILY:
 #endif
-#if defined(EAI_NODATA) && EAI_NODATA != EAI_NONAME
+#if (defined EAI_NODATA) && (defined EAI_NONAME) && (EAI_NODATA != EAI_NONAME)
     case EAI_NODATA:
 #endif
     case EAI_NONAME:
Index: src/plugins/kdb/db2/Makefile.in
--- src/plugins/kdb/db2/Makefile.in.orig	2007-09-18 06:22:24 +0200
+++ src/plugins/kdb/db2/Makefile.in	2007-10-25 16:41:47 +0200
@@ -30,10 +30,7 @@
 RELDIR=../plugins/kdb/db2
 # Depends on libk5crypto and libkrb5
 # Also on gssrpc, for xdr stuff.
-SHLIB_EXPDEPS = \
-	$(GSSRPC_DEPLIBS) \
-	$(TOPLIBD)/libk5crypto$(SHLIBEXT) \
-	$(TOPLIBD)/libkrb5$(SHLIBEXT)
+SHLIB_EXPDEPS =
 SHLIB_EXPLIBS= $(GSSRPC_LIBS) -lkrb5 -lcom_err -lk5crypto $(KDB5_DB_LIB) $(SUPPORT_LIB) $(LIBS)
 
 SHLIB_DIRS=-L$(TOPLIBD)
Index: src/plugins/kdb/ldap/ldap_util/Makefile.in
--- src/plugins/kdb/ldap/ldap_util/Makefile.in.orig	2007-09-29 03:02:10 +0200
+++ src/plugins/kdb/ldap/ldap_util/Makefile.in	2007-10-25 16:42:41 +0200
@@ -19,7 +19,7 @@
 
 $(PROG): $(OBJS) $(KADMSRV_DEPLIBS) $(KRB4COMPAT_DEPLIBS) $(GETDATE)
 	$(CC_LINK) -o $(PROG) $(OBJS) $(GETDATE) \
-		$(KADMSRV_LIBS) $(KDB_DEP_LIB) $(KRB4COMPAT_LIBS)
+		$(KDB_DEP_LIB) $(KADMSRV_LIBS) $(KRB4COMPAT_LIBS)
 
 install::
 	$(INSTALL_PROGRAM) $(PROG) ${DESTDIR}$(ADMIN_BINDIR)/$(PROG)
Index: src/plugins/kdb/ldap/libkdb_ldap/configure
--- src/plugins/kdb/ldap/libkdb_ldap/configure.orig	2007-10-22 05:33:36 +0200
+++ src/plugins/kdb/ldap/libkdb_ldap/configure	2007-10-25 16:44:21 +0200
@@ -7617,7 +7617,7 @@
 
 
 
-           ac_config_files="$ac_config_files ./Makefile:$srcdir/../../../../config/pre.in:./Makefile.in:$srcdir/../../../../config/post.in"
+           ac_config_files="$ac_config_files ./Makefile:$srcdir/../../../../config/pre.in:./Makefile.in:../Makefile.in:../ldap_util/Makefile.in:$srcdir/../../../../config/post.in"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -8170,7 +8170,7 @@
 do
   case "$ac_config_target" in
   # Handling of arguments.
-  "./Makefile" ) CONFIG_FILES="$CONFIG_FILES ./Makefile:$srcdir/../../../../config/pre.in:./Makefile.in:$srcdir/../../../../config/post.in" ;;
+  "./Makefile" ) CONFIG_FILES="$CONFIG_FILES ./Makefile:$srcdir/../../../../config/pre.in:./Makefile.in:../Makefile.in:../ldap_util/Makefile.in:$srcdir/../../../../config/post.in" ;;
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
Index: src/plugins/preauth/pkinit/Makefile.in
--- src/plugins/preauth/pkinit/Makefile.in.orig	2007-09-29 03:02:10 +0200
+++ src/plugins/preauth/pkinit/Makefile.in	2007-10-25 16:57:46 +0200
@@ -17,9 +17,7 @@
 SO_EXT=.so
 RELDIR=../plugins/preauth/pkinit
 # Depends on libk5crypto and libkrb5
-SHLIB_EXPDEPS = \
-	$(TOPLIBD)/libk5crypto$(SHLIBEXT) \
-	$(TOPLIBD)/libkrb5$(SHLIBEXT)
+SHLIB_EXPDEPS =
 LIBS+= -lcrypto
 SHLIB_EXPLIBS= -lkrb5 -lcom_err -lk5crypto -ldl $(SUPPORT_LIB) $(LIBS)
 
Index: src/util/ss/pager.c
--- src/util/ss/pager.c.orig	2003-01-06 00:28:05 +0100
+++ src/util/ss/pager.c	2007-10-25 16:44:40 +0200
@@ -11,6 +11,7 @@
 #include "copyright.h"
 #include <errno.h>
 #include <stdio.h>
+#include <errno.h>
 #include <sys/types.h>
 #include <sys/file.h>
 #include <signal.h>
Index: src/plugins/preauth/pkinit/configure
--- src/plugins/preauth/pkinit/configure.orig	2007-10-22 05:33:20 +0200
+++ src/plugins/preauth/pkinit/configure	2008-01-28 14:41:36 +0100
@@ -6255,7 +6255,7 @@
 fi
 
 
-for ac_func in
+for ac_func in dummy
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
