From ghudson at MIT.EDU Wed Jul 1 12:23:25 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Wed, 1 Jul 2009 12:23:25 -0400 Subject: svn rev #22425: trunk/src/include/ Message-ID: <200907011623.n61GNPPH002869@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22425 Commit By: ghudson Log Message: k5-platform.h no longer takes responsibility for making "static inline" work, so remove the comment which says it does. Changed Files: U trunk/src/include/k5-platform.h Modified: trunk/src/include/k5-platform.h =================================================================== --- trunk/src/include/k5-platform.h 2009-06-27 01:00:05 UTC (rev 22424) +++ trunk/src/include/k5-platform.h 2009-07-01 16:23:25 UTC (rev 22425) @@ -28,7 +28,6 @@ * Some to a C99-ish level, some related utility code. * * Currently: - * + make "static inline" work * + [u]int{8,16,32}_t types * + 64-bit types and load/store code * + SIZE_MAX From ghudson at MIT.EDU Wed Jul 8 16:40:10 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Wed, 8 Jul 2009 16:40:10 -0400 Subject: svn rev #3249: trunk/ Message-ID: <200907082040.n68KeAMN016967@drugstore.mit.edu> Commit By: ghudson Log Message: Remove sample, simple, gss-sample, and user_user as they are not part of the application unbundling. Changed Files: D trunk/gss-sample/ D trunk/sample/ D trunk/simple/ D trunk/user_user/ From ghudson at MIT.EDU Wed Jul 8 17:22:08 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Wed, 8 Jul 2009 17:22:08 -0400 Subject: svn rev #3250: trunk/ bsd/ gssftp/ gssftp/ftp/ gssftp/ftpd/ libpty/ telnet/ ... Message-ID: <200907082122.n68LM8PD020554@drugstore.mit.edu> 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 +#include ], [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 ], [sigprocmask(SIG_SETMASK,0,0);], + krb5_cv_func_sigprocmask_use=yes, +AC_TRY_LINK([#include ], [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 -- 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 +#include +extern pid_t wait(int *);],[], krb5_cv_struct_wait=no,dnl +dnl Else fallback on old stuff +[AC_TRY_COMPILE( +[#include ], [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 ], +[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 +#include +#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 ],[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 +#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 +#endif +#include +#include +#include +],[ + 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 +#endif +#include +#include +#include +],[ + 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 +#include ])]) +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 +#include ]) + +# 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 +#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 ], [ + } /* 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 ],[ + } /* 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 +#include +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 #include -#include "k5-int.h" +#include +#include #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 #include -#include "k5-int.h" +#include +#include #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 #ifdef KERBEROS -#include "k5-int.h" +#include +#include #include #include 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 + #ifdef HAVE_UNISTD_H #include #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 + /* * 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 +#include #include #ifdef HAVE_UTMP_H #include -#include #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 + #define SERVE_NON_KRB #define LOG_REMOTE_REALM #define LOG_CMD @@ -139,7 +141,7 @@ #endif #ifdef KERBEROS -#include "k5-int.h" +#include #include #include "loginpaths.h" #include @@ -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 + /* 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 +#include +#include #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; iprofile, - 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 +#include +]) + +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 +#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 +#endif +#if HAVE_SYS_TTY_H +#include +#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 ],setenv,1) +KRB5_NEED_PROTO([#include ],unsetenv,1) +KRB5_NEED_PROTO([#include +#include ],parsetos,1) +dnl +KRB5_NEED_PROTO([#include +#include +#include +#include ],herror,1) +KRB5_NEED_PROTO([#include +],revoke) +KRB5_NEED_PROTO([#include +#include +],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 +#include ], [], +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 +#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 +#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 +#endif +#ifdef HAVE_UTMPX_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +],getutmp) +dnl + +KRB5_NEED_PROTO([#include +#ifdef HAVE_UTMP_H +#include +#endif +#ifdef HAVE_LIBUTIL_H +#include +#endif +#ifdef HAVE_UTIL_H +#include +#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 +#include ], [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 ],[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 +#include ], [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 +#include +#include ], +[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 ],[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 +#if STDC_HEADERS +#include +#include +#endif +#ifndef USE_TERMIO +#include +#else +# ifdef SYSV_TERMIO +# include +# else +# include +# 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 + /* * 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 + #include #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 + #include #include 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 + #ifdef _WIN32 #include #include 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 + #ifdef _WIN32 #include #include 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 + #include #include 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 + /* * 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 + #include #ifdef HAVE_STDLIB_H #include 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 + #include #include #include 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 + #include #include #include 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 #ifdef GSSAPI #include @@ -11,7 +11,7 @@ extern gss_ctx_id_t gcontext; #endif /* GSSAPI */ -#include /* 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 +#include #include #include @@ -66,7 +68,6 @@ #include #include #include -#include #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 + /* * 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 + #include #include #include 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 + #include #include #include 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 +#include +#include +#include +#include +#include +#include + +/* 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 +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include + +#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 #include #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 +# 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 +#include + +/* 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 +typedef int socklen_t; + +#else /* UNIX variants */ + +#include "autoconf.h" + +#include +#include /* For struct sockaddr_in and in_addr */ +#include /* For inet_ntoa */ +#include + +#include /* For MAXHOSTNAMELEN */ +#include /* For SOCK_*, AF_*, etc */ +#include /* For struct timeval */ +#include /* For struct ifconf, for localaddr.c */ +#ifdef HAVE_SYS_UIO_H +#include /* For struct iovec, for sg_buf */ +#endif +#ifdef HAVE_SYS_FILIO_H +#include /* 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 #if defined(AUTHENTICATION) #include 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 + #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 + #ifdef ENCRYPTION #include 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 + #if defined(KERBEROS) || defined(KRB5) #include #include 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 + #include #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 + #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 + #include #include #include 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 + #include #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 + #include 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 #ifdef KRB5 #include 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 #include #include 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 + #include #include #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 + #include #include #include 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 #include #include 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 + /* * 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 + #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 #include #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 + #ifdef HAVE_STRING_H #include #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 #include 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 + #ifdef HAVE_STRING_H #include #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 #include #include 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 + #ifdef HAVE_STRING_H #include #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 + #if defined(AUTHENTICATION) || defined(ENCRYPTION) #include #include 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 + #if defined(unix) #include #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 + #ifdef HAVE_UNISTD_H #include #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 + #include #include #include 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 + #include #include 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 #include #include 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 + #ifdef HAVE_UNISTD_H #include #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 + #include #include 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 + #include #include 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 + #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 + #if defined(AUTHENTICATION) || defined(ENCRYPTION) #include "telnetd.h" #include 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 + #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 + #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 + #include "telnetd.h" #if defined(AUTHENTICATION) #include 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 + #include "telnetd.h" #include "pathnames.h" #include @@ -47,7 +49,8 @@ #endif #if defined(KRB5) -#include "k5-int.h" +#include +#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 + #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 + #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 + /* 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 + /* 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 + #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 + #include #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 + * From tlyu at MIT.EDU Wed Jul 8 21:54:51 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 8 Jul 2009 21:54:51 -0400 Subject: svn rev #22426: branches/krb5-1-6/src/ kdc/ lib/gssapi/krb5/ lib/krb5/krb/ lib/krb5/os/ ... Message-ID: <200907090154.n691speg010965@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22426 Commit By: tlyu Log Message: ticket: 5997 status: resolved version_fixed: 1.6.4 pull up r20482, r20481 from trunk ------------------------------------------------------------------------ r20482 | raeburn | 2008-06-26 22:51:09 -0400 (Thu, 26 Jun 2008) | 5 lines ticket: 5997 Memory leak, and possible freed-memory dereference, in an error (small allocation failure) path. ------------------------------------------------------------------------ r20481 | raeburn | 2008-06-26 22:47:06 -0400 (Thu, 26 Jun 2008) | 9 lines ticket: new target_version: 1.6.4 subject: misc memory leaks tags: pullup Fix various memory leaks that show up mostly in error cases (e.g., failure to allocate one small object, and then we forget to free another one). Changed Files: U branches/krb5-1-6/src/kdc/do_tgs_req.c U branches/krb5-1-6/src/kdc/kdc_util.c U branches/krb5-1-6/src/lib/gssapi/krb5/k5seal.c U branches/krb5-1-6/src/lib/krb5/krb/bld_pr_ext.c U branches/krb5-1-6/src/lib/krb5/krb/get_creds.c U branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c U branches/krb5-1-6/src/lib/krb5/krb/gic_opt.c U branches/krb5-1-6/src/lib/krb5/krb/init_ctx.c U branches/krb5-1-6/src/lib/krb5/os/an_to_ln.c U branches/krb5-1-6/src/lib/rpc/auth_gss.c U branches/krb5-1-6/src/plugins/kdb/db2/adb_policy.c Modified: branches/krb5-1-6/src/kdc/do_tgs_req.c =================================================================== --- branches/krb5-1-6/src/kdc/do_tgs_req.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/kdc/do_tgs_req.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -57,7 +57,7 @@ process_tgs_req(krb5_data *pkt, const krb5_fulladdr *from, krb5_data **response) { - krb5_keyblock * subkey; + krb5_keyblock * subkey = 0; krb5_kdc_req *request = 0; krb5_db_entry server; krb5_kdc_rep reply; @@ -99,8 +99,10 @@ /* * setup_server_realm() sets up the global realm-specific data pointer. */ - if ((retval = setup_server_realm(request->server))) + if ((retval = setup_server_realm(request->server))) { + krb5_free_kdc_req(kdc_context, request); return retval; + } fromstring = inet_ntop(ADDRTYPE2FAMILY(from->address->addrtype), from->address->contents, @@ -712,7 +714,9 @@ if (session_key.contents) krb5_free_keyblock_contents(kdc_context, &session_key); if (newtransited) - free(enc_tkt_reply.transited.tr_contents.data); + free(enc_tkt_reply.transited.tr_contents.data); + if (subkey) + krb5_free_keyblock(kdc_context, subkey); return retval; } @@ -834,6 +838,7 @@ "TGS_REQ: issuing TGT %s", sname); free(sname); } + krb5_free_realm_tree(kdc_context, plist); return; } krb5_db_free_principal(kdc_context, server, *nprincs); Modified: branches/krb5-1-6/src/kdc/kdc_util.c =================================================================== --- branches/krb5-1-6/src/kdc/kdc_util.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/kdc/kdc_util.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -1,7 +1,7 @@ /* * kdc/kdc_util.c * - * Copyright 1990,1991 by the Massachusetts Institute of Technology. + * Copyright 1990,1991,2007,2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -425,6 +425,10 @@ retval = krb5_dbekd_decrypt_key_data(kdc_context, &master_keyblock, server_key, *key, NULL); + if (retval) { + free(*key); + *key = NULL; + } } else retval = ENOMEM; errout: Modified: branches/krb5-1-6/src/lib/gssapi/krb5/k5seal.c =================================================================== --- branches/krb5-1-6/src/lib/gssapi/krb5/k5seal.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/gssapi/krb5/k5seal.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -159,8 +159,10 @@ } code = krb5_c_checksum_length(context, md5cksum.checksum_type, &sumlen); - if (code) + if (code) { + xfree(t); return(code); + } md5cksum.length = sumlen; Modified: branches/krb5-1-6/src/lib/krb5/krb/bld_pr_ext.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/bld_pr_ext.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/krb/bld_pr_ext.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -1,7 +1,7 @@ /* * lib/krb5/krb/bld_pr_ext.c * - * Copyright 1991 by the Massachusetts Institute of Technology. + * Copyright 1991, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -39,7 +39,7 @@ register int i, count = 0; register unsigned int size; register char *next; - char *tmpdata; + char *tmpdata = 0; krb5_data *princ_data; krb5_principal princ_ret; @@ -97,6 +97,7 @@ krb5_xfree(princ_data[i].data); krb5_xfree(princ_data); krb5_xfree(princ_ret); + krb5_xfree(tmpdata); va_end(ap); return ENOMEM; } Modified: branches/krb5-1-6/src/lib/krb5/krb/get_creds.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/get_creds.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/krb/get_creds.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -1,7 +1,7 @@ /* * lib/krb5/krb/get_creds.c * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -207,8 +207,12 @@ retval = 255; break; } + /* + * Callers to krb5_get_cred_blah... must free up tgts even in + * error cases. + */ + if (tgts) krb5_free_tgt_creds(context, tgts); if (retval) return retval; - if (tgts) krb5_free_tgt_creds(context, tgts); retval = krb5_cc_get_principal(context, ccache, &tmp); if (retval) return retval; Modified: branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -997,13 +997,15 @@ /* stuff the client realm into the server principal. realloc if necessary */ - if (request.server->realm.length < request.client->realm.length) - if ((request.server->realm.data = - (char *) realloc(request.server->realm.data, - request.client->realm.length)) == NULL) { + if (request.server->realm.length < request.client->realm.length) { + char *p = realloc(request.server->realm.data, + request.client->realm.length); + if (p == NULL) { ret = ENOMEM; goto cleanup; } + request.server->realm.data = p; + } request.server->realm.length = request.client->realm.length; memcpy(request.server->realm.data, request.client->realm.data, Modified: branches/krb5-1-6/src/lib/krb5/krb/gic_opt.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/gic_opt.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/krb/gic_opt.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -306,6 +306,7 @@ newpad = realloc(opte->opt_private->preauth_data, newsize); if (newpad == NULL) return ENOMEM; + opte->opt_private->preauth_data = newpad; i = opte->opt_private->num_preauth_data; newpad[i].attr = strdup(attr); @@ -317,7 +318,6 @@ return ENOMEM; } opte->opt_private->num_preauth_data += 1; - opte->opt_private->preauth_data = newpad; return 0; } Modified: branches/krb5-1-6/src/lib/krb5/krb/init_ctx.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/init_ctx.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/krb/init_ctx.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -360,8 +360,10 @@ if ((old_ktypes = (krb5_enctype *)malloc(sizeof(krb5_enctype) * (count + 1))) == - (krb5_enctype *) NULL) + (krb5_enctype *) NULL) { + profile_release_string(retval); return ENOMEM; + } sp = retval; j = 0; Modified: branches/krb5-1-6/src/lib/krb5/os/an_to_ln.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/os/an_to_ln.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/krb5/os/an_to_ln.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -1,7 +1,7 @@ /* * lib/krb5/os/an_to_ln.c * - * Copyright 1990,1991 by the Massachusetts Institute of Technology. + * Copyright 1990,1991,2007,2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -438,7 +438,7 @@ memset(out, '\0', MAX_FORMAT_BUFFER); if (!do_replacement(rule, repl, doglobal, in, out)) { free(rule); - free(repl); + free(repl); kret = KRB5_LNAME_NOTRANS; break; } @@ -453,6 +453,7 @@ } else { /* No memory for copies */ + free(rule); kret = ENOMEM; break; } Modified: branches/krb5-1-6/src/lib/rpc/auth_gss.c =================================================================== --- branches/krb5-1-6/src/lib/rpc/auth_gss.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/lib/rpc/auth_gss.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -186,6 +186,7 @@ rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = ENOMEM; free(auth); + free(gd); return (NULL); } } Modified: branches/krb5-1-6/src/plugins/kdb/db2/adb_policy.c =================================================================== --- branches/krb5-1-6/src/plugins/kdb/db2/adb_policy.c 2009-07-01 16:23:25 UTC (rev 22425) +++ branches/krb5-1-6/src/plugins/kdb/db2/adb_policy.c 2009-07-09 01:54:50 UTC (rev 22426) @@ -358,6 +358,7 @@ if(!xdr_osa_policy_ent_rec(&xdrs, entry)) { xdr_destroy(&xdrs); free(aligned_data); + osa_free_policy_ent(entry); ret = OSA_ADB_FAILURE; goto error; } From tlyu at MIT.EDU Wed Jul 8 21:59:09 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 8 Jul 2009 21:59:09 -0400 Subject: svn rev #22428: branches/krb5-1-6/src/lib/kadm5/clnt/ Message-ID: <200907090159.n691x9ew011392@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22428 Commit By: tlyu Log Message: ticket: 6053 version_fixed: 1.6.4 pull up r20580 from trunk ------------------------------------------------------------------------ r20580 | raeburn | 2008-07-25 15:19:06 -0400 (Fri, 25 Jul 2008) | 8 lines ticket: new target_version: 1.6.4 tags: pullup subject: fix possible uninit variable use in error path Clear gss_client and gss_target before any possible branch to 'error', where they can be used. Changed Files: U branches/krb5-1-6/src/lib/kadm5/clnt/client_init.c Modified: branches/krb5-1-6/src/lib/kadm5/clnt/client_init.c =================================================================== --- branches/krb5-1-6/src/lib/kadm5/clnt/client_init.c 2009-07-09 01:59:03 UTC (rev 22427) +++ branches/krb5-1-6/src/lib/kadm5/clnt/client_init.c 2009-07-09 01:59:08 UTC (rev 22428) @@ -569,6 +569,7 @@ code = KADM5_GSS_ERROR; gss_client_creds = GSS_C_NO_CREDENTIAL; ccname_orig = NULL; + gss_client = gss_target = GSS_C_NO_NAME; /* Temporarily use the kadm5 cache. */ gssstat = gss_krb5_ccache_name(&minor_stat, handle->cache_name, From tlyu at MIT.EDU Wed Jul 8 21:59:03 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 8 Jul 2009 21:59:03 -0400 Subject: svn rev #22427: branches/krb5-1-6/src/ kadmin/server/ kdc/ lib/krb5/krb/ slave/ Message-ID: <200907090159.n691x3HF011340@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22427 Commit By: tlyu Log Message: ticket: 5998 version_fixed: 1.6.4 pull up r20485 from trunk ------------------------------------------------------------------------ r20485 | raeburn | 2008-06-26 23:33:14 -0400 (Thu, 26 Jun 2008) | 8 lines ticket: new target_version: 1.6.4 tags: pullup subject: use-after-free bugs Fix some bugs with storage being used immediately after being freed. None look like anything an attacker can really manipulate AFAICT. Changed Files: U branches/krb5-1-6/src/kadmin/server/server_stubs.c U branches/krb5-1-6/src/kdc/network.c U branches/krb5-1-6/src/lib/krb5/krb/mk_cred.c U branches/krb5-1-6/src/slave/kprop.c Modified: branches/krb5-1-6/src/kadmin/server/server_stubs.c =================================================================== --- branches/krb5-1-6/src/kadmin/server/server_stubs.c 2009-07-09 01:54:50 UTC (rev 22426) +++ branches/krb5-1-6/src/kadmin/server/server_stubs.c 2009-07-09 01:59:03 UTC (rev 22427) @@ -1628,7 +1628,7 @@ } if (ret.code != 0) - errmsg = krb5_get_error_message(handle ? handle->context : NULL, ret.code); + errmsg = krb5_get_error_message(NULL, ret.code); else errmsg = "success"; Modified: branches/krb5-1-6/src/kdc/network.c =================================================================== --- branches/krb5-1-6/src/kdc/network.c 2009-07-09 01:54:50 UTC (rev 22426) +++ branches/krb5-1-6/src/kdc/network.c 2009-07-09 01:59:03 UTC (rev 22427) @@ -775,10 +775,8 @@ return; } if (cc != response->length) { - krb5_free_data(kdc_context, response); com_err(prog, 0, "short reply write %d vs %d\n", response->length, cc); - return; } krb5_free_data(kdc_context, response); return; Modified: branches/krb5-1-6/src/lib/krb5/krb/mk_cred.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/mk_cred.c 2009-07-09 01:54:50 UTC (rev 22426) +++ branches/krb5-1-6/src/lib/krb5/krb/mk_cred.c 2009-07-09 01:59:03 UTC (rev 22427) @@ -176,8 +176,8 @@ if ((pcred->tickets = (krb5_ticket **)malloc(sizeof(krb5_ticket *) * (ncred + 1))) == NULL) { - retval = ENOMEM; free(pcred); + return ENOMEM; } memset(pcred->tickets, 0, sizeof(krb5_ticket *) * (ncred +1)); Modified: branches/krb5-1-6/src/slave/kprop.c =================================================================== --- branches/krb5-1-6/src/slave/kprop.c 2009-07-09 01:54:50 UTC (rev 22426) +++ branches/krb5-1-6/src/slave/kprop.c 2009-07-09 01:59:03 UTC (rev 22427) @@ -1,7 +1,7 @@ /* * slave/kprop.c * - * Copyright 1990,1991 by the Massachusetts Institute of Technology. + * Copyright 1990,1991,2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -505,12 +505,12 @@ free(data_ok_fn); exit(1); } - free(data_ok_fn); if (stbuf.st_mtime > stbuf_ok.st_mtime) { com_err(progname, 0, "'%s' more recent than '%s'.", data_fn, data_ok_fn); exit(1); } + free(data_ok_fn); *size = stbuf.st_size; return(fd); } From tlyu at MIT.EDU Thu Jul 9 14:12:32 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 9 Jul 2009 14:12:32 -0400 Subject: svn rev #22429: branches/krb5-1-6/src/lib/krb5/krb/ Message-ID: <200907091812.n69ICWvJ013591@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22429 Commit By: tlyu Log Message: ticket: 6064 version_fixed: 1.6.4 status: resolved pull up r20608 from trunk ------------------------------------------------------------------------ r20608 | raeburn | 2008-08-05 20:05:47 -0400 (Tue, 05 Aug 2008) | 9 lines ticket: new subject: fix cleanup code in allocating preauth info target_version: 1.6.4 tags: pullup After an allocation failure, free up the previously allocated array elements by counting back down to zero, not continuing to count up until we hit zero. Changed Files: U branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c Modified: branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c 2009-07-09 01:59:08 UTC (rev 22428) +++ branches/krb5-1-6/src/lib/krb5/krb/get_in_tkt.c 2009-07-09 18:12:32 UTC (rev 22429) @@ -1,7 +1,7 @@ /* * lib/krb5/krb/get_in_tkt.c * - * Copyright 1990,1991, 2003 by the Massachusetts Institute of Technology. + * Copyright 1990,1991, 2003, 2008 by the Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -409,7 +409,7 @@ for (i=0; i=0; i++) + for (; i>=0; i--) free(preauthp[i]); free(preauthp); return (ENOMEM); From ghudson at MIT.EDU Thu Jul 9 15:10:58 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Thu, 9 Jul 2009 15:10:58 -0400 Subject: svn rev #22431: trunk/src/tests/dejagnu/ Message-ID: <200907091910.n69JAwEd019172@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22431 Commit By: ghudson Log Message: In tests/dejagnu/Makefile.in, remove a --srcdir option which was redundant with the one in pre.in. Changed Files: U trunk/src/tests/dejagnu/Makefile.in Modified: trunk/src/tests/dejagnu/Makefile.in =================================================================== --- trunk/src/tests/dejagnu/Makefile.in 2009-07-09 19:07:30 UTC (rev 22430) +++ trunk/src/tests/dejagnu/Makefile.in 2009-07-09 19:10:57 UTC (rev 22431) @@ -22,7 +22,7 @@ # Set VALGRIND at run time, that may be changed when running 'make'. check-runtest-yes:: t_inetd site.exp - $(RUNTEST) --tool krb --srcdir $(srcdir) VALGRIND="$(VALGRIND)" $(RUNTESTFLAGS) + $(RUNTEST) --tool krb VALGRIND="$(VALGRIND)" $(RUNTESTFLAGS) t_inetd:: t_inetd.o $(KRB5_BASE_DEPLIBS) $(CC_LINK) -o t_inetd t_inetd.o $(KRB5_BASE_LIBS) From ghudson at MIT.EDU Thu Jul 9 15:07:31 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Thu, 9 Jul 2009 15:07:31 -0400 Subject: svn rev #22430: trunk/src/config/ Message-ID: <200907091907.n69J7VtZ018830@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22430 Commit By: ghudson Log Message: In pre.in, remove some variable expansions in the definition of DEJAFLAGS which aren't used anywhere in the tree. Changed Files: U trunk/src/config/pre.in Modified: trunk/src/config/pre.in =================================================================== --- trunk/src/config/pre.in 2009-07-09 18:12:32 UTC (rev 22429) +++ trunk/src/config/pre.in 2009-07-09 19:07:30 UTC (rev 22430) @@ -242,8 +242,7 @@ # 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) +DEJAFLAGS = --debug --srcdir $(srcdir) --host $(host) RUNTEST = runtest $(DEJAFLAGS) START_SERVERS = $(STESTDIR)/scripts/start_servers $(TEST_SERVER) $(TEST_PATH) From tlyu at MIT.EDU Thu Jul 9 18:08:57 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 9 Jul 2009 18:08:57 -0400 Subject: svn rev #22432: trunk/src/kadmin/cli/ Message-ID: <200907092208.n69M8vpJ002553@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22432 Commit By: tlyu Log Message: Make datetest buildable again. Changed Files: U trunk/src/kadmin/cli/Makefile.in U trunk/src/kadmin/cli/getdate.y Modified: trunk/src/kadmin/cli/Makefile.in =================================================================== --- trunk/src/kadmin/cli/Makefile.in 2009-07-09 19:10:57 UTC (rev 22431) +++ trunk/src/kadmin/cli/Makefile.in 2009-07-09 22:08:57 UTC (rev 22432) @@ -39,8 +39,9 @@ clean:: $(RM) $(PROG).local $(PROG) $(COMMON_OBJS) $(KADMIN_OBJS) $(LOCAL_OBJS) clean-unix:: - $(RM) getdate.c kadmin_ct.c + $(RM) datetest getdate.c kadmin_ct.c # for testing getdate.y +# CC_LINK is not meant for compilation and this use may break in the future. datetest: getdate.c - $(CC) -o datetest $(ALL_CFLAGS) $(LDFLAGS) $(LDARGS) -DTEST getdate.c + $(CC_LINK) $(ALL_CFLAGS) -DTEST -o datetest getdate.c Modified: trunk/src/kadmin/cli/getdate.y =================================================================== --- trunk/src/kadmin/cli/getdate.y 2009-07-09 19:10:57 UTC (rev 22431) +++ trunk/src/kadmin/cli/getdate.y 2009-07-09 22:08:57 UTC (rev 22432) @@ -1053,7 +1053,7 @@ (void)printf("Enter date, or blank line to exit.\n\t> "); (void)fflush(stdout); while (gets(buff) && buff[0]) { - d = get_date(buff, (struct my_timeb *)NULL); + d = get_date(buff); if (d == -1) (void)printf("Bad format - couldn't convert.\n"); else From ghudson at MIT.EDU Fri Jul 10 15:13:18 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Fri, 10 Jul 2009 15:13:18 -0400 Subject: svn rev #22433: trunk/src/tests/dejagnu/config/ Message-ID: <200907101913.n6AJDImK011424@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22433 Commit By: ghudson Log Message: In the dejagnu test suite, remove the no-longer-used check_klogin function. Changed Files: U trunk/src/tests/dejagnu/config/default.exp Modified: trunk/src/tests/dejagnu/config/default.exp =================================================================== --- trunk/src/tests/dejagnu/config/default.exp 2009-07-09 22:08:57 UTC (rev 22432) +++ trunk/src/tests/dejagnu/config/default.exp 2009-07-10 19:13:17 UTC (rev 22433) @@ -567,37 +567,6 @@ return 0 } -proc check_klogin { testname } { - global env - global REALMNAME - - if {![file exists ~/.klogin]} { - if {$env(USER) == "root"} { - return 0 - } else { - return 1 - } - } - - verbose "looking for $env(USER) in ~/.klogin" 2 - set file [open ~/.klogin r] - while { [gets $file principal] != -1 } { - verbose " found $principal" 2 - if { $principal == "$env(USER)" \ - || $principal == "$env(USER)@$REALMNAME" } { - close $file - return 1 - } - } - close $file - - note "$testname test requires that your name appear in your ~/.klogin" - note "file without a realm." - unsupported "$testname" - - return 0 -} - # check_exit_status # Check the exit status of a spawned program (using the caller's value # of spawn_id). Returns 1 if the program succeeded, 0 if it failed. From tlyu at MIT.EDU Fri Jul 10 15:20:26 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Fri, 10 Jul 2009 15:20:26 -0400 Subject: svn rev #22434: trunk/src/ kadmin/dbutil/ kadmin/server/ kadmin/testing/scripts/ ... Message-ID: <200907101920.n6AJKQhg012300@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22434 Commit By: tlyu Log Message: ticket: 1233 Add a new '-W' option to kadmind and kdb5_util create to allow reading weak random numbers on startup, to avoid long delays in testing situations. Use only for testing. Update testing scripts accordingly. Changed Files: U trunk/src/kadmin/dbutil/kdb5_create.c U trunk/src/kadmin/server/ovsec_kadmd.c U trunk/src/kadmin/testing/scripts/start_servers_local U trunk/src/tests/dejagnu/config/default.exp Modified: trunk/src/kadmin/dbutil/kdb5_create.c =================================================================== --- trunk/src/kadmin/dbutil/kdb5_create.c 2009-07-10 19:13:17 UTC (rev 22433) +++ trunk/src/kadmin/dbutil/kdb5_create.c 2009-07-10 19:20:26 UTC (rev 22434) @@ -167,8 +167,9 @@ krb5_data pwd, seed; kdb_log_context *log_ctx; krb5_kvno mkey_kvno; + int strong_random = 1; - while ((optchar = getopt(argc, argv, "s")) != -1) { + while ((optchar = getopt(argc, argv, "sW")) != -1) { switch(optchar) { case 's': do_stash++; @@ -179,6 +180,9 @@ exit(1); } break; + case 'W': + strong_random = 0; + break; case '?': default: usage(); @@ -196,7 +200,7 @@ log_ctx = util_context->kdblog_context; printf ("Loading random data\n"); - retval = krb5_c_random_os_entropy (util_context, 1, NULL); + retval = krb5_c_random_os_entropy (util_context, strong_random, NULL); if (retval) { com_err (progname, retval, "Loading random data"); exit_status++; return; Modified: trunk/src/kadmin/server/ovsec_kadmd.c =================================================================== --- trunk/src/kadmin/server/ovsec_kadmd.c 2009-07-10 19:13:17 UTC (rev 22433) +++ trunk/src/kadmin/server/ovsec_kadmd.c 2009-07-10 19:20:26 UTC (rev 22434) @@ -222,6 +222,7 @@ int db_args_size = 0; char *errmsg; int i; + int strong_random = 1; kdb_log_context *log_ctx; @@ -292,6 +293,8 @@ usage(); params.kadmind_port = atoi(*argv); params.mask |= KADM5_CONFIG_KADMIND_PORT; + } else if (strcmp(*argv, "-W") == 0) { + strong_random = 0; } else break; argc--; argv++; @@ -490,7 +493,7 @@ } krb5_klog_syslog(LOG_INFO, "Seeding random number generator"); - ret = krb5_c_random_os_entropy(context, 1, NULL); + ret = krb5_c_random_os_entropy(context, strong_random, NULL); if (ret) { krb5_klog_syslog(LOG_ERR, "Error getting random seed: %s, aborting", krb5_get_error_message(context, ret)); Modified: trunk/src/kadmin/testing/scripts/start_servers_local =================================================================== --- trunk/src/kadmin/testing/scripts/start_servers_local 2009-07-10 19:13:17 UTC (rev 22433) +++ trunk/src/kadmin/testing/scripts/start_servers_local 2009-07-10 19:20:26 UTC (rev 22434) @@ -121,6 +121,8 @@ sofar_s=0 timewait_s=300 +ovadm_args=-W + while true; do rm -f $adm_start_file Modified: trunk/src/tests/dejagnu/config/default.exp =================================================================== --- trunk/src/tests/dejagnu/config/default.exp 2009-07-10 19:13:17 UTC (rev 22433) +++ trunk/src/tests/dejagnu/config/default.exp 2009-07-10 19:20:26 UTC (rev 22434) @@ -1224,7 +1224,7 @@ } #exec xterm verbose "starting $test" - spawn $KDB5_UTIL -r $REALMNAME create + spawn $KDB5_UTIL -r $REALMNAME create -W expect_after $def_exp_after expect "Enter KDC database master key:" @@ -1775,7 +1775,7 @@ # removed when this is fixed envstack_push setup_kerberos_env kdc - spawn $BINSH -c "exec $KADMIND -r $REALMNAME -nofork 2>>$kadmind_lfile" + spawn $BINSH -c "exec $KADMIND -r $REALMNAME -W -nofork 2>>$kadmind_lfile" envstack_pop set kadmind_pid [exp_pid] set kadmind_spawn_id $spawn_id From tlyu at MIT.EDU Fri Jul 10 15:46:21 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Fri, 10 Jul 2009 15:46:21 -0400 Subject: svn rev #22435: trunk/src/tests/dejagnu/config/ Message-ID: <200907101946.n6AJkLP7014730@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22435 Commit By: tlyu Log Message: ticket: 6530 target_version: 1.7.1 tags: pullup subject: check for slogin failure in setup_root_shell Add a check for a slogin message that indicates an unknown public key fingerprint, as rlogin looks like it points to slogin by default on Debian Lenny. Changed Files: U trunk/src/tests/dejagnu/config/default.exp Modified: trunk/src/tests/dejagnu/config/default.exp =================================================================== --- trunk/src/tests/dejagnu/config/default.exp 2009-07-10 19:20:26 UTC (rev 22434) +++ trunk/src/tests/dejagnu/config/default.exp 2009-07-10 19:46:20 UTC (rev 22435) @@ -2460,7 +2460,7 @@ set got_refused 1 exp_continue } - -re "word:|erberos rlogin failed|ection refused|ection reset by peer|not authorized|Ticket expired" { + -re "word:|erberos rlogin failed|ection refused|ection reset by peer|not authorized|Ticket expired|authenticity of" { note "$testname test requires ability to rlogin as root" unsupported "$testname" set timeout $old_timeout From tlyu at MIT.EDU Mon Jul 13 17:59:02 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Mon, 13 Jul 2009 17:59:02 -0400 Subject: svn rev #22439: branches/commit-handler-test/ Message-ID: <200907132159.n6DLx2LG015668@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22439 Commit By: tlyu Log Message: test Changed Files: A branches/commit-handler-test/aaaa/ From tlyu at MIT.EDU Mon Jul 13 17:58:18 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Mon, 13 Jul 2009 17:58:18 -0400 Subject: svn rev #22438: branches/commit-handler-test/ Message-ID: <200907132158.n6DLwI9d015584@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22438 Commit By: tlyu Log Message: test Changed Files: D branches/commit-handler-test/aaaa/ From tlyu at MIT.EDU Mon Jul 13 18:00:48 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Mon, 13 Jul 2009 18:00:48 -0400 Subject: svn rev #22440: branches/commit-handler-test/aaaa/ Message-ID: <200907132200.n6DM0m2R015892@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22440 Commit By: tlyu Log Message: test Changed Files: A branches/commit-handler-test/aaaa/foo Added: branches/commit-handler-test/aaaa/foo =================================================================== --- branches/commit-handler-test/aaaa/foo 2009-07-13 21:59:02 UTC (rev 22439) +++ branches/commit-handler-test/aaaa/foo 2009-07-13 22:00:48 UTC (rev 22440) @@ -0,0 +1 @@ +foo From tlyu at MIT.EDU Thu Jul 16 17:52:31 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 16 Jul 2009 17:52:31 -0400 Subject: svn rev #22442: branches/krb5-1-6/src/lib/krb5/os/ Message-ID: <200907162152.n6GLqVhk022227@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22442 Commit By: tlyu Log Message: ticket: 6433 version_fixed: 1.6.4 status: resolved pull up r20479 from trunk. The ticket numbers don't match because reported on the 1.6 branch. ------------------------------------------------------------------------ r20479 | raeburn | 2008-06-26 20:31:59 -0400 (Thu, 26 Jun 2008) | 8 lines ticket: 5925 status: open Don't do FD_SETSIZE check on Windows. Also, for form's sake, use closesocket instead of close inside the check. Kevin or Jeff, could you please verify that the code works again? Changed Files: U branches/krb5-1-6/src/lib/krb5/os/sendto_kdc.c Modified: branches/krb5-1-6/src/lib/krb5/os/sendto_kdc.c =================================================================== --- branches/krb5-1-6/src/lib/krb5/os/sendto_kdc.c 2009-07-14 01:56:47 UTC (rev 22441) +++ branches/krb5-1-6/src/lib/krb5/os/sendto_kdc.c 2009-07-16 21:52:30 UTC (rev 22442) @@ -654,12 +654,14 @@ dprint("socket: %m creating with af %d\n", state->err, ai->ai_family); return -1; /* try other hosts */ } +#ifndef _WIN32 /* On Windows FD_SETSIZE is a count, not a max value. */ if (fd >= FD_SETSIZE) { - close(fd); + closesocket(fd); state->err = EMFILE; dprint("socket: fd %d too high\n", fd); return -1; } +#endif /* Make it non-blocking. */ if (ai->ai_socktype == SOCK_STREAM) { static const int one = 1; From tlyu at MIT.EDU Thu Jul 16 21:35:59 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 16 Jul 2009 21:35:59 -0400 Subject: svn rev #22443: trunk/src/appl/gssftp/ftp/ Message-ID: <200907170135.n6H1ZxBg008743@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22443 Commit By: tlyu Log Message: ticket: 6531 target_version: 1.6.4 tags: pullup subject: include win-mac.h in gssftp/ftp/cmds.c for HAVE_STDLIB_H gssftp/ftp/cmds.c had a preprocessor conditional on HAVE_STDLIB_H that will not evaluate correctly on WIN32 unless win-mac.h is included first. Changed Files: U trunk/src/appl/gssftp/ftp/cmds.c Modified: trunk/src/appl/gssftp/ftp/cmds.c =================================================================== --- trunk/src/appl/gssftp/ftp/cmds.c 2009-07-16 21:52:30 UTC (rev 22442) +++ trunk/src/appl/gssftp/ftp/cmds.c 2009-07-17 01:35:58 UTC (rev 22443) @@ -38,6 +38,10 @@ /* * FTP User Program -- Command Routines. */ +#ifdef _WIN32 +#include +#endif + #ifdef HAVE_STDLIB_H #include #endif From tlyu at MIT.EDU Thu Jul 16 21:45:23 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 16 Jul 2009 21:45:23 -0400 Subject: svn rev #22444: branches/krb5-1-6/src/appl/gssftp/ftp/ Message-ID: <200907170145.n6H1jNST009563@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22444 Commit By: tlyu Log Message: ticket; 6531 version_fixed: 1.6.4 pull up r22443 from trunk ------------------------------------------------------------------------ r22443 | tlyu | 2009-07-16 21:35:58 -0400 (Thu, 16 Jul 2009) | 8 lines ticket: 6531 target_version: 1.6.4 tags: pullup subject: include win-mac.h in gssftp/ftp/cmds.c for HAVE_STDLIB_H gssftp/ftp/cmds.c had a preprocessor conditional on HAVE_STDLIB_H that will not evaluate correctly on WIN32 unless win-mac.h is included first. Changed Files: U branches/krb5-1-6/src/appl/gssftp/ftp/cmds.c Modified: branches/krb5-1-6/src/appl/gssftp/ftp/cmds.c =================================================================== --- branches/krb5-1-6/src/appl/gssftp/ftp/cmds.c 2009-07-17 01:35:58 UTC (rev 22443) +++ branches/krb5-1-6/src/appl/gssftp/ftp/cmds.c 2009-07-17 01:45:23 UTC (rev 22444) @@ -38,6 +38,10 @@ /* * FTP User Program -- Command Routines. */ +#ifdef _WIN32 +#include +#endif + #ifdef HAVE_STDLIB_H #include #endif From tlyu at MIT.EDU Wed Jul 22 14:55:20 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 22 Jul 2009 14:55:20 -0400 Subject: svn rev #22445: branches/krb5-1-6/src/ config/ windows/ windows/build/ windows/identity/ ... Message-ID: <200907221855.n6MItK75024966@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22445 Commit By: tlyu Log Message: ticket: 6535 subject: jumbo pullup for kfw-3.2.3-alpha1 version_fixed: 1.6.4 This is a jumbo pullup of multiple KfW-related changes. The are primarily build system fixes, including changes to enable building on amd64. Included are some changes from branches/kpkoch-ccapi that have not yet been merged to the trunk. Relevant RT ticket numbers include: 5817 5819 6007 Changed Files: U branches/krb5-1-6/src/config/win-pre.in U branches/krb5-1-6/src/patchlevel.h U branches/krb5-1-6/src/windows/Makefile.in U branches/krb5-1-6/src/windows/build/BKWconfig.xml U branches/krb5-1-6/src/windows/build/bkw-automation.html U branches/krb5-1-6/src/windows/build/bkw.pl U branches/krb5-1-6/src/windows/build/copyfiles.pl U branches/krb5-1-6/src/windows/build/copyfiles.xml U branches/krb5-1-6/src/windows/build/corebinaryfiles.xml U branches/krb5-1-6/src/windows/build/sdkfiles.xml U branches/krb5-1-6/src/windows/identity/Makefile U branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile U branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile.w2k U branches/krb5-1-6/src/windows/identity/plugins/krb5/Makefile U branches/krb5-1-6/src/windows/identity/ui/Makefile U branches/krb5-1-6/src/windows/identity/ui/Makefile.w2k U branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed.nsi U branches/krb5-1-6/src/windows/installer/nsis/nsi-includes-tagged.nsi U branches/krb5-1-6/src/windows/installer/nsis/site-local-tagged.nsi U branches/krb5-1-6/src/windows/installer/wix/custom/custom.cpp U branches/krb5-1-6/src/windows/installer/wix/features.wxi U branches/krb5-1-6/src/windows/installer/wix/files.wxi U branches/krb5-1-6/src/windows/installer/wix/platform.wxi U branches/krb5-1-6/src/windows/installer/wix/site-local-tagged.wxi U branches/krb5-1-6/src/windows/winlevel.h Modified: branches/krb5-1-6/src/config/win-pre.in =================================================================== --- branches/krb5-1-6/src/config/win-pre.in 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/config/win-pre.in 2009-07-22 18:55:18 UTC (rev 22445) @@ -45,7 +45,7 @@ !endif # NOTE: ^ is an escape char for NMAKE. -!ifdef NODEBUG +!if defined(NODEBUG) && "$(NODEBUG)" == "1" OUTPRE_DBG=rel !else OUTPRE_DBG=dbg @@ -134,7 +134,7 @@ CCOPTS=-nologo /W3 $(PDB_OPTS) $(DLL_FILE_DEF) LOPTS=-nologo -incremental:no -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if (("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )) && (!defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0") CCLINKOPTION=/link bufferoverflowu.lib SCLIB=bufferoverflowu.lib DEBUGOPT=/Zi @@ -162,8 +162,8 @@ # CCOPTS was for DLL compiles # CCOPTS2 was for non-DLL compiles (EXEs, for example) # -!ifdef NODEBUG -!ifdef DEBUG_SYMBOL +!if defined(NODEBUG) && "$(NODEBUG)" == "1" +!if defined(DEBUG_SYMBOL) && "$(DEBUG_SYMBOL)" == "1" CCOPTS=$(DEBUGOPT) $(CCOPTS) LOPTS=$(LOPTS) -debug !endif Modified: branches/krb5-1-6/src/patchlevel.h =================================================================== --- branches/krb5-1-6/src/patchlevel.h 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/patchlevel.h 2009-07-22 18:55:18 UTC (rev 22445) @@ -53,6 +53,6 @@ #define KRB5_MAJOR_RELEASE 1 #define KRB5_MINOR_RELEASE 6 #define KRB5_PATCHLEVEL 4 -#define KRB5_RELTAIL "beta1-postrelease" +#define KRB5_RELTAIL "beta1-kfw-3.2.3-alpha1" /* #undef KRB5_RELDATE */ -#define KRB5_RELTAG "branches/krb5-1-6" +#define KRB5_RELTAG "tags/kfw_3-2-3-alpha1" Modified: branches/krb5-1-6/src/windows/Makefile.in =================================================================== --- branches/krb5-1-6/src/windows/Makefile.in 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/Makefile.in 2009-07-22 18:55:18 UTC (rev 22445) @@ -4,7 +4,7 @@ # # Makefile that recurses into cns subdirectory. # -all-windows:: +all-windows:: ntsecapitest @echo Making in windows\lib cd lib $(MAKE) -$(MFLAGS) @@ -33,7 +33,7 @@ !endif cd .. -clean-windows:: +clean-windows:: clean-ntsecapitest @echo Making clean in windows\lib cd lib $(MAKE) -$(MFLAGS) clean @@ -61,3 +61,17 @@ $(MAKE) -$(MFLAGS) clean !endif cd .. + +# If ntsecapi.h contains the string that indicates it came from the Vista SDK, +# then ntsecapitest.i will be left behind. If the string is not present, +# ntsecapitest.i will be deleted. +ntsecapitest:: clean-ntsecapitest ntsecapitest.i + copy ntsecapitest.i ntsecapitest.copy + ntsecapitest.pl + +clean-ntsecapitest:: + @echo "Cleaning ntsecapitest.i" + $(RM) ntsecapitest.i + +{}.c{}.i: + @$(C_RULE) -P Modified: branches/krb5-1-6/src/windows/build/BKWconfig.xml =================================================================== --- branches/krb5-1-6/src/windows/build/BKWconfig.xml 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/BKWconfig.xml 2009-07-22 18:55:18 UTC (rev 22445) @@ -29,21 +29,23 @@ - + - + + + - - + + - - - + + + @@ -61,9 +63,9 @@ - - - + + + @@ -87,7 +89,7 @@ @@ -96,13 +98,15 @@ Paths that include (or ) will only have the tag substituted and be copied when doing a debug (or release) build. Examples: Will always be copied, from a build-dependent directory: - + Will only be copied in debug build: - + Will always be copied, from a build-independent directory: --> + + @@ -127,7 +131,14 @@ - + + + + + + + + @@ -139,6 +150,8 @@ + + @@ -146,27 +159,45 @@ - + - + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - \ No newline at end of file + Modified: branches/krb5-1-6/src/windows/build/bkw-automation.html =================================================================== --- branches/krb5-1-6/src/windows/build/bkw-automation.html 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/bkw-automation.html 2009-07-22 18:55:18 UTC (rev 22445) @@ -1,356 +1,353 @@ - - lore-bkw-automation - Confluence - - - - - - - -
-
The + + + + lore-bkw-automation - Confluence + + + + + + + + +
+
The Kerberos for Windows (KfW) build is automated.  A script will fetch the sources from a repository and then build, sign and package all the KfW distribution components. -
-
This +
+
This description consists of -
- -

