summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorandre <andre>2000-06-03 14:57:40 +0000
committerandre <andre>2000-06-03 14:57:40 +0000
commit2ff7b5d02817eb74a3ac2bf02eadef127b09d77c (patch)
tree13273092785271978f00ba33f3b14519d5ca1409 /configure.in
parente340f73b53aa3451f88fd9d41b652b659b0398f8 (diff)
Added new login recording code
Added test program for login code (make logintest)
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in268
1 files changed, 210 insertions, 58 deletions
diff --git a/configure.in b/configure.in
index 86284aa22..8bb647c12 100644
--- a/configure.in
+++ b/configure.in
@@ -43,7 +43,6 @@ case "$host" in
43 fi 43 fi
44 CFLAGS="$CFLAGS -D_HPUX_SOURCE" 44 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
45 AC_DEFINE(IPADDR_IN_DISPLAY) 45 AC_DEFINE(IPADDR_IN_DISPLAY)
46 AC_DEFINE(USE_UTMPX)
47 AC_MSG_CHECKING(for HPUX trusted system password database) 46 AC_MSG_CHECKING(for HPUX trusted system password database)
48 if test -f /tcb/files/auth/system/default; then 47 if test -f /tcb/files/auth/system/default; then
49 AC_MSG_RESULT(yes) 48 AC_MSG_RESULT(yes)
@@ -63,7 +62,6 @@ case "$host" in
63 fi 62 fi
64 CFLAGS="$CFLAGS -D_HPUX_SOURCE" 63 CFLAGS="$CFLAGS -D_HPUX_SOURCE"
65 AC_DEFINE(IPADDR_IN_DISPLAY) 64 AC_DEFINE(IPADDR_IN_DISPLAY)
66 AC_DEFINE(USE_UTMPX)
67 AC_MSG_CHECKING(for HPUX trusted system password database) 65 AC_MSG_CHECKING(for HPUX trusted system password database)
68 if test -f /tcb/files/auth/system/default; then 66 if test -f /tcb/files/auth/system/default; then
69 AC_MSG_RESULT(yes) 67 AC_MSG_RESULT(yes)
@@ -104,7 +102,8 @@ case "$host" in
104 CFLAGS="$CFLAGS -I/usr/local/include" 102 CFLAGS="$CFLAGS -I/usr/local/include"
105 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib" 103 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib -L/usr/ucblib -R/usr/ucblib"
106 need_dash_r=1 104 need_dash_r=1
107 AC_DEFINE(USE_UTMPX) 105 # hardwire lastlog location (can't detect it on some versions)
106 conf_lastlog_location="/var/adm/lastlog"
108 ;; 107 ;;
109*-*-sunos4*) 108*-*-sunos4*)
110 CFLAGS="$CFLAGS -DSUNOS4" 109 CFLAGS="$CFLAGS -DSUNOS4"
@@ -113,7 +112,6 @@ case "$host" in
113*-*-sysv*) 112*-*-sysv*)
114 CFLAGS="$CFLAGS -I/usr/local/include" 113 CFLAGS="$CFLAGS -I/usr/local/include"
115 LDFLAGS="$LDFLAGS -L/usr/local/lib" 114 LDFLAGS="$LDFLAGS -L/usr/local/lib"
116 AC_DEFINE(USE_UTMPX)
117 MANTYPE='$(CATMAN)' 115 MANTYPE='$(CATMAN)'
118 mansubdir=cat 116 mansubdir=cat
119 LIBS="$LIBS -lgen -lsocket" 117 LIBS="$LIBS -lgen -lsocket"
@@ -132,10 +130,20 @@ if test -z "$no_libnsl" ; then
132fi 130fi
133 131
134# Checks for header files. 132# Checks for header files.
135AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) 133AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h time.h util.h utmp.h utmpx.h)
136 134
137# Checks for library functions. 135# Checks for library functions.
138AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty pututline pututxline rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmp updwtmpx vsnprintf vhangup _getpty __b64_ntop) 136AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp on_exit openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy vsnprintf vhangup _getpty __b64_ntop)
137dnl checks for time functions
138AC_CHECK_FUNCS(gettimeofday time)
139dnl checks for libutil functions
140AC_CHECK_FUNCS(login logout updwtmp logwtmp)
141dnl checks for utmp functions
142AC_CHECK_FUNCS(entutent getutent getutid getutline pututline setutent)
143AC_CHECK_FUNCS(utmpname)
144dnl checks for utmpx functions
145AC_CHECK_FUNCS(entutxent getutxent getutxid getutxline pututxline )
146AC_CHECK_FUNCS(setutxent utmpxname)
139 147
140AC_CHECK_FUNC(login, 148AC_CHECK_FUNC(login,
141 [AC_DEFINE(HAVE_LOGIN)], 149 [AC_DEFINE(HAVE_LOGIN)],
@@ -501,6 +509,11 @@ OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
501OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX) 509OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
502OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP) 510OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
503OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX) 511OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
512OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
513OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
514OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
515OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
516
504 517
505 518
506AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], 519AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
@@ -590,48 +603,6 @@ if test ! -z "$MAIL" ; then
590 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") 603 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
591fi 604fi
592 605
593# Look for lastlog location
594AC_ARG_WITH(lastlog,
595 [ --with-lastlog=FILE Location of lastlog file],
596 [
597 if test "x$withval" = "xno" ; then
598 AC_DEFINE(DISABLE_LASTLOG)
599 else
600 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$withval")
601 fi
602 ],
603 [
604 AC_MSG_CHECKING([location of lastlog file])
605 for lastlog in /var/log/lastlog /var/adm/lastlog /usr/adm/lastlog /etc/security/lastlog ; do
606 if test -f $lastlog ; then
607 gotlastlog="file"
608 break
609 fi
610 if test -d $lastlog ; then
611 gotlastlog="dir"
612 break
613 fi
614 done
615 if test -z "$gotlastlog" ; then
616 AC_MSG_RESULT(not found)
617 nolastlog=1
618 else
619 if test "x$gotlastlog" = "xdir" ; then
620 AC_MSG_RESULT(${lastlog}/)
621 AC_DEFINE(LASTLOG_IS_DIR)
622 else
623 AC_MSG_RESULT($lastlog)
624 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
625 fi
626 fi
627 ]
628)
629
630if test ! -z "$nolastlog" ; then
631 AC_MSG_WARN([*** Disabling lastlog support *** ])
632 AC_DEFINE(DISABLE_LASTLOG)
633fi
634
635if test -z "$no_dev_ptmx" ; then 606if test -z "$no_dev_ptmx" ; then
636 AC_CHECK_FILE("/dev/ptmx", 607 AC_CHECK_FILE("/dev/ptmx",
637 [ 608 [
@@ -838,16 +809,6 @@ AC_ARG_WITH(md5-passwords,
838 ] 809 ]
839) 810)
840 811
841# Check whether to enable utmpx support
842AC_ARG_WITH(utmpx,
843 [ --with-utmpx Enable utmpx support],
844 [
845 if test "x$withval" != "xno" ; then
846 AC_DEFINE(USE_UTMPX)
847 fi
848 ]
849)
850
851# Whether to disable shadow password support 812# Whether to disable shadow password support
852AC_ARG_WITH(shadow, 813AC_ARG_WITH(shadow,
853 [ --without-shadow Disable shadow password support], 814 [ --without-shadow Disable shadow password support],
@@ -922,6 +883,197 @@ AC_ARG_WITH(pid-dir,
922AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") 883AC_DEFINE_UNQUOTED(PIDDIR, "$piddir")
923AC_SUBST(piddir) 884AC_SUBST(piddir)
924 885
886dnl allow user to disable some login recording features
887AC_ARG_ENABLE(lastlog,
888 [ --disable-lastlog disable use of lastlog even if detected [no]],
889 [ AC_DEFINE(DISABLE_LASTLOG) ]
890)
891AC_ARG_ENABLE(utmp,
892 [ --disable-utmp disable use of utmp even if detected [no]],
893 [ AC_DEFINE(DISABLE_UTMP) ]
894)
895AC_ARG_ENABLE(utmpx,
896 [ --disable-utmpx disable use of utmpx even if detected [no]],
897 [ AC_DEFINE(DISABLE_UTMPX) ]
898)
899AC_ARG_ENABLE(wtmp,
900 [ --disable-wtmp disable use of wtmp even if detected [no]],
901 [ AC_DEFINE(DISABLE_WTMP) ]
902)
903AC_ARG_ENABLE(wtmpx,
904 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
905 [ AC_DEFINE(DISABLE_WTMPX) ]
906)
907AC_ARG_ENABLE(libutil,
908 [ --disable-libutil disable use of libutil (login() etc.) [no]],
909 [ AC_DEFINE(DISABLE_LOGIN) ]
910)
911AC_ARG_ENABLE(pututline,
912 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
913 [ AC_DEFINE(DISABLE_PUTUTLINE) ]
914)
915AC_ARG_ENABLE(pututxline,
916 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
917 [ AC_DEFINE(DISABLE_PUTUTXLINE) ]
918)
919AC_ARG_WITH(lastlog,
920 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
921 [ conf_lastlog_location="$withval"; ],)
922
923dnl lastlog, [uw]tmpx? detection
924dnl NOTE: set the paths in the platform section to avoid the
925dnl need for command-line parameters
926dnl lastlog and [uw]tmp are subject to a file search if all else fails
927
928dnl lastlog detection
929dnl NOTE: the code itself will detect if lastlog is a directory
930AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
931AC_TRY_COMPILE([
932#include <sys/types.h>
933#include <utmp.h>
934#ifdef HAVE_LASTLOG_H
935# include <lastlog.h>
936#endif
937#ifdef PATHS_H
938# include <paths.h>
939#endif
940 ],
941 [ char *lastlog = LASTLOG_FILE; ],
942 [ AC_MSG_RESULT(yes) ],
943 [ AC_MSG_RESULT(no)
944 system_lastlog_path=no ]
945)
946if test -z "$conf_lastlog_location"; then
947 if test x"$system_lastlog_path" = x"no" ; then
948 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
949 if test -e $f ; then
950 conf_lastlog_location=$f
951 fi
952 done
953 if test -z "$conf_lastlog_location"; then
954 AC_MSG_WARN([** Cannot find lastlog - disabling feature **])
955 AC_DEFINE(DISABLE_LASTLOG)
956 fi
957 fi
958fi
959
960if test -n "$conf_lastlog_location"; then
961 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
962fi
963
964dnl utmp detection
965AC_MSG_CHECKING([if your system defines UTMP_FILE])
966AC_TRY_COMPILE([
967#include <sys/types.h>
968#include <utmp.h>
969#ifdef PATHS_H
970# include <paths.h>
971#endif
972 ],
973 [ char *utmp = UTMP_FILE; ],
974 [ AC_MSG_RESULT(yes) ],
975 [ AC_MSG_RESULT(no)
976 system_utmp_path=no ]
977)
978if test -z "$conf_utmp_location"; then
979 if test x"$system_utmp_path" = x"no" ; then
980 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
981 if test -f $f ; then
982 conf_utmp_location=$f
983 fi
984 done
985 if test -z "$conf_utmp_location"; then
986 AC_DEFINE(DISABLE_UTMP)
987 fi
988 fi
989fi
990if test -n "$conf_utmp_location"; then
991 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
992fi
993
994dnl wtmp detection
995AC_MSG_CHECKING([if your system defines WTMP_FILE])
996AC_TRY_COMPILE([
997#include <sys/types.h>
998#include <utmp.h>
999#ifdef PATHS_H
1000# include <paths.h>
1001#endif
1002 ],
1003 [ char *wtmp = WTMP_FILE; ],
1004 [ AC_MSG_RESULT(yes) ],
1005 [ AC_MSG_RESULT(no)
1006 system_wtmp_path=no ]
1007)
1008if test -z "$conf_wtmp_location"; then
1009 if test x"$system_wtmp_path" = x"no" ; then
1010 for f in /usr/adm/wtmp /var/log/wtmp; do
1011 if test -f $f ; then
1012 conf_wtmp_location=$f
1013 fi
1014 done
1015 if test -z "$conf_wtmp_location"; then
1016 AC_DEFINE(DISABLE_WTMP)
1017 fi
1018 fi
1019fi
1020if test -n "$conf_wtmp_location"; then
1021 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
1022fi
1023
1024
1025dnl utmpx detection - I don't know any system so perverse as to require
1026dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
1027dnl there, though.
1028AC_MSG_CHECKING([if your system defines UTMPX_FILE])
1029AC_TRY_COMPILE([
1030#include <sys/types.h>
1031#include <utmp.h>
1032#ifdef HAVE_UTMPX_H
1033#include <utmpx.h>
1034#endif
1035#ifdef PATHS_H
1036# include <paths.h>
1037#endif
1038 ],
1039 [ char *utmpx = UTMPX_FILE; ],
1040 [ AC_MSG_RESULT(yes) ],
1041 [ AC_MSG_RESULT(no)
1042 system_utmpx_path=no ]
1043)
1044if test -z "$conf_utmpx_location"; then
1045 if test x"$system_utmpx_path" = x"no" ; then
1046 AC_DEFINE(DISABLE_UTMPX)
1047 fi
1048else
1049 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
1050fi
1051
1052dnl wtmpx detection
1053AC_MSG_CHECKING([if your system defines WTMPX_FILE])
1054AC_TRY_COMPILE([
1055#include <sys/types.h>
1056#include <utmp.h>
1057#ifdef HAVE_UTMPX_H
1058#include <utmpx.h>
1059#endif
1060#ifdef PATHS_H
1061# include <paths.h>
1062#endif
1063 ],
1064 [ char *wtmpx = WTMPX_FILE; ],
1065 [ AC_MSG_RESULT(yes) ],
1066 [ AC_MSG_RESULT(no)
1067 system_wtmpx_path=no ]
1068)
1069if test -z "$conf_wtmpx_location"; then
1070 if test x"$system_wtmpx_path" = x"no" ; then
1071 AC_DEFINE(DISABLE_WTMPX)
1072 fi
1073else
1074 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
1075fi
1076
925 1077
926# Change default command timeout for builtin PRNG 1078# Change default command timeout for builtin PRNG
927entropy_timeout=100 1079entropy_timeout=100