svn rev #3250: trunk/ bsd/ gssftp/ gssftp/ftp/ gssftp/ftpd/ libpty/ telnet/ ...

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Jul 8 17:22:08 EDT 2009


Commit By: ghudson
Log Message:
First cut of changes for standalone application build, based on the
krb5 build materials.  Of note:
* libpty no longer uses com_err.
* appl didn't used to use a header for autoconf settings; now we do.
* Some un-prototyped krb5 functions are still used, resulting in
  warnings but not build failures.  These should be addressed.
* Still need to add goo to define daemon() if needed for krlogind
  (previously handled by krb5's libapputils).
* Tests are not done yet.



Changed Files:
A   trunk/aclocal.m4
U   trunk/bsd/Makefile.in
U   trunk/bsd/deps
U   trunk/bsd/forward.c
U   trunk/bsd/kcmd.c
U   trunk/bsd/krcp.c
U   trunk/bsd/krlogin.c
U   trunk/bsd/krlogind.c
U   trunk/bsd/krshd.c
U   trunk/bsd/login.c
A   trunk/configure.ac
A   trunk/fake-addrinfo.h
U   trunk/gssftp/Makefile.in
U   trunk/gssftp/ftp/Makefile.in
U   trunk/gssftp/ftp/cmds.c
U   trunk/gssftp/ftp/cmdtab.c
U   trunk/gssftp/ftp/deps
U   trunk/gssftp/ftp/domacro.c
U   trunk/gssftp/ftp/ftp.c
U   trunk/gssftp/ftp/getpass.c
U   trunk/gssftp/ftp/glob.c
U   trunk/gssftp/ftp/main.c
U   trunk/gssftp/ftp/pclose.c
U   trunk/gssftp/ftp/radix.c
U   trunk/gssftp/ftp/ruserpass.c
U   trunk/gssftp/ftp/secure.c
U   trunk/gssftp/ftpd/Makefile.in
U   trunk/gssftp/ftpd/deps
U   trunk/gssftp/ftpd/ftpcmd.y
U   trunk/gssftp/ftpd/ftpd.c
U   trunk/gssftp/ftpd/logwtmp.c
U   trunk/gssftp/ftpd/popen.c
A   trunk/install-sh
A   trunk/k5-platform.h
A   trunk/k5-util.h
U   trunk/libpty/Makefile.in
U   trunk/libpty/deps
U   trunk/libpty/init.c
U   trunk/libpty/libpty.h
U   trunk/libpty/pty-int.h
D   trunk/libpty/pty_err.et
A   trunk/mkinstalldirs
A   trunk/move-if-changed
A   trunk/port-sockets.h
A   trunk/post.in
A   trunk/pre.in
A   trunk/socket-utils.h
U   trunk/telnet/Makefile.in
U   trunk/telnet/libtelnet/Makefile.in
U   trunk/telnet/libtelnet/auth.c
U   trunk/telnet/libtelnet/deps
U   trunk/telnet/libtelnet/enc_des.c
U   trunk/telnet/libtelnet/encrypt.c
U   trunk/telnet/libtelnet/forward.c
U   trunk/telnet/libtelnet/genget.c
U   trunk/telnet/libtelnet/getent.c
U   trunk/telnet/libtelnet/getopt.c
U   trunk/telnet/libtelnet/gettytab.c
U   trunk/telnet/libtelnet/herror.c
U   trunk/telnet/libtelnet/kerberos5.c
U   trunk/telnet/libtelnet/mem.c
U   trunk/telnet/libtelnet/misc.c
U   trunk/telnet/libtelnet/parsetos.c
U   trunk/telnet/libtelnet/setenv.c
U   trunk/telnet/libtelnet/setsid.c
U   trunk/telnet/libtelnet/spx.c
U   trunk/telnet/libtelnet/strcasecmp.c
U   trunk/telnet/libtelnet/strchr.c
U   trunk/telnet/libtelnet/strdup.c
U   trunk/telnet/libtelnet/strerror.c
U   trunk/telnet/libtelnet/strftime.c
U   trunk/telnet/libtelnet/strrchr.c
U   trunk/telnet/telnet/Makefile.in
U   trunk/telnet/telnet/authenc.c
U   trunk/telnet/telnet/commands.c
U   trunk/telnet/telnet/deps
U   trunk/telnet/telnet/main.c
U   trunk/telnet/telnet/network.c
U   trunk/telnet/telnet/ring.c
U   trunk/telnet/telnet/sys_bsd.c
U   trunk/telnet/telnet/telnet.c
U   trunk/telnet/telnet/terminal.c
U   trunk/telnet/telnet/tn3270.c
U   trunk/telnet/telnet/utilities.c
U   trunk/telnet/telnetd/Makefile.in
U   trunk/telnet/telnetd/authenc.c
U   trunk/telnet/telnetd/deps
U   trunk/telnet/telnetd/global.c
U   trunk/telnet/telnetd/slc.c
U   trunk/telnet/telnetd/state.c
U   trunk/telnet/telnetd/sys_term.c
U   trunk/telnet/telnetd/telnetd-ktd.c
U   trunk/telnet/telnetd/telnetd.c
U   trunk/telnet/telnetd/termio-tn.c
U   trunk/telnet/telnetd/termios-tn.c
U   trunk/telnet/telnetd/termstat.c
U   trunk/telnet/telnetd/utility.c
Added: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/aclocal.m4	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,852 @@
+AC_PREREQ(2.52)
+AC_COPYRIGHT([Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+Massachusetts Institute of Technology.
+])dnl
+dnl Maintainer mode, akin to what automake provides, 'cept we don't
+dnl want to use automake right now.
+AC_DEFUN([KRB5_AC_MAINTAINER_MODE],
+[AC_ARG_ENABLE([maintainer-mode],
+AC_HELP_STRING([--enable-maintainer-mode],[enable rebuilding of source files, Makefiles, etc]),
+USE_MAINTAINER_MODE=$enableval,
+USE_MAINTAINER_MODE=no)
+if test "$USE_MAINTAINER_MODE" = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+  AC_MSG_NOTICE(enabling maintainer mode)
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+MAINT=$MAINTAINER_MODE_TRUE
+AC_SUBST(MAINTAINER_MODE_TRUE)
+AC_SUBST(MAINTAINER_MODE_FALSE)
+AC_SUBST(MAINT)
+])dnl
+dnl
+dnl DECLARE_SYS_ERRLIST - check for sys_errlist in libc
+dnl
+AC_DEFUN([DECLARE_SYS_ERRLIST],
+[AC_CACHE_CHECK([for sys_errlist declaration], krb5_cv_decl_sys_errlist,
+[AC_TRY_COMPILE([#include <stdio.h>
+#include <errno.h>], [1+sys_nerr;],
+krb5_cv_decl_sys_errlist=yes, krb5_cv_decl_sys_errlist=no)])
+# assume sys_nerr won't be declared w/o being in libc
+if test $krb5_cv_decl_sys_errlist = yes; then
+  AC_DEFINE(SYS_ERRLIST_DECLARED,1,[Define if sys_errlist is defined in errno.h])
+  AC_DEFINE(HAVE_SYS_ERRLIST,1,[Define if sys_errlist in libc])
+else
+  # This means that sys_errlist is not declared in errno.h, but may still
+  # be in libc.
+  AC_CACHE_CHECK([for sys_errlist in libc], krb5_cv_var_sys_errlist,
+  [AC_TRY_LINK([extern int sys_nerr;], [if (1+sys_nerr < 0) return 1;],
+  krb5_cv_var_sys_errlist=yes, krb5_cv_var_sys_errlist=no;)])
+  if test $krb5_cv_var_sys_errlist = yes; then
+    AC_DEFINE(HAVE_SYS_ERRLIST,1,[Define if sys_errlist in libc])
+    # Do this cruft for backwards compatibility for now.
+    AC_DEFINE(NEED_SYS_ERRLIST,1,[Define if need to declare sys_errlist])
+  else
+    AC_MSG_WARN([sys_errlist is neither in errno.h nor in libc])
+  fi
+fi])dnl
+dnl
+dnl check for sigmask/sigprocmask -- CHECK_SIGPROCMASK
+dnl
+AC_DEFUN(CHECK_SIGPROCMASK,[
+AC_MSG_CHECKING([for use of sigprocmask])
+AC_CACHE_VAL(krb5_cv_func_sigprocmask_use,
+[AC_TRY_LINK([#include <signal.h>], [sigprocmask(SIG_SETMASK,0,0);],
+ krb5_cv_func_sigprocmask_use=yes,
+AC_TRY_LINK([#include <signal.h>], [sigmask(1);], 
+ krb5_cv_func_sigprocmask_use=no, krb5_cv_func_sigprocmask_use=yes))])
+AC_MSG_RESULT($krb5_cv_func_sigprocmask_use)
+if test $krb5_cv_func_sigprocmask_use = yes; then
+ AC_DEFINE(USE_SIGPROCMASK,1,[Define if sigprocmask should be used])
+fi
+])dnl
+dnl
+AC_DEFUN(AC_PROG_ARCHIVE, [AC_CHECK_PROG(ARCHIVE, ar, ar cqv, false)])dnl
+AC_DEFUN(AC_PROG_ARCHIVE_ADD, [AC_CHECK_PROG(ARADD, ar, ar cruv, false)])dnl
+dnl
+dnl check for <dirent.h> -- CHECK_DIRENT
+dnl (may need to be more complex later)
+dnl
+AC_DEFUN(CHECK_DIRENT,[
+AC_CHECK_HEADER(dirent.h,AC_DEFINE(USE_DIRENT_H,1,[Define if you have dirent.h functionality]))])dnl
+dnl
+dnl check if union wait is defined, or if WAIT_USES_INT -- CHECK_WAIT_TYPE
+dnl
+AC_DEFUN(CHECK_WAIT_TYPE,[
+AC_MSG_CHECKING([if argument to wait is int *])
+AC_CACHE_VAL(krb5_cv_struct_wait,
+dnl Test for prototype clash - if there is none - then assume int * works
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/wait.h>
+extern pid_t wait(int *);],[], krb5_cv_struct_wait=no,dnl
+dnl Else fallback on old stuff
+[AC_TRY_COMPILE(
+[#include <sys/wait.h>], [union wait i;
+#ifdef WEXITSTATUS
+  WEXITSTATUS (i);
+#endif
+], 
+	krb5_cv_struct_wait=yes, krb5_cv_struct_wait=no)])])
+AC_MSG_RESULT($krb5_cv_struct_wait)
+if test $krb5_cv_struct_wait = no; then
+	AC_DEFINE(WAIT_USES_INT,1,[Define if wait takes int as a argument])
+fi
+])dnl
+dnl
+dnl check for POSIX signal handling -- CHECK_SIGNALS
+dnl
+AC_DEFUN(CHECK_SIGNALS,[
+AC_CHECK_FUNC(sigprocmask,
+AC_MSG_CHECKING(for sigset_t and POSIX_SIGNALS)
+AC_CACHE_VAL(krb5_cv_type_sigset_t,
+[AC_TRY_COMPILE(
+[#include <signal.h>],
+[sigset_t x],
+krb5_cv_type_sigset_t=yes, krb5_cv_type_sigset_t=no)])
+AC_MSG_RESULT($krb5_cv_type_sigset_t)
+if test $krb5_cv_type_sigset_t = yes; then
+  AC_DEFINE(POSIX_SIGNALS,1,[Define if POSIX signal handling is used])
+fi
+)])dnl
+dnl
+dnl check for signal type
+dnl
+dnl AC_RETSIGTYPE isn't quite right, but almost.
+AC_DEFUN(KRB5_SIGTYPE,[
+AC_MSG_CHECKING([POSIX signal handlers])
+AC_CACHE_VAL(krb5_cv_has_posix_signals,
+[AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+#undef signal
+#endif
+extern void (*signal ()) ();], [],
+krb5_cv_has_posix_signals=yes, krb5_cv_has_posix_signals=no)])
+AC_MSG_RESULT($krb5_cv_has_posix_signals)
+if test $krb5_cv_has_posix_signals = yes; then
+   stype=void
+   AC_DEFINE(POSIX_SIGTYPE, 1, [Define if POSIX signal handlers are used])
+else
+  if test $ac_cv_type_signal = void; then
+     stype=void
+  else
+     stype=int
+  fi
+fi
+AC_DEFINE_UNQUOTED(krb5_sigtype, $stype, [Define krb5_sigtype to type of signal handler])dnl
+])dnl
+dnl
+dnl check for POSIX setjmp/longjmp -- CHECK_SETJMP
+dnl
+AC_DEFUN(CHECK_SETJMP,[
+AC_CHECK_FUNC(sigsetjmp,
+AC_MSG_CHECKING(for sigjmp_buf)
+AC_CACHE_VAL(krb5_cv_struct_sigjmp_buf,
+[AC_TRY_COMPILE(
+[#include <setjmp.h>],[sigjmp_buf x],
+krb5_cv_struct_sigjmp_buf=yes,krb5_cv_struct_sigjmp_buf=no)])
+AC_MSG_RESULT($krb5_cv_struct_sigjmp_buf)
+if test $krb5_cv_struct_sigjmp_buf = yes; then
+  AC_DEFINE(POSIX_SETJMP,1,[Define if setjmp indicates POSIX interface])
+fi
+)])dnl
+dnl
+dnl Check for IPv6 compile-time support.
+dnl
+AC_DEFUN(KRB5_AC_INET6,[
+AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h)
+AC_CHECK_FUNCS(inet_ntop inet_pton getnameinfo)
+dnl getaddrinfo test needs netdb.h, for proper compilation on alpha
+dnl under OSF/1^H^H^H^H^HDigital^H^H^H^H^H^H^HTru64 UNIX, where it's
+dnl a macro
+AC_MSG_CHECKING(for getaddrinfo)
+AC_CACHE_VAL(ac_cv_func_getaddrinfo,
+[AC_TRY_LINK([#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif],[
+struct addrinfo *ai;
+getaddrinfo("kerberos.mit.edu", "echo", 0, &ai);
+], ac_cv_func_getaddrinfo=yes, ac_cv_func_getaddrinfo=no)])
+AC_MSG_RESULT($ac_cv_func_getaddrinfo)
+if test $ac_cv_func_getaddrinfo = yes; then
+  AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
+fi
+dnl
+AC_REQUIRE([KRB5_SOCKADDR_SA_LEN])dnl
+AC_ARG_ENABLE([ipv6], , AC_MSG_WARN(enable/disable-ipv6 option is deprecated))dnl
+AC_MSG_CHECKING(for IPv6 compile-time support)
+AC_CACHE_VAL(krb5_cv_inet6,[
+if test "$ac_cv_func_inet_ntop" != "yes" ; then
+  krb5_cv_inet6=no
+else
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+],[
+  struct sockaddr_in6 in;
+  AF_INET6;
+  IN6_IS_ADDR_LINKLOCAL (&in.sin6_addr);
+],krb5_cv_inet6=yes,krb5_cv_inet6=no)])
+fi
+AC_MSG_RESULT($krb5_cv_inet6)
+if test "$krb5_cv_inet6" = no && test "$ac_cv_func_inet_ntop" = yes; then
+AC_MSG_CHECKING(for IPv6 compile-time support with -DINET6)
+AC_CACHE_VAL(krb5_cv_inet6_with_dinet6,[
+old_CC="$CC"
+CC="$CC -DINET6"
+AC_TRY_COMPILE([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+],[
+  struct sockaddr_in6 in;
+  AF_INET6;
+  IN6_IS_ADDR_LINKLOCAL (&in.sin6_addr);
+],krb5_cv_inet6_with_dinet6=yes,krb5_cv_inet6_with_dinet6=no)
+CC="$old_CC"])
+AC_MSG_RESULT($krb5_cv_inet6_with_dinet6)
+fi
+if test $krb5_cv_inet6 = yes || test "$krb5_cv_inet6_with_dinet6" = yes; then
+  if test "$krb5_cv_inet6_with_dinet6" = yes; then
+    AC_DEFINE(INET6,1,[May need to be defined to enable IPv6 support, for example on IRIX])
+  fi
+  AC_DEFINE(KRB5_USE_INET6,1,[Define if we should compile in IPv6 support (even if we can't use it at run time)])
+fi
+])dnl
+dnl
+dnl Generic File existence tests
+dnl 
+dnl K5_AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN(K5_AC_CHECK_FILE,
+[AC_REQUIRE([AC_PROG_CC])dnl
+dnl Do the transliteration at runtime so arg 1 can be a shell variable.
+ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_file_$ac_safe,
+[if test "$cross_compiling" = yes; then
+  errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling
+)dnl
+  AC_MSG_ERROR(Cannot check for file existence when cross compiling)
+else
+  if test -r $1; then
+    eval "ac_cv_file_$ac_safe=yes"
+  else
+    eval "ac_cv_file_$ac_safe=no"
+  fi
+fi])dnl
+if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  ifelse([$2], , :, [$2])
+else
+  AC_MSG_RESULT(no)
+ifelse([$3], , , [$3
+np])dnl
+fi
+])dnl
+dnl
+dnl K5_AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl
+AC_DEFUN(K5_AC_CHECK_FILES,
+[AC_REQUIRE([AC_PROG_CC])dnl
+for ac_file in $1
+do
+K5_AC_CHECK_FILE($ac_file,
+[changequote(, )dnl
+  ac_tr_file=HAVE`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+changequote([, ])dnl
+  AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
+done
+])dnl
+AC_DEFUN(KRB5_AC_CHECK_FOR_CFLAGS,[
+AC_BEFORE([$0],[AC_PROG_CC])
+krb5_ac_cflags_set=${CFLAGS+set}
+krb5_ac_warn_cflags_set=${WARN_CFLAGS+set}
+])
+dnl
+AC_DEFUN(TRY_WARN_CC_FLAG,[dnl
+  cachevar=`echo "krb5_cv_cc_flag_$1" | sed s/[[^a-zA-Z0-9_]]/_/g`
+  AC_CACHE_CHECK([if C compiler supports $1], [$cachevar],
+  [# first try without, then with
+  AC_TRY_COMPILE([], 1;,
+    [old_cflags="$CFLAGS"
+     CFLAGS="$CFLAGS $1"
+     AC_TRY_COMPILE([], 1;, eval $cachevar=yes, eval $cachevar=no)
+     CFLAGS="$old_cflags"],
+    [AC_MSG_ERROR(compiling simple test program with $CFLAGS failed)])])
+  if eval test '"${'$cachevar'}"' = yes; then
+    WARN_CFLAGS="$WARN_CFLAGS $1"
+  fi
+  eval flag_supported='${'$cachevar'}'
+])dnl
+dnl
+AC_DEFUN(WITH_CC,[dnl
+AC_REQUIRE([KRB5_AC_CHECK_FOR_CFLAGS])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_CXX])dnl
+if test $ac_cv_c_compiler_gnu = yes ; then
+     HAVE_GCC=yes
+     else HAVE_GCC=
+fi
+AC_SUBST(HAVE_GCC)
+AC_CACHE_CHECK([for GNU linker], krb5_cv_prog_gnu_ld,
+[krb5_cv_prog_gnu_ld=no
+if test "$GCC" = yes; then
+  if AC_TRY_COMMAND([$CC -Wl,-v 2>&1 dnl
+			| grep "GNU ld" > /dev/null]); then
+    krb5_cv_prog_gnu_ld=yes
+  fi
+fi])
+# -Wno-long-long, if needed, for k5-platform.h without inttypes.h etc.
+extra_gcc_warn_opts="-Wall -Wcast-qual -Wcast-align -Wshadow"
+# -Wmissing-prototypes
+if test "$GCC" = yes ; then
+  if test "x$krb5_ac_warn_cflags_set" = xset ; then
+    AC_MSG_NOTICE(not adding extra gcc warning flags because WARN_CFLAGS was set)
+  else
+    AC_MSG_NOTICE(adding extra warning flags for gcc)
+    WARN_CFLAGS="$WARN_CFLAGS $extra_gcc_warn_opts -Wmissing-prototypes"
+    if test "`uname -s`" = Darwin ; then
+      AC_MSG_NOTICE(skipping pedantic warnings on Darwin)
+    elif test "`uname -s`" = Linux ; then
+      AC_MSG_NOTICE(skipping pedantic warnings on Linux)
+    else
+      WARN_CFLAGS="$WARN_CFLAGS -pedantic"
+    fi
+    # Currently, G++ does not support -Wno-format-zero-length.
+    TRY_WARN_CC_FLAG(-Wno-format-zero-length)
+    # Other flags here may not be supported on some versions of
+    # gcc that people want to use.
+    for flag in overflow strict-overflow missing-format-attribute missing-prototypes return-type missing-braces parentheses switch unused-function unused-label unused-variable unused-value unknown-pragmas sign-compare newline-eof ; do
+      TRY_WARN_CC_FLAG(-W$flag)
+    done
+    #  old-style-definition? generates many, many warnings
+    #
+    # Warnings that we'd like to turn into errors on versions of gcc
+    # that support promoting only specific warnings to errors, but
+    # we'll take as warnings on older compilers.  (If such a warning
+    # is added after the -Werror=foo feature, you can just put
+    # error=foo in the above list, and skip the test for the
+    # warning-only form.)  At least in some versions, -Werror= doesn't
+    # seem to make the conditions actual errors, but still issues
+    # warnings; I guess we'll take what we can get.
+    #
+    # We're currently targeting C89+, not C99, so disallow some
+    # constructs.
+    for flag in declaration-after-statement variadic-macros ; do
+      TRY_WARN_CC_FLAG(-Werror=$flag)
+      if test "$flag_supported" = no; then
+        TRY_WARN_CC_FLAG(-W$flag)
+      fi
+    done
+    #  missing-prototypes? maybe someday
+    #
+  fi
+  if test "`uname -s`" = Darwin ; then
+    # Someday this should be a feature test.
+    # One current (Jaguar = OS 10.2) problem:
+    # Archive library with foo.o undef sym X and bar.o common sym X,
+    # if foo.o is pulled in at link time, bar.o may not be, causing
+    # the linker to complain.
+    # Dynamic library problems too?
+    case "$CC $CFLAGS" in
+    *-fcommon*) ;; # why someone would do this, I don't know
+    *-fno-common*) ;; # okay, they're already doing the right thing
+    *)
+      AC_MSG_NOTICE(disabling the use of common storage on Darwin)
+      CFLAGS="$CFLAGS -fno-common"
+      ;;
+    esac
+    case "$LD $LDFLAGS" in
+    *-Wl,-search_paths_first*) ;;
+    *) LDFLAGS="${LDFLAGS} -Wl,-search_paths_first" ;;
+    esac
+  fi
+else
+  if test "`uname -s`" = AIX ; then
+    # Using AIX but not GCC, assume native compiler.
+    # The native compiler appears not to give a nonzero exit
+    # status for certain classes of errors, like missing arguments
+    # in function calls.  Let's try to fix that with -qhalt=e.
+    case "$CC $CFLAGS" in
+      *-qhalt=*) ;;
+      *)
+	CFLAGS="$CFLAGS -qhalt=e"
+	AC_MSG_NOTICE(adding -qhalt=e for better error reporting)
+	;;
+    esac
+    # Also, the optimizer isn't turned on by default, which means
+    # the static inline functions get left in random object files,
+    # leading to references to pthread_mutex_lock from anything that
+    # includes k5-int.h whether it uses threads or not.
+    case "$CC $CFLAGS" in
+      *-O*) ;;
+      *)
+	CFLAGS="$CFLAGS -O"
+	AC_MSG_NOTICE(adding -O for inline thread-support function elimination)
+	;;
+    esac
+  fi
+  if test "`uname -s`" = SunOS ; then
+    # Using Solaris but not GCC, assume Sunsoft compiler.
+    # We have some error-out-on-warning options available.
+    # Sunsoft 12 compiler defaults to -xc99=all, it appears, so "inline"
+    # works, but it also means that declaration-in-code warnings won't
+    # be issued.
+    # -v -fd -errwarn=E_DECLARATION_IN_CODE ...
+    WARN_CFLAGS="-errtags=yes -errwarn=E_BAD_PTR_INT_COMBINATION,E_BAD_PTR_INT_COMB_ARG,E_PTR_TO_VOID_IN_ARITHMETIC,E_NO_IMPLICIT_DECL_ALLOWED,E_ATTRIBUTE_PARAM_UNDEFINED"
+  fi
+fi
+AC_SUBST(WARN_CFLAGS)
+])dnl
+dnl
+dnl V5_AC_OUTPUT_MAKEFILE
+dnl
+AC_DEFUN(V5_AC_OUTPUT_MAKEFILE,
+[ifelse($1, , [_V5_AC_OUTPUT_MAKEFILE(.,$2)],[_V5_AC_OUTPUT_MAKEFILE($1,$2)])])
+dnl
+define(_V5_AC_OUTPUT_MAKEFILE,
+[ifelse($2, , ,AC_CONFIG_FILES($2))
+AC_FOREACH([DIR], [$1],dnl
+ [AC_CONFIG_FILES(DIR[/Makefile:$srcdir/pre.in:]DIR[/Makefile.in:]DIR[/deps:$srcdir/post.in])])
+AC_OUTPUT])dnl
+dnl
+dnl
+dnl KRB5_SOCKADDR_SA_LEN: define HAVE_SA_LEN if sockaddr contains the sa_len
+dnl component
+dnl
+AC_DEFUN([KRB5_SOCKADDR_SA_LEN],[ dnl
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+  AC_DEFINE(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len])
+,,[#include <sys/types.h>
+#include <sys/socket.h>])])
+dnl
+dnl
+dnl CHECK_UTMP: check utmp structure and functions
+dnl
+AC_DEFUN(CHECK_UTMP,[
+AC_CHECK_MEMBERS([struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_host, struct utmp.ut_exit],,,
+[#include <sys/types.h>
+#include <utmp.h>])
+
+# Define the names actually used in the krb5 code currently:
+if test $ac_cv_member_struct_utmp_ut_pid = no; then
+  AC_DEFINE(NO_UT_PID,1,[Define if ut_pid field not found])
+fi
+if test $ac_cv_member_struct_utmp_ut_type = no; then
+  AC_DEFINE(NO_UT_TYPE,1,[Define if ut_type field not found])
+fi
+if test $ac_cv_member_struct_utmp_ut_host = no; then
+  AC_DEFINE(NO_UT_HOST,1,[Define if ut_host field not found])
+fi
+if test $ac_cv_member_struct_utmp_ut_exit = no; then
+  AC_DEFINE(NO_UT_EXIT,1,[Define if ut_exit field not found])
+fi
+
+AC_CHECK_FUNCS(setutent setutxent updwtmp updwtmpx)
+])dnl
+dnl
+dnl
+AC_DEFUN(KRB5_AC_NEED_DAEMON, [
+KRB5_NEED_PROTO([#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif],daemon,1)])dnl
+dnl
+dnl Check if stdarg or varargs is available *and compiles*; prefer stdarg.
+dnl (This was sent to djm for incorporation into autoconf 3/12/1996.  KR)
+dnl
+AC_DEFUN(AC_HEADER_STDARG, [
+
+AC_MSG_CHECKING([for stdarg.h])
+AC_CACHE_VAL(ac_cv_header_stdarg_h,
+[AC_TRY_COMPILE([#include <stdarg.h>], [
+  } /* ac_try_compile will have started a function body */
+  int aoeu (char *format, ...) {
+    va_list v;
+    int i;
+    va_start (v, format);
+    i = va_arg (v, int);
+    va_end (v);
+],ac_cv_header_stdarg_h=yes,ac_cv_header_stdarg_h=no)])dnl
+AC_MSG_RESULT($ac_cv_header_stdarg_h)
+if test $ac_cv_header_stdarg_h = yes; then
+  AC_DEFINE(HAVE_STDARG_H, 1, [Define if stdarg available and compiles])
+else
+
+AC_MSG_CHECKING([for varargs.h])
+AC_CACHE_VAL(ac_cv_header_varargs_h,
+[AC_TRY_COMPILE([#include <varargs.h>],[
+  } /* ac_try_compile will have started a function body */
+  int aoeu (va_alist) va_dcl {
+    va_list v;
+    int i;
+    va_start (v);
+    i = va_arg (v, int);
+    va_end (v);
+],ac_cv_header_varargs_h=yes,ac_cv_header_varargs_h=no)])dnl
+AC_MSG_RESULT($ac_cv_header_varargs_h)
+if test $ac_cv_header_varargs_h = yes; then
+  AC_DEFINE(HAVE_VARARGS_H, 1, [Define if varargs available and compiles])
+else
+  AC_MSG_ERROR(Neither stdarg nor varargs compile?)
+fi
+
+fi dnl stdarg test failure
+
+])dnl
+dnl
+dnl AC_KRB5_TCL_FIND_CONFIG (uses tcl_dir)
+dnl
+AC_DEFUN(AC_KRB5_TCL_FIND_CONFIG,[
+AC_REQUIRE([KRB5_LIB_AUX])dnl
+AC_MSG_CHECKING(for tclConfig.sh)
+dnl On Debian, we might be given --with-tcl=/usr, or tclsh might
+dnl point us to /usr/lib/tcl8.4; either way, we need to find
+dnl /usr/lib/tcl8.4/tclConfig.sh.
+dnl On NetBSD, we might be given --with-tcl=/usr/pkg, or tclsh
+dnl might point us to /usr/pkg/lib/tcl8.4; we need to find
+dnl /usr/pkg/lib/tclConfig.sh.
+if test -r "$tcl_dir/lib/tclConfig.sh" ; then
+  tcl_conf="$tcl_dir/lib/tclConfig.sh"
+elif test -r "$tcl_dir/tclConfig.sh" ; then
+  tcl_conf="$tcl_dir/tclConfig.sh"
+elif test -r "$tcl_dir/../tclConfig.sh" ; then
+  tcl_conf="$tcl_dir/../tclConfig.sh"
+else
+  tcl_conf=
+  lib="$tcl_dir/lib"
+  changequote(<<,>>)dnl
+  for d in "$lib" "$lib"/tcl7.[0-9] "$lib"/tcl8.[0-9] ; do
+    if test -r "$d/tclConfig.sh" ; then
+      tcl_conf="$tcl_conf $d/tclConfig.sh"
+    fi
+  done
+  changequote([,])dnl
+fi
+if test -n "$tcl_conf" ; then
+  AC_MSG_RESULT($tcl_conf)
+else
+  AC_MSG_RESULT(not found)
+fi
+tcl_ok_conf=
+tcl_vers_maj=
+tcl_vers_min=
+old_CPPFLAGS=$CPPFLAGS
+old_LIBS=$LIBS
+old_LDFLAGS=$LDFLAGS
+if test -n "$tcl_conf" ; then
+  for file in $tcl_conf ; do
+    TCL_MAJOR_VERSION=x ; TCL_MINOR_VERSION=x
+    AC_MSG_CHECKING(Tcl info in $file)
+    . $file
+    v=$TCL_MAJOR_VERSION.$TCL_MINOR_VERSION
+    if test -z "$tcl_vers_maj" \
+	|| test "$tcl_vers_maj" -lt "$TCL_MAJOR_VERSION" \
+	|| test "$tcl_vers_maj" = "$TCL_MAJOR_VERSION" -a "$tcl_vers_min" -lt "$TCL_MINOR_VERSION" ; then
+      for incdir in "$TCL_PREFIX/include/tcl$v" "$TCL_PREFIX/include" ; do
+	if test -r "$incdir/tcl.h" -o -r "$incdir/tcl/tcl.h" ; then
+	  CPPFLAGS="$old_CPPFLAGS -I$incdir"
+	  break
+	fi
+      done
+      LIBS="$old_LIBS `eval echo x $TCL_LIB_SPEC $TCL_LIBS | sed 's/^x//'`"
+      LDFLAGS="$old_LDFLAGS $TCL_LD_FLAGS"
+      AC_TRY_LINK( , [Tcl_CreateInterp ();],
+	tcl_ok_conf=$file
+	tcl_vers_maj=$TCL_MAJOR_VERSION
+	tcl_vers_min=$TCL_MINOR_VERSION
+	AC_MSG_RESULT($v - working),
+	AC_MSG_RESULT($v - compilation failed)
+      )
+    else
+      AC_MSG_RESULT(older version $v)
+    fi
+  done
+fi
+CPPFLAGS=$old_CPPFLAGS
+LIBS=$old_LIBS
+LDFLAGS=$old_LDFLAGS
+tcl_header=no
+tcl_lib=no
+if test -n "$tcl_ok_conf" ; then
+  . $tcl_ok_conf
+  TCL_INCLUDES=
+  for incdir in "$TCL_PREFIX/include/tcl$v" "$TCL_PREFIX/include" ; do
+    if test -r "$incdir/tcl.h" -o -r "$incdir/tcl/tcl.h" ; then
+      if test "$incdir" != "/usr/include" ; then
+        TCL_INCLUDES=-I$incdir
+      fi
+      break
+    fi
+  done
+  # Need eval because the first-level expansion could reference
+  # variables like ${TCL_DBGX}.
+  eval TCL_LIBS='"'$TCL_LIB_SPEC $TCL_LIBS $TCL_DL_LIBS'"'
+  TCL_LIBPATH="-L$TCL_EXEC_PREFIX/lib"
+  TCL_RPATH=":$TCL_EXEC_PREFIX/lib"
+  if test "$DEPLIBEXT" != "$SHLIBEXT" && test -n "$RPATH_FLAG"; then
+    TCL_MAYBE_RPATH='$(RPATH_FLAG)'"$TCL_EXEC_PREFIX/lib$RPATH_TAIL"
+  else
+    TCL_MAYBE_RPATH=
+  fi
+  CPPFLAGS="$old_CPPFLAGS $TCL_INCLUDES"
+  AC_CHECK_HEADER(tcl.h,AC_DEFINE(HAVE_TCL_H,1,[Define if tcl.h is available]) tcl_header=yes)
+  if test $tcl_header=no; then
+     AC_CHECK_HEADER(tcl/tcl.h,AC_DEFINE(HAVE_TCL_TCL_H,1,[Define if tcl/tcl.h is available]) tcl_header=yes)
+  fi
+  CPPFLAGS="$old_CPPFLAGS"
+  tcl_lib=yes
+else
+  # If we read a tclConfig.sh file, it probably set this.
+  TCL_LIBS=
+fi  
+AC_SUBST(TCL_INCLUDES)
+AC_SUBST(TCL_LIBS)
+AC_SUBST(TCL_LIBPATH)
+AC_SUBST(TCL_RPATH)
+AC_SUBST(TCL_MAYBE_RPATH)
+])dnl
+dnl
+dnl AC_KRB5_TCL_TRYOLD
+dnl attempt to use old search algorithm for locating tcl
+dnl
+AC_DEFUN(AC_KRB5_TCL_TRYOLD, [
+AC_REQUIRE([KRB5_AC_FIND_DLOPEN])
+AC_MSG_WARN([trying old tcl search code])
+if test "$with_tcl" != yes -a "$with_tcl" != no; then
+	TCL_INCLUDES=-I$with_tcl/include
+	TCL_LIBPATH=-L$with_tcl/lib
+	TCL_RPATH=:$with_tcl/lib
+fi
+if test "$with_tcl" != no ; then
+	krb5_save_CPPFLAGS="$CPPFLAGS"
+	krb5_save_LDFLAGS="$LDFLAGS"
+	CPPFLAGS="$CPPFLAGS $TCL_INCLUDES"
+	LDFLAGS="$LDFLAGS $TCL_LIBPATH"
+	tcl_header=no
+	AC_CHECK_HEADER(tcl.h,AC_DEFINE(HAVE_TCL_H,1,[Define if tcl.h found]) tcl_header=yes)
+	if test $tcl_header=no; then
+	   AC_CHECK_HEADER(tcl/tcl.h,AC_DEFINE(HAVE_TCL_TCL_H,1,[Define if tcl/tcl.h found]) tcl_header=yes)
+	fi
+
+	if test $tcl_header = yes ; then
+		tcl_lib=no
+
+		if test $tcl_lib = no; then
+			AC_CHECK_LIB(tcl8.0, Tcl_CreateCommand, 
+				TCL_LIBS="$TCL_LIBS -ltcl8.0 -lm $DL_LIB $LIBS"
+				tcl_lib=yes,,-lm $DL_LIB)
+		fi
+		if test $tcl_lib = no; then
+			AC_CHECK_LIB(tcl7.6, Tcl_CreateCommand, 
+				TCL_LIBS="$TCL_LIBS -ltcl7.6 -lm $DL_LIB $LIBS"
+				tcl_lib=yes,,-lm $DL_LIB)
+		fi
+		if test $tcl_lib = no; then
+			AC_CHECK_LIB(tcl7.5, Tcl_CreateCommand, 
+				TCL_LIBS="$TCL_LIBS -ltcl7.5 -lm $DL_LIB $LIBS"
+				tcl_lib=yes,,-lm $DL_LIB)
+
+		fi
+		if test $tcl_lib = no ; then
+			AC_CHECK_LIB(tcl, Tcl_CreateCommand, 
+				TCL_LIBS="$TCL_LIBS -ltcl -lm $DL_LIB $LIBS"
+				tcl_lib=yes,,-lm $DL_LIB)
+
+		fi
+		if test $tcl_lib = no ; then		
+			AC_MSG_WARN("tcl.h found but not library")
+		fi
+	else
+		AC_MSG_WARN(Could not find Tcl which is needed for the kadm5 tests)
+		TCL_LIBS=
+	fi
+	CPPFLAGS="$krb5_save_CPPFLAGS"
+	LDFLAGS="$krb5_save_LDFLAGS"
+	AC_SUBST(TCL_INCLUDES)
+	AC_SUBST(TCL_LIBS)
+	AC_SUBST(TCL_LIBPATH)
+	AC_SUBST(TCL_RPATH)
+else
+	AC_MSG_RESULT("Not looking for Tcl library")
+fi
+])dnl
+dnl
+dnl AC_KRB5_TCL - determine if the TCL library is present on system
+dnl
+AC_DEFUN(AC_KRB5_TCL,[
+TCL_INCLUDES=
+TCL_LIBPATH=
+TCL_RPATH=
+TCL_LIBS=
+TCL_WITH=
+tcl_dir=
+AC_ARG_WITH(tcl,
+[  --with-tcl=path         where Tcl resides], , with_tcl=try)
+if test "$with_tcl" = no ; then
+  true
+elif test "$with_tcl" = yes -o "$with_tcl" = try ; then
+  tcl_dir=/usr
+  if test ! -r /usr/lib/tclConfig.sh; then
+    cat >> conftest <<\EOF
+puts "tcl_dir=$tcl_library"
+EOF
+    if tclsh conftest >conftest.out 2>/dev/null; then
+      if grep tcl_dir= conftest.out >/dev/null 2>&1; then
+        t=`sed s/tcl_dir=// conftest.out`
+        tcl_dir=$t
+      fi
+    fi # tclsh ran script okay
+  rm -f conftest conftest.out
+  fi # no /usr/lib/tclConfig.sh
+else
+  tcl_dir=$with_tcl
+fi
+if test "$with_tcl" != no ; then
+  AC_KRB5_TCL_FIND_CONFIG
+  if test $tcl_lib = no ; then
+    if test "$with_tcl" != try ; then
+      AC_KRB5_TCL_TRYOLD
+    else
+      AC_MSG_WARN(Could not find Tcl which is needed for some tests)
+    fi
+  fi
+fi
+# If "yes" or pathname, error out if not found.
+if test "$with_tcl" != no -a "$with_tcl" != try ; then
+  if test "$tcl_header $tcl_lib" != "yes yes" ; then
+    AC_MSG_ERROR(Could not find Tcl)
+  fi
+fi
+])dnl
+dnl
+dnl Check if we need the prototype for a function - we give it a bogus 
+dnl prototype and if it complains - then a valid prototype exists on the 
+dnl system.
+dnl
+dnl KRB5_NEED_PROTO(includes, function, [bypass])
+dnl if $3 set, don't see if library defined. 
+dnl Useful for case where we will define in libkrb5 the function if need be
+dnl but want to know if a prototype exists in either case on system.
+dnl
+AC_DEFUN([KRB5_NEED_PROTO], [
+ifelse([$3], ,[if test "x$ac_cv_func_$2" = xyes; then])
+AC_CACHE_CHECK([if $2 needs a prototype provided], krb5_cv_func_$2_noproto,
+AC_TRY_COMPILE([$1],
+[#undef $2
+struct k5foo {int foo; } xx;
+extern int $2 (struct k5foo*);
+$2(&xx);
+],
+krb5_cv_func_$2_noproto=yes,krb5_cv_func_$2_noproto=no))
+if test $krb5_cv_func_$2_noproto = yes; then
+	AC_DEFINE([NEED_]translit($2, [a-z], [A-Z])[_PROTO], 1, dnl
+[define if the system header files are missing prototype for $2()])
+fi
+ifelse([$3], ,[fi])
+])dnl
+dnl
+dnl =============================================================
+dnl Internal function for testing for getsockname arguments
+dnl
+AC_DEFUN([TRY_GETSOCK_INT],[
+krb5_lib_var=`echo "$1 $2" | sed 'y% ./+-*%___p_p%'`
+AC_MSG_CHECKING([if getsockname() takes arguments $1 and $2])
+AC_CACHE_VAL(krb5_cv_getsockname_proto_$krb5_lib_var,
+[
+AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>
+extern int getsockname(int, $1, $2);
+],,eval "krb5_cv_getsockname_proto_$krb5_lib_var=yes",
+    eval "krb5_cv_getsockname_proto_$krb5_lib_var=no")])
+if eval "test \"`echo '$krb5_cv_getsockname_proto_'$krb5_lib_var`\" = yes"; then
+	AC_MSG_RESULT(yes)
+	sock_set=yes; res1="$1"; res2="$2"
+else
+	AC_MSG_RESULT(no)
+fi
+])dnl
+dnl
+dnl Determines the types of the second and third arguments to getsockname().
+dnl
+AC_DEFUN([KRB5_GETSOCKNAME_ARGS],[
+sock_set=no
+for sock_arg1 in "struct sockaddr *" "void *"
+do
+  for sock_arg2 in "size_t *" "int *" "socklen_t *"
+  do
+	if test $sock_set = no; then
+	  TRY_GETSOCK_INT($sock_arg1, $sock_arg2)
+	fi
+  done 
+done
+if test "$sock_set" = no; then
+  AC_MSG_NOTICE(assuming struct sockaddr and socklen_t for getsockname args)
+  res1="struct sockaddr *"
+  res2="socklen_t *"
+fi
+res1=`echo "$res1" | tr -d '*' | sed -e 's/ *$//'`
+res2=`echo "$res2" | tr -d '*' | sed -e 's/ *$//'`
+AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG2_TYPE],$res1,[Type of pointer target for argument 2 to getsockname])
+AC_DEFINE_UNQUOTED([GETSOCKNAME_ARG3_TYPE],$res2,[Type of pointer target for argument 3 to getsockname])
+])dnl
+dnl
+dnl KRB5_AC_PRIOCNTL_HACK
+dnl
+dnl
+AC_DEFUN([KRB5_AC_PRIOCNTL_HACK],
+[AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_LANG_COMPILER_REQUIRE])dnl
+AC_CACHE_CHECK([whether to use priocntl hack], [krb5_cv_priocntl_hack],
+[case $krb5_cv_host in
+*-*-solaris2.9*)
+	if test "$cross_compiling" = yes; then
+		krb5_cv_priocntl_hack=yes
+	else
+		# Solaris patch 117171-11 (sparc) or 117172-11 (x86)
+		# fixes the Solaris 9 bug where final pty output
+		# gets lost on close.
+		if showrev -p | $AWK 'BEGIN { e = 1 }
+/Patch: 11717[[12]]/ { x = index[]([$]2, "-");
+if (substr[]([$]2, x + 1, length([$]2) - x) >= 11)
+{ e = 0 } else { e = 1 } }
+END { exit e; }'; then
+			krb5_cv_priocntl_hack=no
+		else
+			krb5_cv_priocntl_hack=yes
+		fi
+	fi
+	;;
+*)
+	krb5_cv_priocntl_hack=no
+	;;
+esac])
+if test "$krb5_cv_priocntl_hack" = yes; then
+	PRIOCNTL_HACK=1
+else
+	PRIOCNTL_HACK=0
+fi
+AC_SUBST(PRIOCNTL_HACK)])dnl
+dnl
+dnl KRB5_AC_LIBUTIL
+dnl
+dnl Check for libutil, for NetBSD, et al.; needed for openpty() and
+dnl logwtmp() on some platforms.
+dnl
+AC_DEFUN([KRB5_AC_LIBUTIL],
+	[AC_CHECK_LIB(util, main,
+		[AC_DEFINE(HAVE_LIBUTIL,1,[Define if util library is available with openpty, logwtmp, etc])
+  UTIL_LIB=-lutil])dnl
+AC_SUBST(UTIL_LIB)
+])dnl

