svn rev #3288: trunk/ bsd/ gssftp/ftpd/

ghudson@MIT.EDU ghudson at MIT.EDU
Sat Nov 21 15:29:19 EST 2009


Commit By: ghudson
Log Message:
Fix up the utmp tests and make them more self-consistent.



Changed Files:
U   trunk/aclocal.m4
U   trunk/bsd/krlogind.c
U   trunk/bsd/login.c
U   trunk/configure.ac
U   trunk/gssftp/ftpd/logwtmp.c
Modified: trunk/aclocal.m4
===================================================================
--- trunk/aclocal.m4	2009-11-21 19:39:44 UTC (rev 3287)
+++ trunk/aclocal.m4	2009-11-21 20:29:19 UTC (rev 3288)
@@ -387,31 +387,6 @@
 ,,[#include <sys/types.h>
 #include <sys/socket.h>])])
 dnl
-dnl
-dnl CHECK_UTMP: check utmp structure and functions
-dnl
-AC_DEFUN(CHECK_UTMP,[
-AC_CHECK_MEMBERS([struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_host, struct utmp.ut_exit],,,
-[#include <sys/types.h>
-#include <utmp.h>])
-
-# Define the names actually used in the krb5 code currently:
-if test $ac_cv_member_struct_utmp_ut_pid = no; then
-  AC_DEFINE(NO_UT_PID,1,[Define if ut_pid field not found])
-fi
-if test $ac_cv_member_struct_utmp_ut_type = no; then
-  AC_DEFINE(NO_UT_TYPE,1,[Define if ut_type field not found])
-fi
-if test $ac_cv_member_struct_utmp_ut_host = no; then
-  AC_DEFINE(NO_UT_HOST,1,[Define if ut_host field not found])
-fi
-if test $ac_cv_member_struct_utmp_ut_exit = no; then
-  AC_DEFINE(NO_UT_EXIT,1,[Define if ut_exit field not found])
-fi
-
-AC_CHECK_FUNCS(setutent setutxent updwtmp updwtmpx)
-])dnl
-dnl
 dnl 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

Modified: trunk/bsd/krlogind.c
===================================================================
--- trunk/bsd/krlogind.c	2009-11-21 19:39:44 UTC (rev 3287)
+++ trunk/bsd/krlogind.c	2009-11-21 20:29:19 UTC (rev 3288)
@@ -761,7 +761,7 @@
 #endif /* LOG_REMOTE_REALM || LOG_OTHER_USERS || LOG_ALL_LOGINS */
 #endif /* KERBEROS */
 
-#ifndef NO_UT_PID
+#ifdef HAVE_STRUCT_UTMP_UT_PID
 	{
 
 	    pty_update_utmp(PTY_LOGIN_PROCESS, getpid(), "rlogin", line,

Modified: trunk/bsd/login.c
===================================================================
--- trunk/bsd/login.c	2009-11-21 19:39:44 UTC (rev 3287)
+++ trunk/bsd/login.c	2009-11-21 20:29:19 UTC (rev 3288)
@@ -217,7 +217,7 @@
 #define QUOTAWARN	"/usr/ucb/quota" /* warn user about quotas */
 #endif
 
-#ifndef NO_UT_HOST
+#ifdef HAVE_STRUCT_UTMP_UT_HOST
 #ifndef UT_HOSTSIZE
 /* linux defines it directly in <utmp.h> */
 #define	UT_HOSTSIZE	sizeof(((struct utmp *)0)->ut_host)

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2009-11-21 19:39:44 UTC (rev 3287)
+++ trunk/configure.ac	2009-11-21 20:29:19 UTC (rev 3288)
@@ -72,7 +72,6 @@
 CHECK_SETJMP
 CHECK_SIGNALS
 CHECK_SIGPROCMASK
-CHECK_UTMP
 CHECK_WAIT_TYPE
 DECLARE_SYS_ERRLIST
 KRB5_AC_MAINTAINER_MODE
@@ -214,34 +213,14 @@
 
 # ----- utmp stuff -----
 
-AC_DEFUN(K5_CHECK_UT_MEMBER,
-[AC_MSG_CHECKING([for $2 in struct $1])
-AC_CACHE_VAL([krb5_cv_struct_$1_$2],
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <$1.h>], [struct $1 u; u.$2;],
-eval "krb5_cv_struct_$1_$2=yes", eval "krb5_cv_struct_$1_$2=no")])
-if eval "test \"`echo '$krb5_cv_struct_'$1'_'$2`\" = yes"; then
-  AC_MSG_RESULT(yes)
-  krb5_tr_ut=HAVE_STRUCT_`echo $1'_'$2 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
-  AC_DEFINE_UNQUOTED($krb5_tr_ut,1,[Define if $2 field present in $1])
-else
-  AC_MSG_RESULT(no)
-fi])
+AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_syslen, struct utmp.ut_addr, struct utmp.ut_id, struct utmp.ut_pid, struct utmp.ut_type, struct utmp.ut_exit],,,
+[#include <sys/types.h>
+#include <utmp.h>])
 
-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
+AC_CHECK_MEMBERS([struct utmpx.ut_host, struct utmpx.ut_syslen, struct utmpx.ut_addr, struct utmpx.ut_id, struct utmpx.ut_pid, struct utmpx.ut_type, struct utmpx.ut_exit],,,
+[#include <sys/types.h>
+#include <utmpx.h>])
 
-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],
@@ -257,7 +236,7 @@
   ifelse([$4], , :, [$4])
 fi])
 
-if test "$krb5_cv_struct_utmp_ut_exit" = yes; then
+if test "$ac_cv_member_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,
@@ -273,7 +252,7 @@
   fi
 fi
 
-if test "$krb5_cv_struct_utmpx_ut_exit" = yes; then
+if test "$ac_cv_member_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,
@@ -292,9 +271,9 @@
 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
+    if test "$ac_cv_member_struct_utmpx_ut_id" = yes \
+      && test "$ac_cv_member_struct_utmpx_ut_type" = yes \
+      && test "$ac_cv_member_struct_utmpx_ut_pid" = yes; then
       AC_MSG_RESULT(ok)
     else
       AC_MSG_RESULT(not ok)
@@ -310,9 +289,9 @@
   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
+    if test "$ac_cv_member_struct_utmp_ut_id" = yes \
+      && test "$ac_cv_member_struct_utmp_ut_type" = yes \
+      && test "$ac_cv_member_struct_utmp_ut_pid" = yes; then
       AC_MSG_RESULT(ok)
     else
       AC_MSG_RESULT(not ok)

Modified: trunk/gssftp/ftpd/logwtmp.c
===================================================================
--- trunk/gssftp/ftpd/logwtmp.c	2009-11-21 19:39:44 UTC (rev 3287)
+++ trunk/gssftp/ftpd/logwtmp.c	2009-11-21 20:29:19 UTC (rev 3288)
@@ -81,7 +81,7 @@
 	if (fstat(fd, &buf) == 0) {
 		(void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
 		(void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
-#ifndef NO_UT_HOST
+#ifdef HAVE_STRUCT_UTMP_UT_HOST
 		(void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
 #endif
 		(void)time(&ut.ut_time);




More information about the Krb5-appl-commits mailing list