summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2001-04-30 21:53:15 +0000
committerTom Yu <tlyu@mit.edu>2001-04-30 21:53:15 +0000
commita2a6293f177e66c9ea066c585675663bb1e275fb (patch)
treec2e50e9d3eee653042250ded9fc7e5d62c956110 /src
parentfd6e8c85fd56f281de94b4c46b20c5c78a394e10 (diff)
downloadkrb5-a2a6293f177e66c9ea066c585675663bb1e275fb.tar.gz
krb5-a2a6293f177e66c9ea066c585675663bb1e275fb.tar.xz
krb5-a2a6293f177e66c9ea066c585675663bb1e275fb.zip
* 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
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog13
-rw-r--r--src/util/pty/configure.in47
-rw-r--r--src/util/pty/pty-int.h4
-rw-r--r--src/util/pty/update_wtmp.c5
4 files changed, 46 insertions, 23 deletions
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 <tlyu@mit.edu>
+
+ * 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 <tlyu@mit.edu>
* 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)