Modified: trunk/bsd/Makefile.in
===================================================================
--- trunk/bsd/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,22 +1,18 @@
-thisconfigdir=.
-myfulldir=appl/bsd
-mydir=.
-BUILDTOP=$(REL)..$(S)..
-PROG_LIBPATH=-L$(TOPLIBD)
-PROG_RPATH=$(KRB5_LIBDIR)
+mydir=bsd
+BUILDTOP=$(REL)..
 
 SETENVSRC=@SETENVSRC@
 SETENVOBJ=@SETENVOBJ@
 
 LOGINLIBS=@LOGINLIBS@
-LIBOBJS=@LIBOBJS@
+GETDOBJ=@GETDOBJ@
 KRSHDLIBS=@KRSHDLIBS@
 
 SRCS= $(srcdir)/krcp.c $(srcdir)/krlogin.c $(srcdir)/krsh.c $(srcdir)/kcmd.c \
 	$(srcdir)/forward.c $(srcdir)/login.c $(srcdir)/krshd.c \
 	$(srcdir)/krlogind.c
 OBJS= krcp.o krlogin.o krsh.o kcmd.o forward.o $(SETENVOBJ) login.o krshd.o \
-	krlogind.o $(LIBOBJS)
+	krlogind.o $(GETDOBJS)
 
 UCB_RLOGIN = @UCB_RLOGIN@
 UCB_RSH = @UCB_RSH@
@@ -35,14 +31,14 @@
 clean:: 
 	$(RM) rsh rcp rlogin kshd klogind login.krb5
 
-rsh: krsh.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o rsh krsh.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_LIBS)
+rsh: krsh.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS)
+	$(CC_LINK) -o rsh krsh.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(KRB5_BASE_LIBS) $(LIBS)
 
-rcp: krcp.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o rcp krcp.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_LIBS)
+rcp: krcp.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS)
+	$(CC_LINK) -o rcp krcp.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(KRB5_BASE_LIBS) $(LIBS)
 
-rlogin: krlogin.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o rlogin krlogin.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRB5_BASE_LIBS)
+rlogin: krlogin.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS)
+	$(CC_LINK) -o rlogin krlogin.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(KRB5_BASE_LIBS) $(LIBS)
 
 install::
 	for f in rsh rcp rlogin; do \
@@ -53,11 +49,11 @@
 	  ) || exit 1; \
 	done
 