Setting Up the Build Environment

-

KfW is built on a Windows PC, in the default Windows shell (cmd.exe). These - components must be installed:

-
+ +

Setting Up the Build Environment

+

KfW is built on a Windows PC, in the default Windows shell (cmd.exe). These + components must be installed:

+ -

Environment variables

-

+
+
+ The cygwin awk is a link and the MS shell doesn't deal well with that.  Copy c:\tools\cygwin\bin\gawk to c:\tools\cygwin\bin\awk. +

  • + Wix
  • +
  • + + NSIS
  • +

    Environment variables

    +

    All the components above must be in PATH. Installing ActivePerl puts perl in - the PATH. Doxygen, Cygwin, hhc, wix and nsis need to be added.

    -

    perl must be installed so that .pl files are automatically executed with perl. - The ActivePerl installation will do this for you.

    -

    In the INCLUDE path, the Microsoft Platform SDK must come before the Microsoft - Visual C++ include files. Using a Platform SDK Build Environment window will - set this up the right way. 

    -

    If you make your path modifications permanent via Control Panel / System / + the PATH. Doxygen, Cygwin, hhc, wix and nsis need to be added.

    +

    perl must be installed so that .pl files are automatically executed with perl. + The ActivePerl installation will do this for you.

    +

    In the INCLUDE path, the Microsoft Platform SDK must come before the Microsoft + Visual C++ include files. In the PATH path, the Platform SDK bin area must come before the Visual Studio VC\bin area. Using a Platform SDK Build Environment window will + set this up the right way.  Make sure to use a Platform SDK Windows XP Build Environment shell.

    +

    If you make your path modifications permanent via Control Panel / System / Advanced / Environment Variables:  If you use a Platform SDK Build Environment window, it appears that you need to put your PATH components in the - System PATH, not the User PATH.

    -

    Visual Studio installs hhc in C:\Program Files\HTML Help Workshop.

    -

    nmake must be in PATH. If you use a Platform SDK build environment window, it is - already done for you.

    -

    Running the Script

    -

    - The build is a perl script controlled by command line switches and an XML + System PATH, not the User PATH.

    +

    Visual Studio installs hhc in C:\Program Files\HTML Help Workshop.

    +

    nmake must be in PATH. If you use a Platform SDK build environment window, it is + already done for you.

    +

    Running the Script

    +

    The build is a perl script controlled by command line switches and an XML configuration file. The config file is required. Settings in the config file - can be overridden by optional command line switches. 

    -

    There are options for controlling most steps of the build process.  The - steps are

    -
      -
    • - Verifying the environment -
    • - Fetching the sources from repositories -
    • - Building the sources -
    • - Setting up the packaging environment -
    • - Building the installers -
    • - Building the rest of the components -
    • -
    -

    The usage message shows the switches that control these steps:

    -

    C:\Projects\KfW>perl bkw.pl /?
    - Usage: bkw.pl [options] NMAKE-options

    -

      Options are case insensitive. -

    -

      Options:  -
    -
      /help /?          - usage information (what you now see). -
    -   /config /f path   Path to config file. Default is - bkwconfig.xml. -
    -   /src /s dir       Source directory to use. - Should contain -
    -     -                 - pismere/athena. If cvstag or svntag is null, -
    -       -               - the directory should be prepopulated. -
    -   /out /o dir       Directory to be created - where build results will go -
    -
      /repository checkout | co \ What repository action to take. -
    -      /r       - update   | up \ Options are to checkout, update, export
    -               export   - | ex \ or take no action [skip]. 
    -               - skip
    -   /username /u name username used to access svn if checking out. -
    -   /cvstag /c tag    use -r <tag> - in cvs -command
      /svnbranch /b tag use -/branches/<tag> instead of /trunk.
      /svntag /t tag    use -/tags/<tag> instead of /trunk.
      /debug -/d         Do debug make instead of -release make.
      -/[no]make         -Control the make -step.
      -/clean            Build -clean target.
      -/[no]package      Control the packaging step.
      -/[no]sign         Control -signing -of executable files.
      /verbose -/v       Debug mode - verbose output.
      /logfile /l path  Where to write output. -Default is bkw.pl.log.
      - /nolog            Don't - save output.
    -

    -

      Other: -
    + can be overridden by optional command line switches.

    +

    There are options for controlling most steps of the build process.  The + steps are

    +
      +
    • Verifying the environment
    • +
    • Fetching the sources from repositories
    • +
    • Building the sources
    • +
    • Setting up the packaging environment
    • +
    • Building the installers
    • +
    • Building the rest of the components
    • +
    +

    The usage message shows the switches that control these steps:

    +

    C:\Projects\KfW>perl bkw.pl /?
    + Usage: bkw.pl [options] NMAKE-options

    +

      Options are case insensitive.

    +

      Options: 
    +   /help /?          + usage information (what you now see).
    +   /config /f path   Path to config file. Default is + bkwconfig.xml.
    +   /src /s dir       Source directory to use. + Should contain
    +     +                 + pismere/athena. If cvstag or svntag is null,
    +       +               + the directory should be prepopulated.
    +   /out /o dir       Directory to be created + where build results will go
    +   /cpu /p cputype   CPU type [i386 | AMD64]

    +
    +   /repository checkout | co \ What repository action to take.
    +      /r       + update   | up \ Options are to checkout, update, export
    +               export   + | ex \ or take no action [skip]. 
    +               + skip
    +   /username /u name username used to access svn if checking out. +
    +  /cvstag /c tag    use -r <tag> in cvs command
    +  /svnbranch /b tag use /branches/<tag> instead of /trunk.
    +  /svntag /t tag    use /tags/<tag> instead of /trunk.
    +  /debug /d         Do debug make instead of +release make.
    +  /[no]make         +Control the make step.
    +  /clean            Build +clean target.
    +  /[no]package      Control the packaging step.
    +  /[no]sign         Control signing +of executable files.
    +  /verbose /v       Debug mode - verbose output. 
    +   /vverbose         Debug mode - very verbose output. 
    +  /logfile /l path  Where to write output. Default is bkw.pl.log.
    +  /nolog            Don't save output. +
    +

    +

      Other: +
        NMAKE-options any options you want to pass to NMAKE, which can be: -
    +
                      - (note: /nologo is always used)
    -                   NODEBUG=1

    -

    NMAKE-options any options you want to pass to NMAKE, which can be:
    - (note: /nologo is always used)
    - [ nmake options follow ]

    -


    - Notes on the script steps:

    -

    Verifying the environment:  -
    + (note: /nologo is always used)
    +                   NODEBUG=1

    +

    NMAKE-options any options you want to pass to NMAKE, which can be:
    + (note: /nologo is always used)
    + [ nmake options follow ]

    +


    Notes on the script steps:

    +

    Verifying the environment:  +
    The script tests for each program that it needs and warns if the program isn't - found.

    -

    Fetching sources from repositories:  -
    - If building from a source distribution kit, this section does not apply.

    -

    CVSROOT and SVNURL must be specified in the configuration file.

    -

    A source zip file can only be produced if checking out fresh sources from a - repository. 

    -

    If checking out, the entire pismere directory will be deleted.  A warning - message requires that you confirm this action.

    -

    Building the sources:
    + found.

    +

    Fetching sources from repositories:  +
    + If building from a source distribution kit, this section does not apply.

    +

    CVSROOT and SVNURL must be specified in the configuration file.

    +

    A source zip file can only be produced if checking out fresh sources from a + repository. 

    +

    If checking out, the entire pismere directory will be deleted.  A warning + message requires that you confirm this action.

    +

    Building the sources:
    /DEBUG controls whether a debug or release build is done.  /CLEAN will - build the CLEAN target.

    -

    Setting up the packaging environment :
    -
    The pre-package steps gathers up build results and puts them in a - staging area.  -

    -

    If /SIGN is specified, .exes, .dlls - and .cpls are signed.  The signing command - template is in the configuration file.

    -

    Building the installers:
    - The staging area is copied into a fresh area for - each of the installers.  The installer results are copied back to the - staging area.

    -

    Building the rest of the components:
    - Zip files are built in temporary areas and copied to outdir.  - The installers and assorted files are copied from staging - to outdir.  If /SIGN is specified, the - installers will be signed.

    -

     

    -

    Script Internal Details

    -

    Copy Lists

    -

    CopyLists are used in many places.  For example, files to be put into + build the CLEAN target.

    +

    Setting up the packaging environment :
    +
    The pre-package steps gathers up build results and puts them in a + staging area.  +

    +

    If /SIGN is specified, .exes, .dlls + and .cpls are signed.  The signing command + template is in the configuration file.

    +

    Building the installers:
    + The staging area is copied into a fresh area for + each of the installers.  The installer results are copied back to the + staging area.

    +

    Building the rest of the components:
    + Zip files are built in temporary areas and copied to outdir.  + The installers and assorted files are copied from staging + to outdir.  If /SIGN is specified, the + installers will be signed.

    +

     

    +

    Script Internal Details

    +

    Copy Lists

    +

    CopyLists are used in many places.  For example, files to be put into a .zip are copied to a fresh directory which is then zipped up.  There is - an optional Configuration section and a required Files section. 

    -

    The configuration section defines the roots of the from and to paths and can + an optional Configuration section and a required Files section. 

    +

    The configuration section defines the roots of the from and to paths and can optionally define path substitutions.  -

    -

    The to and from paths are forced by the script rather than being set in the - config file.  Comments in the copyfile xml indicate this.

    -

    Lengthy copy lists can be kept in separate files and included with the Include - directive.  Example:

    -

    <Include path="sdkfiles.xml" />

    -

    Substitution tags

    -

    Filenames in copylists can contain variable 'tags' that are replaced before the +

    +

    The to and from paths are forced by the script rather than being set in the + config file.  Comments in the copyfile xml indicate this.

    +

    Lengthy copy lists can be kept in separate files and included with the Include + directive.  Example:

    +

    <Include path="sdkfiles.xml" />

    +

    Substitution tags

    +

    Filenames in copylists can contain variable 'tags' that are replaced before the file is copied.  Some configuration files contain substitution tags which - customize the configuration.  The supported tags are

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    %VERSION_MAJOR%KfW Version from pismere/athena/include/kerberos.ver.
    %VERSION_MINOR%KfW Version from pismere/athena/include/kerberos.ver.
    %VERSION_PATCH%KfW Version from pismere/athena/include/kerberos.ver.
    %filestem%Defined as kfw-%VERSION_MAJOR%-%VERSION_MINOR%-%VERSION_PATCH%.
    %debug%'dbg.'  Only substituted during a debug build. 
    %release%'rel.'  Only substituted during a release build.  -
    %bldtype%Always substituted, to 'dbg' or 'rel,' depending on the type of build.
    %-DEBUG%'-DEBUG' during a debug build; otherwise empty.
    %BUILDDIR%SRCDIR\pismere.  Used in site-local installer configuration files.
    %TARGETDIR%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
    %CONFIGDIR-WIX%SRCDIR\pismere\staging\sample.  Used in site-local installer configuration - files.
    %CONFIGDIR-NSI%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
    -

    -

    The overall build configuration specifies a debug or release build.  Debug + customize the configuration.  The supported tags are

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    %VERSION_MAJOR%KfW Version from pismere/athena/include/kerberos.ver.
    %VERSION_MINOR%KfW Version from pismere/athena/include/kerberos.ver.
    %VERSION_PATCH%KfW Version from pismere/athena/include/kerberos.ver.
    %filestem%Defined as kfw-%VERSION_MAJOR%-%VERSION_MINOR%-%VERSION_PATCH%.
    %debug%'dbg.'  Only substituted during a debug build. 
    %release%'rel.'  Only substituted during a release build.  +
    %bldtype%Always substituted, to 'dbg' or 'rel,' depending on the type of build.
    %cpu%Always substituted, to the value of the /cpu argument, or the value of the CPU environment variable, if /cpu isn't specified, or to 'i386' if the CPU environment variable isn't specified.
    + %WL% + Word length.  If CPU is i386, '32' will be substituted; otherwise '64' will + be substituted.
    %-DEBUG%'-DEBUG' during a debug build; otherwise empty.
    %BUILDDIR%SRCDIR\pismere.  Used in site-local installer configuration files.
    %TARGETDIR%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
    %CONFIGDIR-WIX%SRCDIR\pismere\staging\sample.  Used in site-local installer configuration + files.
    %CONFIGDIR-NSI%SRCDIR\pismere\staging.  Used in site-local installer configuration files.
    +

    The overall build configuration specifies a debug or release build.  Debug and release results are put in different places.  Files whose location depend on the build type can use %bldtype% in their names.  The script will substitute %bldtype% with either dbg or rel, depending on the build - type. 

    -
    -
    -

    Example

    -
    -

    Here is a copylist entry.  Each segment of the file's path that comes - from a different place is in a different color.

    -

    Release build.  Config file: -

    -

    - - - - - - - - - - - - - -
    <BKW_Config>
    <Config>
    <src value ="C:\bkw" /> -
    -

    -

    Copylist comments:

    -

    <!-- File from paths are relative to - \pismere\athena -->
    <!-- File to paths are relative to \ - pismere\staging - -->
    -

    -

    When the script processes this copylist, it will force the from and to paths as - indicated.

    -

    This line -

    -

    <File name="comerr32.dll" from="..\target\bin\i386\%bldtype%\" - to="\bin\i386" />

    -

    will result in C:\bkw\pismere\athena\..\target\bin\i386\rel\comerr32.dll

    -

    being copied to C:\bkw\pismere\staging\bin\i386\comerr32.dll.

    -

    Other possible attributes in a copylist entry:

    -
      -
    • - notrequired -
    • - newname="filename" -
    • -
    -

    By default, copylist entries are required and the script will die if they aren't - present. To ignore missing files, add notrequired.

    -

    To rename the file, set the newname attribute.

    -

    Remaining Work / Bug List

    -

    Implement RETAIL, OFFICIAL, PRERELEASE, PRIVATE, SPECIAL.

    -

    Figure out what MIT_ONLY, BUILD_KFW, DEBUG_SYMBOL should be.

    -

    TARGET, APPVER.

    -

    NODEBUG=1.  Set if release build.

    -

    Troubleshooting -

    -

    Can't clean directory; can't delete file or directory
    - Make sure a file in the named directory isn't open in another application.

    -

    Can't find kerberos.ver
    - You skipped the repository step and are trying to build in an empty directory.

    -
    - - + type.

    +
    +
    +

    Example

    +

    Here is a copylist entry.  Each segment of the file's path that comes + from a different place is in a different color.

    +

    Release build.  Config file:

    + + + + + + + + + + + + + +
    <BKW_Config>
    <Config>
    <src value ="C:\bkw" /> +
    +

    Copylist comments:

    +

    <!-- File from paths are relative to + <src>\pismere\athena -->
    <!-- File to paths are relative to <src>\ + pismere\staging + -->

    +

    When the script processes this copylist, it will force the from and to paths as + indicated.

    +

    This line

    +

    <File name="comerr32.dll" from="..\target\bin\%cpu%\%bldtype%\" + to="\bin\%cpu%" />

    +

    will result in C:\bkw\pismere\athena\..\target\bin\i386\rel\comerr32.dll

    +

    being copied to C:\bkw\pismere\staging\bin\i386\comerr32.dll.

    +

    Other possible attributes in a copylist entry:

    +
      +
    • notrequired
    • +
    • newname="filename"
    • +
    +

    By default, copylist entries are required and the script will die if they aren't + present. To ignore missing files, add notrequired.

    +

    To rename the file, set the newname attribute.

    + +

    64 bit builds

    +

    + To build a 64 bit version, several things must be done:

    +
      +
    • Set the CPU environment variable to AMD64.
    • +
    • run Program Files (x86)\Microsoft Visual Studio 8\VC\vcvarsall.bat with the argument 'AMD64.' 
    • +
    • Run bkw.pl with /cpu AMD64 /components "base AMD64"
    • +
    +

    If you get errors in the CCAPI part of the build that symbols have been multiply declared, it means you changed the build target between i386 and AMD64 without doing + a bkw.pl clean in between.  +

    + +

    Remaining Work / Bug List

    +

    Implement RETAIL, OFFICIAL, PRERELEASE, PRIVATE, SPECIAL.

    +

    Figure out what MIT_ONLY, BUILD_KFW, DEBUG_SYMBOL should be.

    +

    TARGET, APPVER.

    +

    NODEBUG=1.  Set if release build.

    +

    Troubleshooting +

    +

    Can't clean directory; can't delete file or directory
    + Make sure a file in the named directory isn't open in another application.

    +

    Can't find kerberos.ver
    + You skipped the repository step and are trying to build in an empty directory.

    +

    Directories don't exist or can't be created
    +
    This can be a symptom of the Platform SDK bin area not being before the Visual Studio bin areas, such that the version of nmake running is version 8.x.
    + [This explanation courtesy of Jeff Altman]:
    + nmake V8 appears to favor executables over shell commands. As a result, using 'mkdir' instead of 'md' in Makefiles, as a command for creating directory trees, fails when the Cygwin mkdir.exe is present in the PATH. Changing the

    +

    MKDIR=mkdir
    + RMDIR=rmdir

    +

    macros in the Makefiles to

    +

    MKDIR=md
    + RMDIR=rd

    +

    should make the shell versions execute in all cases.

    +

    CCAPI test directory doesn't build after changing CPU type
    + Make clean might not be cleaning everything out.  Carefully remove any source + files that are copied from lib or server and cached in the test directory.

    +
    + + Modified: branches/krb5-1-6/src/windows/build/bkw.pl =================================================================== --- branches/krb5-1-6/src/windows/build/bkw.pl 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/bkw.pl 2009-07-22 18:55:18 UTC (rev 22445) @@ -22,6 +22,11 @@ my $MAKE = 'NMAKE'; our $config; +# List of programs which must be in PATH: +my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'doxygen', + 'hhc', 'candle', 'light', 'makensis', 'nmake', 'filever'); +my @required_for_repository_access = ('cvs', 'svn', 'plink'); + sub get_info { my $cmd = shift || die; my $which = $^X.' which.pl'; @@ -59,6 +64,8 @@ /[no]package Control the packaging step. /[no]sign Control signing of executable files. /verbose /v Debug mode - verbose output. + /vverbose Debug mode - even more output. + /cpu cpu Type of cpu - i386 or amd64. /logfile /l path Where to write output. Default is bkw.pl.log. /nolog Don't save output. Other: @@ -112,7 +119,8 @@ while (($sw, $val) = each %$odr) { local $arg = $sw; if (exists $val->{abbr}) {$arg .= "|$val->{abbr}";} - if (exists $val->{value}) { ## Can't do both negations and string values. + if (exists $val->{value} || + exists $val->{options}) { ## Can't do both negations and string values. $arg .= ":s"; } else { @@ -130,32 +138,6 @@ delete $OPT->{foo}; -##++ Validate required conditions: - - # List of programs which must be in PATH: - my @required_list = ('sed', 'awk', 'which', 'cat', 'rm', 'cvs', 'svn', 'doxygen', - 'hhc', 'candle', 'light', 'makensis', 'nmake', 'plink', 'filever'); - my $requirements_met = 1; - my $first_missing = 0; - my $error_list = ""; - foreach my $required (@required_list) { - if (!get_info($required)) { - $requirements_met = 0; - if (!$first_missing) { - $first_missing = 1; - $error_list = "Fatal -- Environment problem! The following program(s) are not in PATH:\n"; - } - $error_list .= "$required\n"; - } - } - if (!$requirements_met) { - print $error_list; - print "Info -- Update PATH or install the programs and try again.\n"; - exit(0); - } - -##-- Validate required conditions. - use Time::gmtime; $ENV{DATE} = gmctime()." GMT"; our $originalDir = `cd`; @@ -164,9 +146,6 @@ ##++ Assemble configuration from config file and command line: my $bOutputCleaned = 0; - -#while ($v = each %$OPT) {print "$v: $OPT->{$v}\n";} - # Scan the configuration for switch definitions: while (($sw, $val) = each %$odr) { next if (! exists $val->{def}); ## ?? Should always exist. @@ -174,29 +153,38 @@ # Set/clear environment variables: if ($val->{env}) { if ($val->{def}) {$ENV{$sw} = (exists $val->{value}) ? $val->{value} : 1; } - else {delete $ENV{$sw}; } + else { + delete $ENV{$sw}; + undef $sw; + } } # If the switch is in the command line, override the stored value: if (exists $OPT->{$sw}) { if (exists $val->{value}) { - $val->{value} = $OPT->{$sw}; - $val->{def} = 1; + $val->{value} = $OPT->{$sw}; + $val->{def} = 1; } else { - $val->{def} = $OPT->{$sw}; ## If no, value will be zero. + $val->{def} = 0; } } # If the switch can be negated, test that, too: if ( ! ($val->{def} =~ /A/)) { local $nosw = "no".$sw; - if (exists $OPT->{$nosw}) { - $val->{def} = 0; + if (exists $OPT->{$nosw}) { ## -NO ? + if ($val->{env}) { + if (!$val->{def}) { + print "Deleting environment variable $sw\n"; + delete $ENV{$sw}; + undef $sw; + } + } } } # For any switch definition with fixed values ("options"), validate: - if (exists $val->{options}) { + if ( (exists $val->{options}) && ($val->{def})) { local $bValid = 0; # options can be like value1|syn1 value2|syn2|syn3 foreach $option (split(/ /, $val->{options})) { @@ -229,12 +217,19 @@ local $src = $odr->{src}->{value}; local $out = $odr->{out}->{value}; + # /CPU interacts with CPU environment variable. + if (!$odr->{cpu}->{def}) { ## If not defined locally, + $odr->{cpu}->{value} = $ENV{CPU}; ## use environment variable value. + } + # /COMPONENTS can have a %CPU% substitution tag in it: + $odr->{components}->{value} =~ s/%cpu%/$odr->{cpu}->{value}/g; + if ($clean && $odr->{package}->{def}) { print "Info -- /clean forces /nopackage.\n"; $odr->{package}->{def} = 0; } - if ($vverbose) {print "Debug -- Config: ".Dumper($config);} + if ($verbose) {print "Debug -- Config: ".Dumper($config);} # Test the unix find command: # List of directories where it might be: @@ -292,8 +287,35 @@ if ($len < 1) { die "Fatal -- you won't get far accessing the repository without specifying a username."; } + # If repository action is anything but SKIP, then additional programs must + # be installed to enable repository access: + @required_list = (@required_for_repository_access, @required_list); + } +##++ Validate required conditions: + + my $requirements_met = 1; + my $first_missing = 0; + my $error_list = ""; + foreach my $required (@required_list) { + if (!get_info($required)) { + $requirements_met = 0; + if (!$first_missing) { + $first_missing = 1; + $error_list = "Fatal -- Environment problem! The following program(s) are not in PATH:\n"; + } + $error_list .= "$required\n"; + } + } + if (!$requirements_met) { + print $error_list; + print "Info -- Update PATH or install the programs and try again.\n"; + exit(0); + } + +##-- Validate required conditions. + # (------------------------------------------------) if ( (-d $wd) && ( ($rverb =~ /export/) || ($rverb =~ /checkout/) ) ) { print "\n\nHEADS UP!!\n\n"; @@ -315,14 +337,10 @@ $l->no_die_handler; ## Needed so XML::Simple won't throw exceptions. } + print "Command line options:\n"; + while ($v = each %$OPT) {print "$v: $OPT->{$v}\n";} + print "Executing $cmdline\n"; - local $argvsize = @ARGV; - local $nmakeargs = ""; - if ($argvsize > 0) { - map {$nmakeargs .= " $_ "} @ARGV; - print "Arguments for NMAKE: $nmakeargs\n"; - } - print "Info -- Using unix find in $odr->{unixfind}->{value}\n" if ($verbose); ##++ Begin repository action: @@ -412,7 +430,7 @@ # ** Do this now (after repository update and before first zip) # because making zip files requires some configuration data be set up. local $version_path = $config->{Stages}->{Package}->{Config}->{Paths}->{Versions}->{path}; - open(DAT, "$src/$version_path") or die "Could not open $version_path."; + open(DAT, "$src/$version_path") or die "Could not open $src/$version_path."; @raw = ; close DAT; foreach $line (@raw) { @@ -497,7 +515,7 @@ $path = "athena\\wshelper\\wshelper\\Makefile.src"; if (!-e $path) {die "Fatal -- Expected file $wd\\$path not found.";} if (system("grep DEBUG_SYMBOL $path > NUL") != 0) { - !system ("echo DEBUG_SYMBOL=1 >> $wd\\$path") or die "Fatal -- Append line to file failed.\n"; + !system ("echo DEBUG_SYMBOL=0 >> $wd\\$path") or die "Fatal -- Append line to file failed.\n"; print "Info -- Added DEBUG_SYMBOL to $wd\\$path\n" if ($verbose); } @@ -518,8 +536,15 @@ chdir("$wd\\athena") or die "Fatal -- couldn't chdir to source directory $wd\\athena\n"; print "Info -- chdir to ".`cd`."\n" if ($verbose); - local $dbgswitch = ($odr->{debug}->{def}) ? " " : "NODEBUG=1"; - !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget $dbgswitch BUILD_KFW=1 BUILD_OFFICIAL=1 DEBUG_SYMBOL=1 $nmakeargs") + local $nmakeargs = ""; + local $argvsize = @ARGV; + if (!($odr->{debug}->{def})) {$nmakeargs .= " NODEBUG=1";} + if ($argvsize > 0) { + map {$nmakeargs .= " $_ "} @ARGV; + print "Arguments for NMAKE: $nmakeargs\n"; + } + + !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget BUILD_KFW=1 BUILD_OFFICIAL=1 DEBUG_SYMBOL=0 $nmakeargs") or die "Fatal -- build $buildtarget failed."; chdir("$wd") or die "Fatal -- couldn't chdir to $wd."; @@ -532,7 +557,7 @@ if ($verbose) {print "Info -- *** End build".$buildtext."\n";} } ## End make conditional. - else {print "Info -- *** Skipping build.\n" if ($verbose);} + else {print "Info -- *** Skipping build.\n" if ($verbose);} ##-- Make action. ##++ Package action: @@ -545,6 +570,8 @@ else { if ($verbose) {print "Info -- *** Begin prepackage.\n";} + local $dbgswitch = ($odr->{debug}->{def}) ? "DEBUG=1" : ""; + if (! $bOutputCleaned) { ## In case somebody cleaned $out before us. if (-d $out) {!system("rm -rf $out/*") or die "Fatal -- Couldn't clean $out."} ## Clean output directory. else {mkdir($out);} @@ -587,33 +614,47 @@ # Correct errors in files.wxi: !system("sed 's/WorkingDirectory=\"\\[dirbin\\]\"/WorkingDirectory=\"dirbin\"/g' files.wxi > a.tmp") or die "Fatal -- Couldn't modify files.wxi."; !system("mv a.tmp files.wxi") or die "Fatal -- Couldn't update files.wxi."; - - # Make sed script to run on the site-local configuration files: - local $tmpfile = "site-local.sed" ; + + ##++ ----------------------------------------------------------------------------- + ##++ Transform -tagged files: + + ## Make sed script to run on the site-local configuration files: + local $tmpfile = "site-local.sed" ; if (-e $tmpfile) {system("del $tmpfile");} + open SEDFILE, ">>$tmpfile"; + # Basic substitutions: local $dblback_wd = $wd; $dblback_wd =~ s/\\/\\\\/g; - !system("echo s/%BUILDDIR%/$dblback_wd/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%BUILDDIR%/$dblback_wd/\n" or die "Fatal -- Couldn't modify $tmpfile."; local $dblback_staging = "$wd\\staging"; $dblback_staging =~ s/\\/\\\\/g; - !system("echo s/%TARGETDIR%/$dblback_staging/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%TARGETDIR%/$dblback_staging/\n" or die "Fatal -- Couldn't modify $tmpfile."; local $dblback_sample = "$wd\\staging\\sample"; $dblback_sample =~ s/\\/\\\\/g; - !system("echo s/%CONFIGDIR-WIX%/$dblback_sample/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%CONFIGDIR-NSI%/$dblback_staging/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/ >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; + + $ArchTag = $prepackage->{CopyList}->{Config}->{ArchTag}->{value}; + $ArchFragment = ($odr->{cpu}->{value} =~ /386/) ? "32" : "64"; + $CpuTag = $prepackage->{CopyList}->{Config}->{CpuTag}->{value}; + $CpuFragment = ($odr->{cpu}->{value} =~ /386/) ? "i386" : "AMD64"; + + print SEDFILE "s/%CONFIGDIR-WIX%/$dblback_sample/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%CONFIGDIR-NSI%/$dblback_staging/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%VERSION_MAJOR%/$config->{Versions}->{'VER_PROD_MAJOR_STR'}/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%VERSION_MINOR%/$config->{Versions}->{'VER_PROD_MINOR_STR'}/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/%VERSION_PATCH%/$config->{Versions}->{'VER_PROD_REV_STR'}/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/$ArchTag/$ArchFragment/\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "s/$CpuTag/$CpuFragment/\n" or die "Fatal -- Couldn't modify $tmpfile."; # Strip out some defines so they can be replaced: [used for site-local.nsi] - !system("echo /\^!define\.\*RELEASE\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo /\^!define\.\*DEBUG\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; - !system("echo /\^!define\.\*BETA\.\*\$/d >> $tmpfile") or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "/\^!define\.\*RELEASE\.\*\$/d\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "/\^!define\.\*DEBUG\.\*\$/d\n" or die "Fatal -- Couldn't modify $tmpfile."; + print SEDFILE "/\^!define\.\*BETA\.\*\$/d\n" or die "Fatal -- Couldn't modify $tmpfile."; + close SEDFILE; # Run the script on site-local.wxi: !system("sed -f $tmpfile site-local-tagged.wxi > $wd\\buildwix\\site-local.wxi") or die "Fatal -- Couldn't modify site-local.wxi."; - # Now update site-local.nsi: + ## Now update site-local.nsi: chdir "..\\nsis"; print "Info -- chdir to ".`cd`."\n" if ($verbose); !system("sed -f ..\\wix\\$tmpfile site-local-tagged.nsi > b.tmp") or die "Fatal -- Couldn't modify site-local.wxi."; @@ -628,12 +669,20 @@ if (exists $config->{Versions}->{'BETA_STR'}) { !system("echo !define BETA $config->{Versions}->{'BETA_STR'} >> b.tmp") or die "Fatal -- Couldn't modify b.tmp."; } - !system("mv -f b.tmp $wd\\buildnsi\\site-local.nsi") or die "Fatal -- Couldn't replace site-local.nsi."; + !system("mv -f b.tmp $wd\\buildnsi\\site-local.nsi") or die "Fatal -- Couldn't replace site-local.nsi."; - # Run the script on nsi-includes-tagged.nsi: + ## Run the script on nsi-includes-tagged.nsi: !system("sed -f ..\\wix\\$tmpfile nsi-includes-tagged.nsi > $wd\\buildnsi\\nsi-includes.nsi") or die "Fatal -- Couldn't modify nsi-includes.nsi."; - !system("rm ..\\wix\\$tmpfile") or die "Fatal -- Couldn't remove $tmpfile."; + ## Run the script on kfw-fixed-tagged.nsi: + print "KPK -- work on kfw-fixed-tagged.nsi in ".`cd`."\n" if ($verbose); + !system("sed -f ..\\wix\\$tmpfile kfw-fixed-tagged.nsi > kfw-fixed.nsi") or die "Fatal -- Couldn't modify kfw_fixed.nsi."; + !system("sed -f ..\\wix\\$tmpfile kfw-fixed-tagged.nsi > $wd\\buildnsi\\kfw-fixed.nsi") or die "Fatal -- Couldn't modify kfw_fixed.nsi."; + + !system("rm ..\\wix\\$tmpfile") or die "Fatal -- Couldn't remove $tmpfile."; + ##-- Transform -tagged files: + ##-- ----------------------------------------------------------------------------- + if ($verbose) {print "Info -- *** End prepackage.\n";} if ($verbose) {print "Info -- *** Begin package.\n";} @@ -641,7 +690,7 @@ chdir("$wd\\buildwix") or die "Fatal -- Couldn't cd to $wd\\buildwix"; print "Info -- *** Make .msi:\n" if ($verbose); print "Info -- chdir to ".`cd`."\n" if ($verbose); - !system("$MAKE") or die "Error -- msi installer build failed."; + !system("$MAKE $dbgswitch") or die "Error -- msi installer build failed."; chdir("$wd\\buildnsi") or die "Fatal -- Couldn't cd to $wd\\buildnsi"; print "Info -- *** Make NSIS:\n" if ($verbose); @@ -678,6 +727,22 @@ system("rm -rf $out/a.tmp"); ## Clean up junk. system("rm -rf $out/ziptemp"); ## Clean up junk. + # Now check for ntsecapitest.i. If it is present, it means that the test in the Windows + # directory passed. + $dir = "$wd\\athena\\auth\\krb5\\src\\windows"; + chdir($dir) or die "Fatal -- Couldn't cd to $dir"; + print "Info -- chdir to ".`cd`."\n" if ($verbose); + + system("nmake ntsecapitest"); + if (!-e "ntsecapitest.i") { + print "Warning! This build does not use the Vista ntsecapi.h.\n"; + print " That means that the Windows Identity management code does not have MSLSA\n"; + print " access code enabled. To build with that support, copy ntsecapi.h from a\n"; + print " Vista build environment to somewhere in the compiler's include path, like\n"; + print " c:\\Program Files\\Platform SDK Server 2003 R2\\Include. Make sure that the \n"; + print " symbol TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS is defined in ntsecapi.h.\n"; + } + # End logging: if ($odr->{logfile}->{def}) {$l->stop;} @@ -687,4 +752,4 @@ $SIG{'INT'} = \&handler; $SIG{'QUIT'} = \&handler; -exit(main()); \ No newline at end of file +exit(main()); Modified: branches/krb5-1-6/src/windows/build/copyfiles.pl =================================================================== --- branches/krb5-1-6/src/windows/build/copyfiles.pl 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/copyfiles.pl 2009-07-22 18:55:18 UTC (rev 22445) @@ -49,9 +49,15 @@ $IgnoreTag = $xml->{Config}->{DebugTag}->{value}; } my $AlwaysTag = $xml->{Config}->{AlwaysTag}->{value}; + my $ArchTag = $xml->{Config}->{ArchTag}->{value}; + my $CpuTag = $xml->{Config}->{CpuTag}->{value}; + my $DebugFragment = ($odr->{debug}->{def}) ? "-DEBUG" : ""; + my $CpuFragment = $odr->{cpu}->{value}; + my $ArchFragment = ($CpuFragment =~ /386/) ? "32" : "64"; + $FileStemFragment = $xml->{Config}->{FileStem}->{name}; $fromRoot = $xml->{Config}->{From}->{root}; - $toRoot = $xml->{Config}->{To}->{root}; + $toRoot = $xml->{Config}->{To}->{root}; ##-- Set up path substitution variables for use inside the copy loop. # For each file in the file list: # Substitute any variable parts of the path name. @@ -61,6 +67,7 @@ local $i = 0; my $bOldDot = 1; my $bDot = 0; + my $first = 1; while ($files[0]->{File}[$i]) { my ($name, $newname, $from, $to, $file); @@ -71,24 +78,33 @@ if ($name && (! exists $file->{ignore})) { ## Ignore or process this entry? $from = "$fromRoot\\$file->{from}\\$name"; $to = "$toRoot\\$file->{to}\\$newname"; - # Copy this file? Check for ignore tag [debug-only in release mode or vice versa]. - if ( $bPathTags || $bFileStem || (index($from.$to, $IgnoreTag) <0) ) { - if ($bPathTags) { ## Apply PathTag substitutions: + + # Copy this file? + if ( (($odr->{components}->{value} =~ /$file->{component}/) && # file's component must be in component list. + (index($from.$to, $IgnoreTag) < 0) ) && # Check for ignore tag [debug-only in release mode or vice versa]. + ($bPathTags || $bFileStem) ) { + if ($bPathTags) { ## Apply PathTag substitutions: $from =~ s/$AlwaysTag/$PathFragment/g; $to =~ s/$AlwaysTag/$PathFragment/g; $from =~ s/$BuildDependentTag/$PathFragment/g; $to =~ s/$BuildDependentTag/$PathFragment/g; } - if ($bFileStem) { ## FileStem substitution? + if ($bFileStem) { ## FileStem substitution? $from =~ s/%filestem%/$FileStemFragment/g; $to =~ s/%filestem%/$FileStemFragment/g; } # %-DEBUG% substitution: - local $DebugFragment = ($odr->{debug}->{def}) ? "-DEBUG" : ""; $from =~ s/%\-DEBUG%/$DebugFragment/g; $to =~ s/%\-DEBUG%/$DebugFragment/g; $to =~ s/\*.*//; ## Truncate to path before any wildcard + # %cpu% substitution: + $from =~ s/$CpuTag/$CpuFragment/g; + $to =~ s/$CpuTag/$CpuFragment/g; + + # %WL% substitution: + $from =~ s/$ArchTag/$ArchFragment/g; + $to =~ s/$ArchTag/$ArchFragment/g; my $bCopyOK = 1; my $fromcheck = $from; my $bRequired = ! (exists $file->{notrequired}); Modified: branches/krb5-1-6/src/windows/build/copyfiles.xml =================================================================== --- branches/krb5-1-6/src/windows/build/copyfiles.xml 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/copyfiles.xml 2009-07-22 18:55:18 UTC (rev 22445) @@ -6,216 +6,215 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + + + + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Modified: branches/krb5-1-6/src/windows/build/corebinaryfiles.xml =================================================================== --- branches/krb5-1-6/src/windows/build/corebinaryfiles.xml 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/corebinaryfiles.xml 2009-07-22 18:55:18 UTC (rev 22445) @@ -5,81 +5,81 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - \ No newline at end of file + + + + + Modified: branches/krb5-1-6/src/windows/build/sdkfiles.xml =================================================================== --- branches/krb5-1-6/src/windows/build/sdkfiles.xml 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/build/sdkfiles.xml 2009-07-22 18:55:18 UTC (rev 22445) @@ -2,22 +2,22 @@ - - + + + - - - + + - + - + - + - + \ No newline at end of file Modified: branches/krb5-1-6/src/windows/identity/Makefile =================================================================== --- branches/krb5-1-6/src/windows/identity/Makefile 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/Makefile 2009-07-22 18:55:18 UTC (rev 22445) @@ -39,20 +39,20 @@ # default is to treat warnings as errors. #RMAKE=$(MAKECMD) /nologo all KH_NO_WX=1 -RMAKE=$(MAKECMD) /nologo all -RMAKE_W2K=$(MAKECMD) /nologo all KHBUILD_W2K=1 +RMAKE=$(MAKECMD) /nologo all KH_NO_WX=1 +RMAKE_W2K=$(MAKECMD) /nologo all KHBUILD_W2K=1 KH_NO_WX=1 !else -RMAKE=$(MAKECMD) /nologo etag +RMAKE=$(MAKECMD) /nologo etag KH_NO_WX=1 RMAKE_W2K=echo Skipping W2K target for ETAGS run. !endif !else -RMAKE=$(MAKECMD) /nologo test -RMAKE_W2K=$(MAKECMD) /nologo test KHBUILD_W2K=1 +RMAKE=$(MAKECMD) /nologo test KH_NO_WX=1 +RMAKE_W2K=$(MAKECMD) /nologo test KHBUILD_W2K=1 KH_NO_WX=1 !endif !else -RMAKE=$(MAKECMD) /nologo clean -RMAKE_W2K=$(MAKECMD) /nologo clean KHBUILD_W2K=1 +RMAKE=$(MAKECMD) /nologo clean KH_NO_WX=1 +RMAKE_W2K=$(MAKECMD) /nologo clean KHBUILD_W2K=1 KH_NO_WX=1 !endif !if "$(CPU)" != "i386" Modified: branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile =================================================================== --- branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile 2009-07-22 18:55:18 UTC (rev 22445) @@ -107,7 +107,7 @@ shlwapi.lib \ version.lib -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if (("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )) && (!defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0") SCLIB=bufferoverflowu.lib !else SCLIB= Modified: branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile.w2k =================================================================== --- branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile.w2k 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/nidmgrdll/Makefile.w2k 2009-07-22 18:55:18 UTC (rev 22445) @@ -105,7 +105,7 @@ shlwapi.lib \ version.lib -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if (("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )) && (!defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0") SCLIB=bufferoverflowu.lib !else SCLIB= Modified: branches/krb5-1-6/src/windows/identity/plugins/krb5/Makefile =================================================================== --- branches/krb5-1-6/src/windows/identity/plugins/krb5/Makefile 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/plugins/krb5/Makefile 2009-07-22 18:55:18 UTC (rev 22445) @@ -54,8 +54,12 @@ shlwapi.lib \ comctl32.lib -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64") || ("$(CPU)" == "ALPHA64" ) +!if !defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0" SCLIB=bufferoverflowu.lib +!else +SCLIB= +!endif LIBFILES= \ $(LIBDIR)\nidmgr64.lib \ $(KFWLIBDIR)\loadfuncs.lib Modified: branches/krb5-1-6/src/windows/identity/ui/Makefile =================================================================== --- branches/krb5-1-6/src/windows/identity/ui/Makefile 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/ui/Makefile 2009-07-22 18:55:18 UTC (rev 22445) @@ -95,7 +95,7 @@ !endif $(CP) $** $@ -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if (("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )) && (!defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0") SCLIB=bufferoverflowu.lib !else SCLIB= Modified: branches/krb5-1-6/src/windows/identity/ui/Makefile.w2k =================================================================== --- branches/krb5-1-6/src/windows/identity/ui/Makefile.w2k 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/identity/ui/Makefile.w2k 2009-07-22 18:55:18 UTC (rev 22445) @@ -79,7 +79,7 @@ $(OBJ)\appver.res: appver.rc $(RC2RES) -!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" ) +!if (("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )) && (!defined(NO_BUFFEROVERFLOWU) || "$(NO_BUFFEROVERFLOWU)" == "0") SCLIB=bufferoverflowu.lib !else SCLIB= Modified: branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed.nsi =================================================================== --- branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed.nsi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed.nsi 2009-07-22 18:55:18 UTC (rev 22445) @@ -194,7 +194,7 @@ !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe" "$INSTDIR\bin\gss-client.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe" "$INSTDIR\bin\gss-server.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi32.dll" "$INSTDIR\bin\gssapi32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kclnt32.dll" "$INSTDIR\bin\kclnt32.dll" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe" "$INSTDIR\bin\kdestroy.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe" "$INSTDIR\bin\kinit.exe" "$INSTDIR" @@ -203,7 +203,7 @@ !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe" "$INSTDIR\bin\kvno.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_32.dll" "$INSTDIR\bin\krb5_32.dll" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt32.dll" "$INSTDIR\bin\k5sprt32.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc32.dll" "$INSTDIR\bin\krbcc32.dll" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc32s.exe" "$INSTDIR\bin\krbcc32s.exe" "$INSTDIR" !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbv4w32.dll" "$INSTDIR\bin\krbv4w32.dll" "$INSTDIR" @@ -472,7 +472,7 @@ WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408 WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408 WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 + ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408 WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408 WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408 @@ -493,7 +493,7 @@ File "${KFW_BIN_DIR}\gss-client.pdb" File "${KFW_BIN_DIR}\gss-server.pdb" File "${KFW_BIN_DIR}\gssapi32.pdb" - File "${KFW_BIN_DIR}\k524init.pdb" + ;File "${KFW_BIN_DIR}\k524init.pdb" File "${KFW_BIN_DIR}\kclnt32.pdb" File "${KFW_BIN_DIR}\kdestroy.pdb" File "${KFW_BIN_DIR}\kinit.pdb" @@ -502,7 +502,7 @@ File "${KFW_BIN_DIR}\kvno.pdb" File "${KFW_BIN_DIR}\krb5_32.pdb" File "${KFW_BIN_DIR}\k5sprt32.pdb" - File "${KFW_BIN_DIR}\krb524.pdb" + ;File "${KFW_BIN_DIR}\krb524.pdb" File "${KFW_BIN_DIR}\krbcc32.pdb" File "${KFW_BIN_DIR}\krbcc32s.pdb" File "${KFW_BIN_DIR}\krbv4w32.pdb" @@ -1168,7 +1168,7 @@ Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe" Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe" Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll" - Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" Delete /REBOOTOK "$INSTDIR\bin\kclnt32.dll" Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe" Delete /REBOOTOK "$INSTDIR\bin\kinit.exe" @@ -1177,7 +1177,7 @@ Delete /REBOOTOK "$INSTDIR\bin\kvno.exe" Delete /REBOOTOK "$INSTDIR\bin\krb5_32.dll" Delete /REBOOTOK "$INSTDIR\bin\k5sprt32.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" Delete /REBOOTOK "$INSTDIR\bin\krbcc32.dll" Delete /REBOOTOK "$INSTDIR\bin\krbcc32s.exe" Delete /REBOOTOK "$INSTDIR\bin\krbv4w32.dll" @@ -1203,7 +1203,7 @@ Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb" Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb" Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" Delete /REBOOTOK "$INSTDIR\bin\kclnt32.pdb" Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb" Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb" @@ -1212,7 +1212,7 @@ Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb" Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" Delete /REBOOTOK "$INSTDIR\bin\k5sprt32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" Delete /REBOOTOK "$INSTDIR\bin\krbcc32.pdb" Delete /REBOOTOK "$INSTDIR\bin\krbcc32s.pdb" Delete /REBOOTOK "$INSTDIR\bin\krbv4w32.pdb" @@ -1357,7 +1357,7 @@ DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" + ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" Modified: branches/krb5-1-6/src/windows/installer/nsis/nsi-includes-tagged.nsi =================================================================== --- branches/krb5-1-6/src/windows/installer/nsis/nsi-includes-tagged.nsi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/nsis/nsi-includes-tagged.nsi 2009-07-22 18:55:18 UTC (rev 22445) @@ -4,5 +4,5 @@ !define KFW_MAJORVERSION %VERSION_MAJOR% !define KFW_MINORVERSION %VERSION_MINOR% !define KFW_PATCHLEVEL %VERSION_PATCH% -!define CL_1310 +!define CL_1400 Modified: branches/krb5-1-6/src/windows/installer/nsis/site-local-tagged.nsi =================================================================== --- branches/krb5-1-6/src/windows/installer/nsis/site-local-tagged.nsi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/nsis/site-local-tagged.nsi 2009-07-22 18:55:18 UTC (rev 22445) @@ -3,10 +3,12 @@ !define KFW_MAJORVERSION %VERSION_MAJOR% !define KFW_MINORVERSION %VERSION_MINOR% !define KFW_PATCHLEVEL %VERSION_PATCH% -!define CL_1310 +!define CL_1400 +!define X86 -!define RELEASE -!define NOT_DEBUG +;!define RELEASE +;!define NOT_DEBUG +!define DEBUG !define BETA 1 !define SAMPLE_CONFIG_REALM "ATHENA.MIT.EDU" !define HTTP_CONFIG_URL "[Obtain a URL from your Kerberos administrator]" Modified: branches/krb5-1-6/src/windows/installer/wix/custom/custom.cpp =================================================================== --- branches/krb5-1-6/src/windows/installer/wix/custom/custom.cpp 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/wix/custom/custom.cpp 2009-07-22 18:55:18 UTC (rev 22445) @@ -88,7 +88,7 @@ #pragma comment(lib, "msi") #pragma comment(lib, "advapi32") #if defined(_M_IA64) || defined(_M_AMD64) -#pragma comment(lib, "bufferoverflowu") +//#pragma comment(lib, "bufferoverflowu") #endif Modified: branches/krb5-1-6/src/windows/installer/wix/features.wxi =================================================================== --- branches/krb5-1-6/src/windows/installer/wix/features.wxi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/wix/features.wxi 2009-07-22 18:55:18 UTC (rev 22445) @@ -87,7 +87,7 @@ - + @@ -95,12 +95,12 @@ + - - + @@ -182,9 +182,8 @@ - - - + + @@ -192,7 +191,6 @@ - Modified: branches/krb5-1-6/src/windows/installer/wix/files.wxi =================================================================== --- branches/krb5-1-6/src/windows/installer/wix/files.wxi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/wix/files.wxi 2009-07-22 18:55:18 UTC (rev 22445) @@ -119,10 +119,10 @@ - - - - + + + + @@ -179,11 +179,11 @@ - - - + + + - + @@ -360,24 +360,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -410,21 +410,21 @@ - + - + - - + + - - + + @@ -656,29 +656,22 @@ - - - - - - - - + + - - - - - - - - - + + + + + + + + + - - - - + + + @@ -687,9 +680,6 @@ - - - @@ -706,11 +696,6 @@ - - - - - @@ -792,7 +777,7 @@ - + Modified: branches/krb5-1-6/src/windows/installer/wix/platform.wxi =================================================================== --- branches/krb5-1-6/src/windows/installer/wix/platform.wxi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/wix/platform.wxi 2009-07-22 18:55:18 UTC (rev 22445) @@ -24,8 +24,6 @@ - - @@ -43,8 +41,6 @@ - - @@ -88,110 +84,107 @@ - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Modified: branches/krb5-1-6/src/windows/installer/wix/site-local-tagged.wxi =================================================================== --- branches/krb5-1-6/src/windows/installer/wix/site-local-tagged.wxi 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/installer/wix/site-local-tagged.wxi 2009-07-22 18:55:18 UTC (rev 22445) @@ -46,13 +46,13 @@ - - + + - - + + Modified: branches/krb5-1-6/src/windows/winlevel.h =================================================================== --- branches/krb5-1-6/src/windows/winlevel.h 2009-07-17 01:45:23 UTC (rev 22444) +++ branches/krb5-1-6/src/windows/winlevel.h 2009-07-22 18:55:18 UTC (rev 22445) @@ -30,4 +30,4 @@ * updated for each alpha, beta, final release. This will ensure * that file identifiers are unique */ -#define KRB5_BUILDLEVEL 16 +#define KRB5_BUILDLEVEL 17 From tlyu at MIT.EDU Wed Jul 22 14:55:54 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 22 Jul 2009 14:55:54 -0400 Subject: svn rev #22446: tags/ Message-ID: <200907221855.n6MItsJY025059@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22446 Commit By: tlyu Log Message: tag kfw-3.2.3-alpha1 Changed Files: A tags/kfw_3-2-3-alpha1/ Copied: tags/kfw_3-2-3-alpha1 (from rev 22445, branches/krb5-1-6) From tlyu at MIT.EDU Wed Jul 22 14:57:26 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Wed, 22 Jul 2009 14:57:26 -0400 Subject: svn rev #22447: branches/krb5-1-6/src/ Message-ID: <200907221857.n6MIvQV2025205@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22447 Commit By: tlyu Log Message: back to 1.6.4-beta1-postrelease Changed Files: U branches/krb5-1-6/src/patchlevel.h Modified: branches/krb5-1-6/src/patchlevel.h =================================================================== --- branches/krb5-1-6/src/patchlevel.h 2009-07-22 18:55:54 UTC (rev 22446) +++ branches/krb5-1-6/src/patchlevel.h 2009-07-22 18:57:25 UTC (rev 22447) @@ -53,6 +53,6 @@ #define KRB5_MAJOR_RELEASE 1 #define KRB5_MINOR_RELEASE 6 #define KRB5_PATCHLEVEL 4 -#define KRB5_RELTAIL "beta1-kfw-3.2.3-alpha1" +#define KRB5_RELTAIL "beta1-postrelease" /* #undef KRB5_RELDATE */ -#define KRB5_RELTAG "tags/kfw_3-2-3-alpha1" +#define KRB5_RELTAG "branches/krb5-1-6" From tlyu at MIT.EDU Thu Jul 23 13:34:35 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 13:34:35 -0400 Subject: svn rev #22449: branches/krb5-1-6/src/windows/ build/ installer/nsis/ Message-ID: <200907231734.n6NHYZAZ010955@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22449 Commit By: tlyu Log Message: ticket: 6535 Add files omitted from previous commit. (r22445) Revert accidental commit of default option values in BKWconfig.xml. Changed Files: U branches/krb5-1-6/src/windows/build/BKWconfig.xml U branches/krb5-1-6/src/windows/build/bkw.pl A branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi A branches/krb5-1-6/src/windows/ntsecapitest.c A branches/krb5-1-6/src/windows/ntsecapitest.pl Modified: branches/krb5-1-6/src/windows/build/BKWconfig.xml =================================================================== --- branches/krb5-1-6/src/windows/build/BKWconfig.xml 2009-07-22 23:23:45 UTC (rev 22448) +++ branches/krb5-1-6/src/windows/build/BKWconfig.xml 2009-07-23 17:34:35 UTC (rev 22449) @@ -43,8 +43,8 @@ - - + + Modified: branches/krb5-1-6/src/windows/build/bkw.pl =================================================================== --- branches/krb5-1-6/src/windows/build/bkw.pl 2009-07-22 23:23:45 UTC (rev 22448) +++ branches/krb5-1-6/src/windows/build/bkw.pl 2009-07-23 17:34:35 UTC (rev 22449) @@ -544,7 +544,7 @@ print "Arguments for NMAKE: $nmakeargs\n"; } - !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget BUILD_KFW=1 BUILD_OFFICIAL=1 DEBUG_SYMBOL=0 $nmakeargs") + !system("perl ../scripts/build.pl --softdirs --nolog $buildtarget BUILD_KFW=1 BUILD_OFFICIAL=1 DEBUG_SYMBOL=1 $nmakeargs") or die "Fatal -- build $buildtarget failed."; chdir("$wd") or die "Fatal -- couldn't chdir to $wd."; Added: branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi =================================================================== --- branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi 2009-07-22 23:23:45 UTC (rev 22448) +++ branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi 2009-07-23 17:34:35 UTC (rev 22449) @@ -0,0 +1,1890 @@ +;----------------------------------------------------------------- +; KfW defines and functionality +; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology +; Copyright (c) 2006,2007 Secure Endpoints Inc. + +!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}" + +!define PROGRAM_NAME "Kerberos for Windows" +!ifdef RELEASE +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!else +!ifdef BETA +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!else +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!endif +!endif +VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00" +VIAddVersionKey "ProductName" "${PROGRAM_NAME}" +VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology" +VIAddVersionKey "FileVersion" ${VIProductVersion} +VIAddVersionKey "ProductVersion" "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0" +VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer" +VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007" +!ifdef DEBUG +VIAddVersionKey "PrivateBuild" "Checked/Debug" +!endif ; End DEBUG + + +;-------------------------------- +;Configuration + + ;General + SetCompressor lzma +!ifndef DEBUG + OutFile "MITKerberosForWindows.exe" +!else + OutFile "MITKerberosForWindows-DEBUG.exe" +!endif + SilentInstall normal + ShowInstDetails show + XPStyle on + !define MUI_ICON "kfw.ico" + !define MUI_UNICON "kfw.ico" + !define KFW_COMPANY_NAME "Massachusetts Institute of Technology" + !define KFW_PRODUCT_NAME "${PROGRAM_NAME}" + !define KFW_REGKEY_ROOT "Software\MIT\Kerberos\" + !define NIM_REGKEY_ROOT "Software\MIT\NetIDMgr\" + CRCCheck force + !define REPLACEDLL_NOREGISTER + + ;Folder selection page + InstallDir "$PROGRAMFILES\MIT\Kerberos" ; Install to shorter path + + ;Remember install folder + InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" "" + + ;Remember the installer language + !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" + !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" + !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" + + ;Where are the files? + !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\%cpu%" + !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc" + !define KFW_INC_DIR "${KFW_TARGETDIR}\inc" + !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\%cpu%" + !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample" + !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install" + !define SYSTEMDIR "$%SystemRoot%\System32" + !define SXSDIR1 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f" + !define SXSLANG "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.MFCLOC" + !ifdef X86 + !define SXSDIR2 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471" + !define SXSMAND "$%SystemRoot%\WinSxS\Manifests" + !else + !ifdef AMD64 + !define SXSDIR2 "$%SystemRoot%\WinSxS\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_57812684" + !endif + !endif + + !define REDISTDIR "c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86" + +;-------------------------------- +;Modern UI Configuration + + !define MUI_LICENSEPAGE + !define MUI_CUSTOMPAGECOMMANDS + !define MUI_WELCOMEPAGE + !define MUI_COMPONENTSPAGE + !define MUI_COMPONENTSPAGE_SMALLDESC + !define MUI_DIRECTORYPAGE + + !define MUI_ABORTWARNING + !define MUI_FINISHPAGE + + !define MUI_UNINSTALLER + !define MUI_UNCONFIRMPAGE + + + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_LICENSE "Licenses.rtf" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + Page custom KFWPageGetConfigFiles + Page custom KFWPageGetStartupConfig + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Language Strings + + ;Descriptions + LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English" + + LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC." + + LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows" + + LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications." + + LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals." + +; Popup error messages + LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use." + + LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install" + + LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files." + +; Upgrade/re-install strings + LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client" + LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client" + LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client" + + LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK" + LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK" + LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK" + + LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation" + LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation" + LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation" + + ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con" + ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con" + ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in + !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog + +;-------------------------------- +;Reserve Files + + ;Things that need to be extracted on first (keep these lines before any File command!) + ;Only useful for BZIP2 compression + !insertmacro MUI_RESERVEFILE_LANGDLL + +;-------------------------------- +; Load Macros +!include "utils.nsi" + +;-------------------------------- +;Installer Sections + +;---------------------- +; Kerberos for Windows CLIENT +Section "KfW Client" secClient + + SetShellVarContext all + ; Stop any running services or we can't replace the files + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "Killer.exe" + nsExec::Exec '$R0 netidmgr.exe' + nsExec::Exec '$R0 leash32.exe' + nsExec::Exec '$R0 krbcc%WL%s.exe' + nsExec::Exec '$R0 k95.exe' + nsExec::Exec '$R0 k95g.exe' + nsExec::Exec '$R0 krb5.exe' + nsExec::Exec '$R0 gss.exe' + nsExec::Exec '$R0 afscreds.exe' + + RMDir /r "$INSTDIR\bin" + + ; Do client components + SetOutPath "$INSTDIR\bin" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr%WL%.dll" "$INSTDIR\bin\comerr%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe" "$INSTDIR\bin\gss.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe" "$INSTDIR\bin\gss-client.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe" "$INSTDIR\bin\gss-server.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi%WL%.dll" "$INSTDIR\bin\gssapi%WL%.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe" "$INSTDIR\bin\kdestroy.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe" "$INSTDIR\bin\kinit.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe" "$INSTDIR\bin\klist.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe" "$INSTDIR\bin\kpasswd.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe" "$INSTDIR\bin\kvno.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_%WL%.dll" "$INSTDIR\bin\krb5_%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt%WL%.dll" "$INSTDIR\bin\k5sprt%WL%.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%.dll" "$INSTDIR\bin\krbcc%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%s.exe" "$INSTDIR\bin\krbcc%WL%s.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm" "$INSTDIR\bin\netidmgr.chm" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll" "$INSTDIR\bin\krb5cred.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll" "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw%WL%.dll" "$INSTDIR\bin\leashw%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe" "$INSTDIR\bin\ms2mit.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe" "$INSTDIR\bin\mit2ms.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe" "$INSTDIR\bin\kcpytkt.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe" "$INSTDIR\bin\kdeltkt.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp%WL%.dll" "$INSTDIR\bin\wshelp%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof%WL%.dll" "$INSTDIR\bin\xpprof%WL%.dll" "$INSTDIR" + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" nid_inst2000 + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" + goto nid_done +nid_inst2000: + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" +nid_done: + +!ifdef DEBUG +!IFDEF CL_1400 + !insertmacro ReplaceDLL "${SXSDIR1}\msvcr80d.dll" "$INSTDIR\bin\msvcr80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSDIR1}\msvcp80d.dll" "$INSTDIR\bin\msvcp80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSDIR2}\mfc80d.dll" "$INSTDIR\bin\mfc80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHS.DLL" "$INSTDIR\bin\MFC80CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHT.DLL" "$INSTDIR\bin\MFC80CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80DEU.DLL" "$INSTDIR\bin\MFC80DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ENU.DLL" "$INSTDIR\bin\MFC80ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ESP.DLL" "$INSTDIR\bin\MFC80ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80FRA.DLL" "$INSTDIR\bin\MFC80FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ITA.DLL" "$INSTDIR\bin\MFC80ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80JPN.DLL" "$INSTDIR\bin\MFC80JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80KOR.DLL" "$INSTDIR\bin\MFC80KOR.DLL" "$INSTDIR" + !IFDEF X86 + !insertmacro ReplaceDLL "${SXSMAND}\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" + !ELSE + !IFDEF AMD64 + !insertmacro ReplaceDLL "${SXSMAND}\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" + !ENDIF + !ENDIF +!ELSE +!IFDEF CL_1310 + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\bin\msvcr71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\bin\msvcp71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\bin\mfc71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" +!ELSE +!IFDEF CL_1300 + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\bin\msvcr70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\bin\msvcp70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\bin\mfc70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" +!ELSE + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\bin\mfc42d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\bin\msvcp60d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\bin\msvcrtd.dll" "$INSTDIR" +!ENDIF +!ENDIF +!ENDIF +!ELSE +;!IFDEF CL_1400 +; GetTempFileName $R0 +; File /oname=$R0 '${REDISTDIR}\vcredist_x86.exe' +; nsExec::Exec '$R0' +;!ELSE +!IFDEF CL_1310 + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\bin\mfc71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\bin\msvcr71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\bin\msvcp71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" +!ELSE +!IFDEF CL_1300 + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\bin\mfc70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\bin\msvcr70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\bin\msvcp70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" +!ELSE + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\bin\mfc42.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\bin\msvcp60.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\bin\msvcrt.dll" "$INSTDIR" +!ENDIF +!ENDIF +;!ENDIF +!ENDIF + !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll" "$INSTDIR\bin\psapi.dll" "$INSTDIR" + + ; Do WINDOWSDIR components + ;SetOutPath "$WINDOWSDIR" +!ifdef DEBUG +!endif + + ; Do Windows SYSDIR (Control panel) + SetOutPath "$SYSDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR" + File "${KFW_BIN_DIR}\kfwcpcc.exe" + + ; Get Kerberos config files + Call kfw.GetConfigFiles + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + + ; Daemon entries + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" "" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10 + + ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder + ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order + ; to also include the service name. + Call AddProvider + ReadINIStr $R0 $1 "Field 7" "State" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos" + + ; WinLogon Event Notification + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate" 0 + WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll" + WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event" + + ; NetIdMgr Reg entries + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident" + + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider" + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type" 1 + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0 + + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred" + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type" 2 + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0 + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" + SetOutPath "$INSTDIR\bin" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe" + + ReadINIStr $R0 $1 "Field 2" "State" ; startup + + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" + +startshort: + StrCmp $R0 "0" nostart + CreateShortCut "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED + goto checkconflicts + +nostart: + Delete "$SMSTARTUP\Network Identity Manager.lnk" + +checkconflicts: + Call GetSystemPath + Push "krb5_%WL%.dll" + Call SearchPath + Pop $R0 + StrCmp $R0 "" addpath + + Push $R0 + Call GetParent + Pop $R0 + StrCmp $R0 "$INSTDIR\bin" addpath + MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0. This may interfere with the use of the current installation." + +addpath: + ; Add kfw bin to path + Push "$INSTDIR\bin" + Call AddToSystemPath + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2003" addAllowTgtKey + StrCmp $R0 "2000" addAllowTgtKey + StrCmp $R0 "XP" addAllowTgtKey + goto skipAllowTgtKey + +addAllowTgtKey: + ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1" + ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1" +skipAllowTgtKey: + + ; The following are keys added for Terminal Server compatibility + ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408 + ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408 + +SectionEnd + +Section "Debug Symbols" secDebug + + SetOutPath "$INSTDIR\bin" + File "${KFW_BIN_DIR}\comerr%WL%.pdb" + File "${KFW_BIN_DIR}\gss.pdb" + File "${KFW_BIN_DIR}\gss-client.pdb" + File "${KFW_BIN_DIR}\gss-server.pdb" + File "${KFW_BIN_DIR}\gssapi%WL%.pdb" + ;File "${KFW_BIN_DIR}\k524init.pdb" + File "${KFW_BIN_DIR}\kdestroy.pdb" + File "${KFW_BIN_DIR}\kinit.pdb" + File "${KFW_BIN_DIR}\klist.pdb" + File "${KFW_BIN_DIR}\kpasswd.pdb" + File "${KFW_BIN_DIR}\kvno.pdb" + File "${KFW_BIN_DIR}\krb5_%WL%.pdb" + File "${KFW_BIN_DIR}\k5sprt%WL%.pdb" + ;File "${KFW_BIN_DIR}\krb524.pdb" + File "${KFW_BIN_DIR}\krbcc%WL%.pdb" + File "${KFW_BIN_DIR}\krbcc%WL%s.pdb" + File "${KFW_BIN_DIR}\leashw%WL%.pdb" + File "${KFW_BIN_DIR}\krb5cred.pdb" + File "${KFW_BIN_DIR}\ms2mit.pdb" + File "${KFW_BIN_DIR}\mit2ms.pdb" + File "${KFW_BIN_DIR}\kcpytkt.pdb" + File "${KFW_BIN_DIR}\kdeltkt.pdb" + File "${KFW_BIN_DIR}\wshelp%WL%.pdb" + File "${KFW_BIN_DIR}\xpprof%WL%.pdb" + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" nidpdb_inst2000 + File "${KFW_BIN_DIR}\netidmgr.pdb" + File "${KFW_BIN_DIR}\nidmgr%WL%.pdb" + goto nidpdb_done +nidpdb_inst2000: + File "${KFW_BIN_DIR}\W2K\netidmgr.pdb" + File "${KFW_BIN_DIR}\W2K\nidmgr%WL%.pdb" +nidpdb_done: + +!IFDEF DEBUG +!IFDEF CL_1400 +!IFDEF X86 + File "$%SystemRoot%\symbols\dll\msvcr80d.i386.pdb" + File "$%SystemRoot%\symbols\dll\msvcp80d.i386.pdb" + File "$%SystemRoot%\symbols\dll\mfc80d.i386.pdb" +!ELSE +!IFDEF AMD64 + File "$%SystemRoot%\symbols\dll\msvcr80d.AMD64.pdb" + File "$%SystemRoot%\symbols\dll\msvcp80d.AMD64.pdb" + File "$%SystemRoot%\symbols\dll\mfc80d.AMD64.pdb" +!ENDIF ; AMD64 +!ENDIF ; X86 +!ELSE ; NOT CL_1400 +!IFDEF CL_1310 + File "${SYSTEMDIR}\msvcr71d.pdb" + File "${SYSTEMDIR}\msvcp71d.pdb" + File "${SYSTEMDIR}\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\msvcr70d.pdb" + File "${SYSTEMDIR}\msvcp70d.pdb" + File "${SYSTEMDIR}\mfc70d.pdb" +!ELSE + File "${SYSTEMDIR}\mfc42d.pdb" + File "${SYSTEMDIR}\msvcp60d.pdb" + File "${SYSTEMDIR}\msvcrtd.pdb" +!ENDIF +!ENDIF +!ENDIF +!ENDIF ; DEBUG + + SetOutPath "$SYSDIR" + File "${KFW_BIN_DIR}\kfwlogon.pdb" + File "${KFW_BIN_DIR}\kfwcpcc.pdb" + +SectionEnd + +;---------------------- +; Kerberos for Windows SDK +Section "KfW SDK" secSDK + + RMDir /r "$INSTDIR\inc" + RMDir /r "$INSTDIR\lib" + RMDir /r "$INSTDIR\install" + RMDir /r "$INSTDIR\sample" + + SetOutPath "$INSTDIR\doc" + File /r "${KFW_DOC_DIR}\netiddev.chm" + + SetOutPath "$INSTDIR\inc\krb5" + File /r "${KFW_INC_DIR}\krb5\*" + + SetOutPath "$INSTDIR\inc\leash" + File /r "${KFW_INC_DIR}\leash\*" + + SetOutPath "$INSTDIR\inc\loadfuncs" + File /r "${KFW_INC_DIR}\loadfuncs\*" + + SetOutPath "$INSTDIR\inc\netidmgr" + File /r "${KFW_INC_DIR}\netidmgr\*" + + SetOutPath "$INSTDIR\inc\wshelper" + File /r "${KFW_INC_DIR}\wshelper\*" + + SetOutPath "$INSTDIR\lib\%cpu%" + File /r "${KFW_LIB_DIR}\*" + + SetOutPath "$INSTDIR\install" + File /r "${KFW_INSTALL_DIR}\*" + + SetOutPath "$INSTDIR\sample" + File /r "${KFW_SAMPLE_DIR}\*" + + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + +SectionEnd + +;---------------------- +; Kerberos for Windows Documentation +Section "KfW Documentation" secDocs + + RMDir /r "$INSTDIR\doc" + + SetOutPath "$INSTDIR\doc" + File "${KFW_DOC_DIR}\relnotes.html" + File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf" + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" + SetOutPath "$INSTDIR\doc" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" +SectionEnd + +;Display the Finish header +;Insert this macro after the sections if you are not using a finish page +;!insertmacro MUI_SECTIONS_FINISHHEADER + +;-------------------------------- +;Installer Functions + +Function .onInit + !insertmacro MUI_LANGDLL_DISPLAY + + ; Set the default install options + Push $0 + + Call IsUserAdmin + Pop $R0 + StrCmp $R0 "true" checkVer + + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software." + Abort + +checkVer: + ; Check Version of Windows. Do not install onto Windows 95 + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "95" wrongVersion + StrCmp $R0 "98" wrongVersion + StrCmp $R0 "ME" wrongVersion + StrCmp $R0 "NT 4.0" wrongVersion + goto checkIPHLPAPI + +wrongVersion: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher." + Abort + +checkIPHLPAPI: + ClearErrors + ReadEnvStr $R0 "WinDir" + GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2 + IfErrors +1 +3 + GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2 + IfErrors iphlperror + IntOp $R3 $R2 / 0x00010000 + IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious + +iphlperror: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing." + Abort + +iphlpwarning: + MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded. Please install Internet Explorer 5.01 or higher." + +checkprevious: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ + "DisplayVersion" + IfErrors testWIX + StrCmp $R0 "${KFW_VERSION}" contInstall + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this upgrade or downgrade." \ + IDOK uninstNSIS + Abort + +;Run the uninstaller +uninstNSIS: + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ + "UninstallString" + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testWIX: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \ + "DisplayVersion" + IfErrors testSWRT + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstMSI1 + Abort + +;Run the uninstaller +uninstMSI1: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstMSI1_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstMSI1_2000: + ClearErrors + ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testSWRT: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \ + "DisplayVersion" + IfErrors testPismere + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstMSI2 + Abort + +;Run the uninstaller +uninstMSI2: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstMSI2_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstMSI2_2000: + ClearErrors + ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testPismere: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \ + "DisplayVersion" + IfErrors contInstall + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstPismere + Abort + +;Run the uninstaller +uninstPismere: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstPismere_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstPismere_2000: + ClearErrors + ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + + +Restart: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer." + Abort + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed" + +DoNotRestart: +no_remove_uninstaller: + +contInstall: + ; Never install debug symbols unless explicitly selected, except in DEBUG mode +!IFNDEF DEBUG + SectionGetFlags ${secDebug} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secDebug} $0 +!ELSE + SectionGetFlags ${secDebug} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDebug} $0 +!ENDIF + + ; Our logic should be like this. + ; 1) If no KfW components are installed, we do a clean install with default options. (Client/Docs) + ; 2) If existing modules are installed, we keep them selected + ; 3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install + ; TODO: Downgrade? + Call IsAnyKfWInstalled + Pop $R0 + StrCmp $R0 "0" DefaultOptions + + Call ShouldClientInstall + Pop $R2 + + StrCmp $R2 "0" NoClient + StrCmp $R2 "1" ReinstallClient + StrCmp $R2 "2" UpgradeClient + StrCmp $R2 "3" DowngradeClient + + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + ;# !insertmacro SelectSection ${secClient} + goto skipClient +NoClient: + ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now... + SectionGetFlags ${secClient} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secClient} $0 + goto skipClient +UpgradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(UPGRADE_CLIENT) + goto skipClient +ReinstallClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(REINSTALL_CLIENT) + goto skipClient +DowngradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(DOWNGRADE_CLIENT) + goto skipClient + + +skipClient: + + Call ShouldSDKInstall + Pop $R2 + StrCmp $R2 "0" NoSDK + StrCmp $R2 "1" ReinstallSDK + StrCmp $R2 "2" UpgradeSDK + StrCmp $R2 "3" DowngradeSDK + + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + ;# !insertmacro UnselectSection ${secSDK} + goto skipSDK + +UpgradeSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(UPGRADE_SDK) + goto skipSDK + +ReinstallSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(REINSTALL_SDK) + goto skipSDK + +DowngradeSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(DOWNGRADE_SDK) + goto skipSDK + +NoSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + ;# !insertmacro UnselectSection ${secSDK} + goto skipSDK + +skipSDK: + + Call ShouldDocumentationInstall + Pop $R2 + StrCmp $R2 "0" NoDocumentation + StrCmp $R2 "1" ReinstallDocumentation + StrCmp $R2 "2" UpgradeDocumentation + StrCmp $R2 "3" DowngradeDocumentation + + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + ;# !insertmacro UnselectSection ${secDocs} + goto skipDocumentation + +UpgradeDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(UPGRADE_DOCS) + goto skipDocumentation + +ReinstallDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(REINSTALL_DOCS) + goto skipDocumentation + +DowngradeDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(DOWNGRADE_DOCS) + goto skipDocumentation + +NoDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secDocs} $0 + ;# !insertmacro UnselectSection ${secDocs} + goto skipDocumentation + +skipDocumentation: + goto end + +DefaultOptions: + ; Client Selected + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + + ; SDK NOT selected + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + + ; Documentation selected + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + goto end + +end: + Pop $0 + + Push $R0 + + ; See if we can set a default installation path... + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" + StrCmp $R0 "" TrySDK + StrCpy $INSTDIR $R0 + goto Nope + +TrySDK: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" + StrCmp $R0 "" TryDocs + StrCpy $INSTDIR $R0 + goto Nope + +TryDocs: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" + StrCmp $R0 "" TryRoot + StrCpy $INSTDIR $R0 + goto Nope + +TryRoot: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir" + StrCmp $R0 "" Nope + StrCpy $INSTDIR $R0 + +Nope: + Pop $R0 + + GetTempFilename $0 + File /oname=$0 KfWConfigPage.ini + GetTempFilename $1 + File /oname=$1 KfWConfigPage2.ini + +FunctionEnd + + +;-------------------------------- +; These are our cleanup functions +Function .onInstFailed +Delete $0 +Delete $1 +FunctionEnd + +Function .onInstSuccess +Delete $0 +Delete $1 +FunctionEnd + + +;-------------------------------- +;Descriptions + + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient) + !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK) + !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs) + !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them! + IfSilent StartRemove ; New in v2.0b4 + MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove + abort + +StartRemove: + + SetShellVarContext all + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "Killer.exe" + nsExec::Exec '$R0 netidmgr.exe' + nsExec::Exec '$R0 krbcc%WL%s.exe' + + Push "$INSTDIR\bin" + Call un.RemoveFromSystemPath + + ; Delete documentation + Delete "$INSTDIR\doc\relnotes.html" + Delete "$INSTDIR\doc\netidmgr_userdoc.pdf" + Delete "$INSTDIR\doc\netiddev.chm" + + Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\gss.exe" + Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe" + Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe" + Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" + Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe" + Delete /REBOOTOK "$INSTDIR\bin\kinit.exe" + Delete /REBOOTOK "$INSTDIR\bin\klist.exe" + Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe" + Delete /REBOOTOK "$INSTDIR\bin\kvno.exe" + Delete /REBOOTOK "$INSTDIR\bin\krb5_%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.dll" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.exe" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm" + Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll" + Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe" + Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe" + Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe" + Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe" + Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.dll" + Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll" + Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe" + + Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb" + Delete /REBOOTOK "$INSTDIR\bin\klist.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" + Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.pdb" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb" + Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb" + Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb" + Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.pdb" + Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb" + Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb" + +!IFDEF DEBUG +!IFDEF CL_1400 + Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb" +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" +!ENDIF +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1400 + Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL" +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF +!ENDIF + Delete /REBOOTOK "$INSTDIR\bin\psapi.dll" + + RMDir "$INSTDIR\bin" + RmDir "$INSTDIR\doc" + RmDir "$INSTDIR\lib" + RmDir "$INSTDIR\inc" + RmDir "$INSTDIR\install" + RMDir "$INSTDIR" + + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" + RmDir "$SMPROGRAMS\${PROGRAM_NAME}" + Delete "$SMSTARTUP\Network Identity Manager.lnk" + + IfSilent SkipAsk +; IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk +; RealmExists: + MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel + SkipAsk: + Delete "$WINDIR\krb5.ini" + Delete "$WINDIR\krb.con" + Delete "$WINDIR\krbrealm.con" + + SkipDel: + Delete "$INSTDIR\Uninstall.exe" + + ; Restore previous value of AllowTGTSessionKey + ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0 + ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0 + + ; The following are keys added for Terminal Server compatibility + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" + ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK" + DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" + + ; NIM Registry Keys + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5" + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred" + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}" + + ; WinLogon Event Notification + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW" + DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" + + RMDir "$INSTDIR" + +SectionEnd + +;-------------------------------- +;Uninstaller Functions + +Function un.onInit + + ;Get language from registry + ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" + +FunctionEnd + +Function un.onUninstSuccess + + MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software" + +FunctionEnd + +;------------------------------ +; Get the Configurations files from the Internet + +Function kfw.GetConfigFiles + +;Check if we should download Config Files +ReadINIStr $R0 $0 "Field 4" "State" +StrCmp $R0 "1" DoDownload + +;Do nothing if we're keeping the existing file +ReadINIStr $R0 $0 "Field 2" "State" +StrCmp $R0 "1" done + +ReadINIStr $R0 $0 "Field 3" "State" +StrCmp $R0 "1" UsePackaged + +; If none of these, grab file from other location +goto CheckOther + +DoDownload: + ReadINIStr $R0 $0 "Field 5" "State" + NSISdl::download "$R0/krb5.ini" "$WINDIR\krb5.ini" + NSISdl::download "$R0/krb.con" "$WINDIR\krb.con" + NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con" + Pop $R0 ;Get the return value + StrCmp $R0 "success" done + MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0" + goto done + +UsePackaged: + SetOutPath "$WINDIR" + File "${KFW_CONFIG_DIR}\sample\krb5.ini" + File "${KFW_CONFIG_DIR}\sample\krb.con" + File "${KFW_CONFIG_DIR}\sample\krbrealm.con" + goto done + +CheckOther: + ReadINIStr $R0 $0 "Field 7" "State" + StrCmp $R0 "" done + CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini" + CopyFiles "$R0\krb.con" "$WINDIR\krb.con" + CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con" + +done: + +FunctionEnd + + + +;------------------------------- +;Do the page to get the Config files + +Function KFWPageGetConfigFiles + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" Skip + + ; Set the install options here + +startOver: + WriteINIStr $0 "Field 2" "Flags" "DISABLED" + WriteINIStr $0 "Field 3" "State" "1" + WriteINIStr $0 "Field 4" "State" "0" + WriteINIStr $0 "Field 6" "State" "0" + WriteINIStr $0 "Field 3" "Text" "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm." + WriteINIStr $0 "Field 5" "State" "${HTTP_CONFIG_URL}" + + ; If there is an existing krb5.ini file, allow the user to choose it and make it default + IfFileExists "$WINDIR\krb5.ini" +1 notpresent + WriteINIStr $0 "Field 2" "Flags" "ENABLED" + WriteINIStr $0 "Field 2" "State" "1" + WriteINIStr $0 "Field 3" "State" "0" + + notpresent: + + !insertmacro MUI_HEADER_TEXT "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" + InstallOptions::dialog $0 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: Quit +done: + + ; Check that if a file is set, a valid filename is entered... + ReadINIStr $R0 $0 "Field 6" "State" + StrCmp $R0 "1" CheckFileName + + ;Check if a URL is specified, one *IS* specified + ReadINIStr $R0 $0 "Field 4" "State" + StrCmp $R0 "1" CheckURL Skip + + CheckURL: + ReadINIStr $R0 $0 "Field 5" "State" + StrCmp $R0 "" +1 Skip + MessageBox MB_OK|MB_ICONSTOP $(URLError) + WriteINIStr $0 "Field 4" "State" "0" + goto startOver + + CheckFileName: + ReadINIStr $R0 $0 "Field 7" "State" + IfFileExists "$R0\krb5.ini" Skip + + MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError) + WriteINIStr $0 "Field 6" "State" "0" + goto startOver + + Skip: + +FunctionEnd + + +;------------------------------- +;Do the page to get the Startup Configuration + +Function KFWPageGetStartupConfig + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" Skip + + ; Set the install options here + + !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" + InstallOptions::dialog $1 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: + Quit +done: +skip: + +FunctionEnd + + +;------------- +; Common install routines for each module +Function KFWCommon.Install + + WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe" +!ifndef DEBUG + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}" +!else + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug" +!endif + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/" + +!ifdef DEBUG + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1 + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1 +!else + ; Delete the DEBUG string + DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" + DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" +!endif + + WriteUninstaller "$INSTDIR\Uninstall.exe" +FunctionEnd + + +;------------------------------- +; Check if the client should be checked for default install +Function ShouldClientInstall + Push $R0 + StrCpy $R2 "Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + +;------------------------------- +; Check how the Documentation options should be set +Function ShouldDocumentationInstall + Push $R0 + StrCpy $R2 "Documentation" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +;------------------------------- +; Check how the SDK options should be set +Function ShouldSDKInstall + Push $R0 + StrCpy $R2 "SDK" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + +; See if KfW SDK is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsSDKInstalled + Push $R0 + StrCpy $R2 "SDK" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; See if KfW Client is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsClientInstalled + Push $R0 + StrCpy $R2 "Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + + +; See if KfW Documentation is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsDocumentationInstalled + Push $R0 + StrCpy $R2 "Documentation" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + + +;Check to see if any KfW component is installed +;Returns: Value on stack: "1" if it is, "0" if it is not +Function IsAnyKfWInstalled + Push $R0 + Push $R1 + Push $R2 + Call IsClientInstalled + Pop $R0 + Call IsSDKInstalled + Pop $R1 + Call IsDocumentationInstalled + Pop $R2 + ; Now we must see if ANY of the $Rn values are 1 + StrCmp $R0 "1" SomethingInstalled + StrCmp $R1 "1" SomethingInstalled + StrCmp $R2 "1" SomethingInstalled + ;Nothing installed + StrCpy $R0 "0" + goto end +SomethingInstalled: + StrCpy $R0 "1" +end: + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +;-------------------------------- +;Handle what must and what must not be installed +Function .onSelChange + ; If they install the SDK, they MUST install the client + SectionGetFlags ${secSDK} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "1" MakeClientSelected + goto end + +MakeClientSelected: + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $R0 + +end: +FunctionEnd + +Function AddProvider + Push $R0 + Push $R1 + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" DoOther +1 + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + StrCpy $R0 "$R1,MIT Kerberos" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0 +DoOther: + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" +1 End + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + StrCpy $R0 "$R1,MIT Kerberos" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0 +End: + Pop $R1 + Pop $R0 +FunctionEnd + +Function un.RemoveProvider + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" + Call un.RemoveFromProvider + StrCpy $R0 "MIT Kerberos" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" + Call un.RemoveFromProvider + Pop $R0 +FunctionEnd + +Function un.RemoveFromProvider + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + ReadRegStr $1 HKLM "$R0" "ProviderOrder" + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 "," +2 # if last char != , + StrCpy $1 "$1," # append , + Push $1 + Push "$0," + Call un.StrStr ; Find `$0,` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0," + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 "," 0 +2 # if last char == , + StrCpy $3 $3 -1 # remove last char + + WriteRegStr HKLM "$R0" "ProviderOrder" $3 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd Added: branches/krb5-1-6/src/windows/ntsecapitest.c =================================================================== --- branches/krb5-1-6/src/windows/ntsecapitest.c 2009-07-22 23:23:45 UTC (rev 22448) +++ branches/krb5-1-6/src/windows/ntsecapitest.c 2009-07-23 17:34:35 UTC (rev 22449) @@ -0,0 +1,12 @@ +/* Simple program to show what is in ntsecapi.h. + Compile -P to generate preprocessor output. + */ + +#define _WIN32_WINNT 0x0600 +#include "ntsecapi.h" + +#ifdef TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS +VISTA_SDK_VERSION +#else +NT_SDK_VERSION +#endif Added: branches/krb5-1-6/src/windows/ntsecapitest.pl =================================================================== --- branches/krb5-1-6/src/windows/ntsecapitest.pl 2009-07-22 23:23:45 UTC (rev 22448) +++ branches/krb5-1-6/src/windows/ntsecapitest.pl 2009-07-23 17:34:35 UTC (rev 22449) @@ -0,0 +1,20 @@ +#!perl -w + +# We need to search ntsecapitest.i for "VISTA_SDK_VERSION." If the makefile +# greps and the string isn't present, the makefile will terminate. Instead, +# the makefile calls this helper, which either leaves a file behind or +# deletes it, depending on the grep result. Then the makefile tests for +# file existence. + +$filename = "ntsecapitest.i"; +$string = "VISTA_SDK_VERSION"; + +# Without this command, the following grep will fail even when the target +# string is present. +print `ls -l ntsecapitest.* > NULL`."\n"; + +if (system("grep $string $filename > NULL")) { + system("rm $filename"); + } + +exit(0); From tlyu at MIT.EDU Thu Jul 23 13:55:04 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 13:55:04 -0400 Subject: svn rev #22450: branches/krb5-1-6/src/windows/ installer/nsis/ Message-ID: <200907231755.n6NHt4rm012826@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22450 Commit By: tlyu Log Message: ticket: 6535 set eol-style properties Changed Files: UU branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi _U branches/krb5-1-6/src/windows/ntsecapitest.c _U branches/krb5-1-6/src/windows/ntsecapitest.pl Modified: branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi =================================================================== --- branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi 2009-07-23 17:34:35 UTC (rev 22449) +++ branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi 2009-07-23 17:55:04 UTC (rev 22450) @@ -1,1890 +1,1890 @@ -;----------------------------------------------------------------- -; KfW defines and functionality -; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology -; Copyright (c) 2006,2007 Secure Endpoints Inc. - -!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}" - -!define PROGRAM_NAME "Kerberos for Windows" -!ifdef RELEASE -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!else -!ifdef BETA -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!else -!ifndef DEBUG ; !DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}" -!else ; DEBUG on v2.0b4 -Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug" -!endif ; End DEBUG/!DEBUG -!endif -!endif -VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00" -VIAddVersionKey "ProductName" "${PROGRAM_NAME}" -VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology" -VIAddVersionKey "FileVersion" ${VIProductVersion} -VIAddVersionKey "ProductVersion" "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0" -VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer" -VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007" -!ifdef DEBUG -VIAddVersionKey "PrivateBuild" "Checked/Debug" -!endif ; End DEBUG - - -;-------------------------------- -;Configuration - - ;General - SetCompressor lzma -!ifndef DEBUG - OutFile "MITKerberosForWindows.exe" -!else - OutFile "MITKerberosForWindows-DEBUG.exe" -!endif - SilentInstall normal - ShowInstDetails show - XPStyle on - !define MUI_ICON "kfw.ico" - !define MUI_UNICON "kfw.ico" - !define KFW_COMPANY_NAME "Massachusetts Institute of Technology" - !define KFW_PRODUCT_NAME "${PROGRAM_NAME}" - !define KFW_REGKEY_ROOT "Software\MIT\Kerberos\" - !define NIM_REGKEY_ROOT "Software\MIT\NetIDMgr\" - CRCCheck force - !define REPLACEDLL_NOREGISTER - - ;Folder selection page - InstallDir "$PROGRAMFILES\MIT\Kerberos" ; Install to shorter path - - ;Remember install folder - InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" "" - - ;Remember the installer language - !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" - !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" - !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" - - ;Where are the files? - !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\%cpu%" - !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc" - !define KFW_INC_DIR "${KFW_TARGETDIR}\inc" - !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\%cpu%" - !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample" - !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install" - !define SYSTEMDIR "$%SystemRoot%\System32" - !define SXSDIR1 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f" - !define SXSLANG "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.MFCLOC" - !ifdef X86 - !define SXSDIR2 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471" - !define SXSMAND "$%SystemRoot%\WinSxS\Manifests" - !else - !ifdef AMD64 - !define SXSDIR2 "$%SystemRoot%\WinSxS\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_57812684" - !endif - !endif - - !define REDISTDIR "c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86" - -;-------------------------------- -;Modern UI Configuration - - !define MUI_LICENSEPAGE - !define MUI_CUSTOMPAGECOMMANDS - !define MUI_WELCOMEPAGE - !define MUI_COMPONENTSPAGE - !define MUI_COMPONENTSPAGE_SMALLDESC - !define MUI_DIRECTORYPAGE - - !define MUI_ABORTWARNING - !define MUI_FINISHPAGE - - !define MUI_UNINSTALLER - !define MUI_UNCONFIRMPAGE - - - !insertmacro MUI_PAGE_WELCOME - !insertmacro MUI_PAGE_LICENSE "Licenses.rtf" - !insertmacro MUI_PAGE_COMPONENTS - !insertmacro MUI_PAGE_DIRECTORY - Page custom KFWPageGetConfigFiles - Page custom KFWPageGetStartupConfig - !insertmacro MUI_PAGE_INSTFILES - !insertmacro MUI_PAGE_FINISH - -;-------------------------------- -;Languages - - !insertmacro MUI_LANGUAGE "English" - -;-------------------------------- -;Language Strings - - ;Descriptions - LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English" - - LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC." - - LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows" - - LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications." - - LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals." - -; Popup error messages - LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use." - - LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install" - - LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files." - -; Upgrade/re-install strings - LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client" - LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client" - LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client" - - LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK" - LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK" - LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK" - - LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation" - LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation" - LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation" - - ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con" - ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con" - ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini" - !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in - !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog - -;-------------------------------- -;Reserve Files - - ;Things that need to be extracted on first (keep these lines before any File command!) - ;Only useful for BZIP2 compression - !insertmacro MUI_RESERVEFILE_LANGDLL - -;-------------------------------- -; Load Macros -!include "utils.nsi" - -;-------------------------------- -;Installer Sections - -;---------------------- -; Kerberos for Windows CLIENT -Section "KfW Client" secClient - - SetShellVarContext all - ; Stop any running services or we can't replace the files - ; Stop the running processes - GetTempFileName $R0 - File /oname=$R0 "Killer.exe" - nsExec::Exec '$R0 netidmgr.exe' - nsExec::Exec '$R0 leash32.exe' - nsExec::Exec '$R0 krbcc%WL%s.exe' - nsExec::Exec '$R0 k95.exe' - nsExec::Exec '$R0 k95g.exe' - nsExec::Exec '$R0 krb5.exe' - nsExec::Exec '$R0 gss.exe' - nsExec::Exec '$R0 afscreds.exe' - - RMDir /r "$INSTDIR\bin" - - ; Do client components - SetOutPath "$INSTDIR\bin" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr%WL%.dll" "$INSTDIR\bin\comerr%WL%.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe" "$INSTDIR\bin\gss.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe" "$INSTDIR\bin\gss-client.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe" "$INSTDIR\bin\gss-server.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi%WL%.dll" "$INSTDIR\bin\gssapi%WL%.dll" "$INSTDIR" - ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe" "$INSTDIR\bin\kdestroy.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe" "$INSTDIR\bin\kinit.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe" "$INSTDIR\bin\klist.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe" "$INSTDIR\bin\kpasswd.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe" "$INSTDIR\bin\kvno.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_%WL%.dll" "$INSTDIR\bin\krb5_%WL%.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt%WL%.dll" "$INSTDIR\bin\k5sprt%WL%.dll" "$INSTDIR" - ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%.dll" "$INSTDIR\bin\krbcc%WL%.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%s.exe" "$INSTDIR\bin\krbcc%WL%s.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm" "$INSTDIR\bin\netidmgr.chm" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll" "$INSTDIR\bin\krb5cred.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll" "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw%WL%.dll" "$INSTDIR\bin\leashw%WL%.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe" "$INSTDIR\bin\ms2mit.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe" "$INSTDIR\bin\mit2ms.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe" "$INSTDIR\bin\kcpytkt.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe" "$INSTDIR\bin\kdeltkt.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp%WL%.dll" "$INSTDIR\bin\wshelp%WL%.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof%WL%.dll" "$INSTDIR\bin\xpprof%WL%.dll" "$INSTDIR" - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" nid_inst2000 - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" - goto nid_done -nid_inst2000: - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" -nid_done: - -!ifdef DEBUG -!IFDEF CL_1400 - !insertmacro ReplaceDLL "${SXSDIR1}\msvcr80d.dll" "$INSTDIR\bin\msvcr80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSDIR1}\msvcp80d.dll" "$INSTDIR\bin\msvcp80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSDIR2}\mfc80d.dll" "$INSTDIR\bin\mfc80d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHS.DLL" "$INSTDIR\bin\MFC80CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHT.DLL" "$INSTDIR\bin\MFC80CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80DEU.DLL" "$INSTDIR\bin\MFC80DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80ENU.DLL" "$INSTDIR\bin\MFC80ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80ESP.DLL" "$INSTDIR\bin\MFC80ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80FRA.DLL" "$INSTDIR\bin\MFC80FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80ITA.DLL" "$INSTDIR\bin\MFC80ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80JPN.DLL" "$INSTDIR\bin\MFC80JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SXSLANG}\MFC80KOR.DLL" "$INSTDIR\bin\MFC80KOR.DLL" "$INSTDIR" - !IFDEF X86 - !insertmacro ReplaceDLL "${SXSMAND}\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" - !ELSE - !IFDEF AMD64 - !insertmacro ReplaceDLL "${SXSMAND}\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" - !ENDIF - !ENDIF -!ELSE -!IFDEF CL_1310 - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\bin\msvcr71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\bin\msvcp71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\bin\mfc71d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1300 - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\bin\msvcr70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\bin\msvcp70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\bin\mfc70d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" -!ELSE - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\bin\mfc42d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\bin\msvcp60d.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\bin\msvcrtd.dll" "$INSTDIR" -!ENDIF -!ENDIF -!ENDIF -!ELSE -;!IFDEF CL_1400 -; GetTempFileName $R0 -; File /oname=$R0 '${REDISTDIR}\vcredist_x86.exe' -; nsExec::Exec '$R0' -;!ELSE -!IFDEF CL_1310 - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\bin\mfc71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\bin\msvcr71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\bin\msvcp71.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" -!ELSE -!IFDEF CL_1300 - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\bin\mfc70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\bin\msvcr70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\bin\msvcp70.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" -!ELSE - !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\bin\mfc42.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\bin\msvcp60.dll" "$INSTDIR" - !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\bin\msvcrt.dll" "$INSTDIR" -!ENDIF -!ENDIF -;!ENDIF -!ENDIF - !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll" "$INSTDIR\bin\psapi.dll" "$INSTDIR" - - ; Do WINDOWSDIR components - ;SetOutPath "$WINDOWSDIR" -!ifdef DEBUG -!endif - - ; Do Windows SYSDIR (Control panel) - SetOutPath "$SYSDIR" - !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR" - File "${KFW_BIN_DIR}\kfwcpcc.exe" - - ; Get Kerberos config files - Call kfw.GetConfigFiles - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - - ; Daemon entries - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" "" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10 - - ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder - ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order - ; to also include the service name. - Call AddProvider - ReadINIStr $R0 $1 "Field 7" "State" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos" - - ; WinLogon Event Notification - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate" 0 - WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll" - WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event" - - ; NetIdMgr Reg entries - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident" - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider" - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type" 1 - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0 - - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider" - WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred" - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type" 2 - WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0 - - ;Write start menu entries - CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" - SetOutPath "$INSTDIR\bin" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe" - - ReadINIStr $R0 $1 "Field 2" "State" ; startup - - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" - -startshort: - StrCmp $R0 "0" nostart - CreateShortCut "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED - goto checkconflicts - -nostart: - Delete "$SMSTARTUP\Network Identity Manager.lnk" - -checkconflicts: - Call GetSystemPath - Push "krb5_%WL%.dll" - Call SearchPath - Pop $R0 - StrCmp $R0 "" addpath - - Push $R0 - Call GetParent - Pop $R0 - StrCmp $R0 "$INSTDIR\bin" addpath - MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0. This may interfere with the use of the current installation." - -addpath: - ; Add kfw bin to path - Push "$INSTDIR\bin" - Call AddToSystemPath - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2003" addAllowTgtKey - StrCmp $R0 "2000" addAllowTgtKey - StrCmp $R0 "XP" addAllowTgtKey - goto skipAllowTgtKey - -addAllowTgtKey: - ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1" - ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0 - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1" -skipAllowTgtKey: - - ; The following are keys added for Terminal Server compatibility - ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408 - ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408 - WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408 - -SectionEnd - -Section "Debug Symbols" secDebug - - SetOutPath "$INSTDIR\bin" - File "${KFW_BIN_DIR}\comerr%WL%.pdb" - File "${KFW_BIN_DIR}\gss.pdb" - File "${KFW_BIN_DIR}\gss-client.pdb" - File "${KFW_BIN_DIR}\gss-server.pdb" - File "${KFW_BIN_DIR}\gssapi%WL%.pdb" - ;File "${KFW_BIN_DIR}\k524init.pdb" - File "${KFW_BIN_DIR}\kdestroy.pdb" - File "${KFW_BIN_DIR}\kinit.pdb" - File "${KFW_BIN_DIR}\klist.pdb" - File "${KFW_BIN_DIR}\kpasswd.pdb" - File "${KFW_BIN_DIR}\kvno.pdb" - File "${KFW_BIN_DIR}\krb5_%WL%.pdb" - File "${KFW_BIN_DIR}\k5sprt%WL%.pdb" - ;File "${KFW_BIN_DIR}\krb524.pdb" - File "${KFW_BIN_DIR}\krbcc%WL%.pdb" - File "${KFW_BIN_DIR}\krbcc%WL%s.pdb" - File "${KFW_BIN_DIR}\leashw%WL%.pdb" - File "${KFW_BIN_DIR}\krb5cred.pdb" - File "${KFW_BIN_DIR}\ms2mit.pdb" - File "${KFW_BIN_DIR}\mit2ms.pdb" - File "${KFW_BIN_DIR}\kcpytkt.pdb" - File "${KFW_BIN_DIR}\kdeltkt.pdb" - File "${KFW_BIN_DIR}\wshelp%WL%.pdb" - File "${KFW_BIN_DIR}\xpprof%WL%.pdb" - - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" nidpdb_inst2000 - File "${KFW_BIN_DIR}\netidmgr.pdb" - File "${KFW_BIN_DIR}\nidmgr%WL%.pdb" - goto nidpdb_done -nidpdb_inst2000: - File "${KFW_BIN_DIR}\W2K\netidmgr.pdb" - File "${KFW_BIN_DIR}\W2K\nidmgr%WL%.pdb" -nidpdb_done: - -!IFDEF DEBUG -!IFDEF CL_1400 -!IFDEF X86 - File "$%SystemRoot%\symbols\dll\msvcr80d.i386.pdb" - File "$%SystemRoot%\symbols\dll\msvcp80d.i386.pdb" - File "$%SystemRoot%\symbols\dll\mfc80d.i386.pdb" -!ELSE -!IFDEF AMD64 - File "$%SystemRoot%\symbols\dll\msvcr80d.AMD64.pdb" - File "$%SystemRoot%\symbols\dll\msvcp80d.AMD64.pdb" - File "$%SystemRoot%\symbols\dll\mfc80d.AMD64.pdb" -!ENDIF ; AMD64 -!ENDIF ; X86 -!ELSE ; NOT CL_1400 -!IFDEF CL_1310 - File "${SYSTEMDIR}\msvcr71d.pdb" - File "${SYSTEMDIR}\msvcp71d.pdb" - File "${SYSTEMDIR}\mfc71d.pdb" -!ELSE -!IFDEF CL_1300 - File "${SYSTEMDIR}\msvcr70d.pdb" - File "${SYSTEMDIR}\msvcp70d.pdb" - File "${SYSTEMDIR}\mfc70d.pdb" -!ELSE - File "${SYSTEMDIR}\mfc42d.pdb" - File "${SYSTEMDIR}\msvcp60d.pdb" - File "${SYSTEMDIR}\msvcrtd.pdb" -!ENDIF -!ENDIF -!ENDIF -!ENDIF ; DEBUG - - SetOutPath "$SYSDIR" - File "${KFW_BIN_DIR}\kfwlogon.pdb" - File "${KFW_BIN_DIR}\kfwcpcc.pdb" - -SectionEnd - -;---------------------- -; Kerberos for Windows SDK -Section "KfW SDK" secSDK - - RMDir /r "$INSTDIR\inc" - RMDir /r "$INSTDIR\lib" - RMDir /r "$INSTDIR\install" - RMDir /r "$INSTDIR\sample" - - SetOutPath "$INSTDIR\doc" - File /r "${KFW_DOC_DIR}\netiddev.chm" - - SetOutPath "$INSTDIR\inc\krb5" - File /r "${KFW_INC_DIR}\krb5\*" - - SetOutPath "$INSTDIR\inc\leash" - File /r "${KFW_INC_DIR}\leash\*" - - SetOutPath "$INSTDIR\inc\loadfuncs" - File /r "${KFW_INC_DIR}\loadfuncs\*" - - SetOutPath "$INSTDIR\inc\netidmgr" - File /r "${KFW_INC_DIR}\netidmgr\*" - - SetOutPath "$INSTDIR\inc\wshelper" - File /r "${KFW_INC_DIR}\wshelper\*" - - SetOutPath "$INSTDIR\lib\%cpu%" - File /r "${KFW_LIB_DIR}\*" - - SetOutPath "$INSTDIR\install" - File /r "${KFW_INSTALL_DIR}\*" - - SetOutPath "$INSTDIR\sample" - File /r "${KFW_SAMPLE_DIR}\*" - - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - -SectionEnd - -;---------------------- -; Kerberos for Windows Documentation -Section "KfW Documentation" secDocs - - RMDir /r "$INSTDIR\doc" - - SetOutPath "$INSTDIR\doc" - File "${KFW_DOC_DIR}\relnotes.html" - File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf" - - Call KFWCommon.Install - - ; KfW Reg entries - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION} - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR" - WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication" - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} - - ;Write start menu entries - CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" - SetOutPath "$INSTDIR\doc" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" - CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" -SectionEnd - -;Display the Finish header -;Insert this macro after the sections if you are not using a finish page -;!insertmacro MUI_SECTIONS_FINISHHEADER - -;-------------------------------- -;Installer Functions - -Function .onInit - !insertmacro MUI_LANGDLL_DISPLAY - - ; Set the default install options - Push $0 - - Call IsUserAdmin - Pop $R0 - StrCmp $R0 "true" checkVer - - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software." - Abort - -checkVer: - ; Check Version of Windows. Do not install onto Windows 95 - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "95" wrongVersion - StrCmp $R0 "98" wrongVersion - StrCmp $R0 "ME" wrongVersion - StrCmp $R0 "NT 4.0" wrongVersion - goto checkIPHLPAPI - -wrongVersion: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher." - Abort - -checkIPHLPAPI: - ClearErrors - ReadEnvStr $R0 "WinDir" - GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2 - IfErrors +1 +3 - GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2 - IfErrors iphlperror - IntOp $R3 $R2 / 0x00010000 - IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious - -iphlperror: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing." - Abort - -iphlpwarning: - MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded. Please install Internet Explorer 5.01 or higher." - -checkprevious: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ - "DisplayVersion" - IfErrors testWIX - StrCmp $R0 "${KFW_VERSION}" contInstall - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this upgrade or downgrade." \ - IDOK uninstNSIS - Abort - -;Run the uninstaller -uninstNSIS: - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ - "UninstallString" - ClearErrors - ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testWIX: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \ - "DisplayVersion" - IfErrors testSWRT - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstMSI1 - Abort - -;Run the uninstaller -uninstMSI1: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstMSI1_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstMSI1_2000: - ClearErrors - ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testSWRT: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \ - "DisplayVersion" - IfErrors testPismere - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstMSI2 - Abort - -;Run the uninstaller -uninstMSI2: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstMSI2_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstMSI2_2000: - ClearErrors - ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -testPismere: - ClearErrors - ReadRegStr $R0 HKLM \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \ - "DisplayVersion" - IfErrors contInstall - - MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ - "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ - previous version or `Cancel` to cancel this installation." \ - IDOK uninstPismere - Abort - -;Run the uninstaller -uninstPismere: - Call GetWindowsVersion - Pop $R0 - StrCmp $R0 "2000" uninstPismere_2000 - - ClearErrors - ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - -uninstPismere_2000: - ClearErrors - ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}' - - IfErrors no_remove_uninstaller - ;You can either use Delete /REBOOTOK in the uninstaller or add some code - ;here to remove the uninstaller. Use a registry key to check - ;whether the user has chosen to uninstall. If you are using an uninstaller - ;components page, make sure all sections are uninstalled. - - Push $R1 - Call RestartRequired - Pop $R1 - StrCmp $R1 "1" Restart DoNotRestart - - -Restart: - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer." - Abort - MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed" - -DoNotRestart: -no_remove_uninstaller: - -contInstall: - ; Never install debug symbols unless explicitly selected, except in DEBUG mode -!IFNDEF DEBUG - SectionGetFlags ${secDebug} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secDebug} $0 -!ELSE - SectionGetFlags ${secDebug} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDebug} $0 -!ENDIF - - ; Our logic should be like this. - ; 1) If no KfW components are installed, we do a clean install with default options. (Client/Docs) - ; 2) If existing modules are installed, we keep them selected - ; 3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install - ; TODO: Downgrade? - Call IsAnyKfWInstalled - Pop $R0 - StrCmp $R0 "0" DefaultOptions - - Call ShouldClientInstall - Pop $R2 - - StrCmp $R2 "0" NoClient - StrCmp $R2 "1" ReinstallClient - StrCmp $R2 "2" UpgradeClient - StrCmp $R2 "3" DowngradeClient - - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - ;# !insertmacro SelectSection ${secClient} - goto skipClient -NoClient: - ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now... - SectionGetFlags ${secClient} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secClient} $0 - goto skipClient -UpgradeClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(UPGRADE_CLIENT) - goto skipClient -ReinstallClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(REINSTALL_CLIENT) - goto skipClient -DowngradeClient: - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - SectionSetText ${secClient} $(DOWNGRADE_CLIENT) - goto skipClient - - -skipClient: - - Call ShouldSDKInstall - Pop $R2 - StrCmp $R2 "0" NoSDK - StrCmp $R2 "1" ReinstallSDK - StrCmp $R2 "2" UpgradeSDK - StrCmp $R2 "3" DowngradeSDK - - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - ;# !insertmacro UnselectSection ${secSDK} - goto skipSDK - -UpgradeSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(UPGRADE_SDK) - goto skipSDK - -ReinstallSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(REINSTALL_SDK) - goto skipSDK - -DowngradeSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secSDK} $0 - SectionSetText ${secSDK} $(DOWNGRADE_SDK) - goto skipSDK - -NoSDK: - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secSDK} $0 - ;# !insertmacro UnselectSection ${secSDK} - goto skipSDK - -skipSDK: - - Call ShouldDocumentationInstall - Pop $R2 - StrCmp $R2 "0" NoDocumentation - StrCmp $R2 "1" ReinstallDocumentation - StrCmp $R2 "2" UpgradeDocumentation - StrCmp $R2 "3" DowngradeDocumentation - - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - ;# !insertmacro UnselectSection ${secDocs} - goto skipDocumentation - -UpgradeDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(UPGRADE_DOCS) - goto skipDocumentation - -ReinstallDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(REINSTALL_DOCS) - goto skipDocumentation - -DowngradeDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - SectionSetText ${secDocs} $(DOWNGRADE_DOCS) - goto skipDocumentation - -NoDocumentation: - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secDocs} $0 - ;# !insertmacro UnselectSection ${secDocs} - goto skipDocumentation - -skipDocumentation: - goto end - -DefaultOptions: - ; Client Selected - SectionGetFlags ${secClient} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $0 - - ; SDK NOT selected - SectionGetFlags ${secSDK} $0 - IntOp $0 $0 & ${SECTION_OFF} - SectionSetFlags ${secSDK} $0 - - ; Documentation selected - SectionGetFlags ${secDocs} $0 - IntOp $0 $0 | ${SF_SELECTED} - SectionSetFlags ${secDocs} $0 - goto end - -end: - Pop $0 - - Push $R0 - - ; See if we can set a default installation path... - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" - StrCmp $R0 "" TrySDK - StrCpy $INSTDIR $R0 - goto Nope - -TrySDK: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" - StrCmp $R0 "" TryDocs - StrCpy $INSTDIR $R0 - goto Nope - -TryDocs: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" - StrCmp $R0 "" TryRoot - StrCpy $INSTDIR $R0 - goto Nope - -TryRoot: - ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir" - StrCmp $R0 "" Nope - StrCpy $INSTDIR $R0 - -Nope: - Pop $R0 - - GetTempFilename $0 - File /oname=$0 KfWConfigPage.ini - GetTempFilename $1 - File /oname=$1 KfWConfigPage2.ini - -FunctionEnd - - -;-------------------------------- -; These are our cleanup functions -Function .onInstFailed -Delete $0 -Delete $1 -FunctionEnd - -Function .onInstSuccess -Delete $0 -Delete $1 -FunctionEnd - - -;-------------------------------- -;Descriptions - - !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN - !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient) - !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK) - !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs) - !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug) - !insertmacro MUI_FUNCTION_DESCRIPTION_END - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them! - IfSilent StartRemove ; New in v2.0b4 - MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove - abort - -StartRemove: - - SetShellVarContext all - ; Stop the running processes - GetTempFileName $R0 - File /oname=$R0 "Killer.exe" - nsExec::Exec '$R0 netidmgr.exe' - nsExec::Exec '$R0 krbcc%WL%s.exe' - - Push "$INSTDIR\bin" - Call un.RemoveFromSystemPath - - ; Delete documentation - Delete "$INSTDIR\doc\relnotes.html" - Delete "$INSTDIR\doc\netidmgr_userdoc.pdf" - Delete "$INSTDIR\doc\netiddev.chm" - - Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\gss.exe" - Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe" - Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe" - Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll" - ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" - Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe" - Delete /REBOOTOK "$INSTDIR\bin\kinit.exe" - Delete /REBOOTOK "$INSTDIR\bin\klist.exe" - Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe" - Delete /REBOOTOK "$INSTDIR\bin\kvno.exe" - Delete /REBOOTOK "$INSTDIR\bin\krb5_%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.dll" - ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" - Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.exe" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm" - Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll" - Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe" - Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe" - Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe" - Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe" - Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.dll" - Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.dll" - Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll" - Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe" - - Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb" - Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb" - ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb" - Delete /REBOOTOK "$INSTDIR\bin\klist.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" - Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.pdb" - ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.pdb" - Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb" - Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.pdb" - Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb" - Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.pdb" - Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb" - Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb" - Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.pdb" - Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.pdb" - Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb" - Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb" - -!IFDEF DEBUG -!IFDEF CL_1400 - Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb" -!ELSE -!IFDEF CL_1310 - Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" -!ELSE -!IFDEF CL_1300 - Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" -!ELSE - Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" - Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" - Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" -!ENDIF -!ENDIF -!ENDIF -!ELSE -!IFDEF CL_1400 - Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL" -!ELSE -!IFDEF CL_1310 - Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" -!ELSE -!IFDEF CL_1300 - Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" - Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" - Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" -!ELSE - Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" - Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" -!ENDIF -!ENDIF -!ENDIF -!ENDIF - Delete /REBOOTOK "$INSTDIR\bin\psapi.dll" - - RMDir "$INSTDIR\bin" - RmDir "$INSTDIR\doc" - RmDir "$INSTDIR\lib" - RmDir "$INSTDIR\inc" - RmDir "$INSTDIR\install" - RMDir "$INSTDIR" - - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" - Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" - RmDir "$SMPROGRAMS\${PROGRAM_NAME}" - Delete "$SMSTARTUP\Network Identity Manager.lnk" - - IfSilent SkipAsk -; IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk -; RealmExists: - MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel - SkipAsk: - Delete "$WINDIR\krb5.ini" - Delete "$WINDIR\krb.con" - Delete "$WINDIR\krbrealm.con" - - SkipDel: - Delete "$INSTDIR\Uninstall.exe" - - ; Restore previous value of AllowTGTSessionKey - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0 - ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" - WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0 - - ; The following are keys added for Terminal Server compatibility - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" - ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" - - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" - DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK" - DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" - - ; NIM Registry Keys - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred" - DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager" - DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}" - - ; WinLogon Event Notification - DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW" - DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" - - RMDir "$INSTDIR" - -SectionEnd - -;-------------------------------- -;Uninstaller Functions - -Function un.onInit - - ;Get language from registry - ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" - -FunctionEnd - -Function un.onUninstSuccess - - MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software" - -FunctionEnd - -;------------------------------ -; Get the Configurations files from the Internet - -Function kfw.GetConfigFiles - -;Check if we should download Config Files -ReadINIStr $R0 $0 "Field 4" "State" -StrCmp $R0 "1" DoDownload - -;Do nothing if we're keeping the existing file -ReadINIStr $R0 $0 "Field 2" "State" -StrCmp $R0 "1" done - -ReadINIStr $R0 $0 "Field 3" "State" -StrCmp $R0 "1" UsePackaged - -; If none of these, grab file from other location -goto CheckOther - -DoDownload: - ReadINIStr $R0 $0 "Field 5" "State" - NSISdl::download "$R0/krb5.ini" "$WINDIR\krb5.ini" - NSISdl::download "$R0/krb.con" "$WINDIR\krb.con" - NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con" - Pop $R0 ;Get the return value - StrCmp $R0 "success" done - MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0" - goto done - -UsePackaged: - SetOutPath "$WINDIR" - File "${KFW_CONFIG_DIR}\sample\krb5.ini" - File "${KFW_CONFIG_DIR}\sample\krb.con" - File "${KFW_CONFIG_DIR}\sample\krbrealm.con" - goto done - -CheckOther: - ReadINIStr $R0 $0 "Field 7" "State" - StrCmp $R0 "" done - CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini" - CopyFiles "$R0\krb.con" "$WINDIR\krb.con" - CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con" - -done: - -FunctionEnd - - - -;------------------------------- -;Do the page to get the Config files - -Function KFWPageGetConfigFiles - ; Skip this page if we are not installing the client - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "0" Skip - - ; Set the install options here - -startOver: - WriteINIStr $0 "Field 2" "Flags" "DISABLED" - WriteINIStr $0 "Field 3" "State" "1" - WriteINIStr $0 "Field 4" "State" "0" - WriteINIStr $0 "Field 6" "State" "0" - WriteINIStr $0 "Field 3" "Text" "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm." - WriteINIStr $0 "Field 5" "State" "${HTTP_CONFIG_URL}" - - ; If there is an existing krb5.ini file, allow the user to choose it and make it default - IfFileExists "$WINDIR\krb5.ini" +1 notpresent - WriteINIStr $0 "Field 2" "Flags" "ENABLED" - WriteINIStr $0 "Field 2" "State" "1" - WriteINIStr $0 "Field 3" "State" "0" - - notpresent: - - !insertmacro MUI_HEADER_TEXT "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" - InstallOptions::dialog $0 - Pop $R1 - StrCmp $R1 "cancel" exit - StrCmp $R1 "back" done - StrCmp $R1 "success" done -exit: Quit -done: - - ; Check that if a file is set, a valid filename is entered... - ReadINIStr $R0 $0 "Field 6" "State" - StrCmp $R0 "1" CheckFileName - - ;Check if a URL is specified, one *IS* specified - ReadINIStr $R0 $0 "Field 4" "State" - StrCmp $R0 "1" CheckURL Skip - - CheckURL: - ReadINIStr $R0 $0 "Field 5" "State" - StrCmp $R0 "" +1 Skip - MessageBox MB_OK|MB_ICONSTOP $(URLError) - WriteINIStr $0 "Field 4" "State" "0" - goto startOver - - CheckFileName: - ReadINIStr $R0 $0 "Field 7" "State" - IfFileExists "$R0\krb5.ini" Skip - - MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError) - WriteINIStr $0 "Field 6" "State" "0" - goto startOver - - Skip: - -FunctionEnd - - -;------------------------------- -;Do the page to get the Startup Configuration - -Function KFWPageGetStartupConfig - ; Skip this page if we are not installing the client - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "0" Skip - - ; Set the install options here - - !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" - InstallOptions::dialog $1 - Pop $R1 - StrCmp $R1 "cancel" exit - StrCmp $R1 "back" done - StrCmp $R1 "success" done -exit: - Quit -done: -skip: - -FunctionEnd - - -;------------- -; Common install routines for each module -Function KFWCommon.Install - - WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR - - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe" -!ifndef DEBUG - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}" -!else - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug" -!endif - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/" - -!ifdef DEBUG - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1 - WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1 -!else - ; Delete the DEBUG string - DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" - DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" -!endif - - WriteUninstaller "$INSTDIR\Uninstall.exe" -FunctionEnd - - -;------------------------------- -; Check if the client should be checked for default install -Function ShouldClientInstall - Push $R0 - StrCpy $R2 "Client" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - -;------------------------------- -; Check how the Documentation options should be set -Function ShouldDocumentationInstall - Push $R0 - StrCpy $R2 "Documentation" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - -;------------------------------- -; Check how the SDK options should be set -Function ShouldSDKInstall - Push $R0 - StrCpy $R2 "SDK" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - ; Now we see if it's an older or newer version - - Call GetInstalledVersionMajor - Pop $R0 - IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionMinor - Pop $R0 - IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade - - Call GetInstalledVersionPatch - Pop $R0 - IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade - -Reinstall: - StrCpy $R0 "1" - Exch $R0 - goto end - -Upgrade: - StrCpy $R0 "2" - Exch $R0 - goto end - -Downgrade: - StrCpy $R0 "3" - Exch $R0 - goto end - - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - -; See if KfW SDK is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsSDKInstalled - Push $R0 - StrCpy $R2 "SDK" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - -; See if KfW Client is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsClientInstalled - Push $R0 - StrCpy $R2 "Client" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - - -; See if KfW Documentation is installed -; Returns: "1" if it is, 0 if it is not (on the stack) -Function IsDocumentationInstalled - Push $R0 - StrCpy $R2 "Documentation" - Call GetInstalledVersion - Pop $R0 - - StrCmp $R0 "" NotInstalled - - StrCpy $R0 "1" - Exch $R0 - goto end - -NotInstalled: - StrCpy $R0 "0" - Exch $R0 -end: -FunctionEnd - - - -;Check to see if any KfW component is installed -;Returns: Value on stack: "1" if it is, "0" if it is not -Function IsAnyKfWInstalled - Push $R0 - Push $R1 - Push $R2 - Call IsClientInstalled - Pop $R0 - Call IsSDKInstalled - Pop $R1 - Call IsDocumentationInstalled - Pop $R2 - ; Now we must see if ANY of the $Rn values are 1 - StrCmp $R0 "1" SomethingInstalled - StrCmp $R1 "1" SomethingInstalled - StrCmp $R2 "1" SomethingInstalled - ;Nothing installed - StrCpy $R0 "0" - goto end -SomethingInstalled: - StrCpy $R0 "1" -end: - Pop $R2 - Pop $R1 - Exch $R0 -FunctionEnd - -;-------------------------------- -;Handle what must and what must not be installed -Function .onSelChange - ; If they install the SDK, they MUST install the client - SectionGetFlags ${secSDK} $R0 - IntOp $R0 $R0 & ${SF_SELECTED} - StrCmp $R0 "1" MakeClientSelected - goto end - -MakeClientSelected: - SectionGetFlags ${secClient} $R0 - IntOp $R0 $R0 | ${SF_SELECTED} - SectionSetFlags ${secClient} $R0 - -end: -FunctionEnd - -Function AddProvider - Push $R0 - Push $R1 - ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - Call StrStr - Pop $R0 - StrCmp $R0 "" DoOther +1 - ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" - StrCpy $R0 "$R1,MIT Kerberos" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0 -DoOther: - ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - Call StrStr - Pop $R0 - StrCmp $R0 "" +1 End - ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" - StrCpy $R0 "$R1,MIT Kerberos" - WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0 -End: - Pop $R1 - Pop $R0 -FunctionEnd - -Function un.RemoveProvider - Push $R0 - StrCpy $R0 "MIT Kerberos" - Push $R0 - StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" - Call un.RemoveFromProvider - StrCpy $R0 "MIT Kerberos" - Push $R0 - StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" - Call un.RemoveFromProvider - Pop $R0 -FunctionEnd - -Function un.RemoveFromProvider - Exch $0 - Push $1 - Push $2 - Push $3 - Push $4 - Push $5 - Push $6 - - ReadRegStr $1 HKLM "$R0" "ProviderOrder" - StrCpy $5 $1 1 -1 # copy last char - StrCmp $5 "," +2 # if last char != , - StrCpy $1 "$1," # append , - Push $1 - Push "$0," - Call un.StrStr ; Find `$0,` in $1 - Pop $2 ; pos of our dir - StrCmp $2 "" unRemoveFromPath_done - ; else, it is in path - # $0 - path to add - # $1 - path var - StrLen $3 "$0," - StrLen $4 $2 - StrCpy $5 $1 -$4 # $5 is now the part before the path to remove - StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove - StrCpy $3 $5$6 - - StrCpy $5 $3 1 -1 # copy last char - StrCmp $5 "," 0 +2 # if last char == , - StrCpy $3 $3 -1 # remove last char - - WriteRegStr HKLM "$R0" "ProviderOrder" $3 - - unRemoveFromPath_done: - Pop $6 - Pop $5 - Pop $4 - Pop $3 - Pop $2 - Pop $1 - Pop $0 -FunctionEnd +;----------------------------------------------------------------- +; KfW defines and functionality +; Copyright (c) 2004,2005,2006,2007 Massachusetts Institute of Technology +; Copyright (c) 2006,2007 Secure Endpoints Inc. + +!define KFW_VERSION "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}" + +!define PROGRAM_NAME "Kerberos for Windows" +!ifdef RELEASE +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!else +!ifdef BETA +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} Beta ${BETA} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!else +!ifndef DEBUG ; !DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__}" +!else ; DEBUG on v2.0b4 +Name "MIT ${PROGRAM_NAME} ${KFW_VERSION} ${__DATE__} ${__TIME__} Checked/Debug" +!endif ; End DEBUG/!DEBUG +!endif +!endif +VIProductVersion "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.00" +VIAddVersionKey "ProductName" "${PROGRAM_NAME}" +VIAddVersionKey "CompanyName" "Massachusetts Institute of Technology" +VIAddVersionKey "FileVersion" ${VIProductVersion} +VIAddVersionKey "ProductVersion" "${KFW_MAJORVERSION}.${KFW_MINORVERSION}.${KFW_PATCHLEVEL}.0" +VIAddVersionKey "FileDescription" "MIT Kerberos for Windows Installer" +VIAddVersionKey "LegalCopyright" "(C)2004,2005,2006,2007" +!ifdef DEBUG +VIAddVersionKey "PrivateBuild" "Checked/Debug" +!endif ; End DEBUG + + +;-------------------------------- +;Configuration + + ;General + SetCompressor lzma +!ifndef DEBUG + OutFile "MITKerberosForWindows.exe" +!else + OutFile "MITKerberosForWindows-DEBUG.exe" +!endif + SilentInstall normal + ShowInstDetails show + XPStyle on + !define MUI_ICON "kfw.ico" + !define MUI_UNICON "kfw.ico" + !define KFW_COMPANY_NAME "Massachusetts Institute of Technology" + !define KFW_PRODUCT_NAME "${PROGRAM_NAME}" + !define KFW_REGKEY_ROOT "Software\MIT\Kerberos\" + !define NIM_REGKEY_ROOT "Software\MIT\NetIDMgr\" + CRCCheck force + !define REPLACEDLL_NOREGISTER + + ;Folder selection page + InstallDir "$PROGRAMFILES\MIT\Kerberos" ; Install to shorter path + + ;Remember install folder + InstallDirRegKey HKLM "${KFW_REGKEY_ROOT}" "" + + ;Remember the installer language + !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" + !define MUI_LANGDLL_REGISTRY_KEY "${KFW_REGKEY_ROOT}" + !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" + + ;Where are the files? + !define KFW_BIN_DIR "${KFW_TARGETDIR}\bin\%cpu%" + !define KFW_DOC_DIR "${KFW_TARGETDIR}\doc" + !define KFW_INC_DIR "${KFW_TARGETDIR}\inc" + !define KFW_LIB_DIR "${KFW_TARGETDIR}\lib\%cpu%" + !define KFW_SAMPLE_DIR "${KFW_TARGETDIR}\sample" + !define KFW_INSTALL_DIR "${KFW_TARGETDIR}\install" + !define SYSTEMDIR "$%SystemRoot%\System32" + !define SXSDIR1 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f" + !define SXSLANG "c:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.MFCLOC" + !ifdef X86 + !define SXSDIR2 "$%SystemRoot%\WinSxS\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_c8452471" + !define SXSMAND "$%SystemRoot%\WinSxS\Manifests" + !else + !ifdef AMD64 + !define SXSDIR2 "$%SystemRoot%\WinSxS\amd64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_57812684" + !endif + !endif + + !define REDISTDIR "c:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86" + +;-------------------------------- +;Modern UI Configuration + + !define MUI_LICENSEPAGE + !define MUI_CUSTOMPAGECOMMANDS + !define MUI_WELCOMEPAGE + !define MUI_COMPONENTSPAGE + !define MUI_COMPONENTSPAGE_SMALLDESC + !define MUI_DIRECTORYPAGE + + !define MUI_ABORTWARNING + !define MUI_FINISHPAGE + + !define MUI_UNINSTALLER + !define MUI_UNCONFIRMPAGE + + + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_LICENSE "Licenses.rtf" + !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + Page custom KFWPageGetConfigFiles + Page custom KFWPageGetStartupConfig + !insertmacro MUI_PAGE_INSTFILES + !insertmacro MUI_PAGE_FINISH + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Language Strings + + ;Descriptions + LangString DESC_SecCopyUI ${LANG_ENGLISH} "${PROGRAM_NAME}: English" + + LangString DESC_secClient ${LANG_ENGLISH} "Client: Allows you to utilize MIT Kerberos from your Windows PC." + + LangString DESC_secDebug ${LANG_ENGLISH} "Debug Symbols: Used for debugging problems with MIT Kerberos for Windows" + + LangString DESC_secSDK ${LANG_ENGLISH} "SDK: Allows you to build MIT Kerberos aware applications." + + LangString DESC_secDocs ${LANG_ENGLISH} "Documentation: Release Notes and User Manuals." + +; Popup error messages + LangString RealmNameError ${LANG_ENGLISH} "You must specify a realm name for your client to use." + + LangString ConfigFileError ${LANG_ENGLISH} "You must specify a valid configuration file location from which files can be copied during the install" + + LangString URLError ${LANG_ENGLISH} "You must specify a URL if you choose the option to download the config files." + +; Upgrade/re-install strings + LangString UPGRADE_CLIENT ${LANG_ENGLISH} "Upgrade Kerberos Client" + LangString REINSTALL_CLIENT ${LANG_ENGLISH} "Re-install Kerberos Client" + LangString DOWNGRADE_CLIENT ${LANG_ENGLISH} "Downgrade Kerberos Client" + + LangString UPGRADE_SDK ${LANG_ENGLISH} "Upgrade Kerberos SDK" + LangString REINSTALL_SDK ${LANG_ENGLISH} "Re-install Kerberos SDK" + LangString DOWNGRADE_SDK ${LANG_ENGLISH} "Downgrade Kerberos SDK" + + LangString UPGRADE_DOCS ${LANG_ENGLISH} "Upgrade Kerberos Documentation" + LangString REINSTALL_DOCS ${LANG_ENGLISH} "Re-install Kerberos Documentation" + LangString DOWNGRADE_DOCS ${LANG_ENGLISH} "Downgrade Kerberos Documentation" + + ReserveFile "${KFW_CONFIG_DIR}\sample\krb.con" + ReserveFile "${KFW_CONFIG_DIR}\sample\krbrealm.con" + ReserveFile "${KFW_CONFIG_DIR}\sample\krb5.ini" + !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;InstallOptions plug-in + !insertmacro MUI_RESERVEFILE_LANGDLL ;Language selection dialog + +;-------------------------------- +;Reserve Files + + ;Things that need to be extracted on first (keep these lines before any File command!) + ;Only useful for BZIP2 compression + !insertmacro MUI_RESERVEFILE_LANGDLL + +;-------------------------------- +; Load Macros +!include "utils.nsi" + +;-------------------------------- +;Installer Sections + +;---------------------- +; Kerberos for Windows CLIENT +Section "KfW Client" secClient + + SetShellVarContext all + ; Stop any running services or we can't replace the files + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "Killer.exe" + nsExec::Exec '$R0 netidmgr.exe' + nsExec::Exec '$R0 leash32.exe' + nsExec::Exec '$R0 krbcc%WL%s.exe' + nsExec::Exec '$R0 k95.exe' + nsExec::Exec '$R0 k95g.exe' + nsExec::Exec '$R0 krb5.exe' + nsExec::Exec '$R0 gss.exe' + nsExec::Exec '$R0 afscreds.exe' + + RMDir /r "$INSTDIR\bin" + + ; Do client components + SetOutPath "$INSTDIR\bin" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\comerr%WL%.dll" "$INSTDIR\bin\comerr%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss.exe" "$INSTDIR\bin\gss.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-client.exe" "$INSTDIR\bin\gss-client.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gss-server.exe" "$INSTDIR\bin\gss-server.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\gssapi%WL%.dll" "$INSTDIR\bin\gssapi%WL%.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\k524init.exe" "$INSTDIR\bin\k524init.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdestroy.exe" "$INSTDIR\bin\kdestroy.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kinit.exe" "$INSTDIR\bin\kinit.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\klist.exe" "$INSTDIR\bin\klist.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kpasswd.exe" "$INSTDIR\bin\kpasswd.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kvno.exe" "$INSTDIR\bin\kvno.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5_%WL%.dll" "$INSTDIR\bin\krb5_%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\k5sprt%WL%.dll" "$INSTDIR\bin\k5sprt%WL%.dll" "$INSTDIR" + ;!insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb524.dll" "$INSTDIR\bin\krb524.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%.dll" "$INSTDIR\bin\krbcc%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krbcc%WL%s.exe" "$INSTDIR\bin\krbcc%WL%s.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.chm" "$INSTDIR\bin\netidmgr.chm" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred.dll" "$INSTDIR\bin\krb5cred.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\krb5cred_en_us.dll" "$INSTDIR\bin\krb5cred_en_us.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\leashw%WL%.dll" "$INSTDIR\bin\leashw%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\ms2mit.exe" "$INSTDIR\bin\ms2mit.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\mit2ms.exe" "$INSTDIR\bin\mit2ms.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kcpytkt.exe" "$INSTDIR\bin\kcpytkt.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kdeltkt.exe" "$INSTDIR\bin\kdeltkt.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\wshelp%WL%.dll" "$INSTDIR\bin\wshelp%WL%.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\xpprof%WL%.dll" "$INSTDIR\bin\xpprof%WL%.dll" "$INSTDIR" + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" nid_inst2000 + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" + goto nid_done +nid_inst2000: + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\netidmgr.exe" "$INSTDIR\bin\netidmgr.exe" "$INSTDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\W2K\nidmgr%WL%.dll" "$INSTDIR\bin\nidmgr%WL%.dll" "$INSTDIR" +nid_done: + +!ifdef DEBUG +!IFDEF CL_1400 + !insertmacro ReplaceDLL "${SXSDIR1}\msvcr80d.dll" "$INSTDIR\bin\msvcr80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSDIR1}\msvcp80d.dll" "$INSTDIR\bin\msvcp80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSDIR2}\mfc80d.dll" "$INSTDIR\bin\mfc80d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHS.DLL" "$INSTDIR\bin\MFC80CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80CHT.DLL" "$INSTDIR\bin\MFC80CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80DEU.DLL" "$INSTDIR\bin\MFC80DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ENU.DLL" "$INSTDIR\bin\MFC80ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ESP.DLL" "$INSTDIR\bin\MFC80ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80FRA.DLL" "$INSTDIR\bin\MFC80FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80ITA.DLL" "$INSTDIR\bin\MFC80ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80JPN.DLL" "$INSTDIR\bin\MFC80JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SXSLANG}\MFC80KOR.DLL" "$INSTDIR\bin\MFC80KOR.DLL" "$INSTDIR" + !IFDEF X86 + !insertmacro ReplaceDLL "${SXSMAND}\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\x86_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" + !ELSE + !IFDEF AMD64 + !insertmacro ReplaceDLL "${SXSMAND}\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR\bin\AMD64_Microsoft.VC80.DebugMFC_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_257740a4.manifest" "$INSTDIR" + !ENDIF + !ENDIF +!ELSE +!IFDEF CL_1310 + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71d.dll" "$INSTDIR\bin\msvcr71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71d.dll" "$INSTDIR\bin\msvcp71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71d.dll" "$INSTDIR\bin\mfc71d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" +!ELSE +!IFDEF CL_1300 + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70d.dll" "$INSTDIR\bin\msvcr70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70d.dll" "$INSTDIR\bin\msvcp70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70d.dll" "$INSTDIR\bin\mfc70d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" +!ELSE + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42d.dll" "$INSTDIR\bin\mfc42d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60d.dll" "$INSTDIR\bin\msvcp60d.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrtd.dll" "$INSTDIR\bin\msvcrtd.dll" "$INSTDIR" +!ENDIF +!ENDIF +!ENDIF +!ELSE +;!IFDEF CL_1400 +; GetTempFileName $R0 +; File /oname=$R0 '${REDISTDIR}\vcredist_x86.exe' +; nsExec::Exec '$R0' +;!ELSE +!IFDEF CL_1310 + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc71.dll" "$INSTDIR\bin\mfc71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr71.dll" "$INSTDIR\bin\msvcr71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp71.dll" "$INSTDIR\bin\msvcp71.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHS.DLL" "$INSTDIR\bin\MFC71CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71CHT.DLL" "$INSTDIR\bin\MFC71CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71DEU.DLL" "$INSTDIR\bin\MFC71DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ENU.DLL" "$INSTDIR\bin\MFC71ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ESP.DLL" "$INSTDIR\bin\MFC71ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71FRA.DLL" "$INSTDIR\bin\MFC71FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71ITA.DLL" "$INSTDIR\bin\MFC71ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71JPN.DLL" "$INSTDIR\bin\MFC71JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC71KOR.DLL" "$INSTDIR\bin\MFC71KOR.DLL" "$INSTDIR" +!ELSE +!IFDEF CL_1300 + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc70.dll" "$INSTDIR\bin\mfc70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcr70.dll" "$INSTDIR\bin\msvcr70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp70.dll" "$INSTDIR\bin\msvcp70.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHS.DLL" "$INSTDIR\bin\MFC70CHS.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70CHT.DLL" "$INSTDIR\bin\MFC70CHT.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70DEU.DLL" "$INSTDIR\bin\MFC70DEU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ENU.DLL" "$INSTDIR\bin\MFC70ENU.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ESP.DLL" "$INSTDIR\bin\MFC70ESP.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70FRA.DLL" "$INSTDIR\bin\MFC70FRA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70ITA.DLL" "$INSTDIR\bin\MFC70ITA.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70JPN.DLL" "$INSTDIR\bin\MFC70JPN.DLL" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\MFC70KOR.DLL" "$INSTDIR\bin\MFC70KOR.DLL" "$INSTDIR" +!ELSE + !insertmacro ReplaceDLL "${SYSTEMDIR}\mfc42.dll" "$INSTDIR\bin\mfc42.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcp60.dll" "$INSTDIR\bin\msvcp60.dll" "$INSTDIR" + !insertmacro ReplaceDLL "${SYSTEMDIR}\msvcrt.dll" "$INSTDIR\bin\msvcrt.dll" "$INSTDIR" +!ENDIF +!ENDIF +;!ENDIF +!ENDIF + !insertmacro ReplaceDLL "${SYSTEMDIR}\psapi.dll" "$INSTDIR\bin\psapi.dll" "$INSTDIR" + + ; Do WINDOWSDIR components + ;SetOutPath "$WINDOWSDIR" +!ifdef DEBUG +!endif + + ; Do Windows SYSDIR (Control panel) + SetOutPath "$SYSDIR" + !insertmacro ReplaceDLL "${KFW_BIN_DIR}\kfwlogon.dll" "$SYSDIR\kfwlogon.dll" "$INSTDIR" + File "${KFW_BIN_DIR}\kfwcpcc.exe" + + ; Get Kerberos config files + Call kfw.GetConfigFiles + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + + ; Daemon entries + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" "" "" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "ProviderPath" "$SYSDIR\kfwlogon.dll" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "AuthentProviderPath" "$SYSDIR\kfwlogon.dll" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Class" 2 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "VerboseLogging" 10 + + ; Must also add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\HwOrder + ; and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order + ; to also include the service name. + Call AddProvider + ReadINIStr $R0 $1 "Field 7" "State" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos\NetworkProvider" "Name" "MIT Kerberos" + + ; WinLogon Event Notification + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Asynchronous" 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Impersonate" 0 + WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "DLLName" "kfwlogon.dll" + WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\WinLogon\Notify\MIT_KFW" "Logon" "KFW_Logon_Event" + + ; NetIdMgr Reg entries + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "ImagePath" "$INSTDIR\bin\krb5cred.dll" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Modules\MITKrb5" "PluginList" "Krb5Cred,Krb5Ident" + + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Module" "MITKrb5" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Description" "Kerberos v5 Credentials Provider" + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Type" 1 + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Cred" "Flags" 0 + + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Module" "MITKrb5" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Description" "Kerberos v5 Identity Provider" + WriteRegStr HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Dependencies" "Krb5Cred" + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Type" 2 + WriteRegDWORD HKLM "Software\MIT\NetIDMgr\PluginManager\Plugins\Krb5Ident" "Flags" 0 + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" + SetOutPath "$INSTDIR\bin" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" "$INSTDIR\Uninstall.exe" + + ReadINIStr $R0 $1 "Field 2" "State" ; startup + + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" + +startshort: + StrCmp $R0 "0" nostart + CreateShortCut "$SMSTARTUP\Network Identity Manager.lnk" "$INSTDIR\bin\netidmgr.exe" "" "$INSTDIR\bin\netidmgr.exe" 0 SW_SHOWMINIMIZED + goto checkconflicts + +nostart: + Delete "$SMSTARTUP\Network Identity Manager.lnk" + +checkconflicts: + Call GetSystemPath + Push "krb5_%WL%.dll" + Call SearchPath + Pop $R0 + StrCmp $R0 "" addpath + + Push $R0 + Call GetParent + Pop $R0 + StrCmp $R0 "$INSTDIR\bin" addpath + MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "A previous installation of MIT Kerberos for Windows binaries has been found in folder $R0. This may interfere with the use of the current installation." + +addpath: + ; Add kfw bin to path + Push "$INSTDIR\bin" + Call AddToSystemPath + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2003" addAllowTgtKey + StrCmp $R0 "2000" addAllowTgtKey + StrCmp $R0 "XP" addAllowTgtKey + goto skipAllowTgtKey + +addAllowTgtKey: + ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" $R0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" "1" + ReadRegDWORD $R0 HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" $R0 + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" "1" +skipAllowTgtKey: + + ; The following are keys added for Terminal Server compatibility + ; http://support.microsoft.com/default.aspx?scid=kb;EN-US;186499 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" "Flags" 0x408 + ;WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" "Flags" 0x408 + WriteRegDWORD HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" "Flags" 0x408 + +SectionEnd + +Section "Debug Symbols" secDebug + + SetOutPath "$INSTDIR\bin" + File "${KFW_BIN_DIR}\comerr%WL%.pdb" + File "${KFW_BIN_DIR}\gss.pdb" + File "${KFW_BIN_DIR}\gss-client.pdb" + File "${KFW_BIN_DIR}\gss-server.pdb" + File "${KFW_BIN_DIR}\gssapi%WL%.pdb" + ;File "${KFW_BIN_DIR}\k524init.pdb" + File "${KFW_BIN_DIR}\kdestroy.pdb" + File "${KFW_BIN_DIR}\kinit.pdb" + File "${KFW_BIN_DIR}\klist.pdb" + File "${KFW_BIN_DIR}\kpasswd.pdb" + File "${KFW_BIN_DIR}\kvno.pdb" + File "${KFW_BIN_DIR}\krb5_%WL%.pdb" + File "${KFW_BIN_DIR}\k5sprt%WL%.pdb" + ;File "${KFW_BIN_DIR}\krb524.pdb" + File "${KFW_BIN_DIR}\krbcc%WL%.pdb" + File "${KFW_BIN_DIR}\krbcc%WL%s.pdb" + File "${KFW_BIN_DIR}\leashw%WL%.pdb" + File "${KFW_BIN_DIR}\krb5cred.pdb" + File "${KFW_BIN_DIR}\ms2mit.pdb" + File "${KFW_BIN_DIR}\mit2ms.pdb" + File "${KFW_BIN_DIR}\kcpytkt.pdb" + File "${KFW_BIN_DIR}\kdeltkt.pdb" + File "${KFW_BIN_DIR}\wshelp%WL%.pdb" + File "${KFW_BIN_DIR}\xpprof%WL%.pdb" + + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" nidpdb_inst2000 + File "${KFW_BIN_DIR}\netidmgr.pdb" + File "${KFW_BIN_DIR}\nidmgr%WL%.pdb" + goto nidpdb_done +nidpdb_inst2000: + File "${KFW_BIN_DIR}\W2K\netidmgr.pdb" + File "${KFW_BIN_DIR}\W2K\nidmgr%WL%.pdb" +nidpdb_done: + +!IFDEF DEBUG +!IFDEF CL_1400 +!IFDEF X86 + File "$%SystemRoot%\symbols\dll\msvcr80d.i386.pdb" + File "$%SystemRoot%\symbols\dll\msvcp80d.i386.pdb" + File "$%SystemRoot%\symbols\dll\mfc80d.i386.pdb" +!ELSE +!IFDEF AMD64 + File "$%SystemRoot%\symbols\dll\msvcr80d.AMD64.pdb" + File "$%SystemRoot%\symbols\dll\msvcp80d.AMD64.pdb" + File "$%SystemRoot%\symbols\dll\mfc80d.AMD64.pdb" +!ENDIF ; AMD64 +!ENDIF ; X86 +!ELSE ; NOT CL_1400 +!IFDEF CL_1310 + File "${SYSTEMDIR}\msvcr71d.pdb" + File "${SYSTEMDIR}\msvcp71d.pdb" + File "${SYSTEMDIR}\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + File "${SYSTEMDIR}\msvcr70d.pdb" + File "${SYSTEMDIR}\msvcp70d.pdb" + File "${SYSTEMDIR}\mfc70d.pdb" +!ELSE + File "${SYSTEMDIR}\mfc42d.pdb" + File "${SYSTEMDIR}\msvcp60d.pdb" + File "${SYSTEMDIR}\msvcrtd.pdb" +!ENDIF +!ENDIF +!ENDIF +!ENDIF ; DEBUG + + SetOutPath "$SYSDIR" + File "${KFW_BIN_DIR}\kfwlogon.pdb" + File "${KFW_BIN_DIR}\kfwcpcc.pdb" + +SectionEnd + +;---------------------- +; Kerberos for Windows SDK +Section "KfW SDK" secSDK + + RMDir /r "$INSTDIR\inc" + RMDir /r "$INSTDIR\lib" + RMDir /r "$INSTDIR\install" + RMDir /r "$INSTDIR\sample" + + SetOutPath "$INSTDIR\doc" + File /r "${KFW_DOC_DIR}\netiddev.chm" + + SetOutPath "$INSTDIR\inc\krb5" + File /r "${KFW_INC_DIR}\krb5\*" + + SetOutPath "$INSTDIR\inc\leash" + File /r "${KFW_INC_DIR}\leash\*" + + SetOutPath "$INSTDIR\inc\loadfuncs" + File /r "${KFW_INC_DIR}\loadfuncs\*" + + SetOutPath "$INSTDIR\inc\netidmgr" + File /r "${KFW_INC_DIR}\netidmgr\*" + + SetOutPath "$INSTDIR\inc\wshelper" + File /r "${KFW_INC_DIR}\wshelper\*" + + SetOutPath "$INSTDIR\lib\%cpu%" + File /r "${KFW_LIB_DIR}\*" + + SetOutPath "$INSTDIR\install" + File /r "${KFW_INSTALL_DIR}\*" + + SetOutPath "$INSTDIR\sample" + File /r "${KFW_SAMPLE_DIR}\*" + + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" "$INSTDIR\bin\netiddev.chm" + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\SDK\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + +SectionEnd + +;---------------------- +; Kerberos for Windows Documentation +Section "KfW Documentation" secDocs + + RMDir /r "$INSTDIR\doc" + + SetOutPath "$INSTDIR\doc" + File "${KFW_DOC_DIR}\relnotes.html" + File "${KFW_DOC_DIR}\netidmgr_userdoc.pdf" + + Call KFWCommon.Install + + ; KfW Reg entries + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PatchLevel" ${KFW_PATCHLEVEL} + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "VersionString" ${KFW_VERSION} + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Title" "KfW" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Description" "${PROGRAM_NAME}" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PathName" "$INSTDIR" + WriteRegStr HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "Software Type" "Authentication" + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MajorVersion" ${KFW_MAJORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "MinorVersion" ${KFW_MINORVERSION} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\Documentation\${KFW_VERSION}" "PatchLevel" ${KFW_PATCHLEVEL} + + ;Write start menu entries + CreateDirectory "$SMPROGRAMS\${PROGRAM_NAME}" + SetOutPath "$INSTDIR\doc" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" "$INSTDIR\doc\relnotes.html" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" "$INSTDIR\doc\netidmgr_userdoc.pdf" + CreateShortCut "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager Documentation.lnk" "$INSTDIR\bin\netidmgr.chm" +SectionEnd + +;Display the Finish header +;Insert this macro after the sections if you are not using a finish page +;!insertmacro MUI_SECTIONS_FINISHHEADER + +;-------------------------------- +;Installer Functions + +Function .onInit + !insertmacro MUI_LANGDLL_DISPLAY + + ; Set the default install options + Push $0 + + Call IsUserAdmin + Pop $R0 + StrCmp $R0 "true" checkVer + + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "You must be an administrator of this machine to install this software." + Abort + +checkVer: + ; Check Version of Windows. Do not install onto Windows 95 + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "95" wrongVersion + StrCmp $R0 "98" wrongVersion + StrCmp $R0 "ME" wrongVersion + StrCmp $R0 "NT 4.0" wrongVersion + goto checkIPHLPAPI + +wrongVersion: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Microsoft Windows 2000 or higher." + Abort + +checkIPHLPAPI: + ClearErrors + ReadEnvStr $R0 "WinDir" + GetDLLVersion "$R0\System32\iphlpapi.dll" $R1 $R2 + IfErrors +1 +3 + GetDLLVersion "$R0\System\iphlpapi.dll" $R1 $R2 + IfErrors iphlperror + IntOp $R3 $R2 / 0x00010000 + IntCmpU $R3 1952 iphlpwarning checkprevious checkprevious + +iphlperror: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "MIT ${PROGRAM_NAME} requires Internet Explorer version 5.01 or higher. IPHLPAPI.DLL is missing." + Abort + +iphlpwarning: + MessageBox MB_OK|MB_ICONINFORMATION|MB_TOPMOST "IPHLPAPI.DLL must be upgraded. Please install Internet Explorer 5.01 or higher." + +checkprevious: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ + "DisplayVersion" + IfErrors testWIX + StrCmp $R0 "${KFW_VERSION}" contInstall + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this upgrade or downgrade." \ + IDOK uninstNSIS + Abort + +;Run the uninstaller +uninstNSIS: + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" \ + "UninstallString" + ClearErrors + ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testWIX: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}" \ + "DisplayVersion" + IfErrors testSWRT + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstMSI1 + Abort + +;Run the uninstaller +uninstMSI1: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstMSI1_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstMSI1_2000: + ClearErrors + ExecWait 'MSIEXEC /x{FD5B1F41-81BB-4BBC-9F7E-4B971660AE1A}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testSWRT: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{61211594-AAA1-4A98-A299-757326763CC7}" \ + "DisplayVersion" + IfErrors testPismere + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstMSI2 + Abort + +;Run the uninstaller +uninstMSI2: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstMSI2_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstMSI2_2000: + ClearErrors + ExecWait 'MSIEXEC /x{61211594-AAA1-4A98-A299-757326763CC7}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +testPismere: + ClearErrors + ReadRegStr $R0 HKLM \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\{83977767-388D-4DF8-BB08-3BF2401635BD}" \ + "DisplayVersion" + IfErrors contInstall + + MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \ + "${PROGRAM_NAME} is already installed. $\n$\nClick `OK` to remove the \ + previous version or `Cancel` to cancel this installation." \ + IDOK uninstPismere + Abort + +;Run the uninstaller +uninstPismere: + Call GetWindowsVersion + Pop $R0 + StrCmp $R0 "2000" uninstPismere_2000 + + ClearErrors + ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD} /passive /promptrestart' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + +uninstPismere_2000: + ClearErrors + ExecWait 'MSIEXEC /x{83977767-388D-4DF8-BB08-3BF2401635BD}' + + IfErrors no_remove_uninstaller + ;You can either use Delete /REBOOTOK in the uninstaller or add some code + ;here to remove the uninstaller. Use a registry key to check + ;whether the user has chosen to uninstall. If you are using an uninstaller + ;components page, make sure all sections are uninstalled. + + Push $R1 + Call RestartRequired + Pop $R1 + StrCmp $R1 "1" Restart DoNotRestart + + +Restart: + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Please reboot and then restart the installer." + Abort + MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST "Abort failed" + +DoNotRestart: +no_remove_uninstaller: + +contInstall: + ; Never install debug symbols unless explicitly selected, except in DEBUG mode +!IFNDEF DEBUG + SectionGetFlags ${secDebug} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secDebug} $0 +!ELSE + SectionGetFlags ${secDebug} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDebug} $0 +!ENDIF + + ; Our logic should be like this. + ; 1) If no KfW components are installed, we do a clean install with default options. (Client/Docs) + ; 2) If existing modules are installed, we keep them selected + ; 3) If it is an upgrade, we set the text accordingly, else we mark it as a re-install + ; TODO: Downgrade? + Call IsAnyKfWInstalled + Pop $R0 + StrCmp $R0 "0" DefaultOptions + + Call ShouldClientInstall + Pop $R2 + + StrCmp $R2 "0" NoClient + StrCmp $R2 "1" ReinstallClient + StrCmp $R2 "2" UpgradeClient + StrCmp $R2 "3" DowngradeClient + + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + ;# !insertmacro SelectSection ${secClient} + goto skipClient +NoClient: + ;StrCpy $1 ${secClient} ; Gotta remember which section we are at now... + SectionGetFlags ${secClient} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secClient} $0 + goto skipClient +UpgradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(UPGRADE_CLIENT) + goto skipClient +ReinstallClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(REINSTALL_CLIENT) + goto skipClient +DowngradeClient: + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + SectionSetText ${secClient} $(DOWNGRADE_CLIENT) + goto skipClient + + +skipClient: + + Call ShouldSDKInstall + Pop $R2 + StrCmp $R2 "0" NoSDK + StrCmp $R2 "1" ReinstallSDK + StrCmp $R2 "2" UpgradeSDK + StrCmp $R2 "3" DowngradeSDK + + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + ;# !insertmacro UnselectSection ${secSDK} + goto skipSDK + +UpgradeSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(UPGRADE_SDK) + goto skipSDK + +ReinstallSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(REINSTALL_SDK) + goto skipSDK + +DowngradeSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secSDK} $0 + SectionSetText ${secSDK} $(DOWNGRADE_SDK) + goto skipSDK + +NoSDK: + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + ;# !insertmacro UnselectSection ${secSDK} + goto skipSDK + +skipSDK: + + Call ShouldDocumentationInstall + Pop $R2 + StrCmp $R2 "0" NoDocumentation + StrCmp $R2 "1" ReinstallDocumentation + StrCmp $R2 "2" UpgradeDocumentation + StrCmp $R2 "3" DowngradeDocumentation + + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + ;# !insertmacro UnselectSection ${secDocs} + goto skipDocumentation + +UpgradeDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(UPGRADE_DOCS) + goto skipDocumentation + +ReinstallDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(REINSTALL_DOCS) + goto skipDocumentation + +DowngradeDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + SectionSetText ${secDocs} $(DOWNGRADE_DOCS) + goto skipDocumentation + +NoDocumentation: + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secDocs} $0 + ;# !insertmacro UnselectSection ${secDocs} + goto skipDocumentation + +skipDocumentation: + goto end + +DefaultOptions: + ; Client Selected + SectionGetFlags ${secClient} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $0 + + ; SDK NOT selected + SectionGetFlags ${secSDK} $0 + IntOp $0 $0 & ${SECTION_OFF} + SectionSetFlags ${secSDK} $0 + + ; Documentation selected + SectionGetFlags ${secDocs} $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags ${secDocs} $0 + goto end + +end: + Pop $0 + + Push $R0 + + ; See if we can set a default installation path... + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" "PathName" + StrCmp $R0 "" TrySDK + StrCpy $INSTDIR $R0 + goto Nope + +TrySDK: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" "PathName" + StrCmp $R0 "" TryDocs + StrCpy $INSTDIR $R0 + goto Nope + +TryDocs: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" "PathName" + StrCmp $R0 "" TryRoot + StrCpy $INSTDIR $R0 + goto Nope + +TryRoot: + ReadRegStr $R0 HKLM "${KFW_REGKEY_ROOT}" "InstallDir" + StrCmp $R0 "" Nope + StrCpy $INSTDIR $R0 + +Nope: + Pop $R0 + + GetTempFilename $0 + File /oname=$0 KfWConfigPage.ini + GetTempFilename $1 + File /oname=$1 KfWConfigPage2.ini + +FunctionEnd + + +;-------------------------------- +; These are our cleanup functions +Function .onInstFailed +Delete $0 +Delete $1 +FunctionEnd + +Function .onInstSuccess +Delete $0 +Delete $1 +FunctionEnd + + +;-------------------------------- +;Descriptions + + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${secClient} $(DESC_secClient) + !insertmacro MUI_DESCRIPTION_TEXT ${secSDK} $(DESC_secSDK) + !insertmacro MUI_DESCRIPTION_TEXT ${secDocs} $(DESC_secDocs) + !insertmacro MUI_DESCRIPTION_TEXT ${secDebug} $(DESC_secDebug) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + ; Make sure the user REALLY wants to do this, unless they did a silent uninstall, in which case...let them! + IfSilent StartRemove ; New in v2.0b4 + MessageBox MB_YESNO "Are you sure you want to remove MIT ${PROGRAM_NAME} from this machine?" IDYES StartRemove + abort + +StartRemove: + + SetShellVarContext all + ; Stop the running processes + GetTempFileName $R0 + File /oname=$R0 "Killer.exe" + nsExec::Exec '$R0 netidmgr.exe' + nsExec::Exec '$R0 krbcc%WL%s.exe' + + Push "$INSTDIR\bin" + Call un.RemoveFromSystemPath + + ; Delete documentation + Delete "$INSTDIR\doc\relnotes.html" + Delete "$INSTDIR\doc\netidmgr_userdoc.pdf" + Delete "$INSTDIR\doc\netiddev.chm" + + Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\gss.exe" + Delete /REBOOTOK "$INSTDIR\bin\gss-client.exe" + Delete /REBOOTOK "$INSTDIR\bin\gss-server.exe" + Delete /REBOOTOK "$INSTDIR\bin\gssapi32.dll" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.exe" + Delete /REBOOTOK "$INSTDIR\bin\kdestroy.exe" + Delete /REBOOTOK "$INSTDIR\bin\kinit.exe" + Delete /REBOOTOK "$INSTDIR\bin\klist.exe" + Delete /REBOOTOK "$INSTDIR\bin\kpasswd.exe" + Delete /REBOOTOK "$INSTDIR\bin\kvno.exe" + Delete /REBOOTOK "$INSTDIR\bin\krb5_%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.dll" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.dll" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.exe" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.exe" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.chm" + Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred.dll" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred_en_us.dll" + Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\ms2mit.exe" + Delete /REBOOTOK "$INSTDIR\bin\mit2ms.exe" + Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.exe" + Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.exe" + Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.dll" + Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.dll" + Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.dll" + Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.exe" + + Delete /REBOOTOK "$INSTDIR\bin\comerr%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss-client.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gss-server.pdb" + Delete /REBOOTOK "$INSTDIR\bin\gssapi32.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\k524init.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kdestroy.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kinit.pdb" + Delete /REBOOTOK "$INSTDIR\bin\klist.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kpasswd.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kvno.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krb5_32.pdb" + Delete /REBOOTOK "$INSTDIR\bin\k5sprt%WL%.pdb" + ;Delete /REBOOTOK "$INSTDIR\bin\krb524.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krbcc%WL%s.pdb" + Delete /REBOOTOK "$INSTDIR\bin\netidmgr.pdb" + Delete /REBOOTOK "$INSTDIR\bin\nidmgr%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\krb5cred.pdb" + Delete /REBOOTOK "$INSTDIR\bin\leashw%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\ms2mit.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mit2ms.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kcpytkt.pdb" + Delete /REBOOTOK "$INSTDIR\bin\kdeltkt.pdb" + Delete /REBOOTOK "$INSTDIR\bin\wshelp%WL%.pdb" + Delete /REBOOTOK "$INSTDIR\bin\xpprof%WL%.pdb" + Delete /REBOOTOK "$SYSDIR\bin\kfwlogon.pdb" + Delete /REBOOTOK "$SYSDIR\bin\kfwcpcc.pdb" + +!IFDEF DEBUG +!IFDEF CL_1400 + Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr80d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc80d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc80d.pdb" +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc71d.pdb" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc70d.pdb" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.dll" + Delete /REBOOTOK "$INSTDIR\bin\mfc42d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60d.pdb" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrtd.pdb" +!ENDIF +!ENDIF +!ENDIF +!ELSE +!IFDEF CL_1400 + Delete /REBOOTOK "$INSTDIR\bin\mfc80.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr80.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp80.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC80CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC80KOR.DLL" +!ELSE +!IFDEF CL_1310 + Delete /REBOOTOK "$INSTDIR\bin\mfc71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr71.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp71.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC71KOR.DLL" +!ELSE +!IFDEF CL_1300 + Delete /REBOOTOK "$INSTDIR\bin\mfc70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcr70.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp70.dll" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHS.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70CHT.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70DEU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ENU.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ESP.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70FRA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70ITA.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70JPN.DLL" + Delete /REBOOTOK "$INSTDIR\bin\MFC70KOR.DLL" +!ELSE + Delete /REBOOTOK "$INSTDIR\bin\mfc42.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcp60.dll" + Delete /REBOOTOK "$INSTDIR\bin\msvcrt.dll" +!ENDIF +!ENDIF +!ENDIF +!ENDIF + Delete /REBOOTOK "$INSTDIR\bin\psapi.dll" + + RMDir "$INSTDIR\bin" + RmDir "$INSTDIR\doc" + RmDir "$INSTDIR\lib" + RmDir "$INSTDIR\inc" + RmDir "$INSTDIR\install" + RMDir "$INSTDIR" + + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Uninstall ${PROGRAM_NAME}.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Release Notes.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Manager User Documentation.lnk" + Delete "$SMPROGRAMS\${PROGRAM_NAME}\Network Identity Developer Documentation.lnk" + RmDir "$SMPROGRAMS\${PROGRAM_NAME}" + Delete "$SMSTARTUP\Network Identity Manager.lnk" + + IfSilent SkipAsk +; IfFileExists "$WINDIR\krb5.ini" CellExists SkipDelAsk +; RealmExists: + MessageBox MB_YESNO "Would you like to keep your configuration files?" IDYES SkipDel + SkipAsk: + Delete "$WINDIR\krb5.ini" + Delete "$WINDIR\krb.con" + Delete "$WINDIR\krbrealm.con" + + SkipDel: + Delete "$INSTDIR\Uninstall.exe" + + ; Restore previous value of AllowTGTSessionKey + ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters" "AllowTGTSessionKey" $R0 + ReadRegDWORD $R0 HKLM "${KFW_REGKEY_ROOT}\Client\${KFW_VERSION}" "AllowTGTSessionKeyBackup2" + WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Lsa\Kerberos" "AllowTGTSessionKey" $R0 + + ; The following are keys added for Terminal Server compatibility + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\netidmgr" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kinit" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\klist" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdestroy" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-client" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\gss-server" + ;DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k524init" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kpasswd" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kvno" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\ms2mit" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\mit2ms" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kcpytkt" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\kdeltkt" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95" + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Compatibility\Applications\k95g" + + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Client" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\Documentation" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK\CurrentVersion" + DeleteRegKey HKLM "${KFW_REGKEY_ROOT}\SDK" + DeleteRegKey /ifempty HKLM "${KFW_REGKEY_ROOT}" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" + + ; NIM Registry Keys + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules\MITKrb5" + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Cred" + DeleteRegKey HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins\Krb5Ident" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Modules" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager\Plugins" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}\PluginManager" + DeleteRegKey /ifempty HKLM "${NIM_REGKEY_ROOT}" + + ; WinLogon Event Notification + DeleteRegKey HKLM "Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\MIT_KFW" + DeleteRegKey HKLM "SYSTEM\CurrentControlSet\Services\MIT Kerberos" + + RMDir "$INSTDIR" + +SectionEnd + +;-------------------------------- +;Uninstaller Functions + +Function un.onInit + + ;Get language from registry + ReadRegStr $LANGUAGE ${MUI_LANGDLL_REGISTRY_ROOT} "${MUI_LANGDLL_REGISTRY_KEY}" "${MUI_LANGDLL_REGISTRY_VALUENAME}" + +FunctionEnd + +Function un.onUninstSuccess + + MessageBox MB_OK "Please reboot your machine to complete uninstallation of the software" + +FunctionEnd + +;------------------------------ +; Get the Configurations files from the Internet + +Function kfw.GetConfigFiles + +;Check if we should download Config Files +ReadINIStr $R0 $0 "Field 4" "State" +StrCmp $R0 "1" DoDownload + +;Do nothing if we're keeping the existing file +ReadINIStr $R0 $0 "Field 2" "State" +StrCmp $R0 "1" done + +ReadINIStr $R0 $0 "Field 3" "State" +StrCmp $R0 "1" UsePackaged + +; If none of these, grab file from other location +goto CheckOther + +DoDownload: + ReadINIStr $R0 $0 "Field 5" "State" + NSISdl::download "$R0/krb5.ini" "$WINDIR\krb5.ini" + NSISdl::download "$R0/krb.con" "$WINDIR\krb.con" + NSISdl::download "$R0/krbrealm.con" "$WINDIR\krbrealm.con" + Pop $R0 ;Get the return value + StrCmp $R0 "success" done + MessageBox MB_OK|MB_ICONSTOP "Download failed: $R0" + goto done + +UsePackaged: + SetOutPath "$WINDIR" + File "${KFW_CONFIG_DIR}\sample\krb5.ini" + File "${KFW_CONFIG_DIR}\sample\krb.con" + File "${KFW_CONFIG_DIR}\sample\krbrealm.con" + goto done + +CheckOther: + ReadINIStr $R0 $0 "Field 7" "State" + StrCmp $R0 "" done + CopyFiles "$R0\krb5.ini" "$WINDIR\krb5.ini" + CopyFiles "$R0\krb.con" "$WINDIR\krb.con" + CopyFiles "$R0\krbrealm.con" "$WINDIR\krbrealm.con" + +done: + +FunctionEnd + + + +;------------------------------- +;Do the page to get the Config files + +Function KFWPageGetConfigFiles + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" Skip + + ; Set the install options here + +startOver: + WriteINIStr $0 "Field 2" "Flags" "DISABLED" + WriteINIStr $0 "Field 3" "State" "1" + WriteINIStr $0 "Field 4" "State" "0" + WriteINIStr $0 "Field 6" "State" "0" + WriteINIStr $0 "Field 3" "Text" "Use packaged configuration files for the ${SAMPLE_CONFIG_REALM} realm." + WriteINIStr $0 "Field 5" "State" "${HTTP_CONFIG_URL}" + + ; If there is an existing krb5.ini file, allow the user to choose it and make it default + IfFileExists "$WINDIR\krb5.ini" +1 notpresent + WriteINIStr $0 "Field 2" "Flags" "ENABLED" + WriteINIStr $0 "Field 2" "State" "1" + WriteINIStr $0 "Field 3" "State" "0" + + notpresent: + + !insertmacro MUI_HEADER_TEXT "Kerberos Configuration" "Please choose a method for installing the Kerberos Configuration files:" + InstallOptions::dialog $0 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: Quit +done: + + ; Check that if a file is set, a valid filename is entered... + ReadINIStr $R0 $0 "Field 6" "State" + StrCmp $R0 "1" CheckFileName + + ;Check if a URL is specified, one *IS* specified + ReadINIStr $R0 $0 "Field 4" "State" + StrCmp $R0 "1" CheckURL Skip + + CheckURL: + ReadINIStr $R0 $0 "Field 5" "State" + StrCmp $R0 "" +1 Skip + MessageBox MB_OK|MB_ICONSTOP $(URLError) + WriteINIStr $0 "Field 4" "State" "0" + goto startOver + + CheckFileName: + ReadINIStr $R0 $0 "Field 7" "State" + IfFileExists "$R0\krb5.ini" Skip + + MessageBox MB_OK|MB_ICONSTOP $(ConfigFileError) + WriteINIStr $0 "Field 6" "State" "0" + goto startOver + + Skip: + +FunctionEnd + + +;------------------------------- +;Do the page to get the Startup Configuration + +Function KFWPageGetStartupConfig + ; Skip this page if we are not installing the client + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "0" Skip + + ; Set the install options here + + !insertmacro MUI_HEADER_TEXT "Network Identity Manager Setup" "Please select Network Identity ticket manager setup options:" + InstallOptions::dialog $1 + Pop $R1 + StrCmp $R1 "cancel" exit + StrCmp $R1 "back" done + StrCmp $R1 "success" done +exit: + Quit +done: +skip: + +FunctionEnd + + +;------------- +; Common install routines for each module +Function KFWCommon.Install + + WriteRegStr HKLM "${KFW_REGKEY_ROOT}" "InstallDir" $INSTDIR + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayName" "${PROGRAM_NAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "UninstallString" "$INSTDIR\uninstall.exe" +!ifndef DEBUG + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION}" +!else + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "DisplayVersion" "${KFW_VERSION} Checked/Debug" +!endif + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PROGRAM_NAME}" "URLInfoAbout" "http://web.mit.edu/kerberos/" + +!ifdef DEBUG + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" 1 + WriteRegDWORD HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" 1 +!else + ; Delete the DEBUG string + DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\CurrentVersion" "Debug" + DeleteRegValue HKLM "${KFW_REGKEY_ROOT}\${KFW_VERSION}" "Debug" +!endif + + WriteUninstaller "$INSTDIR\Uninstall.exe" +FunctionEnd + + +;------------------------------- +; Check if the client should be checked for default install +Function ShouldClientInstall + Push $R0 + StrCpy $R2 "Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + +;------------------------------- +; Check how the Documentation options should be set +Function ShouldDocumentationInstall + Push $R0 + StrCpy $R2 "Documentation" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +;------------------------------- +; Check how the SDK options should be set +Function ShouldSDKInstall + Push $R0 + StrCpy $R2 "SDK" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + ; Now we see if it's an older or newer version + + Call GetInstalledVersionMajor + Pop $R0 + IntCmpU $R0 ${KFW_MAJORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionMinor + Pop $R0 + IntCmpU $R0 ${KFW_MINORVERSION} +1 Upgrade Downgrade + + Call GetInstalledVersionPatch + Pop $R0 + IntCmpU $R0 ${KFW_PATCHLEVEL} Reinstall Upgrade Downgrade + +Reinstall: + StrCpy $R0 "1" + Exch $R0 + goto end + +Upgrade: + StrCpy $R0 "2" + Exch $R0 + goto end + +Downgrade: + StrCpy $R0 "3" + Exch $R0 + goto end + + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + +; See if KfW SDK is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsSDKInstalled + Push $R0 + StrCpy $R2 "SDK" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + +; See if KfW Client is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsClientInstalled + Push $R0 + StrCpy $R2 "Client" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + + +; See if KfW Documentation is installed +; Returns: "1" if it is, 0 if it is not (on the stack) +Function IsDocumentationInstalled + Push $R0 + StrCpy $R2 "Documentation" + Call GetInstalledVersion + Pop $R0 + + StrCmp $R0 "" NotInstalled + + StrCpy $R0 "1" + Exch $R0 + goto end + +NotInstalled: + StrCpy $R0 "0" + Exch $R0 +end: +FunctionEnd + + + +;Check to see if any KfW component is installed +;Returns: Value on stack: "1" if it is, "0" if it is not +Function IsAnyKfWInstalled + Push $R0 + Push $R1 + Push $R2 + Call IsClientInstalled + Pop $R0 + Call IsSDKInstalled + Pop $R1 + Call IsDocumentationInstalled + Pop $R2 + ; Now we must see if ANY of the $Rn values are 1 + StrCmp $R0 "1" SomethingInstalled + StrCmp $R1 "1" SomethingInstalled + StrCmp $R2 "1" SomethingInstalled + ;Nothing installed + StrCpy $R0 "0" + goto end +SomethingInstalled: + StrCpy $R0 "1" +end: + Pop $R2 + Pop $R1 + Exch $R0 +FunctionEnd + +;-------------------------------- +;Handle what must and what must not be installed +Function .onSelChange + ; If they install the SDK, they MUST install the client + SectionGetFlags ${secSDK} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + StrCmp $R0 "1" MakeClientSelected + goto end + +MakeClientSelected: + SectionGetFlags ${secClient} $R0 + IntOp $R0 $R0 | ${SF_SELECTED} + SectionSetFlags ${secClient} $R0 + +end: +FunctionEnd + +Function AddProvider + Push $R0 + Push $R1 + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" DoOther +1 + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" + StrCpy $R0 "$R1,MIT Kerberos" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" "ProviderOrder" $R0 +DoOther: + ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + Call StrStr + Pop $R0 + StrCmp $R0 "" +1 End + ReadRegStr $R1 HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" + StrCpy $R0 "$R1,MIT Kerberos" + WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" "ProviderOrder" $R0 +End: + Pop $R1 + Pop $R0 +FunctionEnd + +Function un.RemoveProvider + Push $R0 + StrCpy $R0 "MIT Kerberos" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\HWOrder" + Call un.RemoveFromProvider + StrCpy $R0 "MIT Kerberos" + Push $R0 + StrCpy $R0 "SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" + Call un.RemoveFromProvider + Pop $R0 +FunctionEnd + +Function un.RemoveFromProvider + Exch $0 + Push $1 + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + + ReadRegStr $1 HKLM "$R0" "ProviderOrder" + StrCpy $5 $1 1 -1 # copy last char + StrCmp $5 "," +2 # if last char != , + StrCpy $1 "$1," # append , + Push $1 + Push "$0," + Call un.StrStr ; Find `$0,` in $1 + Pop $2 ; pos of our dir + StrCmp $2 "" unRemoveFromPath_done + ; else, it is in path + # $0 - path to add + # $1 - path var + StrLen $3 "$0," + StrLen $4 $2 + StrCpy $5 $1 -$4 # $5 is now the part before the path to remove + StrCpy $6 $2 "" $3 # $6 is now the part after the path to remove + StrCpy $3 $5$6 + + StrCpy $5 $3 1 -1 # copy last char + StrCmp $5 "," 0 +2 # if last char == , + StrCpy $3 $3 -1 # remove last char + + WriteRegStr HKLM "$R0" "ProviderOrder" $3 + + unRemoveFromPath_done: + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Pop $0 +FunctionEnd Property changes on: branches/krb5-1-6/src/windows/installer/nsis/kfw-fixed-tagged.nsi ___________________________________________________________________ Name: svn:eol-style + native Property changes on: branches/krb5-1-6/src/windows/ntsecapitest.c ___________________________________________________________________ Name: svn:eol-style + native Property changes on: branches/krb5-1-6/src/windows/ntsecapitest.pl ___________________________________________________________________ Name: svn:eol-style + native From tlyu at MIT.EDU Thu Jul 23 14:44:50 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 14:44:50 -0400 Subject: svn rev #22451: tags/ Message-ID: <200907231844.n6NIioK1016997@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22451 Commit By: tlyu Log Message: delete Changed Files: D tags/kfw_3-2-3-alpha1/ From tlyu at MIT.EDU Thu Jul 23 14:45:27 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 14:45:27 -0400 Subject: svn rev #22452: branches/krb5-1-6/src/ Message-ID: <200907231845.n6NIjRrc017143@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22452 Commit By: tlyu Log Message: patchlevel for kfw-3.2.3-alpha1 Changed Files: U branches/krb5-1-6/src/patchlevel.h Modified: branches/krb5-1-6/src/patchlevel.h =================================================================== --- branches/krb5-1-6/src/patchlevel.h 2009-07-23 18:44:50 UTC (rev 22451) +++ branches/krb5-1-6/src/patchlevel.h 2009-07-23 18:45:27 UTC (rev 22452) @@ -53,6 +53,6 @@ #define KRB5_MAJOR_RELEASE 1 #define KRB5_MINOR_RELEASE 6 #define KRB5_PATCHLEVEL 4 -#define KRB5_RELTAIL "beta1-postrelease" +#define KRB5_RELTAIL "beta1-kfw-3.2.3-alpha1" /* #undef KRB5_RELDATE */ -#define KRB5_RELTAG "branches/krb5-1-6" +#define KRB5_RELTAG "tags/kfw-3_2_2-alpha1" From tlyu at MIT.EDU Thu Jul 23 14:46:00 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 14:46:00 -0400 Subject: svn rev #22453: tags/ Message-ID: <200907231846.n6NIk0sk017230@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22453 Commit By: tlyu Log Message: retag kfw-3.2.3-alpha1 Changed Files: A tags/kfw-3_2_3-alpha1/ Copied: tags/kfw-3_2_3-alpha1 (from rev 22452, branches/krb5-1-6) From tlyu at MIT.EDU Thu Jul 23 14:48:13 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Thu, 23 Jul 2009 14:48:13 -0400 Subject: svn rev #22454: branches/krb5-1-6/src/ Message-ID: <200907231848.n6NImDUS017437@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22454 Commit By: tlyu Log Message: back to krb5-1.6.4-beta1-postrelease Changed Files: U branches/krb5-1-6/src/patchlevel.h Modified: branches/krb5-1-6/src/patchlevel.h =================================================================== --- branches/krb5-1-6/src/patchlevel.h 2009-07-23 18:46:00 UTC (rev 22453) +++ branches/krb5-1-6/src/patchlevel.h 2009-07-23 18:48:13 UTC (rev 22454) @@ -53,6 +53,6 @@ #define KRB5_MAJOR_RELEASE 1 #define KRB5_MINOR_RELEASE 6 #define KRB5_PATCHLEVEL 4 -#define KRB5_RELTAIL "beta1-kfw-3.2.3-alpha1" +#define KRB5_RELTAIL "beta1-postrelease" /* #undef KRB5_RELDATE */ -#define KRB5_RELTAG "tags/kfw-3_2_2-alpha1" +#define KRB5_RELTAG "branches/krb5-1-6" From tlyu at MIT.EDU Fri Jul 24 14:22:00 2009 From: tlyu at MIT.EDU (tlyu@MIT.EDU) Date: Fri, 24 Jul 2009 14:22:00 -0400 Subject: svn rev #22455: branches/krb5-1-7/src/ include/ tests/misc/ util/support/ Message-ID: <200907241822.n6OIM09o009252@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22455 Commit By: tlyu Log Message: ticket: 6536 version_fixed: 1.7.1 target_version: 1.7.1 tags: pullup subject: C++ compatibility for Windows compilation pull up r21902, r21917, r21918, r21919 to improve C++ compatibility and to enable Windows compilation. ------------------------------------------------------------------------ r21919 | raeburn | 2009-02-09 11:36:09 -0500 (Mon, 09 Feb 2009) | 3 lines Check C++ compatibility for some internal headers that may (now or in the future) be used in C++ code on Windows. ------------------------------------------------------------------------ r21918 | raeburn | 2009-02-09 11:35:01 -0500 (Mon, 09 Feb 2009) | 3 lines More C++ compatibility: Don't use "typedef struct tag *tag"; rename the tag and keep the same typedefname. ------------------------------------------------------------------------ r21917 | raeburn | 2009-02-09 11:28:29 -0500 (Mon, 09 Feb 2009) | 3 lines C++ compatibility fix -- g++ says "types may not be defined in casts", so do the gcc unaligned-struct trick only for C, not C++. ------------------------------------------------------------------------ r21902 | raeburn | 2009-02-05 16:56:21 -0500 (Thu, 05 Feb 2009) | 2 lines use casts, for c++ compilation on windows Changed Files: U branches/krb5-1-7/src/include/k5-int.h U branches/krb5-1-7/src/include/k5-ipc_stream.h U branches/krb5-1-7/src/include/k5-platform.h U branches/krb5-1-7/src/tests/misc/Makefile.in A branches/krb5-1-7/src/tests/misc/test_cxx_k5int.cpp U branches/krb5-1-7/src/util/support/ipc_stream.c Modified: branches/krb5-1-7/src/include/k5-int.h =================================================================== --- branches/krb5-1-7/src/include/k5-int.h 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/include/k5-int.h 2009-07-24 18:21:57 UTC (rev 22455) @@ -2230,11 +2230,11 @@ /* * Per-type ccache cursor. */ -struct krb5_cc_ptcursor { +struct krb5_cc_ptcursor_s { const struct _krb5_cc_ops *ops; krb5_pointer data; }; -typedef struct krb5_cc_ptcursor *krb5_cc_ptcursor; +typedef struct krb5_cc_ptcursor_s *krb5_cc_ptcursor; struct _krb5_cc_ops { krb5_magic magic; Modified: branches/krb5-1-7/src/include/k5-ipc_stream.h =================================================================== --- branches/krb5-1-7/src/include/k5-ipc_stream.h 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/include/k5-ipc_stream.h 2009-07-24 18:21:57 UTC (rev 22455) @@ -29,8 +29,8 @@ #include "k5-platform.h" -struct k5_ipc_stream; -typedef struct k5_ipc_stream *k5_ipc_stream; +struct k5_ipc_stream_s; +typedef struct k5_ipc_stream_s *k5_ipc_stream; int32_t k5_ipc_stream_new (k5_ipc_stream *out_stream); Modified: branches/krb5-1-7/src/include/k5-platform.h =================================================================== --- branches/krb5-1-7/src/include/k5-platform.h 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/include/k5-platform.h 2009-07-24 18:21:57 UTC (rev 22455) @@ -533,13 +533,15 @@ # define SWAP64 OSSwapInt64 #endif +/* Note that on Windows at least this file can be included from C++ + source, so casts *from* void* are required. */ static inline void store_16_be (unsigned int val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_BE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) PUT(16,p,val); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16) && !defined(__cplusplus) PUTSWAPPED(16,p,val); #else p[0] = (val >> 8) & 0xff; @@ -549,10 +551,10 @@ static inline void store_32_be (unsigned int val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_BE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) PUT(32,p,val); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus) PUTSWAPPED(32,p,val); #else p[0] = (val >> 24) & 0xff; @@ -564,10 +566,10 @@ static inline void store_64_be (UINT64_TYPE val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_BE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) PUT(64,p,val); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64) && !defined(__cplusplus) PUTSWAPPED(64,p,val); #else p[0] = (unsigned char)((val >> 56) & 0xff); @@ -583,10 +585,10 @@ static inline unsigned short load_16_be (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_BE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) return GET(16,p); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP16) && !defined(__cplusplus) return GETSWAPPED(16,p); #else return (p[1] | (p[0] << 8)); @@ -595,10 +597,10 @@ static inline unsigned int load_32_be (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_BE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) return GET(32,p); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP32) && !defined(__cplusplus) return GETSWAPPED(32,p); #else return (p[3] | (p[2] << 8) @@ -609,10 +611,10 @@ static inline UINT64_TYPE load_64_be (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_BE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_BE) && !defined(__cplusplus) return GET(64,p); -#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64) +#elif defined(__GNUC__) && defined(K5_LE) && defined(SWAP64) && !defined(__cplusplus) return GETSWAPPED(64,p); #else return ((UINT64_TYPE)load_32_be(p) << 32) | load_32_be(p+4); @@ -621,10 +623,10 @@ static inline void store_16_le (unsigned int val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_LE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) PUT(16,p,val); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16) && !defined(__cplusplus) PUTSWAPPED(16,p,val); #else p[1] = (val >> 8) & 0xff; @@ -634,10 +636,10 @@ static inline void store_32_le (unsigned int val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_LE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) PUT(32,p,val); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32) && !defined(__cplusplus) PUTSWAPPED(32,p,val); #else p[3] = (val >> 24) & 0xff; @@ -649,10 +651,10 @@ static inline void store_64_le (UINT64_TYPE val, void *vp) { - unsigned char *p = vp; -#if defined(__GNUC__) && defined(K5_LE) + unsigned char *p = (unsigned char *) vp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) PUT(64,p,val); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64) && !defined(__cplusplus) PUTSWAPPED(64,p,val); #else p[7] = (unsigned char)((val >> 56) & 0xff); @@ -668,10 +670,10 @@ static inline unsigned short load_16_le (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_LE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) return GET(16,p); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP16) && !defined(__cplusplus) return GETSWAPPED(16,p); #else return (p[0] | (p[1] << 8)); @@ -680,10 +682,10 @@ static inline unsigned int load_32_le (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_LE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) return GET(32,p); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP32) && !defined(__cplusplus) return GETSWAPPED(32,p); #else return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24)); @@ -692,10 +694,10 @@ static inline UINT64_TYPE load_64_le (const void *cvp) { - const unsigned char *p = cvp; -#if defined(__GNUC__) && defined(K5_LE) + const unsigned char *p = (const unsigned char *) cvp; +#if defined(__GNUC__) && defined(K5_LE) && !defined(__cplusplus) return GET(64,p); -#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64) +#elif defined(__GNUC__) && defined(K5_BE) && defined(SWAP64) && !defined(__cplusplus) return GETSWAPPED(64,p); #else return ((UINT64_TYPE)load_32_le(p+4) << 32) | load_32_le(p); Modified: branches/krb5-1-7/src/tests/misc/Makefile.in =================================================================== --- branches/krb5-1-7/src/tests/misc/Makefile.in 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/tests/misc/Makefile.in 2009-07-24 18:21:57 UTC (rev 22455) @@ -11,15 +11,17 @@ $(srcdir)/test_getpw.c \ $(srcdir)/test_getsockname.c \ $(srcdir)/test_cxx_krb5.cpp \ + $(srcdir)/test_cxx_k5int.cpp \ $(srcdir)/test_cxx_gss.cpp \ $(srcdir)/test_cxx_rpc.cpp \ $(srcdir)/test_cxx_kadm5.cpp all:: test_getpw -check:: test_getpw test_cxx_krb5 test_cxx_gss test_cxx_rpc test_cxx_kadm5 +check:: test_getpw test_cxx_krb5 test_cxx_gss test_cxx_rpc test_cxx_k5int test_cxx_kadm5 $(RUN_SETUP) $(VALGRIND) ./test_getpw $(RUN_SETUP) $(VALGRIND) ./test_cxx_krb5 + $(RUN_SETUP) $(VALGRIND) ./test_cxx_k5int $(RUN_SETUP) $(VALGRIND) ./test_cxx_gss $(RUN_SETUP) $(VALGRIND) ./test_cxx_rpc $(RUN_SETUP) $(VALGRIND) ./test_cxx_kadm5 @@ -32,6 +34,8 @@ test_cxx_krb5: $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_DEPLIB) $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_krb5 $(OUTPRE)test_cxx_krb5.$(OBJEXT) $(KRB5_BASE_LIBS) $(LIBS) +test_cxx_k5int: $(OUTPRE)test_cxx_k5int.$(OBJEXT) $(KRB5_DEPLIB) + $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_k5int $(OUTPRE)test_cxx_k5int.$(OBJEXT) $(KRB5_BASE_LIBS) $(LIBS) test_cxx_gss: $(OUTPRE)test_cxx_gss.$(OBJEXT) $(CXX_LINK) $(ALL_CXXFLAGS) -o test_cxx_gss $(OUTPRE)test_cxx_gss.$(OBJEXT) $(LIBS) test_cxx_rpc: $(OUTPRE)test_cxx_rpc.$(OBJEXT) $(GSSRPC_DEPLIBS) Added: branches/krb5-1-7/src/tests/misc/test_cxx_k5int.cpp =================================================================== --- branches/krb5-1-7/src/tests/misc/test_cxx_k5int.cpp 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/tests/misc/test_cxx_k5int.cpp 2009-07-24 18:21:57 UTC (rev 22455) @@ -0,0 +1,19 @@ +// Test that the krb5 internal headers are compatible with C++ code. +// (Some Windows-specific code is in C++ in this source tree.) + +#include +#include "k5-int.h" +#include "k5-ipc_stream.h" +#include "k5-utf8.h" + +int main (int argc, char *argv[]) +{ + krb5_context ctx; + + if (krb5_init_context(&ctx) != 0) { + printf("krb5_init_context returned an error\n"); + return 1; + } + printf("hello, world\n"); + return 0; +} Modified: branches/krb5-1-7/src/util/support/ipc_stream.c =================================================================== --- branches/krb5-1-7/src/util/support/ipc_stream.c 2009-07-23 18:48:13 UTC (rev 22454) +++ branches/krb5-1-7/src/util/support/ipc_stream.c 2009-07-24 18:21:57 UTC (rev 22455) @@ -1,7 +1,7 @@ /* * $Header$ * - * Copyright 2006, 2007 Massachusetts Institute of Technology. + * Copyright 2006, 2007, 2009 Massachusetts Institute of Technology. * All Rights Reserved. * * Export of this software from the United States of America may @@ -37,13 +37,13 @@ /* Add debugging later */ #define k5_check_error(x) (x) -struct k5_ipc_stream { +struct k5_ipc_stream_s { char *data; uint64_t size; uint64_t max_size; }; -const struct k5_ipc_stream k5_ipc_stream_initializer = { NULL, 0, 0 }; +const struct k5_ipc_stream_s k5_ipc_stream_initializer = { NULL, 0, 0 }; #define K5_IPC_STREAM_SIZE_INCREMENT 128 From ghudson at MIT.EDU Mon Jul 27 13:41:19 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Mon, 27 Jul 2009 13:41:19 -0400 Subject: svn rev #22456: trunk/src/ include/ lib/krb5/krb/ Message-ID: <200907271741.n6RHfJgH000923@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22456 Commit By: ghudson Log Message: Use zero-terminated enctype lists in the context structure instead of counted lists, to reduce impedance mismatches. Changed Files: U trunk/src/include/k5-int.h U trunk/src/lib/krb5/krb/gc_frm_kdc.c U trunk/src/lib/krb5/krb/init_ctx.c U trunk/src/lib/krb5/krb/ser_ctx.c Modified: trunk/src/include/k5-int.h =================================================================== --- trunk/src/include/k5-int.h 2009-07-24 18:21:57 UTC (rev 22455) +++ trunk/src/include/k5-int.h 2009-07-27 17:41:19 UTC (rev 22456) @@ -1322,10 +1322,8 @@ struct _kdb_log_context; struct _krb5_context { krb5_magic magic; - krb5_enctype *in_tkt_ktypes; - unsigned int in_tkt_ktype_count; - krb5_enctype *tgs_ktypes; - unsigned int tgs_ktype_count; + krb5_enctype *in_tkt_etypes; + krb5_enctype *tgs_etypes; struct _krb5_os_context os_context; char *default_realm; profile_t profile; Modified: trunk/src/lib/krb5/krb/gc_frm_kdc.c =================================================================== --- trunk/src/lib/krb5/krb/gc_frm_kdc.c 2009-07-24 18:21:57 UTC (rev 22455) +++ trunk/src/lib/krb5/krb/gc_frm_kdc.c 2009-07-27 17:41:19 UTC (rev 22456) @@ -1068,10 +1068,10 @@ * Check if the return enctype is one that we requested if * needed. */ - if (old_use_conf_ktypes || context->tgs_ktype_count == 0) + if (old_use_conf_ktypes || !context->tgs_etypes) goto cleanup; - for (i = 0; i < context->tgs_ktype_count; i++) { - if ((*out_cred)->keyblock.enctype == context->tgs_ktypes[i]) { + for (i = 0; context->tgs_etypes[i]; i++) { + if ((*out_cred)->keyblock.enctype == context->tgs_etypes[i]) { /* Found an allowable etype, so we're done */ goto cleanup; } Modified: trunk/src/lib/krb5/krb/init_ctx.c =================================================================== --- trunk/src/lib/krb5/krb/init_ctx.c 2009-07-24 18:21:57 UTC (rev 22455) +++ trunk/src/lib/krb5/krb/init_ctx.c 2009-07-27 17:41:19 UTC (rev 22456) @@ -258,10 +258,10 @@ return; krb5_os_free_context(ctx); - free(ctx->in_tkt_ktypes); - ctx->in_tkt_ktypes = 0; - free(ctx->tgs_ktypes); - ctx->tgs_ktypes = 0; + free(ctx->in_tkt_etypes); + ctx->in_tkt_etypes = NULL; + free(ctx->tgs_etypes); + ctx->tgs_etypes = NULL; free(ctx->default_realm); ctx->default_realm = 0; if (ctx->ser_ctx_count && ctx->ser_ctx) { @@ -275,58 +275,87 @@ free(ctx); } +/* Copy the zero-terminated enctype list old_list into *new_list. */ +static krb5_error_code +copy_enctypes(krb5_context context, const krb5_enctype *old_list, + krb5_enctype **new_list) +{ + unsigned int count; + krb5_enctype *list; + + *new_list = NULL; + for (count = 0; old_list[count]; count++); + list = malloc(sizeof(krb5_enctype) * (count + 1)); + if (list == NULL) + return ENOMEM; + memcpy(list, old_list, sizeof(krb5_enctype) * (count + 1)); + *new_list = list; + return 0; +} + /* * Set the desired default ktypes, making sure they are valid. */ -krb5_error_code -krb5_set_default_in_tkt_ktypes(krb5_context context, const krb5_enctype *ktypes) +static krb5_error_code +set_default_etype_var(krb5_context context, const krb5_enctype *etypes, + krb5_enctype **var) { - krb5_enctype * new_ktypes; + krb5_error_code code; + krb5_enctype *list; int i; - if (ktypes) { - for (i = 0; ktypes[i]; i++) { - if (!krb5_c_valid_enctype(ktypes[i])) + if (etypes) { + for (i = 0; etypes[i]; i++) { + if (!krb5_c_valid_enctype(etypes[i])) return KRB5_PROG_ETYPE_NOSUPP; - if (!context->allow_weak_crypto && krb5_c_weak_enctype(ktypes[i])) + if (!context->allow_weak_crypto && krb5_c_weak_enctype(etypes[i])) return KRB5_PROG_ETYPE_NOSUPP; } - /* Now copy the default ktypes into the context pointer */ - if ((new_ktypes = (krb5_enctype *)malloc(sizeof(krb5_enctype) * i))) - memcpy(new_ktypes, ktypes, sizeof(krb5_enctype) * i); - else - return ENOMEM; - + code = copy_enctypes(context, etypes, &list); + if (code) + return code; } else { - i = 0; - new_ktypes = 0; + list = NULL; } - if (context->in_tkt_ktypes) - free(context->in_tkt_ktypes); - context->in_tkt_ktypes = new_ktypes; - context->in_tkt_ktype_count = i; + free(*var); + *var = list; return 0; } +krb5_error_code +krb5_set_default_in_tkt_ktypes(krb5_context context, + const krb5_enctype *etypes) +{ + return set_default_etype_var(context, etypes, &context->in_tkt_etypes); +} + +krb5_error_code KRB5_CALLCONV +krb5_set_default_tgs_enctypes(krb5_context context, const krb5_enctype *etypes) +{ + return set_default_etype_var(context, etypes, &context->tgs_etypes); +} + +/* Old name for above function. */ +krb5_error_code +krb5_set_default_tgs_ktypes(krb5_context context, const krb5_enctype *etypes) +{ + return set_default_etype_var(context, etypes, &context->tgs_etypes); +} + static krb5_error_code -get_profile_etype_list(krb5_context context, krb5_enctype **ktypes, char *profstr, - unsigned int ctx_count, krb5_enctype *ctx_list) +get_profile_etype_list(krb5_context context, krb5_enctype **ktypes, + char *profstr, krb5_enctype *ctx_list) { krb5_enctype *old_ktypes; krb5_enctype ktype; + krb5_error_code code; - if (ctx_count) { - /* application-set defaults */ - if ((old_ktypes = - (krb5_enctype *)malloc(sizeof(krb5_enctype) * - (ctx_count + 1)))) { - memcpy(old_ktypes, ctx_list, sizeof(krb5_enctype) * ctx_count); - old_ktypes[ctx_count] = 0; - } else { - return ENOMEM; - } + if (ctx_list) { + code = copy_enctypes(context, ctx_list, &old_ktypes); + if (code) + return code; } else { /* XXX - For now, we only support libdefaults @@ -337,7 +366,6 @@ char *retval = NULL; char *sp = NULL, *ep = NULL; int i, j, count; - krb5_error_code code; code = profile_get_string(context->profile, KRB5_CONF_LIBDEFAULTS, profstr, NULL, DEFAULT_ETYPE_LIST, &retval); @@ -399,50 +427,11 @@ krb5_error_code krb5_get_default_in_tkt_ktypes(krb5_context context, krb5_enctype **ktypes) { - return(get_profile_etype_list(context, ktypes, KRB5_CONF_DEFAULT_TKT_ENCTYPES, - context->in_tkt_ktype_count, - context->in_tkt_ktypes)); + return(get_profile_etype_list(context, ktypes, + KRB5_CONF_DEFAULT_TKT_ENCTYPES, + context->in_tkt_etypes)); } -krb5_error_code KRB5_CALLCONV -krb5_set_default_tgs_enctypes (krb5_context context, const krb5_enctype *ktypes) -{ - krb5_enctype * new_ktypes; - int i; - - if (ktypes) { - for (i = 0; ktypes[i]; i++) { - if (!krb5_c_valid_enctype(ktypes[i])) - return KRB5_PROG_ETYPE_NOSUPP; - if (!context->allow_weak_crypto && krb5_c_weak_enctype(ktypes[i])) - return KRB5_PROG_ETYPE_NOSUPP; - } - - /* Now copy the default ktypes into the context pointer */ - if ((new_ktypes = (krb5_enctype *)malloc(sizeof(krb5_enctype) * i))) - memcpy(new_ktypes, ktypes, sizeof(krb5_enctype) * i); - else - return ENOMEM; - - } else { - i = 0; - new_ktypes = (krb5_enctype *)NULL; - } - - if (context->tgs_ktypes) - krb5_free_ktypes(context, context->tgs_ktypes); - context->tgs_ktypes = new_ktypes; - context->tgs_ktype_count = i; - return 0; -} - -krb5_error_code krb5_set_default_tgs_ktypes -(krb5_context context, const krb5_enctype *etypes) -{ - return (krb5_set_default_tgs_enctypes (context, etypes)); -} - - void KRB5_CALLCONV krb5_free_ktypes (krb5_context context, krb5_enctype *val) @@ -457,20 +446,20 @@ if (context->use_conf_ktypes) /* This one is set *only* by reading the config file; it's not set by the application. */ - return(get_profile_etype_list(context, ktypes, KRB5_CONF_DEFAULT_TKT_ENCTYPES, - 0, NULL)); + return get_profile_etype_list(context, ktypes, + KRB5_CONF_DEFAULT_TKT_ENCTYPES, NULL); else - return(get_profile_etype_list(context, ktypes, KRB5_CONF_DEFAULT_TGS_ENCTYPES, - context->tgs_ktype_count, - context->tgs_ktypes)); + return get_profile_etype_list(context, ktypes, + KRB5_CONF_DEFAULT_TGS_ENCTYPES, + context->tgs_etypes); } krb5_error_code KRB5_CALLCONV krb5_get_permitted_enctypes(krb5_context context, krb5_enctype **ktypes) { - return(get_profile_etype_list(context, ktypes, KRB5_CONF_PERMITTED_ENCTYPES, - context->tgs_ktype_count, - context->tgs_ktypes)); + return get_profile_etype_list(context, ktypes, + KRB5_CONF_PERMITTED_ENCTYPES, + context->tgs_etypes); } krb5_boolean @@ -526,26 +515,6 @@ return(ret); } -static krb5_error_code -copy_ktypes(krb5_context ctx, - unsigned int nktypes, - krb5_enctype *oldktypes, - krb5_enctype **newktypes) -{ - unsigned int i; - - *newktypes = NULL; - if (!nktypes) - return 0; - - *newktypes = malloc(nktypes * sizeof(krb5_enctype)); - if (*newktypes == NULL) - return ENOMEM; - for (i = 0; i < nktypes; i++) - (*newktypes)[i] = oldktypes[i]; - return 0; -} - krb5_error_code KRB5_CALLCONV krb5_copy_context(krb5_context ctx, krb5_context *nctx_out) { @@ -562,10 +531,8 @@ *nctx = *ctx; - nctx->in_tkt_ktypes = NULL; - nctx->in_tkt_ktype_count = 0; - nctx->tgs_ktypes = NULL; - nctx->tgs_ktype_count = 0; + nctx->in_tkt_etypes = NULL; + nctx->tgs_etypes = NULL; nctx->default_realm = NULL; nctx->profile = NULL; nctx->dal_handle = NULL; @@ -583,17 +550,12 @@ memset(&nctx->err, 0, sizeof(nctx->err)); - ret = copy_ktypes(nctx, ctx->in_tkt_ktype_count, - ctx->in_tkt_ktypes, &nctx->in_tkt_ktypes); + ret = copy_enctypes(nctx, ctx->in_tkt_etypes, &nctx->in_tkt_etypes); if (ret) goto errout; - nctx->in_tkt_ktype_count = ctx->in_tkt_ktype_count; - - ret = copy_ktypes(nctx, ctx->tgs_ktype_count, - ctx->tgs_ktypes, &nctx->in_tkt_ktypes); + ret = copy_enctypes(nctx, ctx->tgs_etypes, &nctx->tgs_etypes); if (ret) goto errout; - nctx->tgs_ktype_count = ctx->tgs_ktype_count; if (ctx->os_context.default_ccname != NULL) { nctx->os_context.default_ccname = Modified: trunk/src/lib/krb5/krb/ser_ctx.c =================================================================== --- trunk/src/lib/krb5/krb/ser_ctx.c 2009-07-24 18:21:57 UTC (rev 22455) +++ trunk/src/lib/krb5/krb/ser_ctx.c 2009-07-27 17:41:19 UTC (rev 22456) @@ -92,6 +92,18 @@ profile_ser_internalize /* Internalize routine */ }; #endif /* LEAN_CLIENT */ + +static unsigned int +etypes_len(krb5_enctype *list) +{ + unsigned int i; + + if (list == NULL) + return 0; + for (i = 0; list[i]; i++); + return i; +} + /* * krb5_context_size() - Determine the size required to externalize the * krb5_context. @@ -108,10 +120,10 @@ * krb5_int32 for KV5M_CONTEXT * krb5_int32 for sizeof(default_realm) * strlen(default_realm) for default_realm. - * krb5_int32 for n_in_tkt_ktypes*sizeof(krb5_int32) - * nktypes*sizeof(krb5_int32) for in_tkt_ktypes. - * krb5_int32 for n_tgs_ktypes*sizeof(krb5_int32) - * nktypes*sizeof(krb5_int32) for tgs_ktypes. + * krb5_int32 for n_in_tkt_etypes*sizeof(krb5_int32) + * nktypes*sizeof(krb5_int32) for in_tkt_etypes. + * krb5_int32 for n_tgs_etypes*sizeof(krb5_int32) + * nktypes*sizeof(krb5_int32) for tgs_etypes. * krb5_int32 for clockskew * krb5_int32 for kdc_req_sumtype * krb5_int32 for ap_req_sumtype @@ -129,8 +141,8 @@ if ((context = (krb5_context) arg)) { /* Calculate base length */ required = (14 * sizeof(krb5_int32) + - (context->in_tkt_ktype_count * sizeof(krb5_int32)) + - (context->tgs_ktype_count * sizeof(krb5_int32))); + (etypes_len(context->in_tkt_etypes) * sizeof(krb5_int32)) + + (etypes_len(context->tgs_etypes) * sizeof(krb5_int32))); if (context->default_realm) required += strlen(context->default_realm); @@ -208,31 +220,33 @@ } /* Now number of initial ticket ktypes */ - kret = krb5_ser_pack_int32((krb5_int32) context->in_tkt_ktype_count, + kret = krb5_ser_pack_int32(etypes_len(context->in_tkt_etypes), &bp, &remain); if (kret) return (kret); - + /* Now serialize ktypes */ - for (i=0; iin_tkt_ktype_count; i++) { - kret = krb5_ser_pack_int32((krb5_int32) context->in_tkt_ktypes[i], - &bp, &remain); - if (kret) - return (kret); + if (context->in_tkt_etypes) { + for (i = 0; context->in_tkt_etypes[i]; i++) { + kret = krb5_ser_pack_int32(context->in_tkt_etypes[i], + &bp, &remain); + if (kret) + return (kret); + } } - + /* Now number of default ktypes */ - kret = krb5_ser_pack_int32((krb5_int32) context->tgs_ktype_count, - &bp, &remain); + kret = krb5_ser_pack_int32(etypes_len(context->tgs_etypes), &bp, &remain); if (kret) return (kret); /* Now serialize ktypes */ - for (i=0; itgs_ktype_count; i++) { - kret = krb5_ser_pack_int32((krb5_int32) context->tgs_ktypes[i], - &bp, &remain); - if (kret) - return (kret); + if (context->tgs_etypes) { + for (i = 0; context->tgs_etypes[i]; i++) { + kret = krb5_ser_pack_int32(context->tgs_etypes[i], &bp, &remain); + if (kret) + return (kret); + } } /* Now allowable clockskew */ @@ -333,7 +347,7 @@ krb5_int32 ibuf; krb5_octet *bp; size_t remain; - unsigned int i; + unsigned int i, count; bp = *buffer; remain = *lenremain; @@ -369,40 +383,43 @@ context->default_realm[ibuf] = '\0'; } - /* Get the number of in_tkt_ktypes */ + /* Get the in_tkt_etypes */ if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) goto cleanup; - - context->in_tkt_ktype_count = (int) ibuf; - context->in_tkt_ktypes = (krb5_enctype *) calloc(context->in_tkt_ktype_count+1, - sizeof(krb5_enctype)); - if (!context->in_tkt_ktypes) { - kret = ENOMEM; - goto cleanup; - } - - for (i=0; iin_tkt_ktype_count; i++) { - if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) + count = ibuf; + if (count > 0) { + context->in_tkt_etypes = calloc(count + 1, sizeof(krb5_enctype)); + if (!context->in_tkt_etypes) { + kret = ENOMEM; goto cleanup; - context->in_tkt_ktypes[i] = (krb5_enctype) ibuf; - } + } + for (i = 0; i < count; i++) { + if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) + goto cleanup; + context->in_tkt_etypes[i] = ibuf; + } + context->in_tkt_etypes[count] = 0; + } else + context->in_tkt_etypes = NULL; - /* Get the number of tgs_ktypes */ + /* Get the tgs_etypes */ if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) goto cleanup; - - context->tgs_ktype_count = (int) ibuf; - context->tgs_ktypes = (krb5_enctype *) calloc(context->tgs_ktype_count+1, - sizeof(krb5_enctype)); - if (!context->tgs_ktypes) { - kret = ENOMEM; - goto cleanup; - } - for (i=0; itgs_ktype_count; i++) { - if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) + count = ibuf; + if (count > 0) { + context->tgs_etypes = calloc(count + 1, sizeof(krb5_enctype)); + if (!context->tgs_etypes) { + kret = ENOMEM; goto cleanup; - context->tgs_ktypes[i] = (krb5_enctype) ibuf; - } + } + for (i = 0; i < count; i++) { + if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) + goto cleanup; + context->tgs_etypes[i] = ibuf; + } + context->tgs_etypes[count] = 0; + } else + context->tgs_etypes = NULL; /* Allowable checksum */ if ((kret = krb5_ser_unpack_int32(&ibuf, &bp, &remain))) From lhoward at MIT.EDU Tue Jul 28 06:09:16 2009 From: lhoward at MIT.EDU (lhoward@MIT.EDU) Date: Tue, 28 Jul 2009 06:09:16 -0400 Subject: svn rev #22457: users/ Message-ID: <200907281009.n6SA9Ga9023421@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22457 Commit By: lhoward Log Message: Creating working area for myself Changed Files: A users/lhoward/ From tsitkova at MIT.EDU Tue Jul 28 12:21:19 2009 From: tsitkova at MIT.EDU (tsitkova@MIT.EDU) Date: Tue, 28 Jul 2009 12:21:19 -0400 Subject: svn rev #22460: trunk/src/ Message-ID: <200907281621.n6SGLJG7026445@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22460 Commit By: tsitkova Log Message: Crypto Modularity proj: Added an option --with-crypto-impl to configure.in to specify crypto impl. Changed Files: U trunk/src/configure.in Modified: trunk/src/configure.in =================================================================== --- trunk/src/configure.in 2009-07-28 10:29:38 UTC (rev 22459) +++ trunk/src/configure.in 2009-07-28 16:21:19 UTC (rev 22460) @@ -115,6 +115,16 @@ AC_DEFINE(KRBCONF_VAGUE_ERRORS,1,[Define if the KDC should return only vague error codes to clients]) fi dnl +dnl WITH_CRYPTO_IMPL +dnl +CRYPTO_IMPL="builtin" +AC_ARG_WITH([crypto-impl], +AC_HELP_STRING([--with-crypto-impl=IMPL], [use specified crypto implementation @<:@builtin@:>@]), +[CRYPTO_IMPL=$withval +AC_MSG_RESULT("k5crypto will use \'$withval\'") +], withval=builtin)dnl +AC_SUBST(CRYPTO_IMPL) +dnl dnl --with-kdc-kdb-update makes the KDC update the database with last request dnl information and failure information. dnl From ghudson at MIT.EDU Wed Jul 29 12:10:35 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Wed, 29 Jul 2009 12:10:35 -0400 Subject: svn rev #22469: trunk/ doc/ src/include/ src/lib/krb5/krb/ Message-ID: <200907291610.n6TGAZ0n004477@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22469 Commit By: ghudson Log Message: ticket: 6539 subject: Enctype list configuration enhancements In the processing code for enctype lists, add support for "DEFAULT" to indicate the default list, for families (des/des3/aes/rc4), and for removing entries from the current list (-foo). Also add unit tests and document. Changed Files: U trunk/doc/admin.texinfo U trunk/doc/support-enc.texinfo U trunk/src/include/k5-int.h U trunk/src/lib/krb5/krb/Makefile.in U trunk/src/lib/krb5/krb/init_ctx.c A trunk/src/lib/krb5/krb/t_etypes.c Modified: trunk/doc/admin.texinfo =================================================================== --- trunk/doc/admin.texinfo 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/doc/admin.texinfo 2009-07-29 16:10:32 UTC (rev 22469) @@ -360,6 +360,15 @@ @include support-enc.texinfo +The string DEFAULT can be used to refer to the default set of types for +the variable in question. Types or families can be removed from the +current list by prefixing them with a minus sign (``-''). Types or +families can be prefixed with a plus sign (``+'') for symmetry; it has +the same meaning as just listing the type or family. For example, +``DEFAULT -des'' would be the default set of encryption types with DES +types removed, and ``des3 DEFAULT'' would be the default set of +encryption types with triple DES types moved to the front. + While aes128-cts and aes256-cts are supported for all Kerberos operations, they are not supported by older versions of our GSSAPI implementation (krb5-1.3.1 and earlier). Modified: trunk/doc/support-enc.texinfo =================================================================== --- trunk/doc/support-enc.texinfo 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/doc/support-enc.texinfo 2009-07-29 16:10:32 UTC (rev 22469) @@ -1,6 +1,7 @@ @ignore -the information in this file should be consistent with the information -in krb5/src/lib/crypto/etypes.c (and krb5/src/include/krb5.h[in]?) +The information in this file should be consistent with the information +in krb5/src/lib/crypto/etypes.c and the family processing code in +krb5/src/lib/krb5/krb/init_ctx.c (krb5int_parse_enctype_list). @end ignore @table @code @@ -34,4 +35,12 @@ @itemx rc4-hmac-exp @itemx arcfour-hmac-md5-exp Exportable RC4 with HMAC/MD5 (weak) + at item des +The DES family: des-cbc-crc, des-cbc-md5, and des-cbc-md4 (weak) + at item des3 +The triple DES family: des3-cbc-sha1 + at item aes +The AES family: aes256-cts-hmac-sha1-96 and aes128-cts-hmac-sha1-96 + at item rc4 +The RC4 family: arcfour-hmac @end table Modified: trunk/src/include/k5-int.h =================================================================== --- trunk/src/include/k5-int.h 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/src/include/k5-int.h 2009-07-29 16:10:32 UTC (rev 22469) @@ -2795,6 +2795,10 @@ const krb5_keyblock *privsvr_key, krb5_data *data); +krb5_error_code krb5int_parse_enctype_list(krb5_context context, char *profstr, + krb5_enctype *default_list, + krb5_enctype **result); + #ifdef DEBUG_ERROR_LOCATIONS #define krb5_set_error_message(ctx, code, ...) \ krb5_set_error_message_fl(ctx, code, __FILE__, __LINE__, __VA_ARGS__) Modified: trunk/src/lib/krb5/krb/Makefile.in =================================================================== --- trunk/src/lib/krb5/krb/Makefile.in 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/src/lib/krb5/krb/Makefile.in 2009-07-29 16:10:32 UTC (rev 22469) @@ -284,7 +284,8 @@ $(srcdir)/t_deltat.c \ $(srcdir)/t_expand.c \ $(srcdir)/t_pac.c \ - $(srcdir)/t_princ.c + $(srcdir)/t_princ.c \ + $(srcdir)/t_etypes.c # Someday, when we have a "maintainer mode", do this right: BISON=bison @@ -316,6 +317,8 @@ T_PRINC_OBJS= t_princ.o parse.o unparse.o +T_ETYPES_OBJS= t_etypes.o init_ctx.o + t_walk_rtree: $(T_WALK_RTREE_OBJS) $(KRB5_BASE_DEPLIBS) $(CC_LINK) -o t_walk_rtree $(T_WALK_RTREE_OBJS) $(KRB5_BASE_LIBS) t_ad_fx_armor: t_ad_fx_armor.o @@ -344,8 +347,11 @@ t_princ: $(T_PRINC_OBJS) $(KRB5_BASE_DEPLIBS) $(CC_LINK) -o t_princ $(T_PRINC_OBJS) $(KRB5_BASE_LIBS) +t_etypes: $(T_ETYPES_OBJS) $(KRB5_BASE_DEPLIBS) + $(CC_LINK) -o t_etypes $(T_ETYPES_OBJS) $(KRB5_BASE_LIBS) + TEST_PROGS= t_walk_rtree t_kerb t_ser t_deltat t_expand t_authdata t_pac \ - t_princ + t_princ t_etypes check-unix:: $(TEST_PROGS) KRB5_CONFIG=$(srcdir)/t_krb5.conf ; export KRB5_CONFIG ;\ @@ -382,6 +388,7 @@ $(RUN_SETUP) $(VALGRIND) ./t_authdata $(RUN_SETUP) $(VALGRIND) ./t_pac $(RUN_SETUP) $(VALGRIND) ./t_princ + $(RUN_SETUP) $(VALGRIND) ./t_etypes clean:: $(RM) $(OUTPRE)t_walk_rtree$(EXEEXT) $(OUTPRE)t_walk_rtree.$(OBJEXT) \ Modified: trunk/src/lib/krb5/krb/init_ctx.c =================================================================== --- trunk/src/lib/krb5/krb/init_ctx.c 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/src/lib/krb5/krb/init_ctx.c 2009-07-29 16:10:32 UTC (rev 22469) @@ -60,20 +60,21 @@ #include "../krb5_libinit.h" #endif +/* This must be the largest enctype value defined in krb5.h. */ +#define MAX_ENCTYPE ENCTYPE_ARCFOUR_HMAC_EXP + /* The des-mdX entries are last for now, because it's easy to configure KDCs to issue TGTs with des-mdX keys and then not accept them. This'll be fixed, but for better compatibility, let's prefer des-crc for now. */ -#define DEFAULT_ETYPE_LIST \ - "aes256-cts-hmac-sha1-96 " \ - "aes128-cts-hmac-sha1-96 " \ - "des3-cbc-sha1 arcfour-hmac-md5 " \ - "des-cbc-crc des-cbc-md5 des-cbc-md4 " +static krb5_enctype default_enctype_list[] = { + ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES3_CBC_SHA1, + ENCTYPE_ARCFOUR_HMAC, + ENCTYPE_DES_CBC_CRC, ENCTYPE_DES_CBC_MD5, ENCTYPE_DES_CBC_MD4, + 0 +}; -/* Not included: - "aes128-cts-hmac-sha1-96 " \ - */ - #if (defined(_WIN32)) extern krb5_error_code krb5_vercheck(); extern void krb5_win_ccdll_load(krb5_context context); @@ -344,92 +345,137 @@ return set_default_etype_var(context, etypes, &context->tgs_etypes); } +/* + * Add etype to, or remove etype from, list (of size MAX_ENCTYPE + 1) + * which has *count entries. Filter out weak enctypes if allow_weak + * is false. + */ +static void +mod_list(krb5_enctype etype, krb5_boolean add, krb5_boolean allow_weak, + krb5_enctype *list, unsigned int *count) +{ + unsigned int i; + + assert(etype > 0 && etype <= MAX_ENCTYPE); + if (!allow_weak && krb5_c_weak_enctype(etype)) + return; + for (i = 0; i < *count; i++) { + if (list[i] == etype) { + if (!add) { + for (; i < *count - 1; i++) + list[i] = list[i + 1]; + (*count)--; + } + return; + } + } + if (add) { + assert(*count < MAX_ENCTYPE); + list[(*count)++] = etype; + } +} + +/* + * Set *result to a zero-terminated list of enctypes resulting from + * parsing profstr. profstr may be modified during parsing. + */ +krb5_error_code +krb5int_parse_enctype_list(krb5_context context, char *profstr, + krb5_enctype *default_list, krb5_enctype **result) +{ + char *token, *delim = " \t\r\n,", *save = NULL; + krb5_boolean sel, weak = context->allow_weak_crypto; + krb5_enctype etype, list[MAX_ENCTYPE]; + unsigned int i, count = 0; + + *result = NULL; + + /* Walk through the words in profstr. */ + for (token = strtok_r(profstr, delim, &save); token; + token = strtok_r(NULL, delim, &save)) { + /* Determine if we are adding or removing enctypes. */ + sel = TRUE; + if (*token == '+' || *token == '-') + sel = (*token++ == '+'); + + if (strcasecmp(token, "DEFAULT") == 0) { + /* Set all enctypes in the default list. */ + for (i = 0; default_list[i]; i++) + mod_list(default_list[i], sel, weak, list, &count); + } else if (strcasecmp(token, "des") == 0) { + mod_list(ENCTYPE_DES_CBC_CRC, sel, weak, list, &count); + mod_list(ENCTYPE_DES_CBC_MD5, sel, weak, list, &count); + mod_list(ENCTYPE_DES_CBC_MD4, sel, weak, list, &count); + } else if (strcasecmp(token, "des3") == 0) { + mod_list(ENCTYPE_DES3_CBC_SHA1, sel, weak, list, &count); + } else if (strcasecmp(token, "aes") == 0) { + mod_list(ENCTYPE_AES256_CTS_HMAC_SHA1_96, sel, weak, list, &count); + mod_list(ENCTYPE_AES128_CTS_HMAC_SHA1_96, sel, weak, list, &count); + } else if (strcasecmp(token, "rc4") == 0) { + mod_list(ENCTYPE_ARCFOUR_HMAC, sel, weak, list, &count); + } else if (krb5_string_to_enctype(token, &etype) == 0) { + /* Set a specific enctype. */ + mod_list(etype, sel, weak, list, &count); + } + } + + list[count] = 0; + return copy_enctypes(context, list, result); +} + +/* + * Set *etypes_ptr to a zero-terminated list of enctypes. ctx_list + * (containing application-specified enctypes) is used if non-NULL; + * otherwise the libdefaults profile string specified by profkey is + * used. default_list is the default enctype list to be used while + * parsing profile strings, and is also used if the profile string is + * not set. + */ static krb5_error_code -get_profile_etype_list(krb5_context context, krb5_enctype **ktypes, - char *profstr, krb5_enctype *ctx_list) +get_profile_etype_list(krb5_context context, krb5_enctype **etypes_ptr, + char *profkey, krb5_enctype *ctx_list, + krb5_enctype *default_list) { - krb5_enctype *old_ktypes; - krb5_enctype ktype; + krb5_enctype *etypes; krb5_error_code code; + char *profstr; + *etypes_ptr = NULL; + if (ctx_list) { - code = copy_enctypes(context, ctx_list, &old_ktypes); + /* Use application defaults. */ + code = copy_enctypes(context, ctx_list, &etypes); if (code) return code; } else { - /* - XXX - For now, we only support libdefaults - Perhaps this should be extended to allow for per-host / per-realm - session key types. - */ - - char *retval = NULL; - char *sp = NULL, *ep = NULL; - int i, j, count; - - code = profile_get_string(context->profile, KRB5_CONF_LIBDEFAULTS, profstr, - NULL, DEFAULT_ETYPE_LIST, &retval); + /* Parse profile setting, or "DEFAULT" if not specified. */ + code = profile_get_string(context->profile, KRB5_CONF_LIBDEFAULTS, + profkey, NULL, "DEFAULT", &profstr); if (code) return code; - - count = 0; - sp = retval; - while (*sp) { - for (ep = sp; *ep && (*ep != ',') && !isspace((int) (*ep)); ep++) - ; - if (*ep) { - *ep++ = '\0'; - while (isspace((int) (*ep)) || *ep == ',') - *ep++ = '\0'; - } - count++; - sp = ep; - } - - if ((old_ktypes = - (krb5_enctype *)malloc(sizeof(krb5_enctype) * (count + 1))) == - (krb5_enctype *) NULL) { - profile_release_string(retval); - return ENOMEM; - } - - sp = retval; - j = 0; - i = 1; - while (1) { - if (!krb5_string_to_enctype(sp, &ktype) && - (context->allow_weak_crypto || !krb5_c_weak_enctype(ktype))) { - old_ktypes[j] = ktype; - j++; - } - if (i++ >= count) - break; - - /* skip to next token */ - while (*sp) sp++; - while (! *sp) sp++; - } - - old_ktypes[j] = (krb5_enctype) 0; - profile_release_string(retval); + code = krb5int_parse_enctype_list(context, profstr, default_list, + &etypes); + profile_release_string(profstr); + if (code) + return code; } - if (old_ktypes[0] == 0) { - free (old_ktypes); - *ktypes = 0; + if (etypes[0] == 0) { + free(etypes); return KRB5_CONFIG_ETYPE_NOSUPP; } - *ktypes = old_ktypes; + *etypes_ptr = etypes; return 0; } krb5_error_code krb5_get_default_in_tkt_ktypes(krb5_context context, krb5_enctype **ktypes) { - return(get_profile_etype_list(context, ktypes, + return get_profile_etype_list(context, ktypes, KRB5_CONF_DEFAULT_TKT_ENCTYPES, - context->in_tkt_etypes)); + context->in_tkt_etypes, + default_enctype_list); } void @@ -447,11 +493,13 @@ /* This one is set *only* by reading the config file; it's not set by the application. */ return get_profile_etype_list(context, ktypes, - KRB5_CONF_DEFAULT_TKT_ENCTYPES, NULL); + KRB5_CONF_DEFAULT_TKT_ENCTYPES, NULL, + default_enctype_list); else return get_profile_etype_list(context, ktypes, KRB5_CONF_DEFAULT_TGS_ENCTYPES, - context->tgs_etypes); + context->tgs_etypes, + default_enctype_list); } krb5_error_code KRB5_CALLCONV @@ -459,7 +507,7 @@ { return get_profile_etype_list(context, ktypes, KRB5_CONF_PERMITTED_ENCTYPES, - context->tgs_etypes); + context->tgs_etypes, default_enctype_list); } krb5_boolean Added: trunk/src/lib/krb5/krb/t_etypes.c =================================================================== --- trunk/src/lib/krb5/krb/t_etypes.c 2009-07-29 12:50:43 UTC (rev 22468) +++ trunk/src/lib/krb5/krb/t_etypes.c 2009-07-29 16:10:32 UTC (rev 22469) @@ -0,0 +1,201 @@ +/* -*- mode: c; indent-tabs-mode: nil -*- */ +/* + * t_etypes.c -- test program for krb5int_parse_enctype_list + * + * Copyright 2009 by the 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. + */ + +#include "k5-int.h" +#include +#include "com_err.h" + +static struct { + const char *str; + krb5_enctype defaults[64]; + krb5_enctype expected_noweak[64]; + krb5_enctype expected[64]; +} tests[] = { + /* Empty string, unused default list */ + { "", + { ENCTYPE_DES_CBC_CRC, 0 }, + { 0 }, + { 0 } + }, + /* Single weak enctype */ + { "des-cbc-md4", + { 0 }, + { 0 }, + { ENCTYPE_DES_CBC_MD4, 0 } + }, + /* Single non-weak enctype */ + { "aes128-cts-hmac-sha1-96", + { 0 }, + { ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 }, + { ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 } + }, + /* Two enctypes, one an alias, one weak */ + { "rc4-hmac des-cbc-md5", + { 0 }, + { ENCTYPE_ARCFOUR_HMAC, 0 }, + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_DES_CBC_MD5, 0 } + }, + /* Three enctypes, all weak, case variation, funky separators */ + { " deS-HMac-shA1 , arCFour-hmaC-mD5-exp\tdeS3-Cbc-RAw\n", + { 0 }, + { 0 }, + { ENCTYPE_DES_HMAC_SHA1, ENCTYPE_ARCFOUR_HMAC_EXP, + ENCTYPE_DES3_CBC_RAW, 0 } + }, + /* Default set with enctypes added (one weak in each pair) */ + { "DEFAULT des-cbc-raw +des3-hmac-sha1", + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_ARCFOUR_HMAC_EXP, 0 }, + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_DES3_CBC_SHA1, 0 }, + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_ARCFOUR_HMAC_EXP, + ENCTYPE_DES_CBC_RAW, ENCTYPE_DES3_CBC_SHA1, 0 } + }, + /* Default set with enctypes removed */ + { "default -aes128-cts -des-hmac-sha1", + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES_CBC_MD5, ENCTYPE_DES_HMAC_SHA1, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_DES_CBC_MD5, 0 } + }, + /* Family followed by enctype */ + { "aes des3-cbc-sha1-kd", + { 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES3_CBC_SHA1, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES3_CBC_SHA1, 0 } + }, + /* Enctype followed by two families */ + { "+rc4-hmAC des3 +des", + { 0 }, + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_DES3_CBC_SHA1, 0 }, + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_DES3_CBC_SHA1, ENCTYPE_DES_CBC_CRC, + ENCTYPE_DES_CBC_MD5, ENCTYPE_DES_CBC_MD4 } + }, + /* Default set with family added and enctype removed */ + { "DEFAULT +aes -arcfour-hmac-md5", + { ENCTYPE_ARCFOUR_HMAC, ENCTYPE_DES3_CBC_SHA1, ENCTYPE_DES_CBC_CRC, 0 }, + { ENCTYPE_DES3_CBC_SHA1, ENCTYPE_AES256_CTS_HMAC_SHA1_96, + ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 }, + { ENCTYPE_DES3_CBC_SHA1, ENCTYPE_DES_CBC_CRC, + ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 } + }, + /* Default set with families removed and enctypes added (one redundant) */ + { "DEFAULT -des -des3 rc4-hmac rc4-hmac-exp", + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES3_CBC_SHA1, ENCTYPE_ARCFOUR_HMAC, + ENCTYPE_DES_CBC_CRC, ENCTYPE_DES_CBC_MD5, ENCTYPE_DES_CBC_MD4, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_ARCFOUR_HMAC, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_ARCFOUR_HMAC, ENCTYPE_ARCFOUR_HMAC_EXP, 0 } + }, + /* Default set with family moved to front */ + { "des3 +DEFAULT", + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_AES128_CTS_HMAC_SHA1_96, + ENCTYPE_DES3_CBC_SHA1, 0 }, + { ENCTYPE_DES3_CBC_SHA1, ENCTYPE_AES256_CTS_HMAC_SHA1_96, + ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 }, + { ENCTYPE_DES3_CBC_SHA1, ENCTYPE_AES256_CTS_HMAC_SHA1_96, + ENCTYPE_AES128_CTS_HMAC_SHA1_96, 0 } + }, + /* Two families with default set removed (exotic case), enctype added */ + { "aes +rc4 -DEFaulT des3-hmac-sha1", + { ENCTYPE_AES128_CTS_HMAC_SHA1_96, ENCTYPE_DES3_CBC_SHA1, + ENCTYPE_ARCFOUR_HMAC, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_DES3_CBC_SHA1, 0 }, + { ENCTYPE_AES256_CTS_HMAC_SHA1_96, ENCTYPE_DES3_CBC_SHA1, 0 } + } +}; + +static void show_enctypes(krb5_context ctx, krb5_enctype *list) +{ + unsigned int i; + + for (i = 0; list[i]; i++) { + fprintf(stderr, "%d", (int) list[i]); + if (list[i + 1]) + fprintf(stderr, " "); + } + fprintf(stderr, "\n"); +} + +static void compare(krb5_context ctx, krb5_enctype *result, + krb5_enctype *expected, const char *profstr, + krb5_boolean weak) +{ + unsigned int i; + + for (i = 0; result[i]; i++) { + if (result[i] != expected[i]) + break; + } + if (!result[i] && !expected[i]) /* Success! */ + return; + fprintf(stderr, "Unexpected result while parsing: %s\n", profstr); + fprintf(stderr, "Expected: "); + show_enctypes(ctx, expected); + fprintf(stderr, "Result: "); + show_enctypes(ctx, result); + fprintf(stderr, "allow_weak_crypto was %s\n", weak ? "true" : "false"); + exit(1); +} + +int +main(int argc, char **argv) +{ + krb5_context ctx; + krb5_error_code ret; + krb5_enctype *list; + krb5_boolean weak; + unsigned int i; + char *copy; + + ret = krb5_init_context(&ctx); + if (ret) { + com_err("krb5_init_context", ret, ""); + return 2; + } + for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { + for (weak = FALSE; weak <= TRUE; weak++) { + ctx->allow_weak_crypto = weak; + copy = strdup(tests[i].str); + ret = krb5int_parse_enctype_list(ctx, copy, tests[i].defaults, + &list); + if (ret) { + com_err("krb5int_parse_enctype_list", ret, ""); + return 2; + } + compare(ctx, list, + (weak) ? tests[i].expected : tests[i].expected_noweak, + tests[i].str, weak); + free(copy); + free(list); + } + } + return 0; +} + From epeisach at MIT.EDU Wed Jul 29 21:07:04 2009 From: epeisach at MIT.EDU (epeisach@MIT.EDU) Date: Wed, 29 Jul 2009 21:07:04 -0400 Subject: svn rev #22470: trunk/src/lib/krb5/krb/ Message-ID: <200907300107.n6U174vU017109@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22470 Commit By: epeisach Log Message: ticket: 6539 Fix memory leak by release context at end of test code. Changed Files: U trunk/src/lib/krb5/krb/t_etypes.c Modified: trunk/src/lib/krb5/krb/t_etypes.c =================================================================== --- trunk/src/lib/krb5/krb/t_etypes.c 2009-07-29 16:10:32 UTC (rev 22469) +++ trunk/src/lib/krb5/krb/t_etypes.c 2009-07-30 01:07:03 UTC (rev 22470) @@ -196,6 +196,9 @@ free(list); } } + + krb5_free_context(ctx); + return 0; } From epeisach at MIT.EDU Thu Jul 30 13:12:20 2009 From: epeisach at MIT.EDU (epeisach@MIT.EDU) Date: Thu, 30 Jul 2009 13:12:20 -0400 Subject: svn rev #22473: trunk/src/lib/krb5/krb/ Message-ID: <200907301712.n6UHCKX1001032@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22473 Commit By: epeisach Log Message: ticket: 6540 subject: memory leak in test code t_authdata Free the krb5_context at the end to release memory. Changed Files: U trunk/src/lib/krb5/krb/t_authdata.c Modified: trunk/src/lib/krb5/krb/t_authdata.c =================================================================== --- trunk/src/lib/krb5/krb/t_authdata.c 2009-07-30 08:07:38 UTC (rev 22472) +++ trunk/src/lib/krb5/krb/t_authdata.c 2009-07-30 17:12:20 UTC (rev 22473) @@ -98,5 +98,6 @@ assert( results[3] == NULL); krb5_free_authdata(context, results); krb5_free_authdata(context, container_out); + krb5_free_context(context); return 0; } From epeisach at MIT.EDU Thu Jul 30 13:22:29 2009 From: epeisach at MIT.EDU (epeisach@MIT.EDU) Date: Thu, 30 Jul 2009 13:22:29 -0400 Subject: svn rev #22474: trunk/src/lib/krb5/krb/ Message-ID: <200907301722.n6UHMTBK001939@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22474 Commit By: epeisach Log Message: ticket: 6541 subject: Fix memory leak in k5_pac_verify_server_checksum k5_pac_verify_server_checksum was leaking memory when the checksum was valid. t_pac.c: Fix memory leak by forgetting to release memory. Changed Files: U trunk/src/lib/krb5/krb/pac.c U trunk/src/lib/krb5/krb/t_pac.c Modified: trunk/src/lib/krb5/krb/pac.c =================================================================== --- trunk/src/lib/krb5/krb/pac.c 2009-07-30 17:12:20 UTC (rev 22473) +++ trunk/src/lib/krb5/krb/pac.c 2009-07-30 17:22:28 UTC (rev 22474) @@ -547,8 +547,10 @@ ret = krb5_c_verify_checksum(context, server, KRB5_KEYUSAGE_APP_DATA_CKSUM, &pac_data, &checksum, &valid); + + free(pac_data.data); + if (ret != 0) { - free(pac_data.data); return ret; } Modified: trunk/src/lib/krb5/krb/t_pac.c =================================================================== --- trunk/src/lib/krb5/krb/t_pac.c 2009-07-30 17:12:20 UTC (rev 22473) +++ trunk/src/lib/krb5/krb/t_pac.c 2009-07-30 17:22:28 UTC (rev 22474) @@ -220,6 +220,8 @@ if (ret) err(context, ret, "krb5_pac_verify 4"); + krb5_free_data_contents(context, &data); + krb5_pac_free(context, pac2); } From ghudson at MIT.EDU Thu Jul 30 15:06:37 2009 From: ghudson at MIT.EDU (ghudson@MIT.EDU) Date: Thu, 30 Jul 2009 15:06:37 -0400 Subject: svn rev #22475: trunk/src/include/ Message-ID: <200907301906.n6UJ6bvN011525@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22475 Commit By: ghudson Log Message: ticket: 6533 tags: pullup target_version: 1.7 Include in k5-platform.h, since we use assertions in some of the macros defined there, as well as in many source files which do not themselves include . Report and fix by Rainer Weikusat. Changed Files: U trunk/src/include/k5-platform.h Modified: trunk/src/include/k5-platform.h =================================================================== --- trunk/src/include/k5-platform.h 2009-07-30 17:22:28 UTC (rev 22474) +++ trunk/src/include/k5-platform.h 2009-07-30 19:06:37 UTC (rev 22475) @@ -41,6 +41,7 @@ #define K5_PLATFORM_H #include "autoconf.h" +#include #include #include #include From tsitkova at MIT.EDU Fri Jul 31 22:25:57 2009 From: tsitkova at MIT.EDU (tsitkova@MIT.EDU) Date: Fri, 31 Jul 2009 22:25:57 -0400 Subject: svn rev #22476: trunk/src/lib/krb5/krb/ Message-ID: <200908010225.n712PvJP022799@drugstore.mit.edu> http://src.mit.edu/fisheye/changelog/krb5/?cs=22476 Commit By: tsitkova Log Message: Fix of the test cleanup Changed Files: U trunk/src/lib/krb5/krb/Makefile.in Modified: trunk/src/lib/krb5/krb/Makefile.in =================================================================== --- trunk/src/lib/krb5/krb/Makefile.in 2009-07-30 19:06:37 UTC (rev 22475) +++ trunk/src/lib/krb5/krb/Makefile.in 2009-08-01 02:25:56 UTC (rev 22476) @@ -396,6 +396,9 @@ $(OUTPRE)t_ser$(EXEEXT) $(OUTPRE)t_ser.$(OBJEXT) \ $(OUTPRE)t_deltat$(EXEEXT) $(OUTPRE)t_deltat.$(OBJEXT) \ $(OUTPRE)t_expand$(EXEEXT) $(OUTPRE)t_expand.$(OBJEXT) \ + $(OUTPRE)t_etypes$(EXEEXT) $(OUTPRE)t_etypes.$(OBJEXT) \ + $(OUTPRE)t_pac$(EXEEXT) $(OUTPRE)t_pac.$(OBJEXT) \ + $(OUTPRE)t_princ$(EXEEXT) $(OUTPRE)t_princ.$(OBJEXT) \ $(OUTPRE)t_authdata$(EXEEXT) $(OUTPRE)t_authdata.$(OBJEXT) @libobj_frag@