diff -Nru kstart-3.15/aclocal.m4 kstart-3.16/aclocal.m4 --- kstart-3.15/aclocal.m4 2009-08-15 22:06:55.000000000 +0100 +++ kstart-3.16/aclocal.m4 2010-01-19 18:32:26.000000000 +0000 @@ -13,12 +13,122 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, -[m4_warning([this file was generated for autoconf 2.64. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, +[m4_warning([this file was generated for autoconf 2.65. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) +# longlong.m4 serial 13 +dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +# Define HAVE_LONG_LONG_INT if 'long long int' works. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. + +# Note: If the type 'long long int' exists but is only 32 bits large +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be +# defined. In this case you can treat 'long long int' like 'long int'. + +AC_DEFUN([AC_TYPE_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int], + [AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. + dnl If cross compiling, assume the bug isn't important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [ac_cv_type_long_long_int=yes], + [ac_cv_type_long_long_int=no], + [ac_cv_type_long_long_int=yes])], + [ac_cv_type_long_long_int=no])]) + if test $ac_cv_type_long_long_int = yes; then + AC_DEFINE([HAVE_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `long long int'.]) + fi +]) + +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works. +# This fixes a bug in Autoconf 2.61, but can be removed once we +# assume 2.62 everywhere. + +# Note: If the type 'unsigned long long int' exists but is only 32 bits +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT +# will not be defined. In this case you can treat 'unsigned long long int' +# like 'unsigned long int'. + +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], +[ + AC_CACHE_CHECK([for unsigned long long int], + [ac_cv_type_unsigned_long_long_int], + [AC_LINK_IFELSE( + [_AC_TYPE_LONG_LONG_SNIPPET], + [ac_cv_type_unsigned_long_long_int=yes], + [ac_cv_type_unsigned_long_long_int=no])]) + if test $ac_cv_type_unsigned_long_long_int = yes; then + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + [Define to 1 if the system has the type `unsigned long long int'.]) + fi +]) + +# Expands to a C program that can be used to test for simultaneous support +# of 'long long' and 'unsigned long long'. We don't want to say that +# 'long long' is available if 'unsigned long long' is not, or vice versa, +# because too many programs rely on the symmetry between signed and unsigned +# integer types (excluding 'bool'). +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], +[ + AC_LANG_PROGRAM( + [[/* Test preprocessor. */ + #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + error in preprocessor; + #endif + #if ! (18446744073709551615ULL <= -1ull) + error in preprocessor; + #endif + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63;]], + [[/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) +]) + # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation diff -Nru kstart-3.15/config.h.in kstart-3.16/config.h.in --- kstart-3.15/config.h.in 2009-08-15 22:06:58.000000000 +0100 +++ kstart-3.16/config.h.in 2010-01-19 18:32:28.000000000 +0000 @@ -71,6 +71,9 @@ /* Define to 1 if you have the `krb5_get_err_txt' function. */ #undef HAVE_KRB5_GET_ERR_TXT +/* Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function. */ +#undef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC + /* Define to 1 if you have the `krb5_get_init_creds_opt_set_default_flags' function. */ #undef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS @@ -78,8 +81,8 @@ /* Define to 1 if you have the `krb5_get_renewed_creds' function. */ #undef HAVE_KRB5_GET_RENEWED_CREDS -/* Define to 1 if the system has the type `krb5_realm'. */ -#undef HAVE_KRB5_REALM +/* Define to 1 if you have the `krb5_principal_get_realm' function. */ +#undef HAVE_KRB5_PRINCIPAL_GET_REALM /* Define to 1 if you have the `krb5_svc_get_msg' function. */ #undef HAVE_KRB5_SVC_GET_MSG @@ -90,8 +93,8 @@ /* Define to 1 if you have the k_hasafs function. */ #undef HAVE_K_HASAFS -/* Define to 1 if the system has the type `long long'. */ -#undef HAVE_LONG_LONG +/* Define to 1 if the system has the type `long long int'. */ +#undef HAVE_LONG_LONG_INT /* Define to 1 if you have the OpenAFS lsetpag function. */ #undef HAVE_LSETPAG diff -Nru kstart-3.15/configure kstart-3.16/configure --- kstart-3.15/configure 2009-08-15 22:06:57.000000000 +0100 +++ kstart-3.16/configure 2010-01-19 18:32:28.000000000 +0000 @@ -1,12 +1,14 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for kstart 3.15. +# Generated by GNU Autoconf 2.65 for kstart 3.16. # # Report bugs to . # +# # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -527,7 +529,8 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -549,8 +552,8 @@ # Identity of this package. PACKAGE_NAME='kstart' PACKAGE_TARNAME='kstart' -PACKAGE_VERSION='3.15' -PACKAGE_STRING='kstart 3.15' +PACKAGE_VERSION='3.16' +PACKAGE_STRING='kstart 3.16' PACKAGE_BUGREPORT='rra@stanford.edu' PACKAGE_URL='' @@ -1280,7 +1283,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures kstart 3.15 to adapt to many kinds of systems. +\`configure' configures kstart 3.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1350,7 +1353,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of kstart 3.15:";; + short | recursive ) echo "Configuration of kstart 3.16:";; esac cat <<\_ACEOF @@ -1393,7 +1396,7 @@ LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor KRB5_CONFIG Path to krb5-config @@ -1464,8 +1467,8 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -kstart configure 3.15 -generated by GNU Autoconf 2.64 +kstart configure 3.16 +generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1512,7 +1515,7 @@ ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1549,7 +1552,7 @@ ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1684,7 +1687,7 @@ fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1893,7 +1896,7 @@ fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -1939,7 +1942,7 @@ # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - return $ac_retval + as_fn_set_status $ac_retval } # ac_fn_c_try_link @@ -2106,8 +2109,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by kstart $as_me 3.15, which was -generated by GNU Autoconf 2.64. Invocation command line was +It was created by kstart $as_me 3.16, which was +generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2360,7 +2363,7 @@ for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 @@ -2369,9 +2372,9 @@ done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in @@ -2792,6 +2795,7 @@ fi + test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else @@ -2799,7 +2803,6 @@ # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi @@ -2928,7 +2931,7 @@ # Define the identity of the package. PACKAGE='kstart' - VERSION='3.15' + VERSION='3.16' cat >>confdefs.h <<_ACEOF @@ -3314,32 +3317,30 @@ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 - rm -f conftest.er1 conftest.err fi + rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include + int main () { -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out conftest.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -3401,10 +3402,10 @@ else ac_file='' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then : - $as_echo "$as_me: failed program was:" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 @@ -3412,51 +3413,18 @@ { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out conftest.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" @@ -3489,13 +3457,72 @@ as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi -rm -f conftest$ac_cv_exeext +rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : @@ -6925,7 +6952,9 @@ LIBS="$KRB5_LIBS $LIBS" for ac_func in krb5_cc_copy_creds \ krb5_free_keytab_entry_contents \ + krb5_get_init_creds_opt_alloc \ krb5_get_init_creds_opt_set_default_flags \ + krb5_principal_get_realm \ krb5_get_renewed_creds do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -6939,17 +6968,6 @@ fi done -ac_fn_c_check_type "$LINENO" "krb5_realm" "ac_cv_type_krb5_realm" "#include -" -if test "x$ac_cv_type_krb5_realm" = x""yes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_KRB5_REALM 1 -_ACEOF - - -fi - CPPFLAGS="$rra_krb5_save_CPPFLAGS" LDFLAGS="$rra_krb5_save_LDFLAGS" LIBS="$rra_krb5_save_LIBS" @@ -12927,15 +12945,99 @@ $as_echo "#define HAVE_GNU_VAMACROS 1" >>confdefs.h fi -ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = x""yes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5 +$as_echo_n "checking for long long int... " >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Test preprocessor. */ + #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + error in preprocessor; + #endif + #if ! (18446744073709551615ULL <= -1ull) + error in preprocessor; + #endif + /* Test literals. */ + long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + unsigned long long int ull = 18446744073709551615ULL; + /* Test constant expressions. */ + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) + ? 1 : -1)]; + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 + ? 1 : -1)]; + int i = 63; +int +main () +{ +/* Test availability of runtime routines for shift and division. */ + long long int llmax = 9223372036854775807ll; + unsigned long long int ullmax = 18446744073709551615ull; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if test "$cross_compiling" = yes; then : + ac_cv_type_long_long_int=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_type_long_long_int=yes +else + ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +else + ac_cv_type_long_long_int=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 +$as_echo "$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then + +$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h + + fi ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include #include @@ -13587,8 +13689,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by kstart $as_me 3.15, which was -generated by GNU Autoconf 2.64. Invocation command line was +This file was extended by kstart $as_me 3.16, which was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -13628,6 +13730,7 @@ -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -13650,10 +13753,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -kstart config.status 3.15 -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +kstart config.status 3.16 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation @@ -13691,6 +13795,8 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) @@ -13879,7 +13985,7 @@ t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -13893,7 +13999,7 @@ t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p diff -Nru kstart-3.15/configure.ac kstart-3.16/configure.ac --- kstart-3.15/configure.ac 2009-08-15 22:05:46.000000000 +0100 +++ kstart-3.16/configure.ac 2010-01-19 18:32:04.000000000 +0000 @@ -1,13 +1,13 @@ dnl Process this file with autoconf to produce a configure script. dnl dnl Written by Russ Allbery -dnl Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +dnl Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 dnl Board of Trustees, Leland Stanford Jr. University dnl dnl See LICENSE for licensing terms. AC_PREREQ([2.64]) -AC_INIT([kstart], [3.15], [rra@stanford.edu]) +AC_INIT([kstart], [3.16], [rra@stanford.edu]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_LIBOBJ_DIR([portable]) AC_CONFIG_MACRO_DIR([m4]) @@ -38,13 +38,13 @@ RRA_LIB_KRB5_SWITCH AC_CHECK_FUNCS([krb5_cc_copy_creds \ krb5_free_keytab_entry_contents \ + krb5_get_init_creds_opt_alloc \ krb5_get_init_creds_opt_set_default_flags \ + krb5_principal_get_realm \ krb5_get_renewed_creds]) -AC_CHECK_TYPES([krb5_realm], , , [#include ]) RRA_LIB_KRB5_RESTORE -dnl Allow the user to disable Kerberos v4 support. Useful for building -dnl against just Heimdal, without KTH Kerberos. If the user doesn't +dnl Allow the user to disable Kerberos v4 support. If the user doesn't dnl explicitly disable k4start, it's built if Kerberos v4 libraries are found dnl and isn't built otherwise. rra_build_k4start= @@ -75,7 +75,7 @@ AC_CHECK_DECLS([snprintf, vsnprintf]) RRA_C_C99_VAMACROS RRA_C_GNU_VAMACROS -AC_CHECK_TYPES([long long]) +AC_TYPE_LONG_LONG_INT AC_CHECK_TYPE([sig_atomic_t], , [AC_DEFINE([sig_atomic_t], [int], [Define to int if does not define.])], diff -Nru kstart-3.15/debian/changelog kstart-3.16/debian/changelog --- kstart-3.15/debian/changelog 2010-02-02 00:36:17.000000000 +0000 +++ kstart-3.16/debian/changelog 2010-02-02 00:36:17.000000000 +0000 @@ -1,3 +1,29 @@ +kstart (3.16-3) unstable; urgency=low + + * Skip the xmalloc test by default. It's too fragile and isn't catching + actual bugs. + + -- Russ Allbery Thu, 21 Jan 2010 15:27:57 -0800 + +kstart (3.16-2) unstable; urgency=low + + * Don't attempt to build with setpag support on non-Linux systems. + kfreebsd-* isn't supported by OpenAFS (at least yet). + + -- Russ Allbery Tue, 19 Jan 2010 11:28:18 -0800 + +kstart (3.16-1) unstable; urgency=low + + * New upstream release. + - Add -L option to log messages to syslog. + - In k5start, fix use of -o, -g, and -m when -k was not given. + - Allow the argument to k5start -k to start with FILE:. + * Install the upstream krenew-agent example script in examples now that + it's included in the distribution. + * Update standards version to 3.8.3 (no changes required). + + -- Russ Allbery Tue, 19 Jan 2010 10:44:24 -0800 + kstart (3.15-1) unstable; urgency=low * New upstream release. diff -Nru kstart-3.15/debian/control kstart-3.16/debian/control --- kstart-3.15/debian/control 2010-02-02 00:36:17.000000000 +0000 +++ kstart-3.16/debian/control 2010-02-02 00:36:17.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Russ Allbery Build-Depends: debhelper (>= 7.0.50~), libkrb5-dev, libtest-pod-perl, perl -Standards-Version: 3.8.2 +Standards-Version: 3.8.3 Homepage: http://www.eyrie.org/~eagle/software/kstart/ Vcs-Git: git://git.eyrie.org/kerberos/kstart.git Vcs-Browser: http://git.eyrie.org/?p=kerberos/kstart.git diff -Nru kstart-3.15/debian/examples kstart-3.16/debian/examples --- kstart-3.15/debian/examples 1970-01-01 01:00:00.000000000 +0100 +++ kstart-3.16/debian/examples 2010-02-02 00:36:17.000000000 +0000 @@ -0,0 +1 @@ +examples/krenew-agent diff -Nru kstart-3.15/debian/rules kstart-3.16/debian/rules --- kstart-3.15/debian/rules 2010-02-02 00:36:17.000000000 +0000 +++ kstart-3.16/debian/rules 2010-02-02 00:36:17.000000000 +0000 @@ -1,10 +1,17 @@ #!/usr/bin/make -f +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +ifeq ($(DEB_HOST_ARCH_OS),linux) + SETPAG = --enable-setpag +else + SETPAG = --disable-setpag +endif + %: dh $@ override_dh_auto_configure: - dh_auto_configure -- --enable-reduced-depends --enable-setpag \ + dh_auto_configure -- --enable-reduced-depends $(SETPAG) \ --disable-k4start --without-libkafs --with-aklog=/usr/bin/aklog override_dh_installchangelogs: diff -Nru kstart-3.15/examples/krenew-agent kstart-3.16/examples/krenew-agent --- kstart-3.15/examples/krenew-agent 1970-01-01 01:00:00.000000000 +0100 +++ kstart-3.16/examples/krenew-agent 2010-01-19 18:32:04.000000000 +0000 @@ -0,0 +1,34 @@ +#!/bin/bash +# krenew-agent - + +DATE=`date '+%Y-%m-%d %H:%M:%S'` +FILE="/tmp/krb5cc_$1" +PIDFILE="${FILE}.pid" +LOGFILE="${FILE}.log" +KRENEW_ARGS="-K 10 -t -v -p ${PIDFILE}" + +if [ "x$1" == "x" ] ; then + echo "Usage: $0 USER" + exit 0 +fi + +if [ ! -f ${FILE} ] ; then + echo "No ticket cache to work with: ${FILE}" + exit 0 +fi + +touch ${LOGFILE} + +if [ ! -f ${PIDFILE} ] ; then + echo "${DATE} Starting new krenew" | tee -a ${LOGFILE} + touch ${LOGFILE} + krenew ${KRENEW_ARGS} 2>&1 & >> ${LOGFILE} +else + PID=`cat ${PIDFILE}` + if kill -0 ${PID} 2>/dev/null; then + echo "${DATE} Already running (pid ${PID})" | tee -a ${LOGFILE} + else + echo "${DATE} Restarting krenew" | tee -a ${LOGFILE} + krenew ${KRENEW_ARGS} 2>&1 >> ${LOGFILE} & + fi +fi diff -Nru kstart-3.15/.gitignore kstart-3.16/.gitignore --- kstart-3.15/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ kstart-3.16/.gitignore 2010-01-19 18:32:04.000000000 +0000 @@ -0,0 +1,34 @@ +/Makefile +/Makefile.in +/aclocal.m4 +/build-aux/ +/config.h +/config.h.in +/config.h.in~ +/config.log +/config.status +/configure +/k4start +/k5start +/kstart-* +/krenew +/stamp-h1 +/tests/data/.placeholder +/tests/data/test.* +/tests/kafs/basic +/tests/portable/asprintf-t +/tests/portable/daemon-t +/tests/portable/mkstemp-t +/tests/portable/setenv-t +/tests/portable/snprintf-t +/tests/portable/strlcat-t +/tests/portable/strlcpy-t +/tests/runtests +/tests/util/concat-t +/tests/util/messages-t +/tests/util/xmalloc +.deps +.dirstamp +*.1 +*.a +*.o diff -Nru kstart-3.15/k4start.1 kstart-3.16/k4start.1 --- kstart-3.15/k4start.1 2009-08-15 22:06:59.000000000 +0100 +++ kstart-3.16/k4start.1 2010-01-19 18:32:29.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.08) +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "K4START 1" -.TH K4START 1 "2009-08-15" "3.15" "kstart" +.TH K4START 1 "2010-01-19" "3.16" "kstart" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff -Nru kstart-3.15/k4start.c kstart-3.16/k4start.c --- kstart-3.15/k4start.c 2009-08-15 22:05:46.000000000 +0100 +++ kstart-3.16/k4start.c 2010-01-19 18:32:04.000000000 +0000 @@ -31,7 +31,12 @@ #include #include -#include +#include +#include +#include +#include +#include +#include /* * The number of seconds of fudge to add to the check for whether we need to diff -Nru kstart-3.15/k5start.1 kstart-3.16/k5start.1 --- kstart-3.15/k5start.1 2009-08-15 22:06:59.000000000 +0100 +++ kstart-3.16/k5start.1 2010-01-19 18:32:29.000000000 +0000 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.08) +.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "K5START 1" -.TH K5START 1 "2009-08-15" "3.15" "kstart" +.TH K5START 1 "2010-01-19" "3.16" "kstart" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -133,14 +133,14 @@ k5start \- Obtain and optionally keep active a Kerberos v5 ticket. .SH "SYNOPSIS" .IX Header "SYNOPSIS" -\&\fBk5start\fR [\fB\-bFhnPqstv\fR] [\fB\-c\fR \fIchild pid file\fR] [\fB\-f\fR \fIkeytab\fR] +\&\fBk5start\fR [\fB\-bFhLnPqstv\fR] [\fB\-c\fR \fIchild pid file\fR] [\fB\-f\fR \fIkeytab\fR] [\fB\-g\fR \fIgroup\fR] [\fB\-H\fR \fIminutes\fR] [\fB\-I\fR \fIservice instance\fR] [\fB\-i\fR \fIclient instance\fR] [\fB\-K\fR \fIminutes\fR] [\fB\-k\fR \fIticket file\fR] [\fB\-l\fR \fItime string\fR] [\fB\-m\fR \fImode\fR] [\fB\-o\fR \fIowner\fR] [\fB\-p\fR \fIpid file\fR] [\fB\-r\fR \fIservice realm\fR] [\fB\-S\fR \fIservice name\fR] [\fB\-u\fR \fIclient principal\fR] [\fIusername\fR [\fIcommand\fR ...]] .PP -\&\fBk5start\fR \fB\-U\fR \fB\-f\fR \fIkeytab\fR [\fB\-bFhnPqstv\fR] [\fB\-c\fR \fIchild pid file\fR] +\&\fBk5start\fR \fB\-U\fR \fB\-f\fR \fIkeytab\fR [\fB\-bFhLnPqstv\fR] [\fB\-c\fR \fIchild pid file\fR] [\fB\-g\fR \fIgroup\fR] [\fB\-H\fR \fIminutes\fR] [\fB\-I\fR \fIservice instance\fR] [\fB\-K\fR \fIminutes\fR] [\fB\-k\fR \fIticket file\fR] [\fB\-l\fR \fItime string\fR] [\fB\-m\fR \fImode\fR] [\fB\-o\fR \fIowner\fR] [\fB\-p\fR \fIpid file\fR] @@ -217,6 +217,9 @@ cache. When using \fB\-b\fR in conjunction with \fB\-K\fR on Mac \s-1OS\s0 X, you probably also want to use the \fB\-k\fR flag to specify a ticket cache file and force the use of a file cache. +.Sp +When using this option, consider also using \fB\-L\fR to report \fBk5start\fR +errors to syslog. .IP "\fB\-c\fR \fIchild pid file\fR" 4 .IX Item "-c child pid file" Save the process \s-1ID\s0 (\s-1PID\s0) of the child process into \fIchild pid file\fR. @@ -286,11 +289,19 @@ .IP "\fB\-k\fR \fIticket file\fR" 4 .IX Item "-k ticket file" Use \fIticket file\fR as the ticket cache rather than the contents of the -environment variable \s-1KRB5CCNAME\s0 or the library default. \fIticket file\fR -should be the path to a file, without any leading \f(CW\*(C`FILE:\*(C'\fR string. Using -this option forces a file-based ticket cache; if you wish to use a -different type of ticket cache, don't specify \fB\-k\fR and instead set -\&\s-1KRB5CCNAME\s0 to the designator of the cache you wish to use. +environment variable \s-1KRB5CCNAME\s0 or the library default. Using this option +forces a file-based ticket cache. If you wish to use a different type of +ticket cache, don't specify \fB\-k\fR and instead set \s-1KRB5CCNAME\s0 to the +designator of the cache you wish to use. +.IP "\fB\-L\fR" 4 +.IX Item "-L" +Report messages to syslog as well as to standard output or standard error. +All messages will be logged with facility \s-1LOG_DAEMON\s0. Regular messages +that are displayed on standard output are logged with level \s-1LOG_NOTICE\s0. +Errors that don't cause \fBk5start\fR to terminate are logged with level +\&\s-1LOG_WARNING\s0. Fatal errors are logged with level \s-1LOG_ERR\s0. +.Sp +This is useful when debugging problems in combination with \fB\-b\fR. .IP "\fB\-l\fR \fItime string\fR" 4 .IX Item "-l time string" Set the ticket lifetime. \fItime string\fR should be in a format recognized @@ -372,10 +383,10 @@ \&\s-1PAG\s0. .IP "\fB\-U\fR" 4 .IX Item "-U" -Rather than requiring the principal to authenticate as be given on the -command line, read it from the keytab specified with \fB\-f\fR. The principal -will be taken from the first entry in the keytab. \fB\-f\fR must be specified -if this option is used. +Rather than requiring the authentication principal be given on the command +line, read it from the keytab specified with \fB\-f\fR. The principal will be +taken from the first entry in the keytab. \fB\-f\fR must be specified if this +option is used. .Sp When \fB\-U\fR is given, \fBk5start\fR will not expect a principal name to be given on the command line, and any arguments after the options will be diff -Nru kstart-3.15/k5start.c kstart-3.16/k5start.c --- kstart-3.15/k5start.c 2009-08-15 22:05:46.000000000 +0100 +++ kstart-3.16/k5start.c 2010-01-19 18:32:04.000000000 +0000 @@ -9,13 +9,14 @@ * It is based very heavily on a modified Kerberos v4 kinit, changed to call * the Kerberos v5 initialization functions instead. k5start is not as useful * for Kerberos v5 as kstart is for Kerberos v4, since the v5 kinit supports - * more useful options, but -K and -H are still unique to it. + * more useful options, but AFS integration and -K and -H are still unique to + * it. * * Originally written by Robert Morgan and Booker C. Bense. * Substantial updates by Russ Allbery * Copyright 1987, 1988 by the Massachusetts Institute of Technology. * Copyright 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007, - * 2008, 2009 Board of Trustees, Leland Stanford Jr. University + * 2008, 2009, 2010 Board of Trustees, Leland Stanford Jr. University * * See LICENSE for licensing terms. */ @@ -24,17 +25,25 @@ #include #include +#include #include #include -#include +#include #include #ifdef HAVE_SYS_TIME_H # include #endif +#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include /* The default ticket lifetime in minutes. Default to 10 hours. */ #define DEFAULT_LIFETIME (10 * 60) @@ -56,7 +65,7 @@ char *service; krb5_principal ksprinc; krb5_ccache ccache; - krb5_get_init_creds_opt kopts; + krb5_get_init_creds_opt *kopts; const char *keytab; int happy_ticket; int keep_ticket; @@ -91,6 +100,7 @@ -K Run as daemon, renew ticket every minutes\n\ (implies -q unless -v is given)\n\ -k Use as the ticket cache\n\ + -L Log messages via syslog as well as stderr\n\ -l Ticket lifetime in minutes\n\ -m Set ticket cache permissions to (octal)\n\ -o Set ticket cache owner to \n\ @@ -108,6 +118,12 @@ is set to a program (such as aklog) then this program will be executed when\n\ requested by the -t flag. Otherwise, %s.\n"; +/* Included in the usage message if AFS support is compiled in. */ +const char usage_message_kafs[] = "\n\ +When invoked with -t and a command, k5start will create a new AFS PAG for\n\ +the command before running the AKLOG program to keep its AFS credentials\n\ +isolated from other processes.\n"; + /* * Print out the usage message and then exit with the status given as the @@ -121,6 +137,9 @@ ((PATH_AKLOG[0] == '\0') ? "using -t is an error" : "the program executed will be\n" PATH_AKLOG)); +#ifdef HAVE_KAFS + fprintf((status == 0) ? stdout : stderr, usage_message_kafs); +#endif exit(status); } @@ -139,16 +158,16 @@ * Given a context and a principal, get the realm. This works differently in * MIT Kerberos and Heimdal, unfortunately. */ -static char * +static const char * get_realm(krb5_context ctx UNUSED, krb5_principal princ) { -#ifdef HAVE_KRB5_REALM - krb5_realm *realm; +#ifdef HAVE_KRB5_PRINCIPAL_GET_REALM + const char *realm; - realm = krb5_princ_realm(ctx, princ); + realm = krb5_principal_get_realm(ctx, princ); if (realm == NULL) die("cannot get local Kerberos realm"); - return krb5_realm_data(*realm); + return realm; #else krb5_data *data; @@ -220,10 +239,10 @@ if (status != 0) warn_krb5(ctx, status, "error unparsing name"); else { - printf("Principal: %s\n", p); + notice("authenticating as %s", p); free(p); } - printf("Service principal: %s\n", options->service); + notice("getting tickets for %s", options->service); } if (options->keytab != NULL) { status = krb5_kt_resolve(ctx, options->keytab, &keytab); @@ -232,12 +251,12 @@ options->keytab); status = krb5_get_init_creds_keytab(ctx, &creds, options->kprinc, keytab, 0, options->service, - &options->kopts); + options->kopts); } else if (!options->stdin_passwd) { status = krb5_get_init_creds_password(ctx, &creds, options->kprinc, NULL, krb5_prompter_posix, NULL, 0, options->service, - &options->kopts); + options->kopts); } else { char *p, buffer[BUFSIZ]; @@ -252,7 +271,7 @@ status = krb5_get_init_creds_password(ctx, &creds, options->kprinc, buffer, NULL, NULL, 0, options->service, - &options->kopts); + options->kopts); } if (status != 0) die_krb5(ctx, status, "error getting credentials"); @@ -342,7 +361,8 @@ pid_t child = 0; bool clean_cache = false; bool search_keytab = false; - static const char optstring[] = "bc:Ff:g:H:hI:i:K:k:l:m:no:Pp:qr:S:stUu:v"; + static const char optstring[] + = "bc:Ff:g:H:hI:i:K:k:Ll:m:no:Pp:qr:S:stUu:v"; /* Initialize logging. */ message_program_name = "k5start"; @@ -387,7 +407,19 @@ die("-K interval argument %s out of range", optarg); break; case 'k': - cache = concat("FILE:", optarg, (char *) 0); + if (strncmp(optarg, "FILE:", strlen("FILE:")) == 0) + cache = xstrdup(optarg); + else + cache = concat("FILE:", optarg, (char *) 0); + break; + case 'L': + openlog(message_program_name, LOG_PID, LOG_DAEMON); + message_handlers_notice(2, message_log_stdout, + message_log_syslog_notice); + message_handlers_warn(2, message_log_stderr, + message_log_syslog_warning); + message_handlers_die(2, message_log_stderr, + message_log_syslog_err); break; case 'l': code = krb5_string_to_deltat(optarg, &life_secs); @@ -496,7 +528,7 @@ } if (cache == NULL) { code = krb5_cc_default(ctx, &options.ccache); - if (code != 0) + if (code == 0) cache = krb5_cc_get_name(ctx, options.ccache); } else { if (setenv("KRB5CCNAME", cache, 1) != 0) @@ -536,7 +568,10 @@ /* * Display the identity that we're obtaining Kerberos tickets for. We do * this by unparsing the principal rather than using username and inst - * since that way we get the default realm appended by K5. + * since that way we get the default realm appended by the Kerberos + * libraries. + * + * We intentionally don't use notice() here to avoid prepending k5start. */ if (!options.quiet) { char *p; @@ -572,17 +607,24 @@ /* Figure out our ticket lifetime and initialize the options. */ life_secs = lifetime * 60; - krb5_get_init_creds_opt_init(&options.kopts); +#ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC + code = krb5_get_init_creds_opt_alloc(ctx, &options.kopts); + if (code != 0) + die_krb5(ctx, code, "error allocating credential options"); +#else + options.kopts = xcalloc(1, sizeof(krb5_get_init_creds_opt)); + krb5_get_init_creds_opt_init(options.kopts); +#endif #ifdef HAVE_KRB5_GET_INIT_CREDS_OPT_SET_DEFAULT_FLAGS krb5_get_init_creds_opt_set_default_flags(ctx, "k5start", options.kprinc->realm, - &options.kopts); + options.kopts); #endif - krb5_get_init_creds_opt_set_tkt_life(&options.kopts, life_secs); + krb5_get_init_creds_opt_set_tkt_life(options.kopts, life_secs); if (nonforwardable) - krb5_get_init_creds_opt_set_forwardable(&options.kopts, 0); + krb5_get_init_creds_opt_set_forwardable(options.kopts, 0); if (nonproxiable) - krb5_get_init_creds_opt_set_proxiable(&options.kopts, 0); + krb5_get_init_creds_opt_set_proxiable(options.kopts, 0); /* * If we're just checking the service ticket, do that and exit if okay. diff -Nru kstart-3.15/k5start.pod kstart-3.16/k5start.pod --- kstart-3.15/k5start.pod 2009-08-15 22:05:46.000000000 +0100 +++ kstart-3.16/k5start.pod 2010-01-19 18:32:04.000000000 +0000 @@ -3,20 +3,20 @@ k5start - Obtain and optionally keep active a Kerberos v5 ticket. =for stopwords --bFhnPqstv keytab username kinit LDAP aklog HUP ALRM KRB5CCNAME AFS PAG +-bFhLnPqstv keytab username kinit LDAP aklog HUP ALRM KRB5CCNAME AFS PAG init AKLOG kstart krenew afslog Bense Allbery Navid Golpayegani forwardable proxiable =head1 SYNOPSIS -B [B<-bFhnPqstv>] [B<-c> I] [B<-f> I] +B [B<-bFhLnPqstv>] [B<-c> I] [B<-f> I] [B<-g> I] [B<-H> I] [B<-I> I] [B<-i> I] [B<-K> I] [B<-k> I] [B<-l> I