-kshd: krshd.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB5_BASE_DEPLIBS) $(APPUTILS_DEPLIB)
-	$(CC_LINK) -o kshd krshd.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(KRSHDLIBS) $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(APPUTILS_LIB)
+kshd: krshd.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(PTY_DEPLIB)
+	$(CC_LINK) -o kshd krshd.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(KRSHDLIBS) $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(LIBS)
 
-klogind: krlogind.o kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB5_BASE_DEPLIBS) $(APPUTILS_DEPLIB)
-	$(CC_LINK) -o klogind krlogind.o  kcmd.o forward.o $(SETENVOBJ) $(LIBOBJS) $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(APPUTILS_LIB)
+klogind: krlogind.o kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(PTY_DEPLIB)
+	$(CC_LINK) -o klogind krlogind.o  kcmd.o forward.o $(SETENVOBJ) $(GETDOBJS) $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(LIBS)
 
 install::
 	for f in kshd klogind; do \
@@ -71,8 +67,8 @@
 # No program name transformation is done with login.krb5 since it is directly
 # referenced by klogind.
 #
-login.krb5: login.o  $(SETENVOBJ) $(LIBOBJS) $(PTY_DEPLIB) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o login.krb5 login.o $(SETENVOBJ) $(LIBOBJS) $(LOGINLIBS) $(PTY_LIB) $(KRB5_BASE_LIBS)
+login.krb5: login.o  $(SETENVOBJ) $(GETDOBJS) $(PTY_DEPLIB)
+	$(CC_LINK) -o login.krb5 login.o $(SETENVOBJ) $(GETDOBJS) $(LOGINLIBS) $(PTY_LIB) $(KRB5_BASE_LIBS) $(LIBS)
 
 install::
 	$(INSTALL_PROGRAM) login.krb5 $(DESTDIR)$(SERVER_BINDIR)/login.krb5

Modified: trunk/bsd/deps
===================================================================
--- trunk/bsd/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,78 +1,28 @@
 # 
 # Generated makefile dependencies follow.
 #
