From: Tom Yu Date: Mon, 30 Apr 2001 21:53:15 +0000 (+0000) Subject: * configure.in: Fix some quoting of shell variables when passing X-Git-Tag: krb5-1.3-alpha1~1529 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a2a6293f177e66c9ea066c585675663bb1e275fb;p=krb5.git * configure.in: Fix some quoting of shell variables when passing to "test". Reorder some logic in consistency checks to validate cache variables against "yes" to account for possible empty or nonexistent values. * pty-int.h: Fix conditional prototype of update_wtmp(). * update_wtmp.c: Fix conditional compilation of update_wtmp() to cover the case where we have setutxent() but don't have updwtmpx() and WTMPX_FILE, as is the case on some Linux installations. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13222 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index bae05fd13..cb191a54f 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,3 +1,16 @@ +2001-04-30 Tom Yu + + * configure.in: Fix some quoting of shell variables when passing + to "test". Reorder some logic in consistency checks to validate + cache variables against "yes" to account for possible empty or + nonexistent values. + + * pty-int.h: Fix conditional prototype of update_wtmp(). + + * update_wtmp.c: Fix conditional compilation of update_wtmp() to + cover the case where we have setutxent() but don't have updwtmpx() + and WTMPX_FILE, as is the case on some Linux installations. + 2001-04-27 Tom Yu * configure.in(K5_CHECK_UT_MEMBER): Fix typo in previous; make diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in index 3d3e1ec6e..8dce22902 100644 --- a/src/util/pty/configure.in +++ b/src/util/pty/configure.in @@ -86,14 +86,14 @@ else AC_MSG_RESULT(no) fi]) -if test $ac_cv_header_utmp_h = yes; then +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 +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) @@ -115,7 +115,7 @@ else ifelse([$4], , :, [$4]) fi]) -if test $krb5_cv_struct_utmp_ut_exit = yes; then +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, @@ -131,7 +131,7 @@ krb5_utmp_e_termination=`echo $krb5_mem|sed -e 's%_exit$%_termination%'`], ) fi fi -if test $krb5_cv_struct_utmpx_ut_exit = yes; then +if test "$krb5_cv_struct_utmpx_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(utmpx, $krb5_mem, @@ -147,32 +147,37 @@ krb5_utmpx_e_termination=`echo $krb5_mem|sed -e 's%_exit$%_termination%'`], ) fi fi -if test $ac_cv_func_setutent = yes; then +if test "$ac_cv_func_setutent" = yes; then AC_MSG_CHECKING(consistency of sysV-ish utmp API) - if test $krb5_cv_struct_utmp_ut_id = no \ - || test $krb5_cv_struct_utmp_ut_type = no \ - || test $krb5_cv_struct_utmp_ut_pid = no; then - AC_MSG_RESULT(not ok) - AC_MSG_ERROR([have setutent but no ut_id, ut_type, or ut_pid in utmp]) + 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(ok) + AC_MSG_RESULT(not ok) + AC_MSG_ERROR([have setutent but no utmp.h]) fi fi -if test $ac_cv_header_utmpx_h = yes; then +if test "$ac_cv_header_utmpx_h" = yes; then AC_MSG_CHECKING(consistency of utmpx API) - if test $ac_cv_func_setutxent = no; then - AC_MSG_RESULT(not ok) - AC_MSG_ERROR([have utmpx.h but no setutxent]) - else - if test $krb5_cv_struct_utmpx_ut_id = no \ - || test $krb5_cv_struct_utmpx_ut_type = no \ - || test $krb5_cv_struct_utmpx_ut_pid = no; then + 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]) - else - AC_MSG_RESULT(ok) fi + else + AC_MSG_RESULT(not ok) + AC_MSG_ERROR([have utmpx.h but no setutxent]) fi fi diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h index a955533dc..fa7f828f4 100644 --- a/src/util/pty/pty-int.h +++ b/src/util/pty/pty-int.h @@ -99,7 +99,9 @@ long ptyint_void_association(void); long ptyint_open_ctty (char *slave, int *fd); #ifdef HAVE_SETUTXENT long ptyint_update_wtmpx(struct utmpx *utx); -#else +#endif +#if !(defined(WTMPX_FILE) && defined(HAVE_UPDWTMPX)) \ + || !defined(HAVE_SETUXENT) long ptyint_update_wtmp(struct utmp *ut); #endif void ptyint_vhangup(void); diff --git a/src/util/pty/update_wtmp.c b/src/util/pty/update_wtmp.c index cb0129fd5..aa47322fc 100644 --- a/src/util/pty/update_wtmp.c +++ b/src/util/pty/update_wtmp.c @@ -90,7 +90,10 @@ ptyint_update_wtmpx(struct utmpx *ent) #endif /* !(defined(WTMPX_FILE) && defined(HAVE_UPDWTMPX)) */ } -#else /* !HAVE_SETUTXENT */ +#endif /* HAVE_SETUTXENT */ + +#if !(defined(WTMPX_FILE) && defined(HAVE_UPDWTMPX)) \ + || !defined(HAVE_SETUTXENT) long ptyint_update_wtmp(struct utmp *ent)