-$(OUTPRE)krcp.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
-  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-buf.h $(SRCTOP)/include/k5-err.h \
-  $(SRCTOP)/include/k5-gmt_mktime.h $(SRCTOP)/include/k5-int-pkinit.h \
-  $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/k5-util.h $(SRCTOP)/include/krb5.h \
-  $(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/krb5/preauth_plugin.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  defines.h krcp.c
-$(OUTPRE)krlogin.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h krlogin.c \
-  rpaths.h
-$(OUTPRE)krsh.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h krsh.c
-$(OUTPRE)kcmd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
-  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-buf.h $(SRCTOP)/include/k5-err.h \
-  $(SRCTOP)/include/k5-gmt_mktime.h $(SRCTOP)/include/k5-int-pkinit.h \
-  $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h kcmd.c
-$(OUTPRE)forward.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
-  $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-buf.h $(SRCTOP)/include/k5-err.h \
-  $(SRCTOP)/include/k5-gmt_mktime.h $(SRCTOP)/include/k5-int-pkinit.h \
-  $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h forward.c
-$(OUTPRE)login.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/k5-buf.h $(SRCTOP)/include/k5-err.h \
-  $(SRCTOP)/include/k5-gmt_mktime.h $(SRCTOP)/include/k5-int-pkinit.h \
-  $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h login.c loginpaths.h
-$(OUTPRE)krshd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/k5-buf.h \
-  $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-gmt_mktime.h \
-  $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/k5-util.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h krshd.c \
-  loginpaths.h
-$(OUTPRE)krlogind.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/k5-buf.h \
-  $(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-gmt_mktime.h \
-  $(SRCTOP)/include/k5-int-pkinit.h $(SRCTOP)/include/k5-int.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/k5-util.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h defines.h krlogind.c
+$(OUTPRE)krcp.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/fake-addrinfo.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/k5-util.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h defines.h krcp.c
+$(OUTPRE)krlogin.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h defines.h krlogin.c rpaths.h
+$(OUTPRE)krsh.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/fake-addrinfo.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h \
+  defines.h krsh.c
+$(OUTPRE)kcmd.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/fake-addrinfo.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h \
+  defines.h kcmd.c
+$(OUTPRE)forward.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h defines.h forward.c
+$(OUTPRE)login.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/libpty/libpty.h login.c loginpaths.h
+$(OUTPRE)krshd.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/fake-addrinfo.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/k5-util.h $(SRCTOP)/libpty/libpty.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h defines.h \
+  krshd.c loginpaths.h
+$(OUTPRE)krlogind.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/libpty/libpty.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h defines.h \
+  krlogind.c

Modified: trunk/bsd/forward.c
===================================================================
--- trunk/bsd/forward.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/forward.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -25,7 +25,8 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "k5-int.h"
+#include <krb5.h>
+#include <k5-platform.h>
 
 #include "defines.h"
 

Modified: trunk/bsd/kcmd.c
===================================================================
--- trunk/bsd/kcmd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/kcmd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -89,7 +89,8 @@
 #include <netdb.h>
 
 #include <errno.h>
-#include "k5-int.h"
+#include <krb5.h>
+#include <k5-platform.h>
 
 #include "defines.h"
 
@@ -1020,13 +1021,14 @@
 {
     char *def_realm;
     int retval;
-    
+    krb5_data *realm = krb5_princ_realm(bsd_context, principal);
+
     if ((retval = krb5_get_default_realm(bsd_context, &def_realm))) {
 	return 0;
     }
 
-    if (!data_eq_string(*krb5_princ_realm(bsd_context, principal),
-			def_realm)) {
+    if (realm->length != strlen(def_realm) ||
+	memcmp(realm->data, def_realm, realm->length) != 0) {
 	free(def_realm);
 	return 0;
     }	

Modified: trunk/bsd/krcp.c
===================================================================
--- trunk/bsd/krcp.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/krcp.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -64,7 +64,8 @@
 #include <sys/wait.h>
 
 #ifdef KERBEROS
-#include "k5-int.h"
+#include <krb5.h>
+#include <k5-platform.h>
 #include <k5-util.h>
 #include <com_err.h>
 

Modified: trunk/bsd/krlogin.c
===================================================================
--- trunk/bsd/krlogin.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/krlogin.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -57,7 +57,9 @@
      /*
       * rlogin - remote login
       */
-     
+
+#include <autoconf.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

Modified: trunk/bsd/krlogind.c
===================================================================
--- trunk/bsd/krlogind.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/krlogind.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -103,6 +103,8 @@
  *       Note:  Root logins are always logged.
  */
 
+#include <autoconf.h>
+
 /*
  * This is usually done in the Makefile.  Actually, these sources may
  * not work without the KERBEROS #defined.
@@ -228,11 +230,11 @@
 
 #ifdef KERBEROS
      
-#include "k5-int.h"
+#include <krb5.h>
+#include <k5-platform.h>
 #include <libpty.h>
 #ifdef HAVE_UTMP_H
 #include <utmp.h>
-#include <k5-util.h>
 #endif
 
 int non_privileged = 0; /* set when connection is seen to be from */
@@ -642,7 +644,8 @@
     
     write(f, "", 1);
     if ((retval = pty_getpty(&p,line, sizeof(line)))) {
-	com_err(progname, retval, "while getting master pty");
+	fprintf(stderr, "%s: %s while getting master pty\n", progname,
+		pty_error_message(retval));
 	exit(2);
     }
     
@@ -669,7 +672,7 @@
 	struct sgttyb b;
 #endif /* POSIX_TERMIOS */
 	if ((retval = pty_open_slave(line, &t))) {
-	    fatal(f, error_message(retval));
+	    fatal(f, pty_error_message(retval));
 	    exit(1);
 	}
 	

Modified: trunk/bsd/krshd.c
===================================================================
--- trunk/bsd/krshd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/krshd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -58,7 +58,9 @@
  *             three DEFINES.
  *       Note:  Root account access is always logged.
  */
-     
+
+#include <autoconf.h>
+
 #define SERVE_NON_KRB     
 #define LOG_REMOTE_REALM
 #define LOG_CMD
@@ -139,7 +141,7 @@
 #endif
 
 #ifdef KERBEROS
-#include "k5-int.h"
+#include <krb5.h>
 #include <com_err.h>
 #include "loginpaths.h"
 #include <k5-util.h>
@@ -758,7 +760,7 @@
     status = pty_make_sane_hostname((struct sockaddr *) fromp, maxhostlen,
 				    stripdomain, always_ip, &sane_host);
     if (status) {
-	error("failed make_sane_hostname: %s\n", error_message(status));
+	error("failed make_sane_hostname: %s\n", pty_error_message(status));
 	exit(1);
     }
 

Modified: trunk/bsd/login.c
===================================================================
--- trunk/bsd/login.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/bsd/login.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -25,6 +25,8 @@
  All rights reserved.\n";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 /* based on @(#)login.c	5.25 (Berkeley) 1/6/89 */
 
 /* The configuration, with defaults as listed, is of the form:
@@ -138,11 +140,11 @@
 #endif
 
 #ifdef KRB5_GET_TICKETS
-/* #include "krb5.h" */
-/* need k5-int.h to get ->profile from krb5_context */
-#include "k5-int.h"
+#include <krb5.h>
+#include <profile.h>
+#include <k5-platform.h>
 #include "com_err.h"
-#include "osconf.h"
+#define KRB5_ENV_CCNAME "KRB5CCNAME"
 #endif /* KRB5_GET_TICKETS */
 
 #ifndef __STDC__
@@ -349,11 +351,13 @@
 
     max_i = sizeof(login_conf_set)/sizeof(struct login_confs);
     for (i = 0; i<max_i; i++) {
+	profile_t profile;
 	kconf_names[0] = "login";
 	kconf_names[1] = login_conf_set[i].flagname;
 	kconf_names[2] = 0;
-	retval = profile_get_values(k->profile, 
-				    kconf_names, &kconf_val);
+	retval = krb5_get_profile(k, &profile);
+	if (retval == 0)
+	    retval = profile_get_values(profile, kconf_names, &kconf_val);
 	if (retval) {
 	    /* ignore most (all?) errors */
 	} else if (kconf_val && *kconf_val) {

Added: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/configure.ac	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,475 @@
+AC_INIT(Kerberos 5 applications)
+AC_CONFIG_SRCDIR(k5-platform.h)
+AC_CONFIG_HEADERS(autoconf.h)
+
+dnl Find the krb5 library installation.
+AC_ARG_WITH(krb5, [AS_HELP_STRING([--with-krb5=path],[where krb5 resides])])
+if test "$with_krb5" = no; then
+    AC_MSG_ERROR([This package requires krb5])
+elif test -z "$with_krb5" -o "$with_krb5" = yes; then
+    krb5_config=krb5-config
+elif test -x "$with_krb5/bin/krb5-config"; then
+    # Assume krb5 exec prefix specified.
+    krb5_config=$with_krb5/bin/krb5-config
+elif test -f "$with_krb5" -a -x "$with_krb5"; then
+    # Assume path to krb5-config specified.
+    krb5_config=$with_krb5
+fi
+if test -z "$krb5_config" || test -z "`$krb5_config --prefix`"; then
+  AC_MSG_ERROR([Specify -with-krb5= krb5 exec-prefix or path to krb5-config])
+fi
+KRB5_CFLAGS=`$krb5_config --cflags`
+KRB5_BASE_LIBS=`$krb5_config --libs krb5`" -lkrb5support"
+GSS_LIBS=`$krb5_config --libs gssapi`" -lkrb5support"
+AC_SUBST(KRB5_CFLAGS)
+AC_SUBST(KRB5_BASE_LIBS)
+AC_SUBST(GSS_LIBS)
+
+WITH_CC
+if test -z "$LD" ; then LD=$CC; fi
+AC_ARG_VAR(LD,[linker command [CC]])
+AC_SUBST(LDFLAGS)
+AC_C_CONST
+AC_ARG_PROGRAM
+AC_PROG_LN_S
+AC_PROG_RANLIB
+AC_PROG_ARCHIVE
+AC_PROG_ARCHIVE_ADD
+AC_PROG_INSTALL
+AC_PROG_YACC
+AC_CHECK_PROG(AR, ar, ar, false)
+AC_FUNC_FORK
+AC_TYPE_MODE_T
+AC_CHECK_TYPES([socklen_t, struct sockaddr_storage],,,
+[#include <sys/types.h>
+#include <sys/socket.h>
+])
+
+AC_HEADER_STDARG
+AC_HEADER_TIME
+CHECK_DIRENT
+CHECK_SETJMP
+CHECK_SIGNALS
+CHECK_SIGPROCMASK
+CHECK_UTMP
+CHECK_WAIT_TYPE
+DECLARE_SYS_ERRLIST
+KRB5_AC_MAINTAINER_MODE
+KRB5_AC_NEED_DAEMON
+KRB5_AC_INET6
+KRB5_AC_LIBUTIL
+KRB5_SIGTYPE
+KRB5_GETSOCKNAME_ARGS
+
+AC_CHECK_HEADERS(curses.h lastlog.h libutil.h memory.h paths.h pty.h stdlib.h)
+AC_CHECK_HEADERS(string.h ttyent.h util.h sac.h unistd.h utmp.h utmpx.h)
+AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
+AC_CHECK_HEADERS(sys/filio.h sys/ioctl_compat.h sys/label.h sys/select.h)
+AC_CHECK_HEADERS(sys/sockio.h sys/stream.h sys/time.h sys/tty.h sys/uio.h)
+AC_CHECK_HEADERS(sys/utsname.h sys/wait.h)
+dnl On some systems, term.h requires curses.h inclusion
+AC_CHECK_HEADERS(term.h,,,
+[#ifdef HAVE_CURSES_H
+#include <curses.h>
+#endif
+])
+
+case $krb5_cv_host in
+*-*-solaris*)
+    if test "$ac_cv_c_compiler_gnu" = yes; then
+        # Solaris 8 at least has curses.h that is noisy under gcc
+        ac_cv_header_curses_h=yes
+    fi
+    ;;
+esac
+
+AC_CHECK_HEADER(sys/ptyvar.h, [], [],
+[#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_SYS_TTY_H
+#include <sys/tty.h>
+#endif])
+
+AC_CHECK_FUNCS(_getpty cgetent getcwd getenv gettosbyname getusershell getutmp)
+AC_CHECK_FUNCS(getutmpx grantpt inet_aton initgroups isatty killpg killpg)
+AC_CHECK_FUNCS(line_push logwtmp openpty ptsname revoke rmufile rresvport_af)
+AC_CHECK_FUNCS(setenv seteuid setlogin setpgid setpriority setresuid setreuid)
+AC_CHECK_FUNCS(setsid setutent setutsent setutxent strerror strlcpy strsave)
+AC_CHECK_FUNCS(tcgetpgrp tcsetpgrp ttyname unsetenv updwtmp updwtmpx utimes)
+AC_CHECK_FUNCS(utmpname utmpxname vhangup vasprintf vsnprintf waitpid)
+
+dnl Wishlist item: consolidate all of the replacement functions into a
+dnl new library (perhaps "libroken", according to tradition) and use
+dnl AC_REPLACE_FUNCS for all of them.  This would require moving
+dnl getenv out of setenv.c or just punting it.
+
+dnl ftpd and bsd define getdtablesize if it is not provided.
+GETDOBJ=
+AC_CHECK_FUNCS(getdtablesize,, GETDOBJ=getdtablesize.o)
+AC_SUBST(GETDOBJ)
+
+dnl libtelnet, ftpd, and bsd define setenv if it is not provided.
+if test $ac_cv_func_setenv = no || test $ac_cv_func_unsetenv = no \
+  || test $ac_cv_func_getenv = no; then
+  SETENVOBJ=setenv.o
+  AC_SUBST([SETENVOBJ])
+  AC_DEFINE([NEED_SETENV],1,[Define if setenv needs to be defined])
+fi
+
+dnl libtelnet defines these functions if not provided, using the
+dnl autoconf LIBOBJS mechanism.
+AC_REPLACE_FUNCS(getopt herror parsetos setsid strcasecmp strdup strerror)
+AC_REPLACE_FUNCS(strftime)
+
+KRB5_NEED_PROTO([#include <stdlib.h>],setenv,1)
+KRB5_NEED_PROTO([#include <stdlib.h>],unsetenv,1)
+KRB5_NEED_PROTO([#include <unistd.h>
+#include <stdlib.h>],parsetos,1)
+dnl
+KRB5_NEED_PROTO([#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>],herror,1)
+KRB5_NEED_PROTO([#include <unistd.h>
+],revoke)
+KRB5_NEED_PROTO([#include <stdarg.h>
+#include <stdio.h>
+],vasprintf)
+
+dnl Determine libraries for login and ftpd.
+LOGINLIBS=
+FTPD_LIBS=
+AC_ARG_WITH([afs],
+[  --without-afs        don't have afs libraries to build against (default)
+  --with-afs=AFSDIR    use preinstalled AFS library tree],
+,with_afs=no)
+if test $with_afs != no; then
+    AC_DEFINE(SETPAG,1,[Define if setpag should be used])
+    LOGINLIBS="$LOGINLIBS -L$with_afs/lib -L$with_afs/lib/afs"
+    LOGINLIBS="$LOGINLIBS -lauth -lsys -lrx -llwp"
+fi
+AC_CHECK_LIB(crypt,crypt,
+             [LOGINLIBS="$LOGINLIBS -lcrypt"
+              FTPD_LIBS="$FTPD_LIBS -lcrypt"])
+dnl AIX has all three of these; SCO might too.
+AC_CHECK_LIB(odm,main,
+    AC_CHECK_LIB(s,main,
+        AC_CHECK_LIB(cfg,main, 
+        [LOGINLIBS="$LOGINLIBS -lodm -ls -lcfg"])))
+KRSHDLIBS="$LOGINLIBS"
+AC_SUBST(KRSHDLIBS)
+AC_SUBST(LOGINLIBS)
+AC_SUBST(FTPD_LIBS)
+
+dnl Determine libraries for telnet and telnetd.
+old_LIBS="$LIBS"
+AC_CHECK_LIB(termcap,main,
+             [AC_DEFINE(TERMCAP,1,[Define if termcap library is available])
+              LIBS="$LIBS -ltermcap"])
+AC_CHECK_LIB(curses,setupterm,LIBS="$LIBS -lcurses",
+             [AC_CHECK_LIB(ncurses,setupterm,LIBS="$LIBS -lncurses")])
+AC_CHECK_FUNCS(setupterm)
+TELNET_LIBS="$LIBS"
+TELNETD_LIBS="$LIBS"
+AC_SUBST(TELNET_LIBS)
+AC_SUBST(TELNETD_LIBS)
+AC_CHECK_FUNC(tgetent, ,
+              [AC_MSG_ERROR([Could not find tgetent; are you missing a curses/ncurses library?])])
+LIBS="$old_LIBS"
+
+dnl Make our operating system-specific security checks and definitions
+dnl for libpty, login, and ftpd.  The following code decides what
+dnl streams modules will be pushed onto a pty.  In particular, if
+dnl HAVE_STREAMS is defined and HAVE_LINE_PUSH is not defined, modules
+dnl may be pushed by inserting an appropriate generic ifdef for each
+dnl module in init_slave.c and AC_DEFINES for the operating systems
+dnl that need the modules.  Each OS that supports streams has a
+dnl different idea of what you want to push.
+case $krb5_cv_host in
+*-*-ultrix*)
+    echo "Disabling initial vhangup and setsid because they break under Ultrix"
+    AC_DEFINE([OPEN_CTTY_ONLY_ONCE],[1],
+              [Define on Ultrix where an initial vhangup breaks])
+    ac_cv_func_setsid=no # setsid doesn't do the right thing under Ultrix
+    ;;
+*-*-aix3*)
+    # AIX has streams include files but not streams TTY
+    # Moreover, strops.h trashes sys/ioctl.h
+    krb5_cv_has_streams=no
+    ;;
+alpha*-dec-osf*)
+    AC_MSG_RESULT(will open ctty prior to revoke due to OSF/1 lossage)
+    AC_DEFINE(REVOKE_NEEDS_OPEN,1,
+              [Define if ctty needs to be opened before revoke as on OSF/1])
+    AC_CHECK_LIB(security,setluid,
+                 AC_DEFINE(HAVE_SETLUID,1,
+                 [Define if setluid is supplied by the OSF/1 security library])
+                 LOGINLIBS="$LOGINLIBS -lsecurity"
+                 FTPD_LIBS="$FTPD_LIBS -lsecurity")
+    ;;
+*-*-solaris*)
+    AC_DEFINE(PUSH_PTEM,1,[push ptem?])
+    AC_DEFINE(PUSH_LDTERM,1,[push ldterm?])
+    AC_DEFINE(PUSH_TTCOMPAT,1,[push ttcompat?])
+    ;;
+*-*-hpux*|*-*-linux*|*-*-irix*)
+    krb5_cv_has_streams=no
+    ;;
+esac
+
+AC_MSG_CHECKING([streams interface])
+AC_CACHE_VAL(krb5_cv_has_streams,
+[AC_TRY_COMPILE(
+[#include <sys/stream.h>
+#include <sys/stropts.h>], [],
+krb5_cv_has_streams=yes, krb5_cv_has_streams=no)])
+AC_MSG_RESULT($krb5_cv_has_streams)
+if test $krb5_cv_has_streams = yes; then
+AC_DEFINE(HAVE_STREAMS,1,[Define if have streams])
+fi
+
+dnl telnet checks for STREAMSPTY to indicate streams and grantpt.
+if test "$krb5_cv_has_stream" = yes -a "$ac_cv_func_grantpt" = yes; then
+    AC_DEFINE(STREAMSPTY,1,[Define if streams pty interface should be used])
+fi
+
+dnl ----- utmp stuff -----
+
+AC_DEFUN(K5_CHECK_UT_MEMBER,
+[AC_MSG_CHECKING([for $2 in struct $1])
+AC_CACHE_VAL([krb5_cv_struct_$1_$2],
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$1.h>], [struct $1 u; u.$2;],
+eval "krb5_cv_struct_$1_$2=yes", eval "krb5_cv_struct_$1_$2=no")])
+if eval "test \"`echo '$krb5_cv_struct_'$1'_'$2`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  krb5_tr_ut=HAVE_STRUCT_`echo $1'_'$2 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  AC_DEFINE_UNQUOTED($krb5_tr_ut,1,[Define if $2 field present in $1])
+else
+  AC_MSG_RESULT(no)
+fi])
+
+if test "$ac_cv_header_utmp_h" = yes; then
+  AC_MSG_RESULT(checking struct utmp members)
+  for krb5_mem in ut_host ut_syslen ut_addr ut_id ut_pid ut_type ut_exit; do
+    K5_CHECK_UT_MEMBER(utmp, $krb5_mem)
+  done
+fi
+
+if test "$ac_cv_header_utmpx_h" = yes; then
+  AC_MSG_RESULT(checking struct utmpx members)
+  for krb5_mem in ut_host ut_syslen ut_addr ut_id ut_pid ut_type ut_exit; do
+    K5_CHECK_UT_MEMBER(utmpx, $krb5_mem)
+  done
+fi
+
+AC_DEFUN(K5_CHECK_UT_EXIT_MEMBER,
+[AC_MSG_CHECKING([for ut_exit.$2 in struct $1])
+AC_CACHE_VAL([krb5_cv_struct_$1_ut_exit_$2],
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <$1.h>], [struct $1 u; u.ut_exit.$2;],
+eval "krb5_cv_struct_$1_ut_exit_$2=yes",
+eval "krb5_cv_struct_$1_ut_exit_$2=no")])
+if eval "test \"`echo '$krb5_cv_struct_'$1'_ut_exit_'$2`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], , :, [$3])
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], , :, [$4])
+fi])
+
+if test "$krb5_cv_struct_utmp_ut_exit" = yes; then
+  AC_MSG_RESULT(checking for working ut_exit.e_exit in struct utmp)
+  for krb5_mem in __e_exit ut_e_exit ut_exit e_exit; do
+    K5_CHECK_UT_EXIT_MEMBER(utmp, $krb5_mem,
+[krb5_utmp_e_exit=$krb5_mem
+krb5_utmp_e_termination=`echo $krb5_mem|sed -e 's%_exit$%_termination%'`], )
+  done
+  if test "${krb5_utmp_e_exit+set}" = set; then
+    AC_MSG_RESULT([working ut_exit.e_exit in utmp is $krb5_utmp_e_exit])
+    AC_DEFINE_UNQUOTED(PTY_UTMP_E_EXIT, $krb5_utmp_e_exit,[Define to utmp exit field name])
+    AC_DEFINE_UNQUOTED(PTY_UTMP_E_TERMINATION, $krb5_utmp_e_termination,[Define to utmp termination field name])
+  else
+    AC_MSG_RESULT([cannot find working ut_exit.e_exit in utmp])
+  fi
+fi
+
+if test "$krb5_cv_struct_utmpx_ut_exit" = yes; then
+  AC_MSG_RESULT(checking for working ut_exit.e_exit in struct utmpx)
+  for krb5_mem in __e_exit ut_e_exit ut_exit e_exit; do
+    K5_CHECK_UT_EXIT_MEMBER(utmpx, $krb5_mem,
+[krb5_utmpx_e_exit=$krb5_mem
+krb5_utmpx_e_termination=`echo $krb5_mem|sed -e 's%_exit$%_termination%'`], )
+  done
+  if test "${krb5_utmpx_e_exit+set}" = set; then
+    AC_MSG_RESULT([working ut_exit.e_exit in utmpx is $krb5_utmpx_e_exit])
+    AC_DEFINE_UNQUOTED(PTY_UTMPX_E_EXIT, $krb5_utmpx_e_exit,[Define to utmpx exit field name])
+    AC_DEFINE_UNQUOTED(PTY_UTMPX_E_TERMINATION, $krb5_utmpx_e_termination,[Define to utmpx termination field name])
+  else
+    AC_MSG_RESULT([cannot find working ut_exit.e_exit in utmpx])
+  fi
+fi
+
+if test "$ac_cv_header_utmpx_h" = yes; then
+  AC_MSG_CHECKING(consistency of utmpx API)
+  if test "$ac_cv_func_setutxent" = yes; then
+    if test "$krb5_cv_struct_utmpx_ut_id" = yes \
+      && test "$krb5_cv_struct_utmpx_ut_type" = yes \
+      && test "$krb5_cv_struct_utmpx_ut_pid" = yes; then
+      AC_MSG_RESULT(ok)
+    else
+      AC_MSG_RESULT(not ok)
+      AC_MSG_ERROR([have setutxent but no ut_id, ut_type, or ut_pid in utmpx])
+    fi
+  else
+    AC_MSG_RESULT(not ok)
+    AC_MSG_ERROR([have utmpx.h but no setutxent])
+  fi
+fi
+
+if test "$ac_cv_func_setutent" = yes && \
+  test "$ac_cv_header_utmpx_h" = no; then
+  AC_MSG_CHECKING(consistency of sysV-ish utmp API)
+  if test "$ac_cv_header_utmp_h" = yes; then
+    if test "$krb5_cv_struct_utmp_ut_id" = yes \
+      && test "$krb5_cv_struct_utmp_ut_type" = yes \
+      && test "$krb5_cv_struct_utmp_ut_pid" = yes; then
+      AC_MSG_RESULT(ok)
+    else
+      AC_MSG_RESULT(not ok)
+      AC_MSG_ERROR([have setutent but no ut_id, ut_type, or ut_pid in utmp])
+    fi
+  else
+    AC_MSG_RESULT(not ok)
+    AC_MSG_ERROR([have setutent but no utmp.h])
+  fi
+fi
+
+KRB5_NEED_PROTO([#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+],getutmp)
+dnl
+
+KRB5_NEED_PROTO([#include <sys/types.h>
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_LIBUTIL_H
+#include <libutil.h>
+#endif
+#ifdef HAVE_UTIL_H
+#include <util.h>
+#endif
+],logwtmp)
+
+dnl ----- End of utmp stuff -----
+
+AC_MSG_CHECKING([arguments to getpgrp])
+AC_CACHE_VAL(krb5_cv_getpgrp_args,
+[AC_TRY_COMPILE(
+[#ifndef __STDC__
+#define __STDC__ 1
+#endif
+#include <unistd.h>
+#include <sys/types.h>], [pid_t pid = getpgrp(getpid())],
+krb5_cv_getpgrp_args=pid, krb5_cv_getpgrp_args=void)])
+AC_MSG_RESULT($krb5_cv_getpgrp_args)
+if test $krb5_cv_getpgrp_args = pid; then
+AC_DEFINE(GETPGRP_ONEARG,1,[Define if getpgrp takes one arg])
+fi
+
+AC_MSG_CHECKING([if setpgrp takes two arguments])
+AC_CACHE_VAL(krb5_cv_sys_setpgrp_two,
+[AC_TRY_COMPILE( 
+[#include <unistd.h>],[setpgrp(0,0)],
+krb5_cv_sys_setpgrp_two=yes,krb5_cv_sys_setpgrp_two=no)])
+AC_MSG_RESULT($krb5_cv_sys_setpgrp_two)
+if test $krb5_cv_sys_setpgrp_two = yes; then
+  AC_DEFINE(SETPGRP_TWOARG,1,[Define if setpgrp takes two arguments])
+fi
+
+AC_MSG_CHECKING([F_SETOWN])
+AC_CACHE_VAL(krb5_cv_f_setown,
+[AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <fcntl.h>], [1+F_SETOWN;],
+krb5_cv_f_setown=yes,krb5_cv_f_setown=no)])
+AC_MSG_RESULT($krb5_cv_f_setown)
+if test $krb5_cv_f_setown = yes; then
+AC_DEFINE(HAVE_SETOWN,1,[Define if F_SETOWN is available])
+fi
+
+AC_MSG_CHECKING([shadow password support])
+AC_CACHE_VAL(krb5_cv_shadow_pwd,
+[AC_TRY_LINK(
+[#include <sys/types.h>
+#include <pwd.h>
+#include <shadow.h>],
+[struct spwd *sp = getspnam("root")],
+krb5_cv_shadow_pwd=yes, krb5_cv_shadow_pwd=no)])
+AC_MSG_RESULT($krb5_cv_shadow_pwd)
+if test $krb5_cv_shadow_pwd = yes; then
+AC_DEFINE(HAVE_SHADOW,1,[Define if shadow password interface is available])
+fi
+K5_AC_CHECK_FILES(/etc/environment /etc/TIMEZONE)
+
+dnl bsd and libpty check POSIX_TERMIOS; telnet checks USE_TERMIO.
+AC_CHECK_HEADER(termios.h,
+    [AC_CHECK_FUNC(cfsetispeed,
+        [AC_DEFINE(POSIX_TERMIOS,1,[Define for POSIX termios interface])
+         AC_DEFINE(USE_TERMIO,1,[Define if termio should be used])
+         ac_termio=1])])
+if test -z "$ac_termio"; then
+    AC_CHECK_HEADER(termio.h,
+                    [AC_DEFINE(SYSV_TERMIO,1,
+                               [Define if SysV termio interface is found])
+                     ac_sysv_termio=1])
+    if test -n "$ac_sysv_termio"; then
+        AC_MSG_CHECKING([for cc_t in termio.h])
+        AC_CACHE_VAL(krb_cv_type_cc_t,
+                     [AC_TRY_LINK([cc_t],[#include <termio.h>],[cc_t foo;],
+                                  [krb_cv_type_cc_t=yes],
+                                  [krb_cv_type_cc_t=no])])
+        AC_MSG_RESULT($krb_cv_type_cc_t)
+        if test $krb_cv_type_cc_t = no; then
+            AC_DEFINE(NO_CC_T,1,[Define if termio.h does not define type cc_t])
+        fi
+    fi
+fi
+
+AC_CACHE_CHECK([if speed_t is defined], krb5_cv_type_speed_t,
+[AC_TRY_COMPILE(dnl
+[#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#ifndef	USE_TERMIO
+#include <sgtty.h>
+#else
+# ifdef	SYSV_TERMIO
+# include <termio.h>
+# else
+# include <termios.h>
+# endif
+#endif
+],[speed_t termspeed],krb5_cv_type_speed_t=yes, krb5_cv_type_speed_t=no)])
+if test $krb5_cv_type_speed_t = no; then
+   AC_DEFINE(speed_t, int,
+             [Define if system termios interface doesn't define speed_t])
+fi
+
+V5_AC_OUTPUT_MAKEFILE(. bsd libpty
+                      gssftp gssftp/ftp gssftp/ftpd
+                      telnet telnet/libtelnet telnet/telnet telnet/telnetd)

Added: trunk/fake-addrinfo.h
===================================================================
--- trunk/fake-addrinfo.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/fake-addrinfo.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2001,2002,2003,2004 by the Massachusetts Institute of Technology,
+ * Cambridge, MA, USA.  All Rights Reserved.
+ * 
+ * This software is being provided to you, the LICENSEE, by the 
+ * Massachusetts Institute of Technology (M.I.T.) under the following 
+ * license.  By obtaining, using and/or copying this software, you agree 
+ * that you have read, understood, and will comply with these terms and 
+ * conditions:  
+ * 
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ * 
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute 
+ * this software and its documentation for any purpose and without fee or 
+ * royalty is hereby granted, provided that you agree to comply with the 
+ * following copyright notice and statements, including the disclaimer, and 
+ * that the same appear on ALL copies of the software and documentation, 
+ * including modifications that you make for internal use or for 
+ * distribution:
+ * 
+ * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS 
+ * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not 
+ * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF 
+ * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF 
+ * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY 
+ * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.   
+ * 
+ * The name of the Massachusetts Institute of Technology or M.I.T. may NOT 
+ * be used in advertising or publicity pertaining to distribution of the 
+ * software.  Title to copyright in this software and any associated 
+ * documentation shall at all times remain with M.I.T., and USER agrees to 
+ * preserve same.
+ *
+ * Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.  
+ */
+
+/* Approach overview:
+
+   If a system version is available but buggy, save handles to it (via
+   inline functions in a support library), redefine the names to refer
+   to library functions, and in those functions, call the system
+   versions and fix up the returned data.  Use the native data
+   structures and flag values.
+
+   If no system version exists, use gethostby* and fake it.  Define
+   the data structures and flag values locally.
+
+
+   On Mac OS X, getaddrinfo results aren't cached (though
+   gethostbyname results are), so we need to build a cache here.  Now
+   things are getting really messy.  Because the cache is in use, we
+   use getservbyname, and throw away thread safety.  (Not that the
+   cache is thread safe, but when we get locking support, that'll be
+   dealt with.)  This code needs tearing down and rebuilding, soon.
+
+
+   Note that recent Windows developers' code has an interesting hack:
+   When you include the right header files, with the right set of
+   macros indicating system versions, you'll get an inline function
+   that looks for getaddrinfo (or whatever) in the system library, and
+   calls it if it's there.  If it's not there, it fakes it with
+   gethostby* calls.
+
+   We're taking a simpler approach: A system provides these routines or
+   it does not.
+
+   Someday, we may want to take into account different versions (say,
+   different revs of GNU libc) where some are broken in one way, and
+   some work or are broken in another way.  Cross that bridge when we
+   come to it.  */
+
+/* To do, maybe:
+
+   + For AIX 4.3.3, using the RFC 2133 definition: Implement
+     AI_NUMERICHOST.  It's not defined in the header file.
+
+     For certain (old?) versions of GNU libc, AI_NUMERICHOST is
+     defined but not implemented.
+
+   + Use gethostbyname2, inet_aton and other IPv6 or thread-safe
+     functions if available.  But, see
+     http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=135182 for one
+     gethostbyname2 problem on Linux.  And besides, if a platform is
+     supporting IPv6 at all, they really should be doing getaddrinfo
+     by now.
+
+   + inet_ntop, inet_pton
+
+   + Conditionally export/import the function definitions, so a
+     library can have a single copy instead of multiple.
+
+   + Upgrade host requirements to include working implementations of
+     these functions, and throw all this away.  Pleeease?  :-)  */
+
+#ifndef FAI_DEFINED
+#define FAI_DEFINED
+#include "port-sockets.h"
+#include "socket-utils.h"
+
+#if !defined (HAVE_GETADDRINFO)
+
+#undef  addrinfo
+#define addrinfo	my_fake_addrinfo
+
+struct addrinfo {
+    int ai_family;		/* PF_foo */
+    int ai_socktype;		/* SOCK_foo */
+    int ai_protocol;		/* 0, IPPROTO_foo */
+    int ai_flags;		/* AI_PASSIVE etc */
+    size_t ai_addrlen;		/* real length of socket address */
+    char *ai_canonname;		/* canonical name of host */
+    struct sockaddr *ai_addr;	/* pointer to variable-size address */
+    struct addrinfo *ai_next;	/* next in linked list */
+};
+
+#undef	AI_PASSIVE
+#define	AI_PASSIVE	0x01
+#undef	AI_CANONNAME
+#define	AI_CANONNAME	0x02
+#undef	AI_NUMERICHOST
+#define	AI_NUMERICHOST	0x04
+/* RFC 2553 says these are part of the interface for getipnodebyname,
+   not for getaddrinfo.  RFC 3493 says they're part of the interface
+   for getaddrinfo, and getipnodeby* are deprecated.  Our fake
+   getaddrinfo implementation here does IPv4 only anyways.  */
+#undef	AI_V4MAPPED
+#define	AI_V4MAPPED	0
+#undef	AI_ADDRCONFIG
+#define	AI_ADDRCONFIG	0
+#undef	AI_ALL
+#define	AI_ALL		0
+#undef	AI_DEFAULT
+#define	AI_DEFAULT	(AI_V4MAPPED|AI_ADDRCONFIG)
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
+#ifndef NI_MAXSERV
+#define NI_MAXSERV 32
+#endif
+
+#undef	NI_NUMERICHOST
+#define NI_NUMERICHOST	0x01
+#undef	NI_NUMERICSERV
+#define NI_NUMERICSERV	0x02
+#undef	NI_NAMEREQD
+#define NI_NAMEREQD	0x04
+#undef	NI_DGRAM
+#define NI_DGRAM	0x08
+#undef	NI_NOFQDN
+#define NI_NOFQDN	0x10
+
+
+#undef  EAI_ADDRFAMILY
+#define EAI_ADDRFAMILY	1
+#undef  EAI_AGAIN
+#define EAI_AGAIN	2
+#undef  EAI_BADFLAGS
+#define EAI_BADFLAGS	3
+#undef  EAI_FAIL
+#define EAI_FAIL	4
+#undef  EAI_FAMILY
+#define EAI_FAMILY	5
+#undef  EAI_MEMORY
+#define EAI_MEMORY	6
+#undef  EAI_NODATA
+#define EAI_NODATA	7
+#undef  EAI_NONAME
+#define EAI_NONAME	8
+#undef  EAI_SERVICE
+#define EAI_SERVICE	9
+#undef  EAI_SOCKTYPE
+#define EAI_SOCKTYPE	10
+#undef  EAI_SYSTEM
+#define EAI_SYSTEM	11
+
+#endif /* ! HAVE_GETADDRINFO */
+
+/* Fudge things on older gai implementations.  */
+/* AIX 4.3.3 is based on RFC 2133; no AI_NUMERICHOST.  */
+#ifndef AI_NUMERICHOST
+# define AI_NUMERICHOST 0
+#endif
+/* Partial RFC 2553 implementations may not have AI_ADDRCONFIG and
+   friends, which RFC 3493 says are now part of the getaddrinfo
+   interface, and we'll want to use.  */
+#ifndef AI_ADDRCONFIG
+# define AI_ADDRCONFIG 0
+#endif
+#ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0
+#endif
+#ifndef AI_ALL
+# define AI_ALL 0
+#endif
+#ifndef AI_DEFAULT
+# define AI_DEFAULT (AI_ADDRCONFIG|AI_V4MAPPED)
+#endif
+
+#if defined(KRB5_USE_INET6) && defined(NEED_INSIXADDR_ANY) 
+/* If compiling with IPv6 support and C library does not define in6addr_any */
+extern const struct in6_addr krb5int_in6addr_any;
+#undef in6addr_any
+#define in6addr_any krb5int_in6addr_any
+#endif
+
+/* Call out to stuff defined in libkrb5support.  */
+extern int krb5int_getaddrinfo (const char *node, const char *service,
+				const struct addrinfo *hints,
+				struct addrinfo **aip);
+extern void krb5int_freeaddrinfo (struct addrinfo *ai);
+extern const char *krb5int_gai_strerror(int err);
+extern int krb5int_getnameinfo (const struct sockaddr *sa, socklen_t salen,
+				char *hbuf, size_t hbuflen,
+				char *sbuf, size_t sbuflen,
+				int flags);
+#ifndef IMPLEMENT_FAKE_GETADDRINFO
+#undef	getaddrinfo
+#define getaddrinfo krb5int_getaddrinfo
+#undef  freeaddrinfo
+#define freeaddrinfo krb5int_freeaddrinfo
+#undef  gai_strerror
+#define gai_strerror krb5int_gai_strerror
+#undef  getnameinfo
+#define getnameinfo krb5int_getnameinfo
+#endif
+
+#endif /* FAI_DEFINED */

Modified: trunk/gssftp/Makefile.in
===================================================================
--- trunk/gssftp/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,6 +1,3 @@
-thisconfigdir=.
-myfulldir=appl/gssftp
-mydir=.
-BUILDTOP=$(REL)..$(S)..
+mydir=gssftp
+BUILDTOP=$(REL)..
 SUBDIRS=ftp ftpd
-LDFLAGS = -g

Modified: trunk/gssftp/ftp/Makefile.in
===================================================================
--- trunk/gssftp/ftp/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,10 +1,6 @@
-thisconfigdir=./..
-myfulldir=appl/gssftp/ftp
-mydir=ftp
-BUILDTOP=$(REL)..$(S)..$(S)..
-#
-# appl/gssftp/ftp/Makefile.in
-#
+mydir=gssftp/ftp
+BUILDTOP=$(REL)..$(S)..
+
 DEFINES = -DGSSAPI -DFTP_BUFSIZ=65535
 PROG_LIBPATH=-L$(TOPLIBD)
 PROG_RPATH=$(KRB5_LIBDIR)
@@ -21,24 +17,24 @@
 	  $(OUTPRE)main.$(OBJEXT) $(OUTPRE)radix.$(OBJEXT) \
 	  $(OUTPRE)ruserpass.$(OBJEXT) $(OUTPRE)secure.$(OBJEXT)
 
-LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)
+LOCALINCLUDES = -I$(srcdir)/..
 
-all-unix::	ftp
+all::	ftp
 all-windows::	$(OUTPRE)ftp.exe
 
-ftp:	$(OBJS) $(GSS_DEPLIBS) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o ftp $(OBJS) $(GSS_LIBS) $(KRB5_BASE_LIBS)
+ftp:	$(OBJS)
+	$(CC_LINK) -o ftp $(OBJS) $(GSS_LIBS) $(LIBS)
 
 $(OUTPRE)ftp.exe: $(OBJS) $(GLIB) $(KLIB)
 	link $(EXE_LINKOPTS) -out:$@ $** ws2_32.lib advapi32.lib $(SCLIB)
 	$(_VC_MANIFEST_EMBED_EXE)
 
-clean-unix::
+clean::
 	$(RM) ftp
 
 depend::
 
-install-unix::
+install::
 	for f in ftp; do \
 	  $(INSTALL_PROGRAM) $$f \
 		$(DESTDIR)$(CLIENT_BINDIR)/`echo $$f|sed '$(transform)'`; \

Modified: trunk/gssftp/ftp/cmds.c
===================================================================
--- trunk/gssftp/ftp/cmds.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/cmds.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -35,6 +35,8 @@
 static char sccsid[] = "@(#)cmds.c	5.26 (Berkeley) 3/5/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 /*
  * FTP User Program -- Command Routines.
  */

Modified: trunk/gssftp/ftp/cmdtab.c
===================================================================
--- trunk/gssftp/ftp/cmdtab.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/cmdtab.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -35,6 +35,8 @@
 static char sccsid[] = "@(#)cmdtab.c	5.10 (Berkeley) 6/1/90";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 #include "ftp_var.h"
 

Modified: trunk/gssftp/ftp/deps
===================================================================
--- trunk/gssftp/ftp/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,28 +1,24 @@
 # 
 # Generated makefile dependencies follow.
 #
-$(OUTPRE)cmds.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(srcdir)/../arpa/ftp.h \
-  cmds.c ftp_var.h pathnames.h
+$(OUTPRE)cmds.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h $(srcdir)/../arpa/ftp.h cmds.c \
+  ftp_var.h pathnames.h
 $(OUTPRE)cmdtab.$(OBJEXT): cmdtab.c ftp_var.h
 $(OUTPRE)domacro.$(OBJEXT): domacro.c ftp_var.h
-$(OUTPRE)ftp.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_ext.h \
-  $(BUILDTOP)/include/gssapi/gssapi_generic.h $(BUILDTOP)/include/gssapi/gssapi_krb5.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
-  $(SRCTOP)/include/port-sockets.h $(srcdir)/../arpa/ftp.h \
-  $(srcdir)/../arpa/telnet.h ftp.c ftp_var.h secure.h
+$(OUTPRE)ftp.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h $(srcdir)/../arpa/ftp.h $(srcdir)/../arpa/telnet.h \
+  /me/base/include/com_err.h /me/base/include/gssapi/gssapi.h \
+  /me/base/include/gssapi/gssapi_ext.h /me/base/include/gssapi/gssapi_generic.h \
+  /me/base/include/gssapi/gssapi_krb5.h /me/base/include/krb5.h \
+  /me/base/include/krb5/krb5.h ftp.c ftp_var.h secure.h
 $(OUTPRE)getpass.$(OBJEXT): ftp_var.h getpass.c
-$(OUTPRE)glob.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+$(OUTPRE)glob.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
   ftp_var.h glob.c
-$(OUTPRE)main.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/port-sockets.h $(srcdir)/../arpa/ftp.h \
-  ftp_var.h main.c
+$(OUTPRE)main.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/port-sockets.h \
+  $(srcdir)/../arpa/ftp.h ftp_var.h main.c
 $(OUTPRE)radix.$(OBJEXT): ftp_var.h radix.c
 $(OUTPRE)ruserpass.$(OBJEXT): ftp_var.h ruserpass.c
-$(OUTPRE)secure.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_generic.h \
-  $(srcdir)/../arpa/ftp.h secure.c secure.h
+$(OUTPRE)secure.$(OBJEXT): $(BUILDTOP)/autoconf.h $(srcdir)/../arpa/ftp.h \
+  /me/base/include/gssapi/gssapi.h /me/base/include/gssapi/gssapi_generic.h \
+  secure.c secure.h

Modified: trunk/gssftp/ftp/domacro.c
===================================================================
--- trunk/gssftp/ftp/domacro.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/domacro.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -35,6 +35,8 @@
 static char sccsid[] = "@(#)domacro.c	1.8 (Berkeley) 9/28/90";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 #include <signal.h>
 

Modified: trunk/gssftp/ftp/ftp.c
===================================================================
--- trunk/gssftp/ftp/ftp.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/ftp.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -61,6 +61,8 @@
 static char sccsid[] = "@(#)ftp.c	5.38 (Berkeley) 4/22/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #ifdef _WIN32
 #include <windows.h>
 #include <winsock2.h>

Modified: trunk/gssftp/ftp/getpass.c
===================================================================
--- trunk/gssftp/ftp/getpass.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/getpass.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -8,6 +8,8 @@
 static	char sccsid[] = "@(#)getpass.c 1.1 90/04/28 SMI"; /* from UCB 5.4 3/7/86 */
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #ifdef _WIN32
 #include <io.h>
 #include <windows.h>

Modified: trunk/gssftp/ftp/glob.c
===================================================================
--- trunk/gssftp/ftp/glob.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/glob.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -39,6 +39,8 @@
  * C-shell glob for random programs.
  */
 
+#include <autoconf.h>
+
 #include <sys/stat.h>
 
 #include <errno.h>

Modified: trunk/gssftp/ftp/main.c
===================================================================
--- trunk/gssftp/ftp/main.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/main.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -41,6 +41,8 @@
 static char sccsid[] = "@(#)main.c	5.18 (Berkeley) 3/1/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 /*
  * FTP User Program -- Command Interface.
  */

Modified: trunk/gssftp/ftp/pclose.c
===================================================================
--- trunk/gssftp/ftp/pclose.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/pclose.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -8,6 +8,8 @@
 static	char sccsid[] = "@(#)pclose.c 1.1 90/04/28 SMI"; /* from UCB 1.2 3/7/86 */
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 #ifdef HAVE_STDLIB_H
 #include <stdlib.h>

Modified: trunk/gssftp/ftp/radix.c
===================================================================
--- trunk/gssftp/ftp/radix.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/radix.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,3 +1,5 @@
+#include <autoconf.h>
+
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>

Modified: trunk/gssftp/ftp/ruserpass.c
===================================================================
--- trunk/gssftp/ftp/ruserpass.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/ruserpass.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -35,6 +35,8 @@
 static char sccsid[] = "@(#)ruserpass.c	5.3 (Berkeley) 3/1/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <string.h>

Modified: trunk/gssftp/ftp/secure.c
===================================================================
--- trunk/gssftp/ftp/secure.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftp/secure.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -3,7 +3,7 @@
  * secure read(), write(), getc(), and putc().
  * Only one security context, thus only work on one fd at a time!
  */
-#include "autoconf.h"
+#include <autoconf.h>
 
 #ifdef GSSAPI
 #include <gssapi/gssapi.h>
@@ -11,7 +11,7 @@
 extern gss_ctx_id_t gcontext;
 #endif /* GSSAPI */
 
-#include <secure.h>	/* stuff which is specific to client or server */
+#include "secure.h"	/* stuff which is specific to client or server */
 
 #ifdef _WIN32
 #undef ERROR

Modified: trunk/gssftp/ftpd/Makefile.in
===================================================================
--- trunk/gssftp/ftpd/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,18 +1,12 @@
-thisconfigdir=./..
-myfulldir=appl/gssftp/ftpd
-mydir=ftpd
-BUILDTOP=$(REL)..$(S)..$(S)..
-#
-# appl/gssftp/ftpd/Makefile.in
-#
+mydir=gssftp/ftpd
+BUILDTOP=$(REL)..$(S)..
+
 DEFINES = -DGSSAPI -DFTP_BUFSIZ=10240 #-DNOCONFIDENTIAL
 PROG_LIBPATH=-L$(TOPLIBD)
 PROG_RPATH=$(KRB5_LIBDIR)
 
-SETENVSRC=@SETENVSRC@
 SETENVOBJ=@SETENVOBJ@
-LIBOBJS=@LIBOBJS@
-COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a
+GETDOBJ=@GETDOBJ@
 FTPD_LIBS=@FTPD_LIBS@
 
 SRCS	= $(srcdir)/ftpd.c ftpcmd.c $(srcdir)/popen.c \
@@ -20,17 +14,18 @@
 	  $(srcdir)/../ftp/glob.c \
 	  $(srcdir)/../ftp/radix.c \
 	  $(srcdir)/../ftp/secure.c \
-	  $(srcdir)/../../bsd/getdtablesize.c $(SETENVSRC)
+	  $(srcdir)/../../bsd/getdtablesize.c \
+	  $(srcdir)/../../bsd/setenv.c
 
 OBJS	= ftpd.o ftpcmd.o glob.o popen.o vers.o radix.o \
-	  secure.o $(LIBOBJS) $(SETENVOBJ)
+	  secure.o $(GETDOBJ) $(SETENVOBJ)
 
 LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)
 
 all::	ftpd
 
-ftpd:	$(OBJS) $(PTY_DEPLIB) $(GSS_DEPLIBS) $(KRB5_BASE_DEPLIBS)
-	$(CC_LINK) -o $@ $(OBJS) $(FTPD_LIBS) $(PTY_LIB) $(UTIL_LIB) $(GSS_LIBS) $(KRB5_BASE_LIBS)
+ftpd:	$(OBJS) $(PTY_DEPLIB)
+	$(CC_LINK) -o $@ $(OBJS) $(FTPD_LIBS) $(PTY_LIB) $(UTIL_LIB) $(GSS_LIBS) $(LIBS)
 
 generate-files-mac: ftpcmd.c
 
@@ -66,7 +61,6 @@
 setenv.o: $(srcdir)/../../bsd/setenv.c
 	$(CC) -c $(ALL_CFLAGS) $(srcdir)/../../bsd/setenv.c
 
-
 ftpd.o: $(srcdir)/pathnames.h
 secure.o: $(srcdir)/secure.h
 

Modified: trunk/gssftp/ftpd/deps
===================================================================
--- trunk/gssftp/ftpd/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,29 +1,27 @@
 # 
 # Generated makefile dependencies follow.
 #
-$(OUTPRE)ftpd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_ext.h \
-  $(BUILDTOP)/include/gssapi/gssapi_generic.h $(BUILDTOP)/include/gssapi/gssapi_krb5.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/k5-util.h $(SRCTOP)/include/krb5.h \
-  $(SRCTOP)/include/port-sockets.h $(srcdir)/../arpa/ftp.h \
-  $(srcdir)/../arpa/telnet.h ftpd.c ftpd_var.h pathnames.h \
-  secure.h
-$(OUTPRE)ftpcmd.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
-  $(BUILDTOP)/include/gssapi/gssapi_generic.h $(SRCTOP)/include/k5-buf.h \
+$(OUTPRE)ftpd.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/k5-util.h $(SRCTOP)/libpty/libpty.h $(SRCTOP)/port-sockets.h \
   $(srcdir)/../arpa/ftp.h $(srcdir)/../arpa/telnet.h \
-  ftpcmd.c ftpd_var.h
-$(OUTPRE)popen.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
-  $(BUILDTOP)/include/gssapi/gssapi_generic.h ftpd_var.h \
+  /me/base/include/com_err.h /me/base/include/gssapi/gssapi.h \
+  /me/base/include/gssapi/gssapi_ext.h /me/base/include/gssapi/gssapi_generic.h \
+  /me/base/include/gssapi/gssapi_krb5.h /me/base/include/krb5.h \
+  /me/base/include/krb5/krb5.h ftpd.c ftpd_var.h pathnames.h \
+  secure.h
+$(OUTPRE)ftpcmd.$(OBJEXT): $(srcdir)/../arpa/ftp.h \
+  $(srcdir)/../arpa/telnet.h /me/base/include/gssapi/gssapi.h \
+  /me/base/include/gssapi/gssapi_generic.h ftpcmd.c ftpd_var.h
+$(OUTPRE)popen.$(OBJEXT): /me/base/include/gssapi/gssapi.h \
+  /me/base/include/gssapi/gssapi_generic.h ftpd_var.h \
   popen.c
 $(OUTPRE)vers.$(OBJEXT): vers.c
-$(OUTPRE)glob.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+$(OUTPRE)glob.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
   $(srcdir)/../ftp/ftp_var.h $(srcdir)/../ftp/glob.c
 $(OUTPRE)radix.$(OBJEXT): $(srcdir)/../ftp/ftp_var.h \
   $(srcdir)/../ftp/radix.c
-$(OUTPRE)secure.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_generic.h \
-  $(srcdir)/../arpa/ftp.h $(srcdir)/../ftp/secure.c secure.h
-$(OUTPRE)getdtablesize.$(OBJEXT): $(srcdir)/../../bsd/getdtablesize.c
+$(OUTPRE)secure.$(OBJEXT): $(BUILDTOP)/autoconf.h $(srcdir)/../arpa/ftp.h \
+  $(srcdir)/../ftp/secure.c $(srcdir)/../ftp/secure.h \
+  /me/base/include/gssapi/gssapi.h /me/base/include/gssapi/gssapi_generic.h
+$(OUTPRE)getdtablesize.$(OBJEXT): $(SRCTOP)/bsd/getdtablesize.c
+$(OUTPRE)setenv.$(OBJEXT): $(SRCTOP)/bsd/setenv.c

Modified: trunk/gssftp/ftpd/ftpcmd.y
===================================================================
--- trunk/gssftp/ftpd/ftpcmd.y	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/ftpcmd.y	2009-07-08 21:22:07 UTC (rev 3250)
@@ -45,6 +45,8 @@
 static char sccsid[] = "@(#)ftpcmd.y	5.24 (Berkeley) 2/25/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+#include <k5-platform.h>
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -66,7 +68,6 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
-#include <k5-buf.h>
 
 #include "ftpd_var.h"
 
@@ -1443,7 +1444,6 @@
 	if (s == 0) {
 		register int i, j, w;
 		int columns, lines;
-		struct k5buf buf;
 
 		lreply(214, "The following %scommands are recognized %s.",
 		    ftype, "(* =>'s unimplemented)");
@@ -1452,18 +1452,17 @@
 			columns = 1;
 		lines = (NCMDS + columns - 1) / columns;
 		for (i = 0; i < lines; i++) {
-			krb5int_buf_init_fixed(&buf, str, sizeof(str));
-			krb5int_buf_add(&buf, "   ");
+			strlcpy(str, "   ", sizeof(str));
 			for (j = 0; j < columns; j++) {
 				c = ctab + j * lines + i;
-				krb5int_buf_add_fmt(&buf, "%s%c", c->name,
-						    c->implemented ? ' '
-						    : '*');
+				strlcat(str, c->name, sizeof(str));
+				strlcat(str, c->implemented ? " " : "*",
+					sizeof(str));
 				if (c + lines >= &ctab[NCMDS])
 					break;
 				w = strlen(c->name) + 1;
 				while (w < width) {
-					krb5int_buf_add(&buf, " ");
+					strlcat(str, " ", sizeof(str));
 					w++;
 				}
 			}

Modified: trunk/gssftp/ftpd/ftpd.c
===================================================================
--- trunk/gssftp/ftpd/ftpd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/ftpd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -41,6 +41,8 @@
 static char sccsid[] = "@(#)ftpd.c	5.40 (Berkeley) 7/2/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 /*
  * FTP server.
  */
@@ -1928,7 +1930,7 @@
 					stripdomain, always_ip, &rhost_sane);
 	if (retval) {
 		fprintf(stderr, "make_sane_hostname: %s\n",
-			error_message(retval));
+			pty_error_message(retval));
 		exit(1);
 	}
 #ifdef SETPROCTITLE

Modified: trunk/gssftp/ftpd/logwtmp.c
===================================================================
--- trunk/gssftp/ftpd/logwtmp.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/logwtmp.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -36,6 +36,8 @@
 static char sccsid[] = "@(#)logwtmp.c	5.7 (Berkeley) 2/25/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/stat.h>

Modified: trunk/gssftp/ftpd/popen.c
===================================================================
--- trunk/gssftp/ftpd/popen.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/gssftp/ftpd/popen.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -39,6 +39,8 @@
 static char sccsid[] = "@(#)popen.c	5.9 (Berkeley) 2/25/91";
 #endif /* not lint */
 
+#include <autoconf.h>
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>

Added: trunk/install-sh
===================================================================
--- trunk/install-sh	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/install-sh	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,295 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2003-09-24.23
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=
+transform_arg=
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+
+usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
+   or: $0 -d DIR1 DIR2...
+
+In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
+In the second, create the directory path DIR.
+
+Options:
+-b=TRANSFORMBASENAME
+-c         copy source (using $cpprog) instead of moving (using $mvprog).
+-d         create directories instead of installing files.
+-g GROUP   $chgrp installed files to GROUP.
+-m MODE    $chmod installed files to MODE.
+-o USER    $chown installed files to USER.
+-s         strip installed files (using $stripprog).
+-t=TRANSFORM
+--help     display this help and exit.
+--version  display version info and exit.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+  case $1 in
+    -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+        shift
+        continue;;
+
+    -c) instcmd=$cpprog
+        shift
+        continue;;
+
+    -d) dir_arg=true
+        shift
+        continue;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift
+        shift
+        continue;;
+
+    --help) echo "$usage"; exit 0;;
+
+    -m) chmodcmd="$chmodprog $2"
+        shift
+        shift
+        continue;;
+
+    -o) chowncmd="$chownprog $2"
+        shift
+        shift
+        continue;;
+
+    -s) stripcmd=$stripprog
+        shift
+        continue;;
+
+    -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+        shift
+        continue;;
+
+    --version) echo "$0 $scriptversion"; exit 0;;
+
+    *)  if test -z "$src"; then
+          src=$1
+        else
+          # this colon is to work around a 386BSD /bin/sh bug
+          :
+          dst=$1
+        fi
+        shift
+        continue;;
+  esac
+done
+
+if test -z "$src"; then
+  echo "$0: no input file specified." >&2
+  exit 1
+fi
+
+# Protect names starting with `-'.
+case $src in
+  -*) src=./$src ;;
+esac
+
+if test -n "$dir_arg"; then
+  dst=$src
+  src=
+
+  if test -d "$dst"; then
+    instcmd=:
+    chmodcmd=
+  else
+    instcmd=$mkdirprog
+  fi
+else
+  # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+  # might cause directories to be created, which would be especially bad
+  # if $src (and thus $dsttmp) contains '*'.
+  if test ! -f "$src" && test ! -d "$src"; then
+    echo "$0: $src does not exist." >&2
+    exit 1
+  fi
+
+  if test -z "$dst"; then
+    echo "$0: no destination specified." >&2
+    exit 1
+  fi
+
+  # Protect names starting with `-'.
+  case $dst in
+    -*) dst=./$dst ;;
+  esac
+
+  # If destination is a directory, append the input filename; won't work
+  # if double slashes aren't ignored.
+  if test -d "$dst"; then
+    dst=$dst/`basename "$src"`
+  fi
+fi
+
+# This sed command emulates the dirname command.
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+
+# Skip lots of stat calls in the usual case.
+if test ! -d "$dstdir"; then
+  defaultIFS='
+	'
+  IFS="${IFS-$defaultIFS}"
+
+  oIFS=$IFS
+  # Some sh's can't handle IFS=/ for some reason.
+  IFS='%'
+  set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+  IFS=$oIFS
+
+  pathcomp=
+
+  while test $# -ne 0 ; do
+    pathcomp=$pathcomp$1
+    shift
+    test -d "$pathcomp" || $mkdirprog "$pathcomp"
+    pathcomp=$pathcomp/
+  done
+fi
+
+if test -n "$dir_arg"; then
+  $doit $instcmd "$dst" \
+    && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+    && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+    && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+    && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+else
+  # If we're going to rename the final executable, determine the name now.
+  if test -z "$transformarg"; then
+    dstfile=`basename "$dst"`
+  else
+    dstfile=`basename "$dst" $transformbasename \
+             | sed $transformarg`$transformbasename
+  fi
+
+  # don't allow the sed command to completely eliminate the filename.
+  test -z "$dstfile" && dstfile=`basename "$dst"`
+
+  # Make a couple of temp file names in the proper directory.
+  dsttmp=$dstdir/_inst.$$_
+  rmtmp=$dstdir/_rm.$$_
+
+  # Trap to clean up those temp files at exit.
+  trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Move or copy the file name to the temp name
+  $doit $instcmd "$src" "$dsttmp" &&
+
+  # and set any options; do chmod last to preserve setuid bits.
+  #
+  # If any of these fail, we abort the whole thing.  If we want to
+  # ignore errors from any of these, just make sure not to ignore
+  # errors from the above "$doit $instcmd $src $dsttmp" command.
+  #
+  { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+    && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+    && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+    && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+  # Now remove or move aside any old file at destination location.  We
+  # try this two ways since rm can't unlink itself on some systems and
+  # the destination file might be busy for other reasons.  In this case,
+  # the final cleanup might fail but the new file should still install
+  # successfully.
+  {
+    if test -f "$dstdir/$dstfile"; then
+      $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+      || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+      || {
+	  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+	  (exit 1); exit
+      }
+    else
+      :
+    fi
+  } &&
+
+  # Now rename the file to the real destination.
+  $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:


Added: trunk/k5-platform.h
===================================================================
--- trunk/k5-platform.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/k5-platform.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,104 @@
+/*
+ * k5-platform.h
+ *
+ * Copyright 2003, 2004, 2005, 2007, 2008, 2009 Massachusetts Institute of Technology.
+ * All Rights Reserved.
+ *
+ * Export of this software from the United States of America may
+ *   require a specific license from the United States Government.
+ *   It is the responsibility of any person or organization contemplating
+ *   export to obtain such a license before exporting.
+ * 
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
+ * distribute this software and its documentation for any purpose and
+ * without fee is hereby granted, provided that the above copyright
+ * notice appear in all copies and that both that copyright notice and
+ * this permission notice appear in supporting documentation, and that
+ * the name of M.I.T. not be used in advertising or publicity pertaining
+ * to distribution of the software without specific, written prior
+ * permission.	Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
+ * this software for any purpose.  It is provided "as is" without express
+ * or implied warranty.
+ * 
+ *
+ * Some platform-dependent definitions to sync up the C support level.
+ * Some to a C99-ish level, some related utility code.
+ *
+ * Currently:
+ * + strlcpy, strlcat
+ * + [v]asprintf
+ * + detecting snprintf overflows
+ */
+
+#ifndef K5_PLATFORM_H
+#define K5_PLATFORM_H
+
+#include "autoconf.h"
+#include <string.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+
+/* Provide strlcpy/strlcat interfaces. */
+#ifndef HAVE_STRLCPY
+#define strlcpy krb5int_strlcpy
+#define strlcat krb5int_strlcat
+extern size_t krb5int_strlcpy(char *dst, const char *src, size_t siz);
+extern size_t krb5int_strlcat(char *dst, const char *src, size_t siz);
+#endif
+
+#ifndef HAVE_VASPRINTF
+
+extern int krb5int_vasprintf(char **, const char *, va_list)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+    __attribute__((__format__(__printf__, 2, 0)))
+#endif
+    ;
+extern int krb5int_asprintf(char **, const char *, ...)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+    __attribute__((__format__(__printf__, 2, 3)))
+#endif
+    ;
+
+#define vasprintf krb5int_vasprintf
+/* Assume HAVE_ASPRINTF iff HAVE_VASPRINTF.  */
+#define asprintf krb5int_asprintf
+
+#elif defined(NEED_VASPRINTF_PROTO)
+
+extern int vasprintf(char **, const char *, va_list)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+    __attribute__((__format__(__printf__, 2, 0)))
+#endif
+    ;
+extern int asprintf(char **, const char *, ...)
+#if !defined(__cplusplus) && (__GNUC__ > 2)
+    __attribute__((__format__(__printf__, 2, 3)))
+#endif
+    ;
+
+#endif /* have vasprintf and prototype? */
+
+/* Return true if the snprintf return value RESULT reflects a buffer
+   overflow for the buffer size SIZE.
+
+   We cast the result to unsigned int for two reasons.  First, old
+   implementations of snprintf (such as the one in Solaris 9 and
+   prior) return -1 on a buffer overflow.  Casting the result to -1
+   will convert that value to UINT_MAX, which should compare larger
+   than any reasonable buffer size.  Second, comparing signed and
+   unsigned integers will generate warnings with some compilers, and
+   can have unpredictable results, particularly when the relative
+   widths of the types is not known (size_t may be the same width as
+   int or larger).
+*/
+#define SNPRINTF_OVERFLOW(result, size) \
+    ((unsigned int)(result) >= (size_t)(size))
+
+#endif /* K5_PLATFORM_H */

Added: trunk/k5-util.h
===================================================================
--- trunk/k5-util.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/k5-util.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 1989-1998,2002 by the Massachusetts Institute of Technology,
+ * Cambridge, MA, USA.  All Rights Reserved.
+ * 
+ * This software is being provided to you, the LICENSEE, by the 
+ * Massachusetts Institute of Technology (M.I.T.) under the following 
+ * license.  By obtaining, using and/or copying this software, you agree 
+ * that you have read, understood, and will comply with these terms and 
+ * conditions:  
+ * 
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ * 
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute 
+ * this software and its documentation for any purpose and without fee or 
+ * royalty is hereby granted, provided that you agree to comply with the 
+ * following copyright notice and statements, including the disclaimer, and 
+ * that the same appear on ALL copies of the software and documentation, 
+ * including modifications that you make for internal use or for 
+ * distribution:
+ * 
+ * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS 
+ * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not 
+ * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF 
+ * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF 
+ * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY 
+ * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.   
+ * 
+ * The name of the Massachusetts Institute of Technology or M.I.T. may NOT 
+ * be used in advertising or publicity pertaining to distribution of the 
+ * software.  Title to copyright in this software and any associated 
+ * documentation shall at all times remain with M.I.T., and USER agrees to 
+ * preserve same.
+ *
+ * Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.  
+ */
+
+/*
+ * "internal" utility functions used by various applications.
+ * They live in libkrb5util.
+ */
+
+#include "autoconf.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <errno.h>
+
+#ifndef krb5_seteuid
+
+#if defined(HAVE_SETEUID)
+#  define krb5_seteuid(EUID)	(seteuid((uid_t)(EUID)))
+#elif defined(HAVE_SETRESUID)
+#  define krb5_seteuid(EUID)	setresuid(getuid(), (uid_t)(EUID), geteuid())
+#elif defined(HAVE_SETREUID)
+#  define krb5_seteuid(EUID)	setreuid(geteuid(), (uid_t)(EUID))
+#else
+   /* You need to add a case to deal with this operating system.*/
+#  define krb5_seteuid(EUID)	(errno = EPERM, -1)
+#endif
+
+#ifdef HAVE_SETEGID
+#  define krb5_setegid(EGID)	(setegid((gid_t)(EGID)))
+#elif defined(HAVE_SETRESGID)
+#  define krb5_setegid(EGID)	(setresgid(getgid(), (gid_t)(EGID), getegid()))
+#elif defined(HAVE_SETREGID)
+#  define krb5_setegid(EGID)	(setregid(getegid(), (gid_t)(EGID)))
+#else
+   /* You need to add a case to deal with this operating system.*/
+#  define krb5_setegid(EGID)	(errno = EPERM, -1)
+#endif
+
+#endif

Modified: trunk/libpty/Makefile.in
===================================================================
--- trunk/libpty/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/libpty/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,112 +1,34 @@
-thisconfigdir=.
-myfulldir=appl/libpty
-mydir=.
-BUILDTOP=$(REL)..$(S)..
-RELDIR=../appl/libpty
+mydir=libpty
+BUILDTOP=$(REL)..
 
-SED = sed
+OBJS= cleanup.o getpty.o init_slave.o open_ctty.o open_slave.o \
+	update_utmp.o update_wtmp.o vhangup.o void_assoc.o \
+	logwtmp.o init.o err.o sane_hostname.o
 
-KRB5_RUN_ENV= @KRB5_RUN_ENV@
-PROG_LIBPATH=-L$(TOPLIBD)
-PROG_RPATH=$(KRB5_LIBDIR)
-
-LIBBASE=pty
-LIBMAJOR=1
-LIBMINOR=2
-
-STLIBOBJS= cleanup.o getpty.o init_slave.o open_ctty.o open_slave.o \
-	update_utmp.o update_wtmp.o vhangup.o void_assoc.o pty_err.o \
-	logwtmp.o init.o sane_hostname.o
-
-STOBJLISTS=OBJS.ST
-
-INSTALLFILE = cp
-
-# for pty-int.h
-LOCALINCLUDES=-I. -I$(srcdir)
-
-FILES= Makefile cleanup.c getpty.c init_slave.c open_ctty.c open_slave.c update_utmp.c update_wtmp.c vhangup.c void_assoc.c pty_err.h pty_err.c\
-logwtmp.c init.c
-
-CFILES=$(srcdir)/cleanup.c $(srcdir)/getpty.c $(srcdir)/init_slave.c \
+SRCS=$(srcdir)/cleanup.c $(srcdir)/getpty.c $(srcdir)/init_slave.c \
 	$(srcdir)/open_ctty.c $(srcdir)/open_slave.c \
 	$(srcdir)/update_utmp.c $(srcdir)/update_wtmp.c $(srcdir)/vhangup.c \
 	$(srcdir)/void_assoc.c $(srcdir)/logwtmp.c \
-	$(srcdir)/init.c $(srcdir)/sane_hostname.c
+	$(srcdir)/init.c $(srcdir)/err.c $(srcdir)/sane_hostname.c
 
+all:: libpty.a
 
-SRCS=pty_err.c $(CFILES)
-SHLIB_EXPDEPS = \
-	$(COM_ERR_DEPLIB)
-SHLIB_EXPLIBS= -lcom_err 
-SHLIB_DIRS=-L$(TOPLIBD)
-SHLIB_RDIRS=$(KRB5_LIBDIR)
-
-DEPLIBS=
-
-#
-all-unix:: includes pty_err.h
-
-all-unix:: all-liblinks
-
 dump-utmp: dump-utmp.o
-	$(CC) $(LDFLAGS) -o dump-utmp dump-utmp.o
+	$(CC_LINK) -o dump-utmp dump-utmp.o
 dump-utmp.o: dump-utmp.c
 
 pty_paranoia: pty_paranoia.o $(COM_ERR_DEPLIB) $(PTY_DEPLIB)
-	$(CC_LINK) -o pty_paranoia pty_paranoia.o $(PTY_LIB) $(COM_ERR_LIB) $(LIBS)
+	$(CC_LINK) -o pty_paranoia pty_paranoia.o $(PTY_LIB) $(LIBS)
 
 check-paranoia: pty_paranoia
-	$(KRB5_RUN_ENV) $(VALGRIND) ./pty_paranoia
+	$(VALGRIND) ./pty_paranoia
 
 install-unix:: install-libs
 
-clean-unix::
-	$(RM) libpty.a $(BUILDTOP)/include/libpty.h pty_err.c pty_err.h
-clean-unix:: clean-liblinks clean-libs clean-libobjs
+clean::
+	$(RM) libpty.a
 
-depend::  pty_err.h
-
-#install:: libpty.h
-#	$(INSTALL_DATA) $(srcdir)/libpty.h  $(DESTDIR)$(KRB5_INCDIR)/libpty.h
-
-includes:: libpty.h
-	if cmp $(srcdir)/libpty.h \
-	$(BUILDTOP)/include/libpty.h >/dev/null 2>&1; then :; \
-	else \
-		(set -x; $(RM) $(BUILDTOP)/include/libpty.h; \
-		 $(CP) $(srcdir)/libpty.h \
-			$(BUILDTOP)/include/libpty.h) ; \
-	fi
-
-includes:: $(BUILDTOP)/include/autoconf.h
-
-clean-unix::
-	$(RM) $(BUILDTOP)/include/libpty.h
-
-
-
-clean-unix:: clean-liblinks clean-libs clean-libobjs clean-files
-
-clean-files::
-	rm -f *~ \#* *.bak \
-		*.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
-		*.cp *.fn *.ky *.log *.pg *.tp *.vr \
-		*.o profiled/?*.o libcom_err.a libcom_err_p.a \
-		com_err.o compile_et \
-		et.ar TAGS y.tab.c lex.yy.c error_table.c \
-		et_lex.lex.c \
-		test1.h test1.c test2.h test2.c test_et \
-		eddep makedep *.ln
-
-pty_err.o: pty_err.c
-pty_err.h: pty_err.et
-pty_err.c: pty_err.et
-
-$(BUILDTOP)/include/autoconf.h: $(SRCTOP)/include/autoconf.h.in
-	(cd $(BUILDTOP)/include; $(MAKE) autoconf.h)
-
- at libpriv_frag@
- at lib_frag@
- at libobj_frag@
-
+libpty.a: $(OBJS)
+	$(RM) $@
+	$(AR) cq $@ $(OBJS)
+	$(RANLIB) $@

Modified: trunk/libpty/deps
===================================================================
--- trunk/libpty/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/libpty/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,45 +1,40 @@
 # 
 # Generated makefile dependencies follow.
 #
-pty_err.so pty_err.po $(OUTPRE)pty_err.$(OBJEXT): $(COM_ERR_DEPS) \
-  pty_err.c
-cleanup.so cleanup.po $(OUTPRE)cleanup.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h cleanup.c \
-  libpty.h pty-int.h pty_err.h
-getpty.so getpty.po $(OUTPRE)getpty.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h getpty.c libpty.h \
-  pty-int.h pty_err.h
-init_slave.so init_slave.po $(OUTPRE)init_slave.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h \
-  init_slave.c libpty.h pty-int.h pty_err.h
-open_ctty.so open_ctty.po $(OUTPRE)open_ctty.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h \
-  libpty.h open_ctty.c pty-int.h pty_err.h
-open_slave.so open_slave.po $(OUTPRE)open_slave.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h \
-  libpty.h open_slave.c pty-int.h pty_err.h
-update_utmp.so update_utmp.po $(OUTPRE)update_utmp.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/port-sockets.h \
-  libpty.h pty-int.h pty_err.h update_utmp.c
-update_wtmp.so update_wtmp.po $(OUTPRE)update_wtmp.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h \
-  libpty.h pty-int.h pty_err.h update_wtmp.c
-vhangup.so vhangup.po $(OUTPRE)vhangup.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h libpty.h \
-  pty-int.h pty_err.h vhangup.c
-void_assoc.so void_assoc.po $(OUTPRE)void_assoc.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h \
-  libpty.h pty-int.h pty_err.h void_assoc.c
-logwtmp.so logwtmp.po $(OUTPRE)logwtmp.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h libpty.h \
-  logwtmp.c pty-int.h pty_err.h
-init.so init.po $(OUTPRE)init.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/port-sockets.h init.c \
-  libpty.h pty-int.h pty_err.h
-sane_hostname.so sane_hostname.po $(OUTPRE)sane_hostname.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  libpty.h pty-int.h pty_err.h sane_hostname.c
+$(OUTPRE)pty_err.$(OBJEXT): pty_err.c
+$(OUTPRE)cleanup.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h cleanup.c libpty.h pty-int.h \
+  pty_err.h
+$(OUTPRE)getpty.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h getpty.c libpty.h pty-int.h \
+  pty_err.h
+$(OUTPRE)init_slave.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h init_slave.c libpty.h pty-int.h \
+  pty_err.h
+$(OUTPRE)open_ctty.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h open_ctty.c pty-int.h \
+  pty_err.h
+$(OUTPRE)open_slave.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h open_slave.c pty-int.h \
+  pty_err.h
+$(OUTPRE)update_utmp.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h libpty.h \
+  pty-int.h pty_err.h update_utmp.c
+$(OUTPRE)update_wtmp.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h pty-int.h pty_err.h \
+  update_wtmp.c
+$(OUTPRE)vhangup.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h pty-int.h pty_err.h \
+  vhangup.c
+$(OUTPRE)void_assoc.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h pty-int.h pty_err.h \
+  void_assoc.c
+$(OUTPRE)logwtmp.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/port-sockets.h libpty.h logwtmp.c pty-int.h \
+  pty_err.h
+$(OUTPRE)init.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/port-sockets.h \
+  init.c libpty.h pty-int.h pty_err.h
+$(OUTPRE)sane_hostname.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h libpty.h pty-int.h pty_err.h \
+  sane_hostname.c

Modified: trunk/libpty/init.c
===================================================================
--- trunk/libpty/init.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/libpty/init.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,7 +1,7 @@
 /*
  * pty_init: Initialize internal state of pty.
  * 
- * Currently initializes error tables.
+ * Currently does nothing.
  * 
  * Copyright 1995 by the Massachusetts Institute of Technology.
  *
@@ -28,6 +28,5 @@
 
 long pty_init(void)
 {
-    initialize_pty_error_table();
     return 0;
 }

Modified: trunk/libpty/libpty.h
===================================================================
--- trunk/libpty/libpty.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/libpty/libpty.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -27,10 +27,25 @@
 #define PTY_USER_PROCESS 1
 #define PTY_DEAD_PROCESS 2
 
-/* flags to update_utmp*/
+/* Flags to update_utmp */
 #define PTY_TTYSLOT_USABLE (0x1)
 #define PTY_UTMP_USERNAME_VALID (0x2)
 
+/* Return codes */
+#define PTY_GETPTY_STREAMS 1
+#define PTY_GETPTY_FSTAT 2
+#define PTY_GETPTY_NOPTY 3
+#define PTY_GETPTY_SLAVE_TOOLONG 4
+#define PTY_OPEN_SLAVE_OPENFAIL 5
+#define PTY_OPEN_SLAVE_CHMODFAIL 6
+#define PTY_OPEN_SLAVE_NOCTTY 7
+#define PTY_OPEN_SLAVE_CHOWNFAIL 8
+#define PTY_OPEN_SLAVE_LINE_PUSHFAIL 9
+#define PTY_OPEN_SLAVE_PUSH_FAIL 10
+#define PTY_OPEN_SLAVE_REVOKEFAIL 11
+#define PTY_UPDATE_UTMP_PROCTYPE_INVALID 12
+#define PTY_OPEN_SLAVE_TOOSHORT 13
+
 long pty_init(void);
 long pty_getpty ( int *fd, char *slave, int slavelength);
 
@@ -50,5 +65,8 @@
 #endif
 
 long pty_make_sane_hostname(const struct sockaddr *, int, int, int, char **);
+
+const char *pty_error_message(long code);
+
 #define __LIBPTY_H__
 #endif

Modified: trunk/libpty/pty-int.h
===================================================================
--- trunk/libpty/pty-int.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/libpty/pty-int.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,6 +1,5 @@
 /* Includes needed by libpty*/
 #ifndef __PTY_INT_H__
-#include <pty_err.h>
 #include <sys/types.h>
 
 #if defined(_AIX) && defined(_THREAD_SAFE)

Deleted: trunk/libpty/pty_err.et

Added: trunk/mkinstalldirs
===================================================================
--- trunk/mkinstalldirs	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/mkinstalldirs	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,40 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+# $Id: mkinstalldirs 17354 2005-08-24 16:32:24Z epeisach $
+
+errstatus=0
+
+for file
+do
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+   shift
+
+   pathcomp=
+   for d
+   do
+     pathcomp="$pathcomp$d"
+     case "$pathcomp" in
+       -* ) pathcomp=./$pathcomp ;;
+     esac
+
+     if test ! -d "$pathcomp"; then
+        echo "mkdir $pathcomp"
+
+        mkdir "$pathcomp" || lasterr=$?
+
+        if test ! -d "$pathcomp"; then
+  	  errstatus=$lasterr
+        fi
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here


Added: trunk/move-if-changed
===================================================================
--- trunk/move-if-changed	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/move-if-changed	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Move file 1 to file 2 if they don't already match.
+# Good for "make depend" for example, where it'd be nice to keep the
+# old datestamp.
+if [ $# != 2 ]; then
+  echo 2>&1 usage: $0 newfile oldfilename
+  exit 1
+fi
+#
+if [ ! -r "$2" ]; then
+  exec mv -f "$1" "$2"
+fi
+if cmp "$1" "$2" >/dev/null; then
+  echo "$2 is unchanged"
+  exec rm -f "$1"
+fi
+exec mv -f "$1" "$2"


Added: trunk/port-sockets.h
===================================================================
--- trunk/port-sockets.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/port-sockets.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,161 @@
+#ifndef _PORT_SOCKET_H
+#define _PORT_SOCKET_H
+#if defined(_WIN32)
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+
+/* Some of our own infrastructure where the WinSock stuff was too hairy
+   to dump into a clean Unix program...  */
+
+typedef WSABUF sg_buf;
+
+#define SG_ADVANCE(SG, N) \
+	((SG)->len < (N)				\
+	 ? (abort(), 0)					\
+	 : ((SG)->buf += (N), (SG)->len -= (N), 0))
+
+#define SG_LEN(SG)		((SG)->len + 0)
+#define SG_BUF(SG)		((SG)->buf + 0)
+#define SG_SET(SG, B, N)	((SG)->buf = (char *)(B),(SG)->len = (N))
+
+#define SOCKET_INITIALIZE()     0
+#define SOCKET_CLEANUP()
+#define SOCKET_ERRNO            (WSAGetLastError())
+#define SOCKET_SET_ERRNO(x)     (WSASetLastError (x))
+#define SOCKET_NFDS(f)          (0)     /* select()'s first arg is ignored */
+#define SOCKET_READ(fd, b, l)   (recv(fd, b, l, 0))
+#define SOCKET_WRITE(fd, b, l)  (send(fd, b, l, 0))
+#define SOCKET_CONNECT		connect	/* XXX */
+#define SOCKET_GETSOCKNAME	getsockname /* XXX */
+#define SOCKET_CLOSE		close /* XXX */
+#define SOCKET_EINTR            WSAEINTR
+
+/* Return -1 for error or number of bytes written.
+   TMP is a temporary variable; must be declared by the caller, and
+   must be used by this macro (to avoid compiler warnings).  */
+/* WSASend returns 0 or SOCKET_ERROR.  */
+#define SOCKET_WRITEV_TEMP DWORD
+#define SOCKET_WRITEV(FD, SG, LEN, TMP)	\
+	(WSASend((FD), (SG), (LEN), &(TMP), 0, 0, 0) ? -1 : (TMP))
+
+#define SHUTDOWN_READ	SD_RECEIVE
+#define SHUTDOWN_WRITE	SD_SEND
+#define SHUTDOWN_BOTH	SD_BOTH
+
+#ifndef EINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#endif
+#ifndef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+#ifndef ECONNRESET
+#define ECONNRESET  WSAECONNRESET
+#endif
+#ifndef ECONNABORTED
+#define ECONNABORTED WSAECONNABORTED
+#endif
+#ifndef ECONNREFUSED
+#define ECONNREFUSED WSAECONNREFUSED
+#endif
+#ifndef EHOSTUNREACH
+#define EHOSTUNREACH WSAEHOSTUNREACH
+#endif
+#ifndef ETIMEDOUT
+#define ETIMEDOUT WSAETIMEDOUT
+#endif
+
+#elif defined(__palmos__)
+
+/* If this source file requires it, define struct sockaddr_in
+   (and possibly other things related to network I/O).  */
+
+#include "autoconf.h"
+#include <netdb.h>
+typedef int socklen_t;
+
+#else /* UNIX variants */
+
+#include "autoconf.h"
+
+#include <sys/types.h>
+#include <netinet/in.h>		/* For struct sockaddr_in and in_addr */
+#include <arpa/inet.h>		/* For inet_ntoa */
+#include <netdb.h>
+
+#include <sys/param.h>		/* For MAXHOSTNAMELEN */
+#include <sys/socket.h>		/* For SOCK_*, AF_*, etc */
+#include <sys/time.h>		/* For struct timeval */
+#include <net/if.h>		/* For struct ifconf, for localaddr.c */
+#ifdef HAVE_SYS_UIO_H
+#include <sys/uio.h>		/* For struct iovec, for sg_buf */
+#endif
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>		/* For FIONBIO on Solaris.  */
+#endif
+
+/* Either size_t or int or unsigned int is probably right.  Under
+   SunOS 4, it looks like int is desired, according to the accept man
+   page.  */
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
+/* XXX should only be done if sockaddr_storage not found */
+#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
+struct krb5int_sockaddr_storage {
+    struct sockaddr_in s;
+    /* Plenty of slop just in case we get an ipv6 address anyways.  */
+    long extra[16];
+};
+#define sockaddr_storage krb5int_sockaddr_storage
+#endif
+
+/*
+ * Compatability with WinSock calls on MS-Windows...
+ */
+#define	SOCKET		int
+#define	INVALID_SOCKET	((SOCKET)~0)
+#define	closesocket	close
+#define	ioctlsocket	ioctl
+#define	SOCKET_ERROR	(-1)
+
+typedef struct iovec sg_buf;
+
+#define SG_ADVANCE(SG, N) \
+	((SG)->iov_len < (N)					\
+	 ? (abort(), 0)						\
+	 : ((SG)->iov_base = (char *) (SG)->iov_base + (N),	\
+	    (SG)->iov_len -= (N), 0))
+
+#define SG_LEN(SG)		((SG)->iov_len + 0)
+#define SG_BUF(SG)		((char*)(SG)->iov_base + 0)
+#define SG_SET(SG, B, L)	((SG)->iov_base = (char*)(B), (SG)->iov_len = (L))
+
+/* Some of our own infrastructure where the WinSock stuff was too hairy
+   to dump into a clean Unix program...  */
+
+#define	SOCKET_INITIALIZE()	(0)	/* No error (or anything else) */
+#define	SOCKET_CLEANUP()	/* nothing */
+#define	SOCKET_ERRNO		errno
+#define	SOCKET_SET_ERRNO(x)	(errno = (x))
+#define SOCKET_NFDS(f)		((f)+1)	/* select() arg for a single fd */
+#define SOCKET_READ		read
+#define SOCKET_WRITE		write
+#define SOCKET_CONNECT		connect
+#define SOCKET_GETSOCKNAME	getsockname
+#define SOCKET_CLOSE		close
+#define SOCKET_EINTR		EINTR
+#define SOCKET_WRITEV_TEMP int
+/* Use TMP to avoid compiler warnings and keep things consistent with
+   Windoze version.  */
+#define SOCKET_WRITEV(FD, SG, LEN, TMP) \
+	((TMP) = writev((FD), (SG), (LEN)), (TMP))
+
+#define SHUTDOWN_READ	0
+#define SHUTDOWN_WRITE	1
+#define SHUTDOWN_BOTH	2
+
+#endif /* _WIN32 */
+
+#endif /*_PORT_SOCKET_H*/

Added: trunk/post.in
===================================================================
--- trunk/post.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/post.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,182 @@
+############################################################
+## config/post.in
+##
+
+# in case there is no default target (very unlikely)
+all::
+
+check-windows::
+
+##############################
+# dependency generation
+#
+
+depend:: depend-postrecurse
+depend-postrecurse: depend-recurse
+depend-recurse: depend-prerecurse
+
+depend-prerecurse:
+depend-postrecurse:
+
+depend-postrecurse: depend-update-makefile
+
+ALL_DEP_SRCS= $(SRCS) $(EXTRADEPSRCS)
+
+# be sure to check ALL_DEP_SRCS against *what it would be if SRCS and
+# EXTRADEPSRCS are both empty*
+$(BUILDTOP)/.depend-verify-srcdir:
+	@if test "$(srcdir)" = "." ; then \
+		echo 1>&2 error: cannot build dependencies with srcdir=. ; \
+		echo 1>&2 "(can't distinguish generated files from source files)" ; \
+		exit 1 ; \
+	else \
+		if test -r $(BUILDTOP)/.depend-verify-srcdir; then :; \
+			else (set -x; touch $(BUILDTOP)/.depend-verify-srcdir); fi \
+	fi
+$(BUILDTOP)/.depend-verify-gcc: depend-verify-gcc- at HAVE_GCC@
+depend-verify-gcc-yes:
+	@if test -r $(BUILDTOP)/.depend-verify-gcc; then :; \
+		else (set -x; touch $(BUILDTOP)/.depend-verify-gcc); fi
+depend-verify-gcc-no:
+	@echo 1>&2 error: The '"depend"' rules are written for gcc.
+	@echo 1>&2 Please use gcc, or update the rules to handle your compiler.
+	@exit 1
+
+DEP_CFG_VERIFY = $(BUILDTOP)/.depend-verify-srcdir
+DEP_VERIFY = $(DEP_CFG_VERIFY) $(BUILDTOP)/.depend-verify-gcc
+
+.d: $(ALL_DEP_SRCS) $(DEP_CFG_VERIFY) depend-dependencies
+	if test "$(ALL_DEP_SRCS)" != " " ; then \
+		$(RM) .dtmp && $(MAKE) .dtmp && mv -f .dtmp .d ; \
+	else \
+		touch .d ; \
+	fi
+
+# These are dependencies of the depend target that do not get fed to
+# the compiler.  Examples include generated header files.
+depend-dependencies:
+
+# .dtmp must *always* be out of date so that $? can be used to perform
+# VPATH searches on the sources.
+#
+# NOTE: This will fail when using Make programs whose VPATH support is
+# broken.
+.dtmp: $(ALL_DEP_SRCS)
+	$(CC) -M -DDEPEND $(ALL_CFLAGS) $? > .dtmp
+
+# NOTE: This will also generate spurious $(OUTPRE) and $(OBJEXT)
+# references in rules for non-library objects in a directory where
+# library objects happen to be built.  It's mostly harmless.
+.depend: .d $(SRCTOP)/depfix.pl
+	x=`$(CC) -print-libgcc-file-name` ; \
+	perl $(SRCTOP)/depfix.pl \
+		'$(SRCTOP)' '$(mydir)' '$(srcdir)' '$(BUILDTOP)' "$$x" '$(STLIBOBJS)' \
+		< .d > .depend
+
+# Temporarily keep the rule for removing the dependency line eater
+# until we're sure we've gotten everything converted and excised the
+# old stuff from Makefile.in files.
+depend-update-makefile: .depend depend-recurse
+	if test -n "$(SRCS)" ; then \
+		$(CP) .depend $(srcdir)/deps.new ; \
+	else \
+		echo "# No dependencies here." > $(srcdir)/deps.new ; \
+	fi
+	$(SRCTOP)/move-if-changed $(srcdir)/deps.new $(srcdir)/deps
+	sed -e '/^# +++ Dependency line eater +++/,$$d' \
+		< $(srcdir)/Makefile.in > $(srcdir)/Makefile.in.new
+	$(SRCTOP)/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in
+
+DEPTARGETS = .depend .d .dtmp $(DEP_VERIFY)
+DEPTARGETS_CLEAN = .depend .d .dtmp $(DEPTARGETS_ at srcdir@)
+DEPTARGETS_ at top_srcdir@ = $(DEP_VERIFY)
+
+# Clear out dependencies.  Should only be used temporarily, e.g., while
+# moving or renaming headers and then rebuilding dependencies.
+undepend:: undepend-postrecurse
+undepend-recurse:
+undepend-postrecurse: undepend-recurse
+	if test -n "$(SRCS)" ; then \
+		sed -e '/^# +++ Dependency line eater +++/,$$d' \
+			< $(srcdir)/Makefile.in \
+			> $(srcdir)/Makefile.in.new ;\
+		echo "# +++ Dependency line eater +++" >> $(srcdir)/Makefile.in.new ;\
+		echo "# (dependencies temporarily removed)" >> $(srcdir)/Makefile.in.new ;\
+		$(SRCTOP)/move-if-changed $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in;\
+	else :; fi
+
+#
+# end dependency generation
+##############################
+
+clean::
+	$(RM) $(OBJS) $(DEPTARGETS_CLEAN) $(EXTRA_FILES) et-[ch]-*.et et-[ch]-*.[ch]
+	-$(RM) -r $(srcdir)/$(BUILDTOP)/autom4te.cache
+
+distclean-normal-clean:
+	$(MAKE) NORECURSE=true clean
+distclean-prerecurse: distclean-normal-clean
+distclean-nuke-configure-state:
+	$(RM) config.log config.cache config.status Makefile
+distclean-postrecurse: distclean-nuke-configure-state
+
+Makefiles-prerecurse: Makefile
+
+# thisconfigdir = relative path from this Makefile to config.status
+# mydir = relative path from config.status to this Makefile
+Makefile: $(srcdir)/Makefile.in $(srcdir)/deps $(BUILDTOP)/config.status \
+		$(SRCTOP)/pre.in $(SRCTOP)/post.in
+	cd $(BUILDTOP) && $(SHELL) config.status $(mydir)/Makefile
+$(BUILDTOP)/config.status: $(srcdir)/$(BUILDTOP)/configure
+	cd $(BUILDTOP) && $(SHELL) config.status --recheck
+# autom4te.cache supposedly improves performance with multiple runs, but
+# it breaks across versions, and around MIT we've got plenty of version
+# mixing.  So nuke it.
+$(top_srcdir)/configure: @MAINT@ \
+		$(top_srcdir)/configure.ac \
+		$(SRCTOP)/patchlevel.h \
+		$(SRCTOP)/aclocal.m4
+	-$(RM) -r $(srcdir)/$(BUILDTOP)/autom4te.cache
+	cd $(srcdir)/$(BUILDTOP) && $(AUTOCONF) $(AUTOCONFFLAGS)
+	-$(RM) -r $(srcdir)/$(BUILDTOP)/autom4te.cache
+
+RECURSE_TARGETS=all-recurse clean-recurse distclean-recurse install-recurse \
+	check-recurse depend-recurse undepend-recurse \
+	Makefiles-recurse install-headers-recurse
+
+# MY_SUBDIRS overrides any setting of SUBDIRS generated by the
+# configure script that generated this Makefile.  This is needed when
+# the configure script that produced this Makefile creates multiple
+# Makefiles in different directories; the setting of SUBDIRS will be
+# the same in each.
+#
+# LOCAL_SUBDIRS seems to account for the case where the configure
+# script doesn't call any other subsidiary configure scripts, but
+# generates multiple Makefiles.
+$(RECURSE_TARGETS):
+	@case "`echo 'x$(MFLAGS)'|sed -e 's/^x//' -e 's/ --.*$$//'`" \
+		in *[ik]*) e="status=1" ;; *) e="exit 1";; esac; \
+	do_subdirs="$(SUBDIRS)" ; \
+	status=0; \
+	if test -n "$$do_subdirs" && test -z "$(NORECURSE)"; then \
+	for i in $$do_subdirs ; do \
+		if test -d $$i && test -r $$i/Makefile ; then \
+		case $$i in .);; *) \
+			target=`echo $@|sed s/-recurse//`; \
+			echo "making $$target in $(CURRENT_DIR)$$i..."; \
+			if (cd $$i ; $(MAKE) \
+			    CURRENT_DIR=$(CURRENT_DIR)$$i/ $$target) then :; \
+			else eval $$e; fi; \
+			;; \
+		esac; \
+		else \
+			echo "Skipping missing directory $(CURRENT_DIR)$$i" ; \
+		fi; \
+	done; \
+	else :; \
+	fi;\
+	exit $$status
+
+##
+## end of post.in
+############################################################

Added: trunk/pre.in
===================================================================
--- trunk/pre.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/pre.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,236 @@
+############################################################
+## config/pre.in
+## common prefix for all Makefile.in in the Kerberos V5 tree.
+##
+
+# These are set per-directory by autoconf 2.52 and 2.53:
+#  srcdir=@srcdir@
+#  top_srcdir=@top_srcdir@
+# but these are only set by autoconf 2.53, and thus not useful to us on
+# Mac OS X yet (as of 10.2):
+#  abs_srcdir=@abs_srcdir@
+#  abs_top_srcdir=@abs_top_srcdir@
+#  builddir=@builddir@
+#  abs_builddir=@abs_builddir@
+#  top_builddir=@top_builddir@
+#  abs_top_builddir=@abs_top_builddir@
+# The "top" variables refer to the directory with the configure (or
+# config.status) script.
+
+SHELL=/bin/sh
+
+##############################
+# Recursion rule support
+#
+
+# The commands for the recursion targets live in config/post.in.
+#
+# General form of recursion rules:
+#
+# Each recursive target foo has related targets: foo-prerecurse,
+# foo-recurse, and foo-postrecurse
+#
+# The foo-recurse rule is in post.in.  It is what actually recursively
+# calls make.
+#
+# foo-recurse depends on foo-prerecurse, so any targets that must be
+# built before descending into subdirectories must be dependencies of
+# foo-prerecurse.
+#
+# foo-postrecurse depends on foo-recurse, but targets that must be
+# built after descending into subdirectories should be have
+# foo-recurse as dependencies in addition to being listed under
+# foo-postrecurse, to avoid ordering issues.
+#
+# The foo-prerecurse, foo-recurse, and foo-postrecurse rules are all
+# single-colon rules, to avoid nasty ordering problems with
+# double-colon rules.
+#
+# e.g.
+# all:: includes foo
+# foo:
+#	echo foo
+# includes::
+#	echo bar
+# includes::
+#	echo baz
+#
+# will result in "bar", "foo", "baz" on AIX, and possibly others.
+all:: all-postrecurse
+all-postrecurse: all-recurse
+all-recurse: all-prerecurse
+
+all-prerecurse:
+all-postrecurse:
+
+clean:: clean-postrecurse
+clean-postrecurse: clean-recurse
+clean-recurse: clean-prerecurse
+
+clean-prerecurse:
+clean-postrecurse:
+
+distclean: distclean-postrecurse
+distclean-postrecurse: distclean-recurse
+distclean-recurse: distclean-prerecurse
+
+distclean-prerecurse:
+distclean-postrecurse:
+
+install:: install-postrecurse
+install-postrecurse: install-recurse
+install-recurse: install-prerecurse
+
+install-prerecurse:
+install-postrecurse:
+
+install-headers:: install-headers-postrecurse
+install-headers-postrecurse: install-headers-recurse
+install-headers-recurse: install-headers-prerecurse
+
+install-headers-prerecurse:
+install-headers-postrecurse:
+
+check:: check-postrecurse
+check-postrecurse: check-recurse
+check-recurse: check-prerecurse
+
+check-prerecurse:
+check-postrecurse:
+
+Makefiles: Makefiles-postrecurse
+Makefiles-postrecurse: Makefiles-recurse
+Makefiles-recurse: Makefiles-prerecurse
+
+Makefiles-prerecurse:
+Makefiles-postrecurse:
+
+#
+# end recursion rule support
+##############################
+
+# Directory syntax:
+#
+# begin relative path
+REL=
+# this is magic... should only be used for preceding a program invocation
+C=./
+# "/" for UNIX, "\" for Windows; *sigh*
+S=/
+
+#
+srcdir = @srcdir@
+SRCTOP = @srcdir@/$(BUILDTOP)
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+CONFIG_RELTOPDIR = @CONFIG_RELTOPDIR@
+
+# top_srcdir for k5-platform.h etc.
+# top_srcdir/libpty for libpty.h
+# BUILDTOP for autoconf.h
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libpty -I$(BUILDTOP)
+
+# DEFINES	set by local Makefile.in
+# LOCALINCLUDES	set by local Makefile.in
+# CPPFLAGS	user override
+# CFLAGS	user override but starts off set by configure
+# WARN_CFLAGS	user override but starts off set by configure
+ALL_CFLAGS = $(DEFINES) $(KRB5_CFLAGS) $(LOCALINCLUDES) $(INCLUDES) \
+	$(CPPFLAGS) $(CFLAGS) $(WARN_CFLAGS)
+
+CFLAGS = @CFLAGS@
+CXXFLAGS = @CXXFLAGS@
+WARN_CFLAGS = @WARN_CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+DEFS = @DEFS@
+CC = @CC@
+LD = $(PURE) @LD@
+AR = @AR@
+KRB5_CFLAGS = @KRB5_CFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+
+INSTALL=@INSTALL@
+INSTALL_STRIP=
+INSTALL_PROGRAM=@INSTALL_PROGRAM@ $(INSTALL_STRIP)
+INSTALL_DATA=@INSTALL_DATA@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+SHLIB_TAIL_COMP=@SHLIB_TAIL_COMP@
+
+datadir = @datadir@
+EXAMPLEDIR = $(datadir)/examples/krb5
+
+KRB5MANROOT = @mandir@
+SERVER_BINDIR = @sbindir@
+CLIENT_BINDIR =@bindir@
+SERVER_MANDIR = $(KRB5MANROOT)/man8
+CLIENT_MANDIR = $(KRB5MANROOT)/man1
+
+# Dejagnu variables.
+# We have to set the host with --host so that setup_xfail will work.
+# If we don't set it, then the host type used is "native", which
+# doesn't match "*-*-*".
+host=@krb5_cv_host@
+DEJAFLAGS	= $(DEJALFLAGS) $(CLFLAGS) --debug --srcdir $(srcdir) --host \
+		   $(host)
+RUNTEST		= runtest $(DEJAFLAGS)
+
+transform = @program_transform_name@
+
+RM = rm -f
+CP = cp
+MV = mv -f
+CHMOD=chmod
+RANLIB = @RANLIB@
+ARCHIVE = @ARCHIVE@
+ARADD = @ARADD@
+LN = @LN_S@
+AWK = @AWK@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+YACC = @YACC@
+PERL = @PERL@
+AUTOCONF = autoconf
+AUTOCONFFLAGS =
+AUTOHEADER = autoheader
+AUTOHEADERFLAGS =
+MOVEIFCHANGED = $(SRCTOP)/config/move-if-changed
+
+KRB5_BASE_LIBS = @KRB5_BASE_LIBS@
+GSS_LIBS = @GSS_LIBS@
+PTY_DEPLIB = $(BUILDTOP)/libpty/libpty.a
+PTY_LIB = -L$(BUILDTOP)/libpty -lpty
+
+# libutil for NetBSD, et al. for openpty(), etc.
+UTIL_LIB	= @UTIL_LIB@
+
+OBJEXT = o
+LIBEXT = a
+EXEEXT =
+
+CC_LINK=$(CC) $(CFLAGS) $(LDFLAGS)
+
+# variables for --with-tcl=
+TCL_LIBS	= @TCL_LIBS@
+TCL_LIBPATH	= @TCL_LIBPATH@
+TCL_RPATH	= @TCL_RPATH@
+TCL_MAYBE_RPATH = @TCL_MAYBE_RPATH@
+TCL_INCLUDES	= @TCL_INCLUDES@
+
+# rule to make object files
+#
+.SUFFIXES: .cpp .c .o
+.c.o:
+	$(CC) $(ALL_CFLAGS) -c $<
+
+VALGRIND=
+# Need absolute paths here because under kshd or ftpd we may run programs
+# while in other directories.
+VALGRIND_LOGDIR = `cd $(BUILDTOP)&&pwd`
+VALGRIND1 = valgrind --tool=memcheck --log-file=$(VALGRIND_LOGDIR)/vg --trace-children=yes -v --leak-check=yes --suppressions=`cd $(SRCTOP)&&pwd`/tests/valgrind-suppressions
+
+##
+## end of pre.in
+############################################################

Added: trunk/socket-utils.h
===================================================================
--- trunk/socket-utils.h	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/socket-utils.h	2009-07-08 21:22:07 UTC (rev 3250)
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2001,2005 by the Massachusetts Institute of Technology,
+ * Cambridge, MA, USA.  All Rights Reserved.
+ * 
+ * This software is being provided to you, the LICENSEE, by the 
+ * Massachusetts Institute of Technology (M.I.T.) under the following 
+ * license.  By obtaining, using and/or copying this software, you agree 
+ * that you have read, understood, and will comply with these terms and 
+ * conditions:  
+ * 
+ * Export of this software from the United States of America may
+ * require a specific license from the United States Government.
+ * It is the responsibility of any person or organization contemplating
+ * export to obtain such a license before exporting.
+ * 
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify and distribute 
+ * this software and its documentation for any purpose and without fee or 
+ * royalty is hereby granted, provided that you agree to comply with the 
+ * following copyright notice and statements, including the disclaimer, and 
+ * that the same appear on ALL copies of the software and documentation, 
+ * including modifications that you make for internal use or for 
+ * distribution:
+ * 
+ * THIS SOFTWARE IS PROVIDED "AS IS", AND M.I.T. MAKES NO REPRESENTATIONS 
+ * OR WARRANTIES, EXPRESS OR IMPLIED.  By way of example, but not 
+ * limitation, M.I.T. MAKES NO REPRESENTATIONS OR WARRANTIES OF 
+ * MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF 
+ * THE LICENSED SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY 
+ * PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.   
+ * 
+ * The name of the Massachusetts Institute of Technology or M.I.T. may NOT 
+ * be used in advertising or publicity pertaining to distribution of the 
+ * software.  Title to copyright in this software and any associated 
+ * documentation shall at all times remain with M.I.T., and USER agrees to 
+ * preserve same.
+ *
+ * Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.  
+ */
+
+#ifndef SOCKET_UTILS_H
+#define SOCKET_UTILS_H
+
+/* Some useful stuff cross-platform for manipulating socket addresses.
+   We assume at least ipv4 sockaddr_in support.  The sockaddr_storage
+   stuff comes from the ipv6 socket api enhancements; socklen_t is
+   provided on some systems; the rest is just convenience for internal
+   use in the krb5 tree.
+
+   Do NOT install this file.  */
+
+/* for HAVE_SOCKLEN_T, KRB5_USE_INET6, etc */
+#include "autoconf.h"
+/* for sockaddr_storage */
+#include "port-sockets.h"
+/* for "inline" if needed */
+#include "k5-platform.h"
+
+/*
+ * There's a lot of confusion between pointers to different sockaddr
+ * types, and pointers with different degrees of indirection, as in
+ * the locate_kdc type functions.  Use these function to ensure we
+ * don't do something silly like cast a "sockaddr **" to a
+ * "sockaddr_in *".
+ *
+ * The casts to (void *) are to get GCC to shut up about alignment
+ * increasing.
+ */
+static inline struct sockaddr_in *sa2sin (struct sockaddr *sa)
+{
+    return (struct sockaddr_in *) (void *) sa;
+}
+#ifdef KRB5_USE_INET6
+static inline struct sockaddr_in6 *sa2sin6 (struct sockaddr *sa)
+{
+    return (struct sockaddr_in6 *) (void *) sa;
+}
+#endif
+static inline struct sockaddr *ss2sa (struct sockaddr_storage *ss)
+{
+    return (struct sockaddr *) ss;
+}
+static inline struct sockaddr_in *ss2sin (struct sockaddr_storage *ss)
+{
+    return (struct sockaddr_in *) ss;
+}
+#ifdef KRB5_USE_INET6
+static inline struct sockaddr_in6 *ss2sin6 (struct sockaddr_storage *ss)
+{
+    return (struct sockaddr_in6 *) ss;
+}
+#endif
+
+#if !defined (socklen)
+/* socklen_t socklen (struct sockaddr *) */
+#  ifdef HAVE_SA_LEN
+#    define socklen(X) ((X)->sa_len)
+#  else
+#    ifdef KRB5_USE_INET6
+#      define socklen(X) ((X)->sa_family == AF_INET6 ? (socklen_t) sizeof (struct sockaddr_in6) : (X)->sa_family == AF_INET ? (socklen_t) sizeof (struct sockaddr_in) : (socklen_t) sizeof (struct sockaddr))
+#    else
+#      define socklen(X) ((X)->sa_family == AF_INET ? (socklen_t) sizeof (struct sockaddr_in) : (socklen_t) sizeof (struct sockaddr))
+#    endif
+#  endif
+#endif
+
+#endif /* SOCKET_UTILS_H */

Modified: trunk/telnet/Makefile.in
===================================================================
--- trunk/telnet/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,5 +1,3 @@
-thisconfigdir=.
-myfulldir=appl/telnet
-mydir=.
-BUILDTOP=$(REL)..$(S)..
+mydir=telnet
+BUILDTOP=$(REL)..
 SUBDIRS=libtelnet telnet telnetd

Modified: trunk/telnet/libtelnet/Makefile.in
===================================================================
--- trunk/telnet/libtelnet/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,7 +1,5 @@
-thisconfigdir=..
-myfulldir=appl/telnet/libtelnet
-mydir=libtelnet
-BUILDTOP=$(REL)..$(S)..$(S)..
+mydir=telnet/libtelnet
+BUILDTOP=$(REL)..$(S)..
 # derived from the original Makefile.generic
 #
 # Copyright (c) 1991 The Regents of the University of California.
@@ -29,7 +27,6 @@
 DEFINES = -DTELNET_BUFSIZE=65535 $(AUTH_DEF)
 LIBOBJS=@LIBOBJS@
 
-SETENVSRC=@SETENVSRC@
 SETENVOBJ=@SETENVOBJ@
 
 LIBBASE=telnet
@@ -55,16 +52,21 @@
 	$(srcdir)/strftime.c \
 	$(srcdir)/strerror.c
 
-STLIBOBJS=   auth.o encrypt.o genget.o \
+OBJS=   auth.o encrypt.o genget.o \
 	misc.o kerberos5.o forward.o enc_des.o \
 	$(LIBOBJS) getent.o $(SETENVOBJ)
 
 TELNET_H= $(srcdir)/../arpa/telnet.h
 
-all:: all-libs
+all:: libtelnet.a
 
-clean:: clean-libs clean-libobjs
+libtelnet.a: $(OBJS)
+	$(RM) $@
+	$(AR) cq $@ $(OBJS)
+	$(RANLIB) $@
 
+clean::
+
 auth.o: $(TELNET_H)
 auth.o: encrypt.h
 auth.o: auth.h
@@ -81,9 +83,3 @@
 enc_des.o: encrypt.h
 enc_des.o: key-proto.h
 enc_des.o: misc-proto.h
-install::
-
- at libpriv_frag@
- at lib_frag@
- at libobj_frag@
-

Modified: trunk/telnet/libtelnet/auth.c
===================================================================
--- trunk/telnet/libtelnet/auth.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/auth.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -56,6 +56,7 @@
  * or implied warranty.
  */
 
+#include <autoconf.h>
 
 #if	defined(AUTHENTICATION)
 #include <stdio.h>

Modified: trunk/telnet/libtelnet/deps
===================================================================
--- trunk/telnet/libtelnet/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,38 +1,31 @@
 # 
 # Generated makefile dependencies follow.
 #
-auth.so auth.po $(OUTPRE)auth.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
+$(OUTPRE)auth.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
   auth-proto.h auth.c auth.h enc-proto.h encrypt.h misc-proto.h
-encrypt.so encrypt.po $(OUTPRE)encrypt.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
+$(OUTPRE)encrypt.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
   enc-proto.h encrypt.c encrypt.h misc-proto.h misc.h
-genget.so genget.po $(OUTPRE)genget.$(OBJEXT): genget.c \
-  misc-proto.h misc.h
-misc.so misc.po $(OUTPRE)misc.$(OBJEXT): auth-proto.h \
-  auth.h enc-proto.h encrypt.h misc-proto.h misc.c misc.h
-kerberos5.so kerberos5.po $(OUTPRE)kerberos5.$(OBJEXT): \
-  $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(srcdir)/../arpa/telnet.h \
-  auth-proto.h auth.h enc-proto.h encrypt.h kerberos5.c \
-  krb5forw.h misc-proto.h misc.h
-forward.so forward.po $(OUTPRE)forward.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/krb5.h forward.c \
-  krb5forw.h
-enc_des.so enc_des.po $(OUTPRE)enc_des.$(OBJEXT): $(BUILDTOP)/include/krb5/krb5.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/krb5.h $(srcdir)/../arpa/telnet.h \
-  enc-proto.h enc_des.c encrypt.h key-proto.h misc-proto.h
-setenv.so setenv.po $(OUTPRE)setenv.$(OBJEXT): misc-proto.h \
-  setenv.c
-getent.so getent.po $(OUTPRE)getent.$(OBJEXT): getent.c \
-  gettytab.h
-parsetos.so parsetos.po $(OUTPRE)parsetos.$(OBJEXT): \
-  misc-proto.h parsetos.c
-strdup.so strdup.po $(OUTPRE)strdup.$(OBJEXT): strdup.c
-strcasecmp.so strcasecmp.po $(OUTPRE)strcasecmp.$(OBJEXT): \
-  strcasecmp.c
-strchr.so strchr.po $(OUTPRE)strchr.$(OBJEXT): strchr.c
-strrchr.so strrchr.po $(OUTPRE)strrchr.$(OBJEXT): strrchr.c
-strftime.so strftime.po $(OUTPRE)strftime.$(OBJEXT): \
-  strftime.c
-strerror.so strerror.po $(OUTPRE)strerror.$(OBJEXT): \
-  strerror.c
+$(OUTPRE)genget.$(OBJEXT): genget.c misc-proto.h misc.h
+$(OUTPRE)misc.$(OBJEXT): auth-proto.h auth.h enc-proto.h \
+  encrypt.h misc-proto.h misc.c misc.h
+$(OUTPRE)kerberos5.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(srcdir)/../arpa/telnet.h \
+  /me/base/include/com_err.h /me/base/include/krb5.h \
+  /me/base/include/krb5/krb5.h auth-proto.h auth.h enc-proto.h \
+  encrypt.h kerberos5.c krb5forw.h misc-proto.h misc.h
+$(OUTPRE)forward.$(OBJEXT): /me/base/include/com_err.h \
+  /me/base/include/krb5.h /me/base/include/krb5/krb5.h \
+  forward.c krb5forw.h
+$(OUTPRE)enc_des.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
+  /me/base/include/com_err.h /me/base/include/krb5.h \
+  /me/base/include/krb5/krb5.h enc-proto.h enc_des.c \
+  encrypt.h key-proto.h misc-proto.h
+$(OUTPRE)setenv.$(OBJEXT): misc-proto.h setenv.c
+$(OUTPRE)getent.$(OBJEXT): getent.c gettytab.h
+$(OUTPRE)parsetos.$(OBJEXT): misc-proto.h parsetos.c
+$(OUTPRE)strdup.$(OBJEXT): strdup.c
+$(OUTPRE)strcasecmp.$(OBJEXT): strcasecmp.c
+$(OUTPRE)strchr.$(OBJEXT): strchr.c
+$(OUTPRE)strrchr.$(OBJEXT): strrchr.c
+$(OUTPRE)strftime.$(OBJEXT): strftime.c
+$(OUTPRE)strerror.$(OBJEXT): strerror.c

Modified: trunk/telnet/libtelnet/enc_des.c
===================================================================
--- trunk/telnet/libtelnet/enc_des.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/enc_des.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -59,6 +59,8 @@
 
 /* based on @(#)enc_des.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #ifdef	ENCRYPTION
 # ifdef	AUTHENTICATION
 #  ifdef DES_ENCRYPTION

Modified: trunk/telnet/libtelnet/encrypt.c
===================================================================
--- trunk/telnet/libtelnet/encrypt.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/encrypt.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -56,6 +56,8 @@
  * or implied warranty.
  */
 
+#include <autoconf.h>
+
 #ifdef	ENCRYPTION
 
 #include <stdio.h>

Modified: trunk/telnet/libtelnet/forward.c
===================================================================
--- trunk/telnet/libtelnet/forward.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/forward.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -23,6 +23,8 @@
 /* General-purpose forwarding routines. These routines may be put into */
 /* libkrb5.a to allow widespread use */ 
 
+#include <autoconf.h>
+
 #if defined(KERBEROS) || defined(KRB5)
 #include <stdio.h>
 #include <netdb.h>

Modified: trunk/telnet/libtelnet/genget.c
===================================================================
--- trunk/telnet/libtelnet/genget.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/genget.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)genget.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include <ctype.h>
 #include "misc.h"
 

Modified: trunk/telnet/libtelnet/getent.c
===================================================================
--- trunk/telnet/libtelnet/getent.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/getent.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)getent.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "gettytab.h"
 
 #ifdef	HAVE_CGETENT

Modified: trunk/telnet/libtelnet/getopt.c
===================================================================
--- trunk/telnet/libtelnet/getopt.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/getopt.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,9 +33,8 @@
 
 /* based on @(#)getopt.c	8.1 (Berkeley) 6/4/93 */
 
-#ifndef __STDC__
-#define const
-#endif
+#include <autoconf.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

Modified: trunk/telnet/libtelnet/gettytab.c
===================================================================
--- trunk/telnet/libtelnet/gettytab.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/gettytab.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -6,6 +6,8 @@
 
 /* based on @(#)gettytab.c	5.1 (Berkeley) 4/29/85 */
 
+#include <autoconf.h>
+
 #include <ctype.h>
 
 #define	TABBUFSIZ	512

Modified: trunk/telnet/libtelnet/herror.c
===================================================================
--- trunk/telnet/libtelnet/herror.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/herror.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)herror.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 
 char	*h_errlist[] = {

Modified: trunk/telnet/libtelnet/kerberos5.c
===================================================================
--- trunk/telnet/libtelnet/kerberos5.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/kerberos5.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -60,6 +60,7 @@
  * or implied warranty.
  */
 
+#include <autoconf.h>
 
 #ifdef	KRB5
 #include <arpa/telnet.h>

Modified: trunk/telnet/libtelnet/mem.c
===================================================================
--- trunk/telnet/libtelnet/mem.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/mem.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -41,10 +41,7 @@
    @(#)memmove.c	8.1 (Berkeley) 6/4/93
  */
 
-#ifndef	__STDC__
-#define	const
-#endif
-typedef int size_t;
+#include <autoconf.h>
 
 #include <sys/types.h>
 #include <sys/cdefs.h>

Modified: trunk/telnet/libtelnet/misc.c
===================================================================
--- trunk/telnet/libtelnet/misc.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/misc.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)misc.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include "misc.h"

Modified: trunk/telnet/libtelnet/parsetos.c
===================================================================
--- trunk/telnet/libtelnet/parsetos.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/parsetos.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -4,6 +4,8 @@
  * Unix systems.  This is part of UNICOS 7.0 and later.
  */
 
+#include <autoconf.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>

Modified: trunk/telnet/libtelnet/setenv.c
===================================================================
--- trunk/telnet/libtelnet/setenv.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/setenv.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -34,9 +34,7 @@
 /* based on @(#)setenv.c	8.1 (Berkeley) 6/4/93 */
 /* based on @(#)getenv.c	8.1 (Berkeley) 6/4/93 */
 
-#ifndef __STDC__
-#define const
-#endif
+#include <autoconf.h>
 
 #include <stddef.h>
 #include <stdlib.h>

Modified: trunk/telnet/libtelnet/setsid.c
===================================================================
--- trunk/telnet/libtelnet/setsid.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/setsid.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)setsid.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 /*
  * Emulate the functionality of setsid(), called when forking
  * and execing the new process.

Modified: trunk/telnet/libtelnet/spx.c
===================================================================
--- trunk/telnet/libtelnet/spx.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/spx.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)spx.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #ifdef	SPX
 /*
  * COPYRIGHT (C) 1990 DIGITAL EQUIPMENT CORPORATION

Modified: trunk/telnet/libtelnet/strcasecmp.c
===================================================================
--- trunk/telnet/libtelnet/strcasecmp.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strcasecmp.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -31,9 +31,7 @@
  * SUCH DAMAGE.
  */
 
-#ifndef __STDC__
-#define const
-#endif
+#include <autoconf.h>
 
 #include <sys/types.h>
 #ifdef HAVE_STRING_H

Modified: trunk/telnet/libtelnet/strchr.c
===================================================================
--- trunk/telnet/libtelnet/strchr.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strchr.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)strchr.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #ifdef	HAVE_STRING_H
 #include <string.h>
 #else

Modified: trunk/telnet/libtelnet/strdup.c
===================================================================
--- trunk/telnet/libtelnet/strdup.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strdup.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,9 +33,7 @@
 
 /* based on @(#)strdup.c	8.1 (Berkeley) 6/4/93 */
 
-#ifndef __STDC__
-#define const
-#endif
+#include <autoconf.h>
 
 #include <sys/types.h>
 

Modified: trunk/telnet/libtelnet/strerror.c
===================================================================
--- trunk/telnet/libtelnet/strerror.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strerror.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)strerror.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #ifdef	HAVE_STRING_H
 #include <string.h>
 #else

Modified: trunk/telnet/libtelnet/strftime.c
===================================================================
--- trunk/telnet/libtelnet/strftime.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strftime.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,9 +33,7 @@
 
 /* based on @(#)strftime.c	8.1 (Berkeley) 6/4/93 */
 
-#ifndef __STDC__
-#define const
-#endif
+#include <autoconf.h>
 
 #include <sys/types.h>
 #include <sys/time.h>

Modified: trunk/telnet/libtelnet/strrchr.c
===================================================================
--- trunk/telnet/libtelnet/strrchr.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/libtelnet/strrchr.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)strrchr.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #ifdef	HAVE_STRING_H
 #include <string.h>
 #else

Modified: trunk/telnet/telnet/Makefile.in
===================================================================
--- trunk/telnet/telnet/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,7 +1,5 @@
-thisconfigdir=..
-myfulldir=appl/telnet/telnet
-mydir=telnet
-BUILDTOP=$(REL)..$(S)..$(S)..
+mydir=telnet/telnet
+BUILDTOP=$(REL)..$(S)..
 # derived from the original Makefile.generic
 #
 # Copyright (c) 1991 The Regents of the University of California.
@@ -47,8 +45,8 @@
 
 all:: telnet
 
-telnet:	$(OBJS) $(KRB5_BASE_DEPLIBS) ../libtelnet/libtelnet.a
-	$(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(KRB5_BASE_LIBS)
+telnet:	$(OBJS) ../libtelnet/libtelnet.a
+	$(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(KRB5_BASE_LIBS) $(LIBS)
 
 clean::
 	$(RM) telnet

Modified: trunk/telnet/telnet/authenc.c
===================================================================
--- trunk/telnet/telnet/authenc.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/authenc.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)authenc.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #if	defined(AUTHENTICATION) || defined(ENCRYPTION)
 #include <sys/types.h>
 #include <arpa/telnet.h>

Modified: trunk/telnet/telnet/commands.c
===================================================================
--- trunk/telnet/telnet/commands.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/commands.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)commands.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #if	defined(unix)
 #include <sys/param.h>
 #if	defined(CRAY) || defined(sysV88)

Modified: trunk/telnet/telnet/deps
===================================================================
--- trunk/telnet/telnet/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,39 +1,41 @@
 # 
 # Generated makefile dependencies follow.
 #
-$(OUTPRE)authenc.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
-  $(srcdir)/../libtelnet/enc-proto.h $(srcdir)/../libtelnet/encrypt.h \
-  $(srcdir)/../libtelnet/misc-proto.h $(srcdir)/../libtelnet/misc.h \
-  authenc.c defines.h externs.h general.h ring.h types.h
-$(OUTPRE)commands.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h $(srcdir)/../arpa/telnet.h \
+$(OUTPRE)authenc.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/enc-proto.h \
+  $(srcdir)/../libtelnet/encrypt.h $(srcdir)/../libtelnet/misc-proto.h \
+  $(srcdir)/../libtelnet/misc.h authenc.c defines.h externs.h \
+  general.h ring.h types.h
+$(OUTPRE)commands.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
   $(srcdir)/../libtelnet/auth-proto.h $(srcdir)/../libtelnet/auth.h \
   $(srcdir)/../libtelnet/enc-proto.h $(srcdir)/../libtelnet/encrypt.h \
   $(srcdir)/../libtelnet/misc-proto.h commands.c defines.h \
   externs.h general.h ring.h types.h
-$(OUTPRE)main.$(OBJEXT): $(srcdir)/../libtelnet/auth-proto.h \
+$(OUTPRE)main.$(OBJEXT): $(BUILDTOP)/autoconf.h $(srcdir)/../libtelnet/auth-proto.h \
   $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
   $(srcdir)/../libtelnet/encrypt.h defines.h externs.h \
   main.c ring.h
-$(OUTPRE)network.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
-  defines.h externs.h fdset.h network.c ring.h
-$(OUTPRE)ring.$(OBJEXT): general.h ring.c ring.h
-$(OUTPRE)sys_bsd.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
-  defines.h externs.h fdset.h ring.h sys_bsd.c types.h
-$(OUTPRE)telnet.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+$(OUTPRE)network.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(srcdir)/../arpa/telnet.h defines.h externs.h fdset.h \
+  network.c ring.h
+$(OUTPRE)ring.$(OBJEXT): $(BUILDTOP)/autoconf.h general.h \
+  ring.c ring.h
+$(OUTPRE)sys_bsd.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(srcdir)/../arpa/telnet.h defines.h externs.h fdset.h \
+  ring.h sys_bsd.c types.h
+$(OUTPRE)telnet.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
   $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/auth-proto.h \
   $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
   $(srcdir)/../libtelnet/encrypt.h $(srcdir)/../libtelnet/misc-proto.h \
   defines.h externs.h general.h ring.h telnet.c types.h
-$(OUTPRE)terminal.$(OBJEXT): $(srcdir)/../arpa/telnet.h \
+$(OUTPRE)terminal.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/enc-proto.h \
+  $(srcdir)/../libtelnet/encrypt.h externs.h ring.h terminal.c \
+  types.h
+$(OUTPRE)utilities.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(srcdir)/../arpa/telnet.h \
+  $(srcdir)/../libtelnet/auth-proto.h $(srcdir)/../libtelnet/auth.h \
   $(srcdir)/../libtelnet/enc-proto.h $(srcdir)/../libtelnet/encrypt.h \
-  externs.h ring.h terminal.c types.h
-$(OUTPRE)utilities.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/auth-proto.h \
-  $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
-  $(srcdir)/../libtelnet/encrypt.h defines.h externs.h \
-  fdset.h general.h ring.h utilities.c
+  defines.h externs.h fdset.h general.h ring.h utilities.c

Modified: trunk/telnet/telnet/main.c
===================================================================
--- trunk/telnet/telnet/main.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/main.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -39,6 +39,8 @@
 
 /* based on @(#)main.c	5.5 (Berkeley) 12/18/92 */
 
+#include <autoconf.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

Modified: trunk/telnet/telnet/network.c
===================================================================
--- trunk/telnet/telnet/network.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/network.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)network.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/time.h>

Modified: trunk/telnet/telnet/ring.c
===================================================================
--- trunk/telnet/telnet/ring.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/ring.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -44,6 +44,8 @@
  *
  */
 
+#include	<autoconf.h>
+
 #include	<stdio.h>
 #include	<errno.h>
 

Modified: trunk/telnet/telnet/sys_bsd.c
===================================================================
--- trunk/telnet/telnet/sys_bsd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/sys_bsd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -38,6 +38,7 @@
  * (at least between 4.x and dos) which is used in telnet.c.
  */
 
+#include <autoconf.h>
 
 #include <fcntl.h>
 #include <sys/types.h>

Modified: trunk/telnet/telnet/telnet.c
===================================================================
--- trunk/telnet/telnet/telnet.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/telnet.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)telnet.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif

Modified: trunk/telnet/telnet/terminal.c
===================================================================
--- trunk/telnet/telnet/terminal.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/terminal.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)terminal.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #include <arpa/telnet.h>
 #include <sys/types.h>
 

Modified: trunk/telnet/telnet/tn3270.c
===================================================================
--- trunk/telnet/telnet/tn3270.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/tn3270.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)tn3270.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #include <sys/types.h>
 #include <arpa/telnet.h>
 

Modified: trunk/telnet/telnet/utilities.c
===================================================================
--- trunk/telnet/telnet/utilities.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnet/utilities.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)utilities.c	8.1 (Berkeley) 6/6/93 */
 
+#include <autoconf.h>
+
 #define	TELOPTS
 #define	TELCMDS
 #define	SLC_NAMES

Modified: trunk/telnet/telnetd/Makefile.in
===================================================================
--- trunk/telnet/telnetd/Makefile.in	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/Makefile.in	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,7 +1,5 @@
-thisconfigdir=..
-myfulldir=appl/telnet/telnetd
-mydir=telnetd
-BUILDTOP=$(REL)..$(S)..$(S)..
+mydir=telnet/telnetd
+BUILDTOP=$(REL)..$(S)..
 # derived from the original Makefile.generic
 #
 # Copyright (c) 1991 The Regents of the University of California.
@@ -24,7 +22,7 @@
 #	@(#)Makefile.generic	5.5 (Berkeley) 3/1/91
 #
 
-AUTH_DEF=-DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -UNO_LOGIN_F -ULOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN
+AUTH_DEF=-DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -UNO_LOGIN_F -ULOGIN_CAP_F -DLOGIN_PROGRAM=\"$(SERVER_BINDIR)/login.krb5\"
 OTHERDEFS=-DKLUDGELINEMODE -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON
 LOCALINCLUDES=-I.. -I$(srcdir)/..
 DEFINES = -DTELNET_BUFSIZE=65535 $(AUTH_DEF) $(OTHERDEFS)
@@ -60,8 +58,8 @@
 
 all:: telnetd
 
-telnetd: $(OBJS) $(PTY_DEPLIB) $(KRB5_BASE_DEPLIBS) ../libtelnet/libtelnet.a
-	$(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS)
+telnetd: $(OBJS) $(PTY_DEPLIB) ../libtelnet/libtelnet.a
+	$(CC_LINK) -o $@ $(OBJS) ../libtelnet/libtelnet.a $(PTY_LIB) $(UTIL_LIB) $(KRB5_BASE_LIBS) $(LIBS)
 
 clean::
 	$(RM) telnetd

Modified: trunk/telnet/telnetd/authenc.c
===================================================================
--- trunk/telnet/telnetd/authenc.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/authenc.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)authenc.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #if	defined(AUTHENTICATION) || defined(ENCRYPTION)
 #include "telnetd.h"
 #include <libtelnet/misc.h>

Modified: trunk/telnet/telnetd/deps
===================================================================
--- trunk/telnet/telnetd/deps	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/deps	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,58 +1,47 @@
 # 
 # Generated makefile dependencies follow.
 #
-$(OUTPRE)telnetd.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/fake-addrinfo.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/auth-proto.h \
-  $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
-  $(srcdir)/../libtelnet/encrypt.h $(srcdir)/../libtelnet/misc-proto.h \
+$(OUTPRE)telnetd.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/fake-addrinfo.h $(SRCTOP)/k5-platform.h $(SRCTOP)/libpty/libpty.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
+  $(srcdir)/../libtelnet/auth-proto.h $(srcdir)/../libtelnet/auth.h \
+  $(srcdir)/../libtelnet/enc-proto.h $(srcdir)/../libtelnet/encrypt.h \
+  $(srcdir)/../libtelnet/misc-proto.h /me/base/include/com_err.h \
+  /me/base/include/krb5.h /me/base/include/krb5/krb5.h \
   defs.h ext.h pathnames.h telnetd.c telnetd.h
-$(OUTPRE)termio-tn.$(OBJEXT): termio-tn.c
-$(OUTPRE)termios-tn.$(OBJEXT): termios-tn.c
-$(OUTPRE)state.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/auth-proto.h \
-  $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
-  $(srcdir)/../libtelnet/encrypt.h defs.h ext.h state.c \
-  telnetd.h
-$(OUTPRE)termstat.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
+$(OUTPRE)termio-tn.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  termio-tn.c
+$(OUTPRE)termios-tn.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  termios-tn.c
+$(OUTPRE)state.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
+  $(srcdir)/../libtelnet/auth-proto.h $(srcdir)/../libtelnet/auth.h \
+  $(srcdir)/../libtelnet/enc-proto.h $(srcdir)/../libtelnet/encrypt.h \
+  defs.h ext.h state.c telnetd.h
+$(OUTPRE)termstat.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h \
   $(srcdir)/../arpa/telnet.h defs.h ext.h telnetd.h termstat.c
-$(OUTPRE)slc.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  $(srcdir)/../arpa/telnet.h defs.h ext.h slc.c telnetd.h
-$(OUTPRE)sys_term.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/libpty.h \
-  $(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
-  $(COM_ERR_DEPS) $(SRCTOP)/include/k5-buf.h $(SRCTOP)/include/k5-err.h \
-  $(SRCTOP)/include/k5-gmt_mktime.h $(SRCTOP)/include/k5-int-pkinit.h \
-  $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
-  $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
-  $(SRCTOP)/include/krb5/preauth_plugin.h $(SRCTOP)/include/port-sockets.h \
-  $(SRCTOP)/include/socket-utils.h $(srcdir)/../arpa/telnet.h \
+$(OUTPRE)slc.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
+  defs.h ext.h slc.c telnetd.h
+$(OUTPRE)sys_term.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/libpty/libpty.h $(SRCTOP)/port-sockets.h \
+  $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
   $(srcdir)/../libtelnet/auth-proto.h $(srcdir)/../libtelnet/auth.h \
-  defs.h ext.h pathnames.h sys_term.c telnetd.h
-$(OUTPRE)utility.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
+  /me/base/include/com_err.h /me/base/include/krb5.h \
+  /me/base/include/krb5/krb5.h defs.h ext.h pathnames.h \
+  sys_term.c telnetd.h
+$(OUTPRE)utility.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h \
   $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/auth-proto.h \
   $(srcdir)/../libtelnet/auth.h $(srcdir)/../libtelnet/enc-proto.h \
   $(srcdir)/../libtelnet/encrypt.h defs.h ext.h telnetd.h \
   utility.c
-$(OUTPRE)global.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
-  $(srcdir)/../arpa/telnet.h defs.h ext.h global.c
-$(OUTPRE)authenc.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
-  $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
-  $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
+$(OUTPRE)global.$(OBJEXT): $(BUILDTOP)/autoconf.h $(SRCTOP)/k5-platform.h \
+  $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h $(srcdir)/../arpa/telnet.h \
+  defs.h ext.h global.c
+$(OUTPRE)authenc.$(OBJEXT): $(BUILDTOP)/autoconf.h \
+  $(SRCTOP)/k5-platform.h $(SRCTOP)/port-sockets.h $(SRCTOP)/socket-utils.h \
   $(srcdir)/../arpa/telnet.h $(srcdir)/../libtelnet/misc-proto.h \
   $(srcdir)/../libtelnet/misc.h authenc.c defs.h ext.h \
   telnetd.h

Modified: trunk/telnet/telnetd/global.c
===================================================================
--- trunk/telnet/telnetd/global.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/global.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -41,6 +41,8 @@
  * we will actually allocate the space.
  */
 
+#include <autoconf.h>
+
 #include "defs.h"
 #define extern
 #include "ext.h"

Modified: trunk/telnet/telnetd/slc.c
===================================================================
--- trunk/telnet/telnetd/slc.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/slc.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)slc.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 
 #ifdef	LINEMODE

Modified: trunk/telnet/telnetd/state.c
===================================================================
--- trunk/telnet/telnetd/state.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/state.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)state.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 #if	defined(AUTHENTICATION)
 #include <libtelnet/auth.h>

Modified: trunk/telnet/telnetd/sys_term.c
===================================================================
--- trunk/telnet/telnetd/sys_term.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/sys_term.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* baesd on @(#)sys_term.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 #include "pathnames.h"
 #include <com_err.h>
@@ -47,7 +49,8 @@
 #endif
 
 #if	defined(KRB5)
-#include "k5-int.h"
+#include <krb5.h>
+#include "k5-platform.h"
 #endif
 
 char *login_program = LOGIN_PROGRAM;
@@ -936,7 +939,7 @@
 
 	if ( (retval = pty_open_slave (line, &t)) != 0 )
 	    {
-		fatalperror(net,  error_message(retval));
+		fatalperror(net, pty_error_message(retval));
 	    }
 
 #ifdef  STREAMSPTY

Modified: trunk/telnet/telnetd/telnetd-ktd.c
===================================================================
--- trunk/telnet/telnetd/telnetd-ktd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/telnetd-ktd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -39,6 +39,8 @@
 
 /* based on @(#)telnetd.c	5.51 (Berkeley) 1/21/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 #include "pathnames.h"
 
@@ -703,7 +705,7 @@
 	 * Find an available pty to use.
 	 */
 	if ( (retval = pty_getpty(&pty, line, sizeof(line)) < 0 ) {
-	    com_err(retval, "telnetd", "");
+		fatal(net, pty_error_message(retval));
 	    
 	if (pty < 0)
 		fatal(net, "All network ports in use");

Modified: trunk/telnet/telnetd/telnetd.c
===================================================================
--- trunk/telnet/telnetd/telnetd.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/telnetd.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -39,6 +39,8 @@
 
 /* based on @(#)telnetd.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 #include "pathnames.h"
 
@@ -959,7 +961,7 @@
 	
 
 	if ((retval = pty_getpty(&pty, line, 17)) != 0) {
-		fatal(net, error_message(retval));
+		fatal(net, pty_error_message(retval));
 	}
 
 #if	defined(_SC_CRAY_SECURE_SYS)
@@ -982,7 +984,7 @@
 					stripdomain, always_ip,
 					&rhost_sane);
 	if (retval) {
-		fatal(net, error_message(retval));
+		fatal(net, pty_error_message(retval));
 	}
 	if (registerd_host_only) {
 	    /* Get name of connected client -- but we don't actually

Modified: trunk/telnet/telnetd/termio-tn.c
===================================================================
--- trunk/telnet/telnetd/termio-tn.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/termio-tn.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,3 +1,5 @@
+#include <autoconf.h>
+
 /* handle having mutually exclusive termio vs. termios */
 /* return 0 if handled */
 #ifdef	STREAMSPTY

Modified: trunk/telnet/telnetd/termios-tn.c
===================================================================
--- trunk/telnet/telnetd/termios-tn.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/termios-tn.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -1,3 +1,5 @@
+#include <autoconf.h>
+
 /* handle having mutually exclusive termio vs. termios */
 /* return 0 if handled */
 #ifdef	STREAMSPTY

Modified: trunk/telnet/telnetd/termstat.c
===================================================================
--- trunk/telnet/telnetd/termstat.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/termstat.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)termstat.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include "telnetd.h"
 
 /*

Modified: trunk/telnet/telnetd/utility.c
===================================================================
--- trunk/telnet/telnetd/utility.c	2009-07-08 20:40:09 UTC (rev 3249)
+++ trunk/telnet/telnetd/utility.c	2009-07-08 21:22:07 UTC (rev 3250)
@@ -33,6 +33,8 @@
 
 /* based on @(#)utility.c	8.1 (Berkeley) 6/4/93 */
 
+#include <autoconf.h>
+
 #include <stdarg.h>
 #define PRINTOPTIONS
 #include "telnetd.h"

Property changes on: trunk/install-sh
___________________________________________________________________
Name: svn:executable
   + *

Property changes on: trunk/mkinstalldirs
___________________________________________________________________
Name: svn:executable
   + *

Property changes on: trunk/move-if-changed
___________________________________________________________________
Name: svn:executable
   + *




More information about the cvs-krb5 mailing list