diff options
68 files changed, 2482 insertions, 1061 deletions
diff --git a/contrib/opie/BUG-REPORT b/contrib/opie/BUG-REPORT index 813b38887814..655d0b49d465 100644 --- a/contrib/opie/BUG-REPORT +++ b/contrib/opie/BUG-REPORT @@ -1,5 +1,5 @@ -OPIE Software Distribution, Release 2.3 Bug Reporting Form -======================================= ================== +OPIE Software Distribution, Release 2.31 Bug Reporting Form +======================================== ================== Please make a copy of this file and then edit it with your favorite text editor to include the answers to the following questions: @@ -72,8 +72,8 @@ it usually takes a week or two. Copyright ========= -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/INSTALL b/contrib/opie/INSTALL index 8551cb5ef7af..3ed3e4c3a692 100644 --- a/contrib/opie/INSTALL +++ b/contrib/opie/INSTALL @@ -1,5 +1,5 @@ -OPIE Software Distribution, Release 2.3 Installation Instructions -======================================= ========================= +OPIE Software Distribution, Release 2.31 Installation Instructions +======================================== ========================= Did you read the README file? @@ -26,6 +26,11 @@ hole, but a necessary evil for some sites), type: If you'd like the file to go somewhere else, adjust this appropriately. + There are a number of configure-time options available for OPIE. To +get a list, type: + + sh configure --help + 2. Edit the Makefile The Makefile contains some options that you may wish to modify. Also @@ -34,13 +39,7 @@ verify that Autoconf chose the correct options for your system. The Makefile created by Autoconf should be correct for most users as-is. -3. Edit options.h - - Most user-tweakable options are specified in this file. - - The defaults should be reasonable for most users. - -4. Build OPIE +3. Build OPIE Normally, you will need to type: @@ -54,7 +53,7 @@ as-is. make server -5. Verify that OPIE works on your system and install +4. Verify that OPIE works on your system and install Normall, you will need to type: @@ -75,8 +74,8 @@ way things were before. Copyright ========= -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/Makefile.in b/contrib/opie/Makefile.in index 8c7b96da5521..562a613f46a0 100644 --- a/contrib/opie/Makefile.in +++ b/contrib/opie/Makefile.in @@ -1,8 +1,8 @@ ## # Makefile.source and Makefile: Directions for building and installing OPIE. # -# %%% portions-copyright-cmetz -# Portions of this software are Copyright 1996 by Craig Metz, All Rights +# %%% portions-copyright-cmetz-96 +# Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights # Reserved. The Inner Net License Version 2 applies to these portions of # the software. # You should have received a copy of the license with this software. If @@ -15,6 +15,7 @@ # # History: # +# Modified by cmetz for OPIE 2.31. Moved logwtmp.o into libopie. # Modified by cmetz for OPIE 2.3. Removed manual config -- it's # Autoconf or bust. Replaced user configuration options # with options.h. Eliminated unused variables. Pass down @@ -83,8 +84,7 @@ GROUP=bin # # Some sites might want to put this elsewhere. If you want to use an old # S/Key database, you should create a link from /etc/skeykeys to /etc/opiekeys. -STD_KEY_FILE=/etc/opiekeys -EXT_KEY_FILE=/etc/opiekeys.ext +KEY_FILE=/etc/opiekeys # Are we debugging? # @@ -114,6 +114,7 @@ LOCALMAN=@LOCALMAN@ SU=@SU@ ALT_SU=@ALT_SU@ LOGIN=@LOGIN@ +LOCK_DIR=@LOCK_DIR@ BACKUP=opie.old @@ -184,15 +185,15 @@ server-install: server @chgrp $(GROUP) $(FTPD) @echo "Changing file permissions of ftpd" @chmod 0100 $(FTPD) - @echo "Making sure OPIE database files exist" - @touch $(STD_KEY_FILE) $(EXT_KEY_FILE) - @echo "Changing permissions of OPIE database files" - @chmod 0644 $(STD_KEY_FILE) - @chmod 0600 $(EXT_KEY_FILE) - @echo "Changing ownership of OPIE database files" - @$(CHOWN) $(OWNER) $(STD_KEY_FILE) $(EXT_KEY_FILE) - @chgrp $(GROUP) $(STD_KEY_FILE) $(EXT_KEY_FILE) - @-if test ! -z "$(ACCESS_FILE)"; then echo "Creating OPIE access file (don't say we didn't warn you)"; FILE=`echo $(ACCESS_FILE) | sed 's:^-DACCESS_FILE="\(.*\)":\1:'`; touch $$FILE; $(CHOWN) 0 $$FILE; chgrp 0 $$FILE; chmod 0444 $$FILE; fi; + @echo "Making sure OPIE database file exists" + @touch $(KEY_FILE) + @echo "Changing permissions of OPIE database file" + @chmod 0644 $(KEY_FILE) + @echo "Changing ownership of OPIE database file" + @$(CHOWN) $(OWNER) $(KEY_FILE) + @chgrp $(GROUP) $(KEY_FILE) + @-if test ! -z "$(LOCK_DIR)"; then echo "Creating OPIE lock directory"; mkdir $(LOCK_DIR); $(CHOWN) 0 $(LOCK_DIR); chgrp 0 $(LOCK_DIR); chmod 0700 $(LOCK_DIR); fi; + @-if test ! -z "$(ACCESS_FILE)"; then echo "Creating OPIE access file (don't say we didn't warn you)"; touch $(ACCESS_FILE); $(CHOWN) 0 $(ACCESS_FILE); chgrp 0 $(ACCESS_FILE); chmod 0444 $(ACCESS_FILE); fi; @echo "Installing manual pages" @if test ! -d $(LOCALMAN); then $(MKDIR) $(LOCALMAN); chmod 755 $(LOCALMAN); fi @for i in 1 4 5 8; do for j in *.$$i; do if test ! -d $(LOCALMAN)/man$$i; then $(MKDIR) $(LOCALMAN)/man$$i; chmod 755 $(LOCALMAN)/man$$i; fi; cp $$j $(LOCALMAN)/man$$i/$$j; $(CHOWN) $(OWNER) $(LOCALMAN)/man$$i/$$j; chgrp $(GROUP) $(LOCALMAN)/man$$i/$$j; chmod 644 $(LOCALMAN)/man$$i/$$j; done; done @@ -222,7 +223,7 @@ opietest-passed: opietest -./opietest && touch opietest-passed libopie/libopie.a: libopie/*.c *.h - (cd libopie ; $(MAKE) libopie.a CFL='$(CFLAGS) -DSTD_KEY_FILE=\"$(STD_KEY_FILE)\" -DEXT_KEY_FILE=\"$(EXT_KEY_FILE)\"') + (cd libopie ; $(MAKE) libopie.a CFL='$(CFLAGS) -DKEY_FILE=\"$(KEY_FILE)\"') libmissing/libmissing.a: libmissing/*.c (cd libmissing ; $(MAKE) libmissing.a CFL='$(CFLAGS)') @@ -249,8 +250,8 @@ opiegen: opiegen.o $(LDEPS) opieserv: opieserv.o $(LDEPS) $(CC) $(CFLAGS) opieserv.o $(LFLAGS) -o opieserv -opieftpd: opieftpd.o glob.o logwtmp.o popen.o y.tab.o $(LDEPS) - $(CC) $(CFLAGS) opieftpd.o glob.o logwtmp.o popen.o y.tab.o $(LFLAGS) -o opieftpd +opieftpd: opieftpd.o glob.o popen.o y.tab.o $(LDEPS) + $(CC) $(CFLAGS) opieftpd.o glob.o popen.o y.tab.o $(LFLAGS) -o opieftpd opielogin: opielogin.o permsfile.o $(LDEPS) $(CC) $(CFLAGS) opielogin.o permsfile.o $(LFLAGS) -o opielogin diff --git a/contrib/opie/README b/contrib/opie/README index 63b4d8cc4948..28ce401303b8 100644 --- a/contrib/opie/README +++ b/contrib/opie/README @@ -1,5 +1,5 @@ -OPIE Software Distribution, Release 2.3 Important Information -======================================= ===================== +OPIE Software Distribution, Release 2.31 Important Information +======================================== ===================== Introduction ============ @@ -75,6 +75,16 @@ original Bellcore S/Key(tm) Version 1 software: A Glance at What's New ====================== + 2.31 March 20, 1997. + + Removed active attack protection support due to patent problems. + + Moved user locks to a separate directory. + + Moved user-serviceable configuration options to the configure script. + + Lots of portability and bug fixes. + 2.3 September 22, 1996 Autoconf is now the only supported configuration method. @@ -174,6 +184,11 @@ restore the original system programs, but it will not work properly (and can even result in the total loss of the old system programs -- beware!) if the installation procedure itself did not work properly. + If you are running a release version, try installing the latest public +test version (look around). These frequently have already fixed the problem +you are seeing, but may have new problems of their own (that's why they're +test versions!). + OPIE is NOT supported software. We don't promise to support you or even to acknowledge your mail, but we are interested in bug reports and are reasonable folks. We also have an interest in seeing OPIE work on as many @@ -272,9 +287,10 @@ log in via opielogin, but opielogin will decrement their sequence number if a valid response is received. On some systems, the OPIE login program does not always display -a "login:" prompt the first time. We think that this has something to do -with the telnet daemon on those systems. (This is common on SunOS) You should -be able to fix this by upgrading to the latest version of telnetd. +a "login:" prompt the first time. There is a race condition in many older +telnetds that is probably the cause of this problem. This should be fixed by +replacing your telnetd with the latest version of the stock telnetd +(ftp.cray.com:/src/telnet). The standard HPUX compiler is severely drain bamaged. One of the worst parts is that it sometimes won't grok a symbol definition with forward @@ -291,20 +307,54 @@ seed. opielogin is a replacement for /bin/login. It is NOT an OPIE "shell." You can use it as one, but don't be surprised if it doesn't behave the way -you expect. An OPIE "shell" is on the TODO list. +you expect -- we've seen various reports of success and failure when used this +way. An OPIE "shell" is on the TODO list. Clients that use opiegen() will automatically send a re-initialization extended response if the sequence number falls below ten. If the server does not support this, the user will need to log in using opiekey and reset his sequence manually (using opiepasswd). + For reasons that remain very unclear, Solaris passes the login name +from getty/telnetd to login by stuffing it in the terminal input buffer +instead of passing it on the command line like every other *IX. This is just +plain broken. Solaris has other problems with its telnetd and getty; you may +want to consider getting the telnet(d) sources (ftp.cray.com:/src/telnet) +and reasonable getty sources (try sunsite.unc.edu:/pub/Linux/system/Serial, at +least one of agetty, mingetty, and getty_ps should work) and replacing the +Solaris versions with these. OPIE should work *much* more happily with these +programs than the ones that come with Solaris. However, there could be negative +side effects -- this is not a procedure recommended for the faint of heart. An +even more drastic solution more likely to make OPIE happy is to install Linux +or NetBSD on your box ;) + + OPIE is a lot more fussy than it used to be about lock files and where +it puts them. The lock file directory must be a directory used only for OPIE +lock files. It must be a directory, owned by the superuser, and must be mode +0700. + Gripes ====== Is it too much to ask that certain OS vendors just do the right thing -and not fix what isn't broken? (Look at all the ifdefs in the OPIE code and +and not "fix" what isn't broken? (Look at all the ifdefs in the OPIE code and the answer is clear) + utmp and wtmp handling in OPIE has been a very, very sore subject. +Every vendor does things differently, and, of course, most of them swear they +are complying to some or other "standard." My (cmetz) conclusion is that the +only thing that is standard about utmp and wtmp handling is that it will be +nonstandard on any given system. I've tried a lot of things and I've wasted +*a lot* of time on trying to make utmp and wtmp handling work for everybody; +my conclusion is that it will never happen. I personally am willing to stand +behind the code for utmp/wtmp handling on reasonable Linux and 4.4BSD-Lite +systems. If it breaks, tell me and I will fix it. While I am still interested +in hearing about fixes for other OSs, I'm not likely to go out of my way to fix +utmp/wtmp handling on them. If you want it fixed, the best way to do it is to +fix it yourself and give me a patch. As long as the patch is reasonable, I'll +include it in the next release. If you can't wait, use the --disable-utmp +option. + Credits ======= @@ -336,17 +386,22 @@ community effort. These contributors include: Mowgli Assor Lawrie Brown + Andrew Davis Axel Grewe "Hobbit" + Kojima Hajime Darren Hosking Martijn Koster Osamu Kurati Ayamura Kikuchi + Hiroshi Nakano Ikuo Nakagawa Angelo Neri + C. R. Oldham D. Jason Penney John Perkins Jim Simmons + Brad Smith Werner Wiethege Wietse Venema @@ -371,8 +426,8 @@ trademarked by anyone. Copyrights ========== -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/acconfig.h b/contrib/opie/acconfig.h index 27a45c4fd2b7..4c6c61ce2db3 100644 --- a/contrib/opie/acconfig.h +++ b/contrib/opie/acconfig.h @@ -1,7 +1,7 @@ /* acconfig.h: Extra commentary for Autoheader -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -116,3 +116,36 @@ you didn't get a copy, you may request one from <license@inner.net>. /* Define if there is a ut_host field in struct utmp */ #undef HAVE_UT_HOST + +/* Define if the system has getutline() */ +#undef HAVE_GETUTLINE + +/* Defined if the system has SunOS C2 security shadow passwords */ +#undef HAVE_SUNOS_C2_SHADOW + +/* Defined if you want to disable utmp support */ +#undef DISABLE_UTMP + +/* Defined if you want to disable wtmp support */ +#undef DISABLE_WTMP + +/* Defined if you want to allow users to override the insecure checks */ +#undef INSECURE_OVERRIDE + +/* Defined to the default hash value, always defined */ +#undef MDX + +/* Defined if new-style prompts are to be used */ +#undef NEW_PROMPTS + +/* Defined to the path of the OPIE lock directory */ +#undef OPIE_LOCK_DIR + +/* Defined if users are to be asked to re-type secret pass phrases */ +#undef RETYPE + +/* Defined if su should not switch to disabled accounts */ +#undef SU_STAR_CHECK + +/* Defined if user locking is to be used */ +#undef USER_LOCKING diff --git a/contrib/opie/config.h b/contrib/opie/config.h index b01598a8d759..0f6fd1c51533 100644 --- a/contrib/opie/config.h +++ b/contrib/opie/config.h @@ -1,3 +1,6 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + /* Define if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ @@ -40,9 +43,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ @@ -78,6 +81,15 @@ /* The path to the mail spool, if we know it */ #define PATH_MAIL "/var/mail" +/* The path to the utmp file, if we know it */ +#define PATH_UTMP_AC "/var/run/utmp" + +/* The path to the wtmp file, if we know it */ +#define PATH_WTMP_AC "/var/log/wtmp" + +/* The path to the wtmpx file, if we know it */ +/* #undef PATH_WTMPX_AC */ + /* Defined if the system's profile (/etc/profile) displays the motd file */ /* #undef HAVE_MOTD_IN_PROFILE */ @@ -138,6 +150,36 @@ /* Define if there is a ut_host field in struct utmp */ #define HAVE_UT_HOST 1 +/* Define if the system has getutline() */ +/* #undef HAVE_GETUTLINE */ + +/* Defined if the system has SunOS C2 security shadow passwords */ +/* #undef HAVE_SUNOS_C2_SHADOW */ + +/* Defined if you want to disable utmp support */ +/* #undef DISABLE_UTMP */ + +/* Defined if you want to allow users to override the insecure checks */ +/* #undef INSECURE_OVERRIDE */ + +/* Defined to the default hash value, always defined */ +#define MDX 5 + +/* Defined if new-style prompts are to be used */ +#define NEW_PROMPTS 1 + +/* Defined to the path of the OPIE lock directory */ +#define OPIE_LOCK_DIR "/etc/opielocks" + +/* Defined if users are to be asked to re-type secret pass phrases */ +/* #undef RETYPE */ + +/* Defined if su should not switch to disabled accounts */ +/* #undef SU_STAR_CHECK */ + +/* Defined if user locking is to be used */ +#define USER_LOCKING 1 + /* Define if you have the bcopy function. */ /* #undef HAVE_BCOPY */ @@ -159,8 +201,8 @@ /* Define if you have the gethostname function. */ /* #undef HAVE_GETHOSTNAME */ -/* Define if you have the getspent function. */ -/* #undef HAVE_GETSPENT */ +/* Define if you have the getspnam function. */ +/* #undef HAVE_GETSPNAM */ /* Define if you have the gettimeofday function. */ #define HAVE_GETTIMEOFDAY 1 @@ -168,6 +210,9 @@ /* Define if you have the getttynam function. */ #define HAVE_GETTTYNAM 1 +/* Define if you have the getusershell function. */ +#define HAVE_GETUSERSHELL 1 + /* Define if you have the getutxline function. */ /* #undef HAVE_GETUTXLINE */ @@ -180,18 +225,15 @@ /* Define if you have the lstat function. */ #define HAVE_LSTAT 1 +/* Define if you have the on_exit function. */ +/* #undef HAVE_ON_EXIT */ + /* Define if you have the pututxline function. */ /* #undef HAVE_PUTUTXLINE */ /* Define if you have the rindex function. */ /* #undef HAVE_RINDEX */ -/* Define if you have the setegid function. */ -#define HAVE_SETEGID 1 - -/* Define if you have the seteuid function. */ -#define HAVE_SETEUID 1 - /* Define if you have the setgroups function. */ #define HAVE_SETGROUPS 1 @@ -202,7 +244,7 @@ #define HAVE_SETPRIORITY 1 /* Define if you have the setregid function. */ -#define HAVE_SETREGID 1 +/* #undef HAVE_SETREGID */ /* Define if you have the setresgid function. */ /* #undef HAVE_SETRESGID */ @@ -211,32 +253,44 @@ /* #undef HAVE_SETRESUID */ /* Define if you have the setreuid function. */ -#define HAVE_SETREUID 1 +/* #undef HAVE_SETREUID */ /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 +/* Define if you have the sigaddset function. */ +#define HAVE_SIGADDSET 1 + /* Define if you have the sigblock function. */ /* #undef HAVE_SIGBLOCK */ +/* Define if you have the sigemptyset function. */ +#define HAVE_SIGEMPTYSET 1 + /* Define if you have the sigsetmask function. */ /* #undef HAVE_SIGSETMASK */ /* Define if you have the socket function. */ #define HAVE_SOCKET 1 +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 +/* Define if you have the strncasecmp function. */ +#define HAVE_STRNCASECMP 1 + /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 -/* Define if you have the sysconf function. */ -#define HAVE_SYSCONF 1 - /* Define if you have the ttyslot function. */ #define HAVE_TTYSLOT 1 +/* Define if you have the usleep function. */ +#define HAVE_USLEEP 1 + /* Define if you have the <crypt.h> header file. */ /* #undef HAVE_CRYPT_H */ @@ -288,6 +342,9 @@ /* Define if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 +/* Define if you have the <sys/select.h> header file. */ +#define HAVE_SYS_SELECT_H 1 + /* Define if you have the <sys/signal.h> header file. */ #define HAVE_SYS_SIGNAL_H 1 diff --git a/contrib/opie/config.h.in b/contrib/opie/config.h.in index 1fdbff930f12..2d101a5e03da 100644 --- a/contrib/opie/config.h.in +++ b/contrib/opie/config.h.in @@ -42,9 +42,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION @@ -80,6 +80,15 @@ /* The path to the mail spool, if we know it */ #undef PATH_MAIL +/* The path to the utmp file, if we know it */ +#undef PATH_UTMP_AC + +/* The path to the wtmp file, if we know it */ +#undef PATH_WTMP_AC + +/* The path to the wtmpx file, if we know it */ +#undef PATH_WTMPX_AC + /* Defined if the system's profile (/etc/profile) displays the motd file */ #undef HAVE_MOTD_IN_PROFILE @@ -140,6 +149,36 @@ /* Define if there is a ut_host field in struct utmp */ #undef HAVE_UT_HOST +/* Define if the system has getutline() */ +#undef HAVE_GETUTLINE + +/* Defined if the system has SunOS C2 security shadow passwords */ +#undef HAVE_SUNOS_C2_SHADOW + +/* Defined if you want to disable utmp support */ +#undef DISABLE_UTMP + +/* Defined if you want to allow users to override the insecure checks */ +#undef INSECURE_OVERRIDE + +/* Defined to the default hash value, always defined */ +#undef MDX + +/* Defined if new-style prompts are to be used */ +#undef NEW_PROMPTS + +/* Defined to the path of the OPIE lock directory */ +#undef OPIE_LOCK_DIR + +/* Defined if users are to be asked to re-type secret pass phrases */ +#undef RETYPE + +/* Defined if su should not switch to disabled accounts */ +#undef SU_STAR_CHECK + +/* Defined if user locking is to be used */ +#undef USER_LOCKING + /* Define if you have the bcopy function. */ #undef HAVE_BCOPY @@ -161,8 +200,8 @@ /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME -/* Define if you have the getspent function. */ -#undef HAVE_GETSPENT +/* Define if you have the getspnam function. */ +#undef HAVE_GETSPNAM /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY @@ -170,6 +209,9 @@ /* Define if you have the getttynam function. */ #undef HAVE_GETTTYNAM +/* Define if you have the getusershell function. */ +#undef HAVE_GETUSERSHELL + /* Define if you have the getutxline function. */ #undef HAVE_GETUTXLINE @@ -182,18 +224,15 @@ /* Define if you have the lstat function. */ #undef HAVE_LSTAT +/* Define if you have the on_exit function. */ +#undef HAVE_ON_EXIT + /* Define if you have the pututxline function. */ #undef HAVE_PUTUTXLINE /* Define if you have the rindex function. */ #undef HAVE_RINDEX -/* Define if you have the setegid function. */ -#undef HAVE_SETEGID - -/* Define if you have the seteuid function. */ -#undef HAVE_SETEUID - /* Define if you have the setgroups function. */ #undef HAVE_SETGROUPS @@ -218,27 +257,39 @@ /* Define if you have the setvbuf function. */ #undef HAVE_SETVBUF +/* Define if you have the sigaddset function. */ +#undef HAVE_SIGADDSET + /* Define if you have the sigblock function. */ #undef HAVE_SIGBLOCK +/* Define if you have the sigemptyset function. */ +#undef HAVE_SIGEMPTYSET + /* Define if you have the sigsetmask function. */ #undef HAVE_SIGSETMASK /* Define if you have the socket function. */ #undef HAVE_SOCKET +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + /* Define if you have the strftime function. */ #undef HAVE_STRFTIME +/* Define if you have the strncasecmp function. */ +#undef HAVE_STRNCASECMP + /* Define if you have the strstr function. */ #undef HAVE_STRSTR -/* Define if you have the sysconf function. */ -#undef HAVE_SYSCONF - /* Define if you have the ttyslot function. */ #undef HAVE_TTYSLOT +/* Define if you have the usleep function. */ +#undef HAVE_USLEEP + /* Define if you have the <crypt.h> header file. */ #undef HAVE_CRYPT_H @@ -290,6 +341,9 @@ /* Define if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H +/* Define if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + /* Define if you have the <sys/signal.h> header file. */ #undef HAVE_SYS_SIGNAL_H diff --git a/contrib/opie/configure b/contrib/opie/configure index f635e0889d57..04bc30a536fa 100755 --- a/contrib/opie/configure +++ b/contrib/opie/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.10 +# Generated automatically using autoconf version 2.12 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -12,9 +12,29 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --enable-access-file=PATH Use the OPIE access file PATH as a transition aid" + --enable-access-file=FILENAME + Enable the OPIE access file FILENAME" +ac_help="$ac_help + --enable-server-md4 Use MD4 instead of MD5 for the server" +ac_help="$ac_help + --disable-user-locking Disable user locking + --enable-user-locking[=DIR] + Put user lock files in DIR [/etc/opielocks]" +ac_help="$ac_help + --enable-retype Ask users to re-type their secret pass phrases" +ac_help="$ac_help + --enable-su-star-check Refuse to switch to disabled accounts" +ac_help="$ac_help + --disable-new-prompts Use more compatible (but less informative) prompts" +ac_help="$ac_help + --enable-insecure-override + Allow users to override insecure checks" ac_help="$ac_help --enable-anonymous-ftp Enable anonymous FTP support" +ac_help="$ac_help + --disable-utmp Disable utmp logging" +ac_help="$ac_help + --disable-wtmp Disable wtmp logging" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -53,6 +73,8 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -334,7 +356,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.10" + echo "configure generated by autoconf version 2.12" exit 0 ;; -with-* | --with-*) @@ -436,11 +458,14 @@ do done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -502,6 +527,7 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. @@ -526,6 +552,92 @@ EOF echo "Using the access file in $enable_access_file -- don't say we didn't warn you!" fi +ACCESS_FILE="$enable_access_file" + +# Check whether --enable-server-md4 or --disable-server-md4 was given. +if test "${enable_server_md4+set}" = set; then + enableval="$enable_server_md4" + cat >> confdefs.h <<\EOF +#define MDX 4 +EOF + +else + cat >> confdefs.h <<\EOF +#define MDX 5 +EOF + +fi + + +set do_user_locking=1; +# Check whether --enable-user-locking or --disable-user-locking was given. +if test "${enable_user_locking+set}" = set; then + enableval="$enable_user_locking" + : +else + set do_user_locking=0 +fi + +if $do_user_locking; +then + cat >> confdefs.h <<\EOF +#define USER_LOCKING 1 +EOF + + if test -z "$enable_user_locking" + then + cat >> confdefs.h <<\EOF +#define OPIE_LOCK_DIR "/etc/opielocks" +EOF + + else + cat >> confdefs.h <<EOF +#define OPIE_LOCK_DIR "$enable_user_locking" +EOF + + fi +fi +LOCK_DIR="$enable_user_locking" + + +# Check whether --enable-retype or --disable-retype was given. +if test "${enable_retype+set}" = set; then + enableval="$enable_retype" + cat >> confdefs.h <<\EOF +#define RETYPE 1 +EOF + +fi + +# Check whether --enable-su-star-check or --disable-su-star-check was given. +if test "${enable_su_star_check+set}" = set; then + enableval="$enable_su_star_check" + cat >> confdefs.h <<\EOF +#define SU_STAR_CHECK 1 +EOF + +fi + +# Check whether --enable-new-prompts or --disable-new-prompts was given. +if test "${enable_new_prompts+set}" = set; then + enableval="$enable_new_prompts" + : +else + cat >> confdefs.h <<\EOF +#define NEW_PROMPTS 1 +EOF + +fi + +# Check whether --enable-insecure-override or --disable-insecure-override was given. +if test "${enable_insecure_override+set}" = set; then + enableval="$enable_insecure_override" + cat >> confdefs.h <<\EOF +#define INSECURE_OVERRIDE 1 +EOF + +fi + # Check whether --enable-anonymous-ftp or --disable-anonymous-ftp was given. if test "${enable_anonymous_ftp+set}" = set; then enableval="$enable_anonymous_ftp" @@ -535,10 +647,29 @@ EOF echo "Enabling anonymous FTP support in ftp -- don't say we didn't warn you!" fi +# Check whether --enable-utmp or --disable-utmp was given. +if test "${enable_utmp+set}" = set; then + enableval="$enable_utmp" + cat >> confdefs.h <<\EOF +#define DISABLE_UTMP 1 +EOF + echo "Disabling utmp logging" +fi + +# Check whether --enable-wtmp or --disable-wtmp was given. +if test "${enable_wtmp+set}" = set; then + enableval="$enable_wtmp" + cat >> confdefs.h <<\EOF +#define DISABLE_UTMP 1 +EOF + echo "Disabling wtmp logging" +fi + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:673: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -567,6 +698,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:702: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -613,7 +745,47 @@ fi test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext <<EOF +#line 760 "configure" +#include "confdefs.h" +main(){return(0);} +EOF +if { (eval echo configure:764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:784: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:789: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -622,7 +794,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:798: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -630,29 +802,34 @@ fi fi echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + if test $ac_cv_prog_gcc = yes; then GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then + ac_test_CFLAGS="${CFLAGS+set}" + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:813: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo 'void f(){}' > conftest.c if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes + ac_cv_prog_cc_g=yes else - ac_cv_prog_gcc_g=no + ac_cv_prog_cc_g=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-O2" fi else GCC= @@ -660,6 +837,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:841: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -674,33 +852,37 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 678 "configure" +#line 856 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:862: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 693 "configure" +#line 873 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:699: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi @@ -716,6 +898,7 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:902: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -738,6 +921,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:925: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -768,6 +952,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:956: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -798,8 +983,9 @@ test -n "$YACC" || YACC="yacc" echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:987: checking for AIX" >&5 cat > conftest.$ac_ext <<EOF -#line 803 "configure" +#line 989 "configure" #include "confdefs.h" #ifdef _AIX yes @@ -821,6 +1007,7 @@ rm -f conftest* echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1011: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -840,24 +1027,27 @@ else ISC= fi -ac_safe=`echo "minix/config.h" | tr './\055' '___'` +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1033: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 850 "configure" +#line 1038 "configure" #include "confdefs.h" #include <minix/config.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -887,37 +1077,11 @@ EOF fi -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext <<EOF -#line 900 "configure" -#include "confdefs.h" -main(){return(0);} -EOF -{ (eval echo configure:904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_cross=no -else - ac_cv_c_cross=yes -fi -fi -rm -fr conftest* -fi - -echo "$ac_t""$ac_cv_c_cross" 1>&6 -cross_compiling=$ac_cv_c_cross - - # Extract the first word of "chown", so it can be a program name with args. set dummy chown; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CHOWN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -927,7 +1091,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/bin /bin /usr/sbin /sbin /usr/etc /etc; do + for ac_dir in /usr/bin /bin /usr/sbin /sbin /usr/etc /etc$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_CHOWN="$ac_dir/$ac_word" @@ -950,6 +1114,7 @@ fi # Extract the first word of "su", so it can be a program name with args. set dummy su; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1118: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SU'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -959,7 +1124,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/bin /bin; do + for ac_dir in /usr/bin /bin$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SU="$ac_dir/$ac_word" @@ -981,6 +1146,7 @@ fi # Extract the first word of "su", so it can be a program name with args. set dummy su; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1150: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ALT_SU'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -990,7 +1156,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/sbin /sbin; do + for ac_dir in /usr/sbin /sbin$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_ALT_SU="$ac_dir/$ac_word" @@ -1012,6 +1178,7 @@ fi # Extract the first word of "scheme", so it can be a program name with args. set dummy scheme; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1182: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SCHEME'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1021,7 +1188,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/lib/iaf/scheme; do + for ac_dir in /usr/lib/iaf/scheme$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_SCHEME="$ac_dir/$ac_word" @@ -1042,6 +1209,7 @@ fi # Extract the first word of "login", so it can be a program name with args. set dummy login; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1213: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_LOGIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1051,7 +1219,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/bin /bin; do + for ac_dir in /usr/bin /bin$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_LOGIN="$ac_dir/$ac_word" @@ -1079,6 +1247,7 @@ fi # Extract the first word of "ftpd", so it can be a program name with args. set dummy ftpd; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1251: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FTPD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1088,7 +1257,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin; do + for ac_dir in /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_FTPD="$ac_dir/$ac_word" @@ -1109,6 +1278,7 @@ fi # Extract the first word of "in.ftpd", so it can be a program name with args. set dummy in.ftpd; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1282: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_INFTPD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1118,7 +1288,7 @@ else ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin; do + for ac_dir in /usr/libexec /usr/etc /etc /usr/sbin /sbin /usr/lbin$ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_INFTPD="$ac_dir/$ac_word" @@ -1146,6 +1316,7 @@ then fi echo $ac_n "checking for default PATH entries""... $ac_c" 1>&6 +echo "configure:1320: checking for default PATH entries" >&5 default_path="" save_IFS="$IFS" IFS=" " @@ -1176,6 +1347,7 @@ EOF echo "$ac_t""$default_path" 1>&6 echo $ac_n "checking for test -e flag""... $ac_c" 1>&6 +echo "configure:1351: checking for test -e flag" >&5 if sh config.testeflag then result=yes @@ -1188,6 +1360,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for mkdir -p flag""... $ac_c" 1>&6 +echo "configure:1364: checking for mkdir -p flag" >&5 if test -d config.tmpdir then rmdir config.tmpdir/foo/bar >/dev/null 2>/dev/null @@ -1223,6 +1396,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for ls group field""... $ac_c" 1>&6 +echo "configure:1400: checking for ls group field" >&5 lsg=`/bin/ls -ldg / | wc -w | awk '{print $1}'`; ls=`/bin/ls -ld / | wc -w | awk '{print $1}'`; result="no" @@ -1242,6 +1416,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for /etc/default/login""... $ac_c" 1>&6 +echo "configure:1420: checking for /etc/default/login" >&5 if test $EXISTS /etc/default/login then result=yes @@ -1255,6 +1430,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for /etc/securetty""... $ac_c" 1>&6 +echo "configure:1434: checking for /etc/securetty" >&5 if test $EXISTS /etc/securetty then result=yes @@ -1268,6 +1444,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for /etc/logindevperm""... $ac_c" 1>&6 +echo "configure:1448: checking for /etc/logindevperm" >&5 if test $EXISTS /etc/logindevperm then echo "$ac_t""yes" 1>&6 @@ -1279,6 +1456,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for /etc/fbtab""... $ac_c" 1>&6 +echo "configure:1460: checking for /etc/fbtab" >&5 if test $EXISTS /etc/fbtab then result=yes @@ -1293,6 +1471,7 @@ EOF fi echo $ac_n "checking for /etc/environment""... $ac_c" 1>&6 +echo "configure:1475: checking for /etc/environment" >&5 if test $EXISTS /etc/environment then echo "$ac_t""yes" 1>&6 @@ -1304,6 +1483,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for /etc/src.sh""... $ac_c" 1>&6 +echo "configure:1487: checking for /etc/src.sh" >&5 if test $EXISTS /etc/src.sh then result=yes @@ -1318,6 +1498,7 @@ EOF fi echo $ac_n "checking for /etc/shadow""... $ac_c" 1>&6 +echo "configure:1502: checking for /etc/shadow" >&5 if test $EXISTS /etc/shadow then result=yes @@ -1326,11 +1507,26 @@ then EOF else - result=no + echo "$ac_t""no" 1>&6 + + echo $ac_n "checking for /etc/security/passwd.adjunct""... $ac_c" 1>&6 +echo "configure:1514: checking for /etc/security/passwd.adjunct" >&5 + if test $EXISTS /etc/security/passwd.adjunct + then + result=yes + cat >> confdefs.h <<\EOF +#define HAVE_SUNOS_C2_SHADOW 1 +EOF + + LIBOBJS="$LIBOBJS getspnam.o endspent.o" + else + result=no + fi fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for /var/adm/sulog""... $ac_c" 1>&6 +echo "configure:1530: checking for /var/adm/sulog" >&5 if test $EXISTS /var/adm/sulog then result=yes @@ -1344,6 +1540,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking mail spool location""... $ac_c" 1>&6 +echo "configure:1544: checking mail spool location" >&5 mail_spool="" for i in /var/mail /usr/mail /var/spool/mail /usr/spool/mail do @@ -1364,9 +1561,94 @@ EOF fi echo "$ac_t""$result" 1>&6 +echo $ac_n "checking where your system puts the utmp file""... $ac_c" 1>&6 +echo "configure:1566: checking where your system puts the utmp file" >&5 +utmp_path="" +for i in /var/run /var/adm /usr/adm /etc +do + if test $EXISTS $i/utmp + then + utmp_path="$i" + fi +done +if test -z "$utmp_path" +then + result="not found" +else + result="$utmp_path" + cat >> confdefs.h <<EOF +#define PATH_UTMP_AC "$utmp_path/utmp" +EOF + +fi +echo "$ac_t""$result" 1>&6 + +echo $ac_n "checking where your system puts the utmpx file""... $ac_c" 1>&6 +echo "configure:1588: checking where your system puts the utmpx file" >&5 +utmp_path="" +for i in /var/run /var/adm /usr/adm /etc +do + if test $EXISTS $i/utmp + then + utmp_path="$i" + fi +done +if test -z "$utmp_path" +then + result="not found" + cat >> confdefs.h <<EOF +#define PATH_UTMP_AC "$utmp_path/utmpx" +EOF + +fi +echo "$ac_t""$result" 1>&6 + +echo $ac_n "checking where your system puts the wtmp file""... $ac_c" 1>&6 +echo "configure:1608: checking where your system puts the wtmp file" >&5 +wtmp_path="" +for i in /var/run /var/log /var/adm /usr/adm /etc +do + if test $EXISTS $i/wtmp + then + wtmp_path="$i" + fi +done +if test -z "$wtmp_path" +then + result="not found" +else + result="$wtmp_path" + cat >> confdefs.h <<EOF +#define PATH_WTMP_AC "$wtmp_path/wtmp" +EOF + +fi +echo "$ac_t""$result" 1>&6 + +echo $ac_n "checking where your system puts the wtmpx file""... $ac_c" 1>&6 +echo "configure:1630: checking where your system puts the wtmpx file" >&5 +wtmpx_path="" +for i in /var/run /var/log /var/adm /usr/adm /etc +do + if test $EXISTS $i/wtmpx + then + wtmpx_path="$i" + fi +done +if test -z "$wtmpx_path" +then + result="not found" +else + result="$wtmpx_path" + cat >> confdefs.h <<EOF +#define PATH_WTMPX_AC "$wtmpx_path/wtmpx" +EOF +fi +echo "$ac_t""$result" 1>&6 echo $ac_n "checking whether the system profile displays the motd""... $ac_c" 1>&6 +echo "configure:1652: checking whether the system profile displays the motd" >&5 result=no if test $EXISTS /etc/profile then @@ -1385,6 +1667,7 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking whether the system profile checks for mail""... $ac_c" 1>&6 +echo "configure:1671: checking whether the system profile checks for mail" >&5 result=no if test $EXISTS /etc/profile then @@ -1403,15 +1686,15 @@ fi echo "$ac_t""$result" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1690: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1411 "configure" +#line 1695 "configure" #include "confdefs.h" -int main() { return 0; } -int t() { +int main() { /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; @@ -1457,15 +1740,16 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:1461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -1478,123 +1762,129 @@ fi echo $ac_n "checking to see if your compiler can handle void arguments""... $ac_c" 1>&6 +echo "configure:1766: checking to see if your compiler can handle void arguments" >&5 cat > conftest.$ac_ext <<EOF -#line 1483 "configure" +#line 1768 "configure" #include "confdefs.h" foo(void) { } -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_VOIDARG 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if your compiler can handle void return values""... $ac_c" 1>&6 +echo "configure:1790: checking to see if your compiler can handle void return values" >&5 cat > conftest.$ac_ext <<EOF -#line 1506 "configure" +#line 1792 "configure" #include "confdefs.h" void foo() { } -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_VOIDRET 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if your compiler can handle void pointers""... $ac_c" 1>&6 +echo "configure:1814: checking to see if your compiler can handle void pointers" >&5 cat > conftest.$ac_ext <<EOF -#line 1529 "configure" +#line 1816 "configure" #include "confdefs.h" foo() { void *bar = (void *)0x42; bar = bar + 1; } -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1823: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_VOIDPTR 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if your compiler can handle ANSI argument lists""... $ac_c" 1>&6 +echo "configure:1838: checking to see if your compiler can handle ANSI argument lists" >&5 cat > conftest.$ac_ext <<EOF -#line 1552 "configure" +#line 1840 "configure" #include "confdefs.h" int foo(int bar, int baz) { return 0; } -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ANSIDECL 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if your compiler can handle ANSI prototypes""... $ac_c" 1>&6 +echo "configure:1862: checking to see if your compiler can handle ANSI prototypes" >&5 cat > conftest.$ac_ext <<EOF -#line 1575 "configure" +#line 1864 "configure" #include "confdefs.h" extern int foo(int, int); -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ANSIPROTO 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if your compiler can handle ANSI variable arguments""... $ac_c" 1>&6 +echo "configure:1886: checking to see if your compiler can handle ANSI variable arguments" >&5 cat > conftest.$ac_ext <<EOF -#line 1598 "configure" +#line 1888 "configure" #include "confdefs.h" #include <stdarg.h> int foo(int arg, ...) { @@ -1603,30 +1893,31 @@ int foo(int arg, ...) { va_end(ap); return 0; } -int main() { return 0; } -int t() { +int main() { ; return 0; } EOF -if { (eval echo configure:1612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ANSISTDARG 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking to see if you have an ANSI-style sprintf""... $ac_c" 1>&6 +echo "configure:1916: checking to see if you have an ANSI-style sprintf" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""no" 1>&6 else -cat > conftest.$ac_ext <<EOF -#line 1630 "configure" + cat > conftest.$ac_ext <<EOF +#line 1921 "configure" #include "confdefs.h" #include <stdio.h> int main(argc, argv) @@ -1639,42 +1930,48 @@ char *argv[]; return (i == 6) ? 0 : -1; } EOF -{ (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then cat >> confdefs.h <<\EOF #define HAVE_ANSISPRINTF 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* echo "$ac_t""no" 1>&6 fi -fi rm -fr conftest* +fi -echo $ac_n "checking for -lcrypt""... $ac_c" 1>&6 -ac_lib_var=`echo crypt'_'crypt | tr './+\055' '__p_'` + +echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:1951: checking for crypt in -lcrypt" >&5 +ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <<EOF -#line 1663 "configure" +#line 1959 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char crypt(); -int main() { return 0; } -int t() { +int main() { crypt() ; return 0; } EOF -if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:1970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1684,7 +1981,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo crypt | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -1695,30 +1993,32 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for -lnsl""... $ac_c" 1>&6 -ac_lib_var=`echo nsl'_'gethostname | tr './+\055' '__p_'` +echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>&6 +echo "configure:1998: checking for gethostname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <<EOF -#line 1707 "configure" +#line 2006 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostname(); -int main() { return 0; } -int t() { +int main() { gethostname() ; return 0; } EOF -if { (eval echo configure:1719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1728,7 +2028,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -1739,26 +2040,28 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for -lposix""... $ac_c" 1>&6 -ac_lib_var=`echo posix'_'main | tr './+\055' '__p_'` +echo $ac_n "checking for main in -lposix""... $ac_c" 1>&6 +echo "configure:2045: checking for main in -lposix" >&5 +ac_lib_var=`echo posix'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <<EOF -#line 1751 "configure" +#line 2053 "configure" #include "confdefs.h" -int main() { return 0; } -int t() { +int main() { main() ; return 0; } EOF -if { (eval echo configure:1759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1768,7 +2071,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo posix | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo posix | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -1779,30 +2083,32 @@ else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for -lsocket""... $ac_c" 1>&6 -ac_lib_var=`echo socket'_'socket | tr './+\055' '__p_'` +echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +echo "configure:2088: checking for socket in -lsocket" >&5 +ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <<EOF -#line 1791 "configure" +#line 2096 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char socket(); -int main() { return 0; } -int t() { +int main() { socket() ; return 0; } EOF -if { (eval echo configure:1803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1812,7 +2118,8 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <<EOF #define $ac_tr_lib 1 EOF @@ -1827,34 +2134,35 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 +echo "configure:2140: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1837 "configure" +#line 2145 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> -int main() { return 0; } -int t() { +int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=no" fi rm -f conftest* - fi if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -1865,30 +2173,32 @@ fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then -echo $ac_n "checking for -ldir""... $ac_c" 1>&6 -ac_lib_var=`echo dir'_'opendir | tr './+\055' '__p_'` +echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 +echo "configure:2178: checking for opendir in -ldir" >&5 +ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 1877 "configure" +#line 2186 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); -int main() { return 0; } -int t() { +int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1889: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1904,30 +2214,32 @@ else fi else -echo $ac_n "checking for -lx""... $ac_c" 1>&6 -ac_lib_var=`echo x'_'opendir | tr './+\055' '__p_'` +echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 +echo "configure:2219: checking for opendir in -lx" >&5 +ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 1916 "configure" +#line 2227 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir(); -int main() { return 0; } -int t() { +int main() { opendir() ; return 0; } EOF -if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=no" fi @@ -1945,11 +2257,12 @@ fi fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:2261: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1953 "configure" +#line 2266 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -1959,22 +2272,22 @@ else #ifndef WIFEXITED #define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -int main() { return 0; } -int t() { +int main() { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:1970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_sys_wait_h=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 @@ -1985,26 +2298,29 @@ EOF fi -for ac_hdr in crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h +for ac_hdr in crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h sys/select.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2306: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1997 "configure" +#line 2311 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -2012,7 +2328,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <<EOF #define $ac_tr_hdr 1 EOF @@ -2025,85 +2341,89 @@ done echo $ac_n "checking for ut_pid in struct utmp""... $ac_c" 1>&6 +echo "configure:2345: checking for ut_pid in struct utmp" >&5 cat > conftest.$ac_ext <<EOF -#line 2030 "configure" +#line 2347 "configure" #include "confdefs.h" #include <sys/types.h> #include <utmp.h> -int main() { return 0; } -int t() { +int main() { struct utmp foo; return (int)foo.ut_pid; ; return 0; } EOF -if { (eval echo configure:2039: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UT_PID 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking for ut_type in struct utmp""... $ac_c" 1>&6 +echo "configure:2369: checking for ut_type in struct utmp" >&5 cat > conftest.$ac_ext <<EOF -#line 2053 "configure" +#line 2371 "configure" #include "confdefs.h" #include <sys/types.h> #include <utmp.h> -int main() { return 0; } -int t() { +int main() { struct utmp foo; return (int)foo.ut_type; ; return 0; } EOF -if { (eval echo configure:2062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2379: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UT_TYPE 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - echo $ac_n "checking for ut_name in struct utmp""... $ac_c" 1>&6 +echo "configure:2393: checking for ut_name in struct utmp" >&5 cat > conftest.$ac_ext <<EOF -#line 2076 "configure" +#line 2395 "configure" #include "confdefs.h" #include <sys/types.h> #include <utmp.h> -int main() { return 0; } -int t() { +int main() { struct utmp foo; return (int)foo.ut_name[0]; ; return 0; } EOF -if { (eval echo configure:2085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_UT_NAME 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - cat >> confdefs.h <<\EOF #define HAVE_UT_HOST 1 EOF echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:2422: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2107 "configure" +#line 2427 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2116,20 +2436,20 @@ extern "C" void (*signal (int, void (*)(int)))(int); void (*signal ()) (); #endif -int main() { return 0; } -int t() { +int main() { int i; ; return 0; } EOF -if { (eval echo configure:2125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_type_signal=int fi rm -f conftest* - fi echo "$ac_t""$ac_cv_type_signal" 1>&6 @@ -2138,14 +2458,15 @@ cat >> confdefs.h <<EOF EOF -for ac_func in gettimeofday socket strftime strstr setpriority seteuid setreuid setegid setregid setresuid setresgid getttynam sysconf setvbuf getspent endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline +for ac_func in gettimeofday socket strftime strstr setpriority getttynam setvbuf getspnam endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2465: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2149 "configure" +#line 2470 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2155,8 +2476,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2169,16 +2489,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2193,14 +2515,15 @@ done echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_memcmp'+set}'`\" = set"; then +echo "configure:2519: checking for 8-bit clean memcmp" >&5 +if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then - ac_cv_func_memcmp=no + ac_cv_func_memcmp_clean=no else -cat > conftest.$ac_ext <<EOF -#line 2204 "configure" + cat > conftest.$ac_ext <<EOF +#line 2527 "configure" #include "confdefs.h" main() @@ -2210,43 +2533,48 @@ main() } EOF -{ (eval echo configure:2214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_func_memcmp=yes +if { (eval echo configure:2537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + ac_cv_func_memcmp_clean=yes else - ac_cv_func_memcmp=no -fi + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_memcmp_clean=no fi rm -fr conftest* fi -echo "$ac_t""$ac_cv_func_memcmp" 1>&6 -test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o" +fi + +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +echo "configure:2557: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2234 "configure" +#line 2562 "configure" #include "confdefs.h" #include <alloca.h> -int main() { return 0; } -int t() { +int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_cv_header_alloca_h=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_alloca_h=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 @@ -2258,11 +2586,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then +echo "configure:2590: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2266 "configure" +#line 2595 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2281,31 +2610,31 @@ char *alloca (); # endif #endif -int main() { return 0; } -int t() { +int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - ac_cv_func_alloca=yes + ac_cv_func_alloca_works=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_func_alloca=no + ac_cv_func_alloca_works=no fi rm -f conftest* - fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then +echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +if test $ac_cv_func_alloca_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA 1 EOF fi -if test $ac_cv_func_alloca = no; then +if test $ac_cv_func_alloca_works = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, @@ -2317,11 +2646,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +echo "configure:2650: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2325 "configure" +#line 2655 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2346,11 +2676,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2680: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2354 "configure" +#line 2685 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2360,8 +2691,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2374,16 +2704,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<EOF @@ -2399,14 +2731,15 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +echo "configure:2735: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else -cat > conftest.$ac_ext <<EOF -#line 2410 "configure" + cat > conftest.$ac_ext <<EOF +#line 2743 "configure" #include "confdefs.h" find_stack_direction () { @@ -2425,16 +2758,20 @@ main () exit (find_stack_direction() < 0); } EOF -{ (eval echo configure:2429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:2762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then ac_cv_c_stack_direction=1 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_c_stack_direction=-1 fi -fi rm -fr conftest* fi +fi + echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 cat >> confdefs.h <<EOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -2445,11 +2782,12 @@ fi for ac_func in getusershell sigaddset sigemptyset strerror strncasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2786: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2453 "configure" +#line 2791 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2459,8 +2797,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2473,33 +2810,40 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + else echo "$ac_t""no" 1>&6 LIBOBJS="$LIBOBJS ${ac_func}.o" fi - done -MISSING="$LIBOBJS $ALLOCA " + +MISSING="$LIBOBJS $ALLOCA " ; echo $ac_n "checking for atexit""... $ac_c" 1>&6 +echo "configure:2842: checking for atexit" >&5 if eval "test \"`echo '$''{'ac_cv_func_atexit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2503 "configure" +#line 2847 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char atexit(); below. */ @@ -2509,8 +2853,7 @@ else builtin and then its argument prototype would still apply. */ char atexit(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2523,64 +2866,122 @@ atexit(); ; return 0; } EOF -if { (eval echo configure:2527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_atexit=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_atexit=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'atexit`\" = yes"; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 -MISSING="${MISSING}atexit.o " +MISSING="${MISSING}atexit.o "; for ac_func in on_exit +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2890: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2895 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 fi +done -echo $ac_n "checking for entutent""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_entutent'+set}'`\" = set"; then +fi + +echo $ac_n "checking for endutent""... $ac_c" 1>&6 +echo "configure:2945: checking for endutent" >&5 +if eval "test \"`echo '$''{'ac_cv_func_endutent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2550 "configure" +#line 2950 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char entutent(); below. */ + which can conflict with char endutent(); below. */ #include <assert.h> /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char entutent(); +char endutent(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_entutent) || defined (__stub___entutent) +#if defined (__stub_endutent) || defined (__stub___endutent) choke me #else -entutent(); +endutent(); #endif ; return 0; } EOF -if { (eval echo configure:2574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* - eval "ac_cv_func_entutent=yes" + eval "ac_cv_func_endutent=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_entutent=no" + eval "ac_cv_func_endutent=no" fi rm -f conftest* - fi -if eval "test \"`echo '$ac_cv_func_'entutent`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'endutent`\" = yes"; then echo "$ac_t""yes" 1>&6 : else @@ -2589,11 +2990,12 @@ MISSING="${MISSING}endutent.o " fi echo $ac_n "checking for memcpy""... $ac_c" 1>&6 +echo "configure:2994: checking for memcpy" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcpy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2597 "configure" +#line 2999 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memcpy(); below. */ @@ -2603,8 +3005,7 @@ else builtin and then its argument prototype would still apply. */ char memcpy(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2617,16 +3018,18 @@ memcpy(); ; return 0; } EOF -if { (eval echo configure:2621: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_memcpy=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_memcpy=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'memcpy`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2635,11 +3038,12 @@ else MISSING="${MISSING}memcpy.o "; for ac_func in bcopy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3042: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2643 "configure" +#line 3047 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2649,8 +3053,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2663,16 +3066,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2688,11 +3093,12 @@ done fi echo $ac_n "checking for memset""... $ac_c" 1>&6 +echo "configure:3097: checking for memset" >&5 if eval "test \"`echo '$''{'ac_cv_func_memset'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2696 "configure" +#line 3102 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memset(); below. */ @@ -2702,8 +3108,7 @@ else builtin and then its argument prototype would still apply. */ char memset(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2716,16 +3121,18 @@ memset(); ; return 0; } EOF -if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_memset=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_memset=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'memset`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2734,11 +3141,12 @@ else MISSING="${MISSING}memset.o "; for ac_func in bzero do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3145: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2742 "configure" +#line 3150 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2748,8 +3156,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2762,16 +3169,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2787,11 +3196,12 @@ done fi echo $ac_n "checking for getcwd""... $ac_c" 1>&6 +echo "configure:3200: checking for getcwd" >&5 if eval "test \"`echo '$''{'ac_cv_func_getcwd'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2795 "configure" +#line 3205 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getcwd(); below. */ @@ -2801,8 +3211,7 @@ else builtin and then its argument prototype would still apply. */ char getcwd(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2815,16 +3224,18 @@ getcwd(); ; return 0; } EOF -if { (eval echo configure:2819: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_getcwd=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_getcwd=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'getcwd`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -2833,11 +3244,12 @@ else MISSING="${MISSING}getcwd.o "; for ac_func in getwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3248: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2841 "configure" +#line 3253 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2847,8 +3259,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2861,16 +3272,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -2886,11 +3299,12 @@ done fi echo $ac_n "checking for getenv""... $ac_c" 1>&6 +echo "configure:3303: checking for getenv" >&5 if eval "test \"`echo '$''{'ac_cv_func_getenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2894 "configure" +#line 3308 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getenv(); below. */ @@ -2900,8 +3314,7 @@ else builtin and then its argument prototype would still apply. */ char getenv(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2914,16 +3327,18 @@ getenv(); ; return 0; } EOF -if { (eval echo configure:2918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_getenv=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_getenv=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'getenv`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -2936,11 +3351,12 @@ MISSING="${MISSING}env.o " fi echo $ac_n "checking for getutline""... $ac_c" 1>&6 +echo "configure:3355: checking for getutline" >&5 if eval "test \"`echo '$''{'ac_cv_func_getutline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2944 "configure" +#line 3360 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char getutline(); below. */ @@ -2950,8 +3366,7 @@ else builtin and then its argument prototype would still apply. */ char getutline(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -2964,29 +3379,35 @@ getutline(); ; return 0; } EOF -if { (eval echo configure:2968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_getutline=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_getutline=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'getutline`\" = yes"; then echo "$ac_t""yes" 1>&6 - : + cat >> confdefs.h <<\EOF +#define HAVE_GETUTLINE 1 +EOF + else echo "$ac_t""no" 1>&6 MISSING="${MISSING}getutline.o "; for ac_func in ttyslot do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3406: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2990 "configure" +#line 3411 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2996,8 +3417,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3010,16 +3430,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3035,11 +3457,12 @@ done fi echo $ac_n "checking for pututline""... $ac_c" 1>&6 +echo "configure:3461: checking for pututline" >&5 if eval "test \"`echo '$''{'ac_cv_func_pututline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3043 "configure" +#line 3466 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char pututline(); below. */ @@ -3049,8 +3472,7 @@ else builtin and then its argument prototype would still apply. */ char pututline(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3063,16 +3485,18 @@ pututline(); ; return 0; } EOF -if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_pututline=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_pututline=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'pututline`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3081,11 +3505,12 @@ else MISSING="${MISSING}pututline.o "; for ac_func in ttyslot do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3509: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3089 "configure" +#line 3514 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3095,8 +3520,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3109,16 +3533,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3134,11 +3560,12 @@ done fi echo $ac_n "checking for setenv""... $ac_c" 1>&6 +echo "configure:3564: checking for setenv" >&5 if eval "test \"`echo '$''{'ac_cv_func_setenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3142 "configure" +#line 3569 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setenv(); below. */ @@ -3148,8 +3575,7 @@ else builtin and then its argument prototype would still apply. */ char setenv(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3162,16 +3588,18 @@ setenv(); ; return 0; } EOF -if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_setenv=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_setenv=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'setenv`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -3183,12 +3611,268 @@ else MISSING="${MISSING}env.o " fi +echo $ac_n "checking for setegid""... $ac_c" 1>&6 +echo "configure:3616: checking for setegid" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setegid'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3621 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setegid(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setegid(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setegid) || defined (__stub___setegid) +choke me +#else +setegid(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_setegid=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_setegid=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'setegid`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +MISSING="${MISSING}setegid.o "; for ac_func in setregid setresgid +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3664: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3669 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +fi + +echo $ac_n "checking for seteuid""... $ac_c" 1>&6 +echo "configure:3719: checking for seteuid" >&5 +if eval "test \"`echo '$''{'ac_cv_func_seteuid'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3724 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char seteuid(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char seteuid(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_seteuid) || defined (__stub___seteuid) +choke me +#else +seteuid(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_seteuid=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_seteuid=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'seteuid`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +MISSING="${MISSING}seteuid.o "; for ac_func in setreuid setresuid +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3767: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3772 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +fi + +echo $ac_n "checking for setutent""... $ac_c" 1>&6 +echo "configure:3822: checking for setutent" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setutent'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3827 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setutent(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setutent(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setutent) || defined (__stub___setutent) +choke me +#else +setutent(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_setutent=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_setutent=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'setutent`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +MISSING="${MISSING}setutent.o " +fi + echo $ac_n "checking for sigprocmask""... $ac_c" 1>&6 +echo "configure:3871: checking for sigprocmask" >&5 if eval "test \"`echo '$''{'ac_cv_func_sigprocmask'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3192 "configure" +#line 3876 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sigprocmask(); below. */ @@ -3198,8 +3882,7 @@ else builtin and then its argument prototype would still apply. */ char sigprocmask(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3212,16 +3895,18 @@ sigprocmask(); ; return 0; } EOF -if { (eval echo configure:3216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_sigprocmask=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_sigprocmask=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'sigprocmask`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3230,11 +3915,12 @@ else MISSING="${MISSING}sigprocmask.o "; for ac_func in sigblock sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3919: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3238 "configure" +#line 3924 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3244,8 +3930,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3258,16 +3943,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:3947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3283,11 +3970,12 @@ done fi echo $ac_n "checking for strchr""... $ac_c" 1>&6 +echo "configure:3974: checking for strchr" >&5 if eval "test \"`echo '$''{'ac_cv_func_strchr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3291 "configure" +#line 3979 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strchr(); below. */ @@ -3297,8 +3985,7 @@ else builtin and then its argument prototype would still apply. */ char strchr(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3311,16 +3998,18 @@ strchr(); ; return 0; } EOF -if { (eval echo configure:3315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strchr=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_strchr=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'strchr`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3329,11 +4018,12 @@ else MISSING="${MISSING}strchr.o "; for ac_func in index do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4022: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3337 "configure" +#line 4027 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3343,8 +4033,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3357,16 +4046,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3382,11 +4073,12 @@ done fi echo $ac_n "checking for strrchr""... $ac_c" 1>&6 +echo "configure:4077: checking for strrchr" >&5 if eval "test \"`echo '$''{'ac_cv_func_strrchr'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3390 "configure" +#line 4082 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char strrchr(); below. */ @@ -3396,8 +4088,7 @@ else builtin and then its argument prototype would still apply. */ char strrchr(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3410,16 +4101,18 @@ strrchr(); ; return 0; } EOF -if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strrchr=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_strrchr=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'strrchr`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3428,11 +4121,12 @@ else MISSING="${MISSING}strrchr.o "; for ac_func in rindex do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4125: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3436 "configure" +#line 4130 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3442,8 +4136,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3456,16 +4149,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3480,12 +4175,62 @@ done fi +echo $ac_n "checking for strtoul""... $ac_c" 1>&6 +echo "configure:4180: checking for strtoul" >&5 +if eval "test \"`echo '$''{'ac_cv_func_strtoul'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 4185 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char strtoul(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strtoul(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_strtoul) || defined (__stub___strtoul) +choke me +#else +strtoul(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_strtoul=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_strtoul=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'strtoul`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +MISSING="${MISSING}strtoul.o " +fi + echo $ac_n "checking for sysconf""... $ac_c" 1>&6 +echo "configure:4229: checking for sysconf" >&5 if eval "test \"`echo '$''{'ac_cv_func_sysconf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3489 "configure" +#line 4234 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sysconf(); below. */ @@ -3495,8 +4240,7 @@ else builtin and then its argument prototype would still apply. */ char sysconf(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3509,16 +4253,18 @@ sysconf(); ; return 0; } EOF -if { (eval echo configure:3513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_sysconf=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_sysconf=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'sysconf`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3527,11 +4273,12 @@ else MISSING="${MISSING}sysconf.o "; for ac_func in getdtablesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4277: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3535 "configure" +#line 4282 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3541,8 +4288,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3555,16 +4301,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3580,11 +4328,12 @@ done fi echo $ac_n "checking for uname""... $ac_c" 1>&6 +echo "configure:4332: checking for uname" >&5 if eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3588 "configure" +#line 4337 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char uname(); below. */ @@ -3594,8 +4343,7 @@ else builtin and then its argument prototype would still apply. */ char uname(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3608,16 +4356,18 @@ uname(); ; return 0; } EOF -if { (eval echo configure:3612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_uname=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_uname=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'uname`\" = yes"; then echo "$ac_t""yes" 1>&6 : @@ -3626,11 +4376,12 @@ else MISSING="${MISSING}uname.o "; for ac_func in gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4380: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3634 "configure" +#line 4385 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3640,8 +4391,7 @@ else builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3654,16 +4404,18 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -3679,11 +4431,12 @@ done fi echo $ac_n "checking for unsetenv""... $ac_c" 1>&6 +echo "configure:4435: checking for unsetenv" >&5 if eval "test \"`echo '$''{'ac_cv_func_unsetenv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3687 "configure" +#line 4440 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char unsetenv(); below. */ @@ -3693,8 +4446,7 @@ else builtin and then its argument prototype would still apply. */ char unsetenv(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -3707,16 +4459,18 @@ unsetenv(); ; return 0; } EOF -if { (eval echo configure:3711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then +if { (eval echo configure:4463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_unsetenv=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_unsetenv=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'unsetenv`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -3731,8 +4485,9 @@ fi echo $ac_n "checking for nonstandard gettimeofday""... $ac_c" 1>&6 +echo "configure:4489: checking for nonstandard gettimeofday" >&5 cat > conftest.$ac_ext <<EOF -#line 3736 "configure" +#line 4491 "configure" #include "confdefs.h" #if HAVE_SYS_TIME_H @@ -3742,19 +4497,20 @@ cat > conftest.$ac_ext <<EOF #include <unistd.h> #endif /* HAVE_UNISTD_H */ -int main() { return 0; } -int t() { +int main() { struct timeval tv; gettimeofday(&tv, NULL) ; return 0; } EOF -if { (eval echo configure:3752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""no" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""maybe" 1>&6 cat > conftest.$ac_ext <<EOF -#line 3758 "configure" +#line 4514 "configure" #include "confdefs.h" #if HAVE_SYS_TIME_H @@ -3764,28 +4520,27 @@ else #include <unistd.h> #endif /* HAVE_UNISTD_H */ -int main() { return 0; } -int t() { +int main() { struct timeval tv; gettimeofday(&tv) ; return 0; } EOF -if { (eval echo configure:3774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ONE_ARG_GETTIMEOFDAY 1 EOF echo "$ac_t""yes" 1>&6 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* echo "$ac_t""no" 1>&6 fi rm -f conftest* - fi rm -f conftest* - # Munge out LOCALBIN and LOCALMAN in canonical (no bletch) form trap '' 1 2 15 cat > confcache <<\EOF @@ -3804,11 +4559,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -3863,7 +4632,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.10" + echo "$CONFIG_STATUS generated by autoconf version 2.12" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -3903,6 +4672,8 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@ACCESS_FILE@%$ACCESS_FILE%g +s%@LOCK_DIR@%$LOCK_DIR%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@LN_S@%$LN_S%g @@ -3923,20 +4694,56 @@ s%@MISSING@%$MISSING%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <<EOF CONFIG_FILES=\${CONFIG_FILES-"configure.munger libmissing/Makefile libopie/Makefile Makefile.munge:Makefile.in"} EOF cat >> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -3960,6 +4767,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -3968,13 +4776,15 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. @@ -3995,11 +4805,17 @@ ac_eB='$%\1#\2define\3' ac_eC=' ' ac_eD='%g' -CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"} +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS="config.h" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac @@ -4007,7 +4823,8 @@ for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then echo creating $ac_file rm -f conftest.frag conftest.in conftest.out - cp $ac_given_srcdir/$ac_file_in conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in EOF @@ -4035,8 +4852,6 @@ EOF # Break up conftest.vals because some shells have a limit on # the size of here documents, and old seds have small limits too. -# Maximum number of lines to put in a single here document. -ac_max_here_lines=12 rm -f conftest.tail while : @@ -4078,7 +4893,11 @@ cat >> $CONFIG_STATUS <<\EOF fi fi; done +EOF +cat >> $CONFIG_STATUS <<EOF +EOF +cat >> $CONFIG_STATUS <<\EOF exit 0 EOF diff --git a/contrib/opie/configure.in b/contrib/opie/configure.in index 91c1a355a835..475fd57910bf 100644 --- a/contrib/opie/configure.in +++ b/contrib/opie/configure.in @@ -1,7 +1,7 @@ dnl configure.in: Input for Autoconf dnl -dnl %%% portions-copyright-cmetz -dnl Portions of this software are Copyright 1996 by Craig Metz, All Rights +dnl %%% portions-copyright-cmetz-96 +dnl Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights dnl Reserved. The Inner Net License Version 2 applies to these portions of dnl the software. dnl You should have received a copy of the license with this software. If @@ -14,6 +14,14 @@ dnl License Agreement applies to this software. dnl dnl History: dnl +dnl Modified by cmetz for OPIE 2.31. Put back manual utmp[x]/wtmp[x] +dnl checks -- too many OSs can't be trusted to tell us where they are. +dnl Check for sys/select.h. Spell endutent right. Replace strtoul() +dnl if needed. Removed duplicate check for sysconf. Added check for +dnl SunOS C2 shadow passwords (may need more work). Replace +dnl setutent. Added options to disable use of utmp/wtmp. Replace +dnl seteuid and setegid. Check for usleep. Moved options.h options +dnl here as enable/disable options. dnl Modified by cmetz for OPIE 2.3. Removed redundant memset/memcpy. dnl Changed ls -g test around. Changed logindevperm/fbtab defines. dnl Added check for /etc/environment and /etc/src.sh. Check for @@ -34,8 +42,37 @@ dnl Created at NRL for OPIE 2.1. AC_INIT(README) AC_CONFIG_HEADER(config.h) -AC_ARG_ENABLE(access-file, [ --enable-access-file=PATH Use the OPIE access file PATH as a transition aid], AC_DEFINE_UNQUOTED(PATH_ACCESS_FILE, "$enable_access_file") echo "Using the access file in $enable_access_file -- don't say we didn't warn you!") +AC_ARG_ENABLE(access-file, [ --enable-access-file=FILENAME + Enable the OPIE access file FILENAME], AC_DEFINE_UNQUOTED(PATH_ACCESS_FILE, "$enable_access_file") echo "Using the access file in $enable_access_file -- don't say we didn't warn you!") +ACCESS_FILE="$enable_access_file" +AC_SUBST(ACCESS_FILE) +AC_ARG_ENABLE(server-md4, [ --enable-server-md4 Use MD4 instead of MD5 for the server], AC_DEFINE(MDX, 4), AC_DEFINE(MDX, 5)) + +set do_user_locking=1; +AC_ARG_ENABLE(user-locking, [ --disable-user-locking Disable user locking + --enable-user-locking[=DIR] + Put user lock files in DIR [/etc/opielocks]],, set do_user_locking=0) +if $do_user_locking; +then + AC_DEFINE(USER_LOCKING) + if test -z "$enable_user_locking" + then + AC_DEFINE(OPIE_LOCK_DIR, "/etc/opielocks") + else + AC_DEFINE_UNQUOTED(OPIE_LOCK_DIR, "$enable_user_locking") + fi +fi +LOCK_DIR="$enable_user_locking" +AC_SUBST(LOCK_DIR) + +AC_ARG_ENABLE(retype, [ --enable-retype Ask users to re-type their secret pass phrases], AC_DEFINE(RETYPE)) +AC_ARG_ENABLE(su-star-check, [ --enable-su-star-check Refuse to switch to disabled accounts], AC_DEFINE(SU_STAR_CHECK)) +AC_ARG_ENABLE(new-prompts, [ --disable-new-prompts Use more compatible (but less informative) prompts],, AC_DEFINE(NEW_PROMPTS)) +AC_ARG_ENABLE(insecure-override, [ --enable-insecure-override + Allow users to override insecure checks], AC_DEFINE(INSECURE_OVERRIDE)) AC_ARG_ENABLE(anonymous-ftp, [ --enable-anonymous-ftp Enable anonymous FTP support], AC_DEFINE(DOANONYMOUS) echo "Enabling anonymous FTP support in ftp -- don't say we didn't warn you!") +AC_ARG_ENABLE(utmp, [ --disable-utmp Disable utmp logging], AC_DEFINE(DISABLE_UTMP) echo "Disabling utmp logging") +AC_ARG_ENABLE(wtmp, [ --disable-wtmp Disable wtmp logging], AC_DEFINE(DISABLE_UTMP) echo "Disabling wtmp logging") dnl Checks for programs. AC_PROG_CC @@ -48,8 +85,6 @@ AC_AIX AC_ISC_POSIX AC_MINIX -AC_C_CROSS - dnl We'd put PATH in these checks, but it turns out that autoconf doesn't dnl work as documented when it comes to the colon separator... @@ -233,7 +268,17 @@ then result=yes AC_DEFINE(HAVE_ETC_SHADOW) else - result=no + AC_MSG_RESULT(no) + + AC_MSG_CHECKING(for /etc/security/passwd.adjunct) + if test $EXISTS /etc/security/passwd.adjunct + then + result=yes + AC_DEFINE(HAVE_SUNOS_C2_SHADOW) + LIBOBJS="$LIBOBJS getspnam.o endspent.o" + else + result=no + fi fi AC_MSG_RESULT($result) @@ -265,41 +310,75 @@ else fi AC_MSG_RESULT($result) -dnl AC_MSG_CHECKING(where your system puts the utmp file) -dnl utmp_path="" -dnl for i in /var/run /var/adm /usr/adm /etc -dnl do -dnl if test $EXISTS $i/utmp -dnl then -dnl utmp_path="$i" -dnl fi -dnl done -dnl if test -z "$utmp_path" -dnl then -dnl result="not found" -dnl else -dnl result="$utmp_path" -dnl AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmp") -dnl fi -dnl AC_MSG_RESULT($result) - -dnl AC_MSG_CHECKING(where your system puts the wtmp file) -dnl wtmp_path="" -dnl for i in /var/run /var/adm /usr/adm /etc -dnl do -dnl if test $EXISTS $i/wtmp -dnl then -dnl wtmp_path="$i" -dnl fi -dnl done -dnl if test -z "$wtmp_path" -dnl then -dnl result="not found" -dnl else -dnl result="$wtmp_path" -dnl AC_DEFINE_UNQUOTED(PATH_WTMP_AC, "$wtmp_path/wtmp") -dnl fi -dnl AC_MSG_RESULT($result) +AC_MSG_CHECKING(where your system puts the utmp file) +utmp_path="" +for i in /var/run /var/adm /usr/adm /etc +do + if test $EXISTS $i/utmp + then + utmp_path="$i" + fi +done +if test -z "$utmp_path" +then + result="not found" +else + result="$utmp_path" + AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmp") +fi +AC_MSG_RESULT($result) + +AC_MSG_CHECKING(where your system puts the utmpx file) +utmp_path="" +for i in /var/run /var/adm /usr/adm /etc +do + if test $EXISTS $i/utmp + then + utmp_path="$i" + fi +done +if test -z "$utmp_path" +then + result="not found" + AC_DEFINE_UNQUOTED(PATH_UTMP_AC, "$utmp_path/utmpx") +fi +AC_MSG_RESULT($result) + +AC_MSG_CHECKING(where your system puts the wtmp file) +wtmp_path="" +for i in /var/run /var/log /var/adm /usr/adm /etc +do + if test $EXISTS $i/wtmp + then + wtmp_path="$i" + fi +done +if test -z "$wtmp_path" +then + result="not found" +else + result="$wtmp_path" + AC_DEFINE_UNQUOTED(PATH_WTMP_AC, "$wtmp_path/wtmp") +fi +AC_MSG_RESULT($result) + +AC_MSG_CHECKING(where your system puts the wtmpx file) +wtmpx_path="" +for i in /var/run /var/log /var/adm /usr/adm /etc +do + if test $EXISTS $i/wtmpx + then + wtmpx_path="$i" + fi +done +if test -z "$wtmpx_path" +then + result="not found" +else + result="$wtmpx_path" + AC_DEFINE_UNQUOTED(PATH_WTMPX_AC, "$wtmpx_path/wtmpx") +fi +AC_MSG_RESULT($result) AC_MSG_CHECKING(whether the system profile displays the motd) result=no @@ -379,7 +458,7 @@ AC_CHECK_LIB(socket, socket) dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h) +AC_CHECK_HEADERS(crypt.h fcntl.h limits.h termios.h sys/file.h sys/ioctl.h sys/time.h syslog.h unistd.h paths.h shadow.h signal.h sys/signal.h lastlog.h sys/utsname.h pwd.h sys/param.h string.h stdlib.h utmpx.h sys/select.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_TYPE_UID_T @@ -405,25 +484,29 @@ AC_DEFINE(HAVE_UT_HOST) dnl Checks for library functions. dnl AC_PROG_GCC_TRADITIONAL AC_TYPE_SIGNAL -AC_CHECK_FUNCS(gettimeofday socket strftime strstr setpriority seteuid setreuid setegid setregid setresuid setresgid getttynam sysconf setvbuf getspent endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline) +AC_CHECK_FUNCS(gettimeofday socket strftime strstr setpriority getttynam setvbuf getspnam endspent setgroups getgroups fpurge setlogin lstat getutxline pututxline usleep) dnl Libmissing... AC_FUNC_MEMCMP AC_FUNC_ALLOCA AC_REPLACE_FUNCS(getusershell sigaddset sigemptyset strerror strncasecmp) -MISSING="$LIBOBJS $ALLOCA " -AC_CHECK_FUNC(atexit,, MISSING="${MISSING}atexit.o ") -AC_CHECK_FUNC(entutent,, MISSING="${MISSING}endutent.o ") +MISSING="$LIBOBJS $ALLOCA " ; +AC_CHECK_FUNC(atexit,, MISSING="${MISSING}atexit.o "; AC_CHECK_FUNCS(on_exit)) +AC_CHECK_FUNC(endutent,, MISSING="${MISSING}endutent.o ") AC_CHECK_FUNC(memcpy,, MISSING="${MISSING}memcpy.o "; AC_CHECK_FUNCS(bcopy)) AC_CHECK_FUNC(memset,, MISSING="${MISSING}memset.o "; AC_CHECK_FUNCS(bzero)) AC_CHECK_FUNC(getcwd,, MISSING="${MISSING}getcwd.o "; AC_CHECK_FUNCS(getwd)) AC_CHECK_FUNC(getenv, AC_DEFINE(HAVE_GETENV), MISSING="${MISSING}env.o ") -AC_CHECK_FUNC(getutline,, MISSING="${MISSING}getutline.o "; AC_CHECK_FUNCS(ttyslot)) +AC_CHECK_FUNC(getutline, AC_DEFINE(HAVE_GETUTLINE), MISSING="${MISSING}getutline.o "; AC_CHECK_FUNCS(ttyslot)) AC_CHECK_FUNC(pututline,, MISSING="${MISSING}pututline.o "; AC_CHECK_FUNCS(ttyslot)) AC_CHECK_FUNC(setenv, AC_DEFINE(HAVE_SETENV), MISSING="${MISSING}env.o ") +AC_CHECK_FUNC(setegid,, MISSING="${MISSING}setegid.o "; AC_CHECK_FUNCS(setregid setresgid)) +AC_CHECK_FUNC(seteuid,, MISSING="${MISSING}seteuid.o "; AC_CHECK_FUNCS(setreuid setresuid)) +AC_CHECK_FUNC(setutent,, MISSING="${MISSING}setutent.o ") AC_CHECK_FUNC(sigprocmask,, MISSING="${MISSING}sigprocmask.o "; AC_CHECK_FUNCS(sigblock sigsetmask)) AC_CHECK_FUNC(strchr,, MISSING="${MISSING}strchr.o "; AC_CHECK_FUNCS(index)) AC_CHECK_FUNC(strrchr,, MISSING="${MISSING}strrchr.o "; AC_CHECK_FUNCS(rindex)) +AC_CHECK_FUNC(strtoul,, MISSING="${MISSING}strtoul.o ") AC_CHECK_FUNC(sysconf,, MISSING="${MISSING}sysconf.o "; AC_CHECK_FUNCS(getdtablesize)) AC_CHECK_FUNC(uname,, MISSING="${MISSING}uname.o "; AC_CHECK_FUNCS(gethostname)) AC_CHECK_FUNC(unsetenv, AC_DEFINE(HAVE_UNSETENV), MISSING="${MISSING}env.o ") diff --git a/contrib/opie/ftpcmd.y b/contrib/opie/ftpcmd.y index 10ef24f6a3f8..ed1e71003c82 100644 --- a/contrib/opie/ftpcmd.y +++ b/contrib/opie/ftpcmd.y @@ -1,7 +1,7 @@ /* ftpcmd.y: yacc parser for the FTP daemon. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -1226,6 +1226,7 @@ VOIDRET help FUNCTION((ctab, s), struct tab *ctab AND char *s) printf("\r\n"); } (void) fflush(stdout); + reply(214, " "); return; } upper(s); diff --git a/contrib/opie/glob.c b/contrib/opie/glob.c index 342aa924310d..58f58f3ee82d 100644 --- a/contrib/opie/glob.c +++ b/contrib/opie/glob.c @@ -1,7 +1,7 @@ /* glob.c: The csh et al glob pattern matching routines. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libmissing/Makefile.in b/contrib/opie/libmissing/Makefile.in index e00ead375d29..1e26e64fff50 100644 --- a/contrib/opie/libmissing/Makefile.in +++ b/contrib/opie/libmissing/Makefile.in @@ -1,8 +1,8 @@ ## # Makefile.in/Makefile: Directions for building libmissing. # -# %%% copyright-cmetz -# This software is Copyright 1996 by Craig Metz, All Rights Reserved. +# %%% copyright-cmetz-96 +# This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. # The Inner Net License Version 2 applies to this software. # You should have received a copy of the license with this software. If # you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libmissing/endutent.c b/contrib/opie/libmissing/endutent.c index 4a4051cdcfa2..6e863218cd2d 100644 --- a/contrib/opie/libmissing/endutent.c +++ b/contrib/opie/libmissing/endutent.c @@ -1,18 +1,19 @@ /* endutent.c: A replacement for the endutent function -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Use VOIDRET macro. Created by cmetz for OPIE 2.3. */ #include "opie_cfg.h" #include "opie.h" -void endutent FUNCTION_NOARGS +VOIDRET endutent FUNCTION_NOARGS { } diff --git a/contrib/opie/libmissing/getutline.c b/contrib/opie/libmissing/getutline.c index 965395008d24..0ceb76b804a8 100644 --- a/contrib/opie/libmissing/getutline.c +++ b/contrib/opie/libmissing/getutline.c @@ -1,13 +1,16 @@ /* getutline.c: A replacement for the getutline() function -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. If the OS won't tell us where + _PATH_UTMP is, play the SVID game, then use + Autoconf-discovered values. Created by cmetz for OPIE 2.3. */ @@ -18,6 +21,14 @@ you didn't get a copy, you may request one from <license@inner.net>. static struct utmp u; +#ifndef _PATH_UTMP +#ifdef UTMP_FILE +#define _PATH_UTMP UTMP_FILE +#else /* UTMP_FILE */ +#define _PATH_UTMP PATH_UTMP_AC +#endif /* UTMP_FILE */ +#endif /* _PATH_UTMP */ + struct utmp *getutline FUNCTION((utmp), struct utmp *utmp) { FILE *f; diff --git a/contrib/opie/libmissing/pututline.c b/contrib/opie/libmissing/pututline.c index 62da45892a7e..2b79608b9dfe 100644 --- a/contrib/opie/libmissing/pututline.c +++ b/contrib/opie/libmissing/pututline.c @@ -1,13 +1,15 @@ /* pututline.c: A replacement for the pututline() function -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. If the OS won't tell us where + _PATH_UTMP is, use Autoconf-discovered values. Created by cmetz for OPIE 2.3. */ @@ -16,6 +18,10 @@ you didn't get a copy, you may request one from <license@inner.net>. #include <utmp.h> #include "opie.h" +#ifndef _PATH_UTMP +#define _PATH_UTMP PATH_UTMP_AC +#endif /* _PATH_UTMP */ + void pututline FUNCTION((utmp), struct utmp *utmp) { FILE *f; diff --git a/contrib/opie/libopie/Makefile.in b/contrib/opie/libopie/Makefile.in index 99ab4e7f434b..17ca82906961 100644 --- a/contrib/opie/libopie/Makefile.in +++ b/contrib/opie/libopie/Makefile.in @@ -1,15 +1,18 @@ ## # Makefile.in/Makefile: Directions for building libopie. # -# This software is Copyright 1996 by Craig Metz, All Rights Reserved. The Inner -# Net Copyright Notice and License Agreement version 2.00 applies to this -# software. +# %%% copyright-cmetz-96 +# This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. +# The Inner Net License Version 2 applies to this software. +# You should have received a copy of the license with this software. If +# you didn't get a copy, you may request one from <license@inner.net>. # # History: # +# Modified by cmetz for OPIE 2.31. Added logwtmp.o # Created by cmetz for OPIE 2.3 using old Makefiles as a guide. -OBJS=md4c.o md5c.o atob8.o btoa8.o btoh.o challenge.o getsequence.o hash.o hashlen.o keycrunch.o lock.o lookup.o newseed.o parsechallenge.o passcheck.o passwd.o randomchallenge.o readpass.o unlock.o verify.o version.o btoe.o accessfile.o generator.o insecure.o getutmpentry.o readrec.o writerec.o login.o open.o +OBJS=md4c.o md5c.o atob8.o btoa8.o btoh.o challenge.o getsequence.o hash.o hashlen.o keycrunch.o lock.o lookup.o newseed.o parsechallenge.o passcheck.o passwd.o randomchallenge.o readpass.o unlock.o verify.o version.o btoe.o accessfile.o generator.o insecure.o getutmpentry.o readrec.o writerec.o login.o open.o logwtmp.o # sha.o CC=@CC@ CFLAGS=$(CFL) -I.. diff --git a/contrib/opie/libopie/accessfile.c b/contrib/opie/libopie/accessfile.c index 7b1866ebca27..39e3d827663a 100644 --- a/contrib/opie/libopie/accessfile.c +++ b/contrib/opie/libopie/accessfile.c @@ -1,8 +1,8 @@ /* accessfile.c: Handle trusted network access file and per-user overrides. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -15,6 +15,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Include syslog.h on debug. Modified by cmetz for OPIE 2.3. Send debug info to syslog. Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. Ifdef around some headers. Remove extra semicolon. @@ -42,6 +43,10 @@ License Agreement applies to this software. #include <stdlib.h> #endif /* HAVE_STDLIB_H */ +#ifdef DEBUG +#include <syslog.h> +#endif /* DEBUG */ + #include "opie.h" int opieaccessfile FUNCTION((host), char *host) diff --git a/contrib/opie/libopie/atob8.c b/contrib/opie/libopie/atob8.c index 2c2347812e52..d548ef987b31 100644 --- a/contrib/opie/libopie/atob8.c +++ b/contrib/opie/libopie/atob8.c @@ -1,7 +1,7 @@ /* atob8.c: The opieatob8() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/btoa8.c b/contrib/opie/libopie/btoa8.c index 8696a7488114..7e53d409d416 100644 --- a/contrib/opie/libopie/btoa8.c +++ b/contrib/opie/libopie/btoa8.c @@ -1,7 +1,7 @@ /* btoa8.c: The opiebtoa8() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/btoe.c b/contrib/opie/libopie/btoe.c index e402e69c7ba3..7cd7c290e59e 100644 --- a/contrib/opie/libopie/btoe.c +++ b/contrib/opie/libopie/btoe.c @@ -2,8 +2,8 @@ Conversion to/from the six-English-word representation of a 64 bit OTP. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/btoh.c b/contrib/opie/libopie/btoh.c index 68cf75f1e787..11e3c5d1f578 100644 --- a/contrib/opie/libopie/btoh.c +++ b/contrib/opie/libopie/btoh.c @@ -1,7 +1,7 @@ /* btoh.c: The opiebtoh() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/challenge.c b/contrib/opie/libopie/challenge.c index d67d49523ee8..a52e5fafb3eb 100644 --- a/contrib/opie/libopie/challenge.c +++ b/contrib/opie/libopie/challenge.c @@ -1,7 +1,7 @@ /* challenge.c: The opiechallenge() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/generator.c b/contrib/opie/libopie/generator.c index ccd67c7532f4..02167bf4ba65 100644 --- a/contrib/opie/libopie/generator.c +++ b/contrib/opie/libopie/generator.c @@ -1,7 +1,7 @@ /* generator.c: The opiegenerator() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -9,6 +9,9 @@ you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Renamed "init" to "init-hex". + Removed active attack protection support. Fixed fairly + bug in how init response was computed (i.e., dead wrong). Modified by cmetz for OPIE 2.3. Use _opieparsechallenge(). ifdef around string.h. Output hex responses by default, output OTP re-init extended responses (same secret) if sequence @@ -51,12 +54,16 @@ int opiegenerator FUNCTION((buffer, secret, response), char *buffer AND char *se if (i = opiekeycrunch(algorithm, key, seed, secret)) return i; + if (sequence < 10) { char newseed[OPIE_SEED_MAX + 1]; - char newkey[8], cko[8], ckn[8], ckxor[8], cv[8]; + char newkey[8]; char *c; char buf[OPIE_SEED_MAX + 48 + 1]; + while (sequence-- != 0) + opiehash(key, algorithm); + if (opienewseed(strcpy(newseed, seed)) < 0) return -1; @@ -66,43 +73,15 @@ int opiegenerator FUNCTION((buffer, secret, response), char *buffer AND char *se for (i = 0; i < 499; i++) opiehash(newkey, algorithm); - if (opiekeycrunch(algorithm | 0x10, cko, seed, secret)) - return -1; - - if (opiekeycrunch(algorithm | 0x10, ckn, newseed, secret)) - return -1; - - for (i = 0; i < 8; i++) - ckxor[i] = cko[i] ^ ckn[i]; - - strcpy(response, "init:"); + strcpy(response, "init-hex:"); strcat(response, opiebtoh(buf, key)); sprintf(buf, ":%s 499 %s:", algids[algorithm], newseed); strcat(response, buf); strcat(response, opiebtoh(buf, newkey)); - strcat(response, ":"); - strcat(response, opiebtoh(buf, ckxor)); - strcat(response, ":"); - - c = buf; - memcpy(c, ckn, sizeof(ckn)); c += sizeof(ckn); - memcpy(c, key, sizeof(key)); c += sizeof(key); -#ifdef HAVE_ANSISPRINTF - c += sprintf(c, "%s 499 %s", algids[algorithm], newseed); -#else /* HAVE_ANSISPRINTF */ - sprintf(c, "%s 499 %s", algids[algorithm], newseed); - while(*c) c++; -#endif /* HAVE_ANSISPRINTF */ - memcpy(c, newkey, sizeof(newkey)); c += sizeof(newkey); - memcpy(c, ckxor, sizeof(ckxor)); c += sizeof(ckxor); - memcpy(c, ckn, sizeof(ckn)); c += sizeof(ckn); - opiehashlen(algorithm, buf, cv, (unsigned int)c - (unsigned int)buf); - - strcat(response, opiebtoh(buf, cv)); } else { while (sequence-- != 0) opiehash(key, algorithm); - + opiebtoh(response, key); } diff --git a/contrib/opie/libopie/getsequence.c b/contrib/opie/libopie/getsequence.c index f0a6e782bdcf..44a34cee1746 100644 --- a/contrib/opie/libopie/getsequence.c +++ b/contrib/opie/libopie/getsequence.c @@ -1,7 +1,7 @@ /* getsequence.c: The opiegetsequence() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/getutmpentry.c b/contrib/opie/libopie/getutmpentry.c index 8013f87e4885..1c9ed0ff3aae 100644 --- a/contrib/opie/libopie/getutmpentry.c +++ b/contrib/opie/libopie/getutmpentry.c @@ -1,13 +1,14 @@ /* getutmpentry.c: The __opiegetutmpentry() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Cache result. Created by cmetz for OPIE 2.3 (re-write). */ @@ -18,6 +19,7 @@ you didn't get a copy, you may request one from <license@inner.net>. #if DOUTMPX #include <utmpx.h> +#define setutent setutxent #define getutline(x) getutxline(x) #define utmp utmpx #endif /* DOUTMPX */ @@ -31,30 +33,40 @@ you didn't get a copy, you may request one from <license@inner.net>. #endif /* DEBUG */ #include "opie.h" -#if !HAVE_GETUTLINE +#if !HAVE_GETUTLINE && !DOUTMPX struct utmp *getutline __P((struct utmp *)); -#endif /* HAVE_GETUTLINE */ +#endif /* HAVE_GETUTLINE && !DOUTMPX */ + +static struct utmp u; int __opiegetutmpentry FUNCTION((line, utmp), char *line AND struct utmp *utmp) { - struct utmp u, *pu; + struct utmp *pu; + + if (u.ut_line[0]) { + pu = &u; + goto gotit; + }; memset(&u, 0, sizeof(u)); if (!strncmp(line, "/dev/", 5)) { strncpy(u.ut_line, line + 5, sizeof(u.ut_line)); + setutent(); if ((pu = getutline(&u))) goto gotit; #ifdef hpux strcpy(u.ut_line, "pty/"); strncpy(u.ut_line + 4, line + 5, sizeof(u.ut_line) - 4); + setutent(); if ((pu = getutline(&u))) goto gotit; #endif /* hpux */ } strncpy(u.ut_line, line, sizeof(u.ut_line)); + setutent(); if ((pu = getutline(&u))) goto gotit; diff --git a/contrib/opie/libopie/hash.c b/contrib/opie/libopie/hash.c index 4029fa9313e9..4b72d6b4834b 100644 --- a/contrib/opie/libopie/hash.c +++ b/contrib/opie/libopie/hash.c @@ -1,24 +1,24 @@ /* hash.c: The opiehash() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Updated by cmetz for OPIE 2.31. Added SHA support (which may + not be correct). Backed out previous optimizations as + they killed thread-safety. Created by cmetz for OPIE 2.3 using the old hash.c as a guide. */ #include "opie_cfg.h" -#include "opie.h" - -static struct opiemdx_ctx mdx; -static UINT4 mdx_tmp[4]; #if 0 -static SHA_INFO sha; +#include "sha.h" #endif /* 0 */ +#include "opie.h" VOIDRET opiehash FUNCTION((x, algorithm), VOIDPTR x AND unsigned algorithm) { @@ -27,26 +27,39 @@ VOIDRET opiehash FUNCTION((x, algorithm), VOIDPTR x AND unsigned algorithm) switch(algorithm) { #if 0 case 3: - sha_init(&sha); - sha_update(&sha, (BYTE *)x, 8); - sha_final(&sha); - results[0] = sha.digest[0] ^ sha.digest[2] ^ sha.digest[4]; - results[1] = sha.digest[1] ^ sha.digest[3] ^ sha.digest[5]; + { + SHA_CTX sha; + SHAInit(&sha); + SHAUpdate(&sha, (unsigned char *)x, 8); + SHAFinal(&sha); + results[0] = sha.buffer[0] ^ sha.buffer[2] ^ sha.buffer[4]; + results[1] = sha.buffer[1] ^ sha.buffer[3]; + }; break; #endif /* 0 */ case 4: + { + struct opiemdx_ctx mdx; + UINT4 mdx_tmp[4]; + opiemd4init(&mdx); opiemd4update(&mdx, (unsigned char *)x, 8); opiemd4final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; + }; break; case 5: + { + struct opiemdx_ctx mdx; + UINT4 mdx_tmp[4]; + opiemd5init(&mdx); opiemd5update(&mdx, (unsigned char *)x, 8); opiemd5final((unsigned char *)mdx_tmp, &mdx); results[0] = mdx_tmp[0] ^ mdx_tmp[2]; results[1] = mdx_tmp[1] ^ mdx_tmp[3]; + }; break; } } diff --git a/contrib/opie/libopie/hashlen.c b/contrib/opie/libopie/hashlen.c index 110eef4038b3..f1463d2d8d23 100644 --- a/contrib/opie/libopie/hashlen.c +++ b/contrib/opie/libopie/hashlen.c @@ -1,7 +1,7 @@ /* hashlen.c: The opiehashlen() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/insecure.c b/contrib/opie/libopie/insecure.c index afab006768fb..999d6e783261 100644 --- a/contrib/opie/libopie/insecure.c +++ b/contrib/opie/libopie/insecure.c @@ -1,7 +1,7 @@ /* insecure.c: The opieinsecure() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Fixed a logic bug. Call endut[x]ent(). Modified by cmetz for OPIE 2.3. Added result caching. Use __opiegetutmpentry(). Ifdef around ut_host check. Eliminate unused variable. @@ -37,6 +38,7 @@ License Agreement applies to this software. #if DOUTMPX #include <utmpx.h> #define utmp utmpx +#define endutent endutxent #endif /* DOUTMPX */ #if HAVE_SYS_UTSNAME_H @@ -45,6 +47,8 @@ License Agreement applies to this software. #include "opie.h" +char *remote_terms[] = { "xterm", "xterms", "kterm", NULL }; + int opieinsecure FUNCTION_NOARGS { #ifndef NO_INSECURE_CHECK @@ -89,7 +93,7 @@ int opieinsecure FUNCTION_NOARGS int n2 = s - display_name; if (n < n2) n2 = n; - if (!strncmp(utsname.nodename, display_name, n)) + if (!strncmp(utsname.nodename, display_name, n2)) insecure = 0; } /* endif display_name is '.' */ } /* endif hostname != display_name */ @@ -106,12 +110,19 @@ int opieinsecure FUNCTION_NOARGS with an rlogin or telnet to our system. If it were a local xterm, then the DISPLAY environment variable would have to exist. rja */ - if (!display_name && !term_name && !strcmp("xterm", term_name)) - return (result = 1); + if (!display_name && term_name) { + int i; + for (i = 0; remote_terms[i]; i++) + if (!strcmp(term_name, remote_terms[i])) + return (result = 1); + }; #if HAVE_UT_HOST memset(&utmp, 0, sizeof(struct utmp)); - if (!__opiegetutmpentry(ttyname(0), &utmp) && utmp.ut_host[0]) { + { + int i = __opiegetutmpentry(ttyname(0), &utmp); + endutent(); + if (!i && utmp.ut_host[0]) { insecure = 1; if (s = strchr(utmp.ut_host, ':')) { @@ -135,6 +146,7 @@ int opieinsecure FUNCTION_NOARGS } } } + }; #endif /* HAVE_UT_HOST */ if (insecure) return (result = 1); diff --git a/contrib/opie/libopie/keycrunch.c b/contrib/opie/libopie/keycrunch.c index 7df86d9139aa..fccdc3c2b1cc 100644 --- a/contrib/opie/libopie/keycrunch.c +++ b/contrib/opie/libopie/keycrunch.c @@ -1,7 +1,7 @@ /* keycrunch.c: The opiekeycrunch() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/lock.c b/contrib/opie/libopie/lock.c index d6ea56e98ced..40999dea08f5 100644 --- a/contrib/opie/libopie/lock.c +++ b/contrib/opie/libopie/lock.c @@ -1,7 +1,7 @@ /* lock.c: The opielock() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,8 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Put locks in a separate dir. + Bug fixes. Modified by cmetz for OPIE 2.3. Do refcounts whether or not we actually lock. Fixed USER_LOCKING=0 case. Modified by cmetz for OPIE 2.22. Added reference count for locks. @@ -33,12 +35,19 @@ License Agreement applies to this software. #if HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ +#include <sys/stat.h> +#include <syslog.h> #include <fcntl.h> #if HAVE_STDLIB_H #include <stdlib.h> #endif /* HAVE_STDLIB_H */ +#include <errno.h> #include "opie.h" +#if !HAVE_LSTAT +#define lstat(x, y) stat(x, y) +#endif /* !HAVE_LSTAT */ + int __opie_lockrefcount = 0; #if USER_LOCKING @@ -75,22 +84,70 @@ int opielock FUNCTION((principal), char *principal) #if USER_LOCKING int fh, waits = 0, rval = -1, pid, t, i; char buffer[128], buffer2[128], *c, *c2; + struct stat statbuf[2]; + + if (getuid() && geteuid()) { +#if DEBUG + syslog(LOG_DEBUG, "opielock: requires superuser priveleges"); +#endif /* DEBUG */ + return -1; + }; if (__opie_lockfilename) { __opie_lockrefcount++; return 0; } - if (!(__opie_lockfilename = (char *)malloc(sizeof(OPIE_LOCK_PREFIX) + strlen(principal)))) + if (!(__opie_lockfilename = (char *)malloc(sizeof(OPIE_LOCK_DIR) + 1 + strlen(principal)))) + return -1; + + strcpy(__opie_lockfilename, OPIE_LOCK_DIR); + + if (mkdir(__opie_lockfilename, 0700) < 0) + if (errno != EEXIST) + return -1; + + if (lstat(__opie_lockfilename, &statbuf[0]) < 0) + return -1; + + if (statbuf[0].st_uid) { +#if DEBUG + syslog(LOG_DEBUG, "opielock: %s isn't owned by the superuser.", __opie_lockfilename); +#endif /* DEBUG */ + return -1; + }; + + if (!S_ISDIR(statbuf[0].st_mode)) { +#if DEBUG + syslog(LOG_DEBUG, "opielock: %s isn't a directory.", __opie_lockfilename); +#endif /* DEBUG */ + return -1; + }; + + if ((statbuf[0].st_mode & 0777) != 00700) { +#if DEBUG + syslog(LOG_DEBUG, "opielock: permissions on %s are not correct.", __opie_lockfilename); +#endif /* DEBUG */ return -1; + }; - strcpy(__opie_lockfilename, OPIE_LOCK_PREFIX); + strcat(__opie_lockfilename, "/"); strcat(__opie_lockfilename, principal); - fh = 0; - while (!fh) + fh = -1; + while (fh < 0) { + if (!lstat(__opie_lockfilename, &statbuf[0])) + if (!S_ISREG(statbuf[0].st_mode)) + goto lockret; + if ((fh = open(__opie_lockfilename, O_WRONLY | O_CREAT | O_EXCL, 0600)) < 0) { - if ((fh = open(__opie_lockfilename, O_RDWR, 0600)) < 0) + if (lstat(__opie_lockfilename, &statbuf[1]) < 0) + goto lockret; + if (statbuf[0].st_ino != statbuf[1].st_ino) + goto lockret; + if (statbuf[0].st_mode != statbuf[1].st_mode) + goto lockret; + if ((fh = open(__opie_lockfilename, O_RDONLY, 0600)) < 0) goto lockret; if ((i = read(fh, buffer, sizeof(buffer))) <= 0) goto lockret; @@ -114,7 +171,7 @@ int opielock FUNCTION((principal), char *principal) if (!(t = atoi(c))) break; - if ((time(0) + OPIE_LOCK_TIMEOUT) < t) + if ((t + OPIE_LOCK_TIMEOUT) < time(0)) break; if (kill(pid, 0)) @@ -128,6 +185,14 @@ int opielock FUNCTION((principal), char *principal) goto lockret; }; }; + }; + + if (lstat(__opie_lockfilename, &statbuf[0]) < 0) + goto lockret; + if (fstat(fh, &statbuf[1]) < 0) + goto lockret; + if (!S_ISREG(statbuf[0].st_mode) || (statbuf[0].st_mode != statbuf[1].st_mode) || (statbuf[0].st_ino != statbuf[1].st_ino)) + goto lockret; sprintf(buffer, "%d\n%d\n", getpid(), time(0)); i = strlen(buffer) + 1; @@ -165,8 +230,12 @@ int opielock FUNCTION((principal), char *principal) atexit(opieunlockaeh); lockret: - if (fh) + if (fh >= 0) close(fh); + if (!__opie_lockrefcount) { + free (__opie_lockfilename); + __opie_lockfilename = NULL; + }; return rval; #else /* USER_LOCKING */ __opie_lockrefcount++; diff --git a/contrib/opie/libopie/login.c b/contrib/opie/libopie/login.c index d70280fbf8df..f7082c900cba 100644 --- a/contrib/opie/libopie/login.c +++ b/contrib/opie/libopie/login.c @@ -1,13 +1,18 @@ /* login.c: The opielogin() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. If the OS won't tell us where + _PATH_WTMP[X] is, try playing the SVID game, then use + Autoconf-discovered values. Fixed gettimeofday() call + and updwtmpx() call. Call endutxent for utmpx. Added + DISABLE_UTMP. Created by cmetz for OPIE 2.3. */ @@ -19,6 +24,7 @@ you didn't get a copy, you may request one from <license@inner.net>. #if DOUTMPX #include <utmpx.h> #define pututline(x) pututxline(x) +#define endutent endutxent #define utmp utmpx #endif /* DOUTMPX */ @@ -37,6 +43,7 @@ int opielogin FUNCTION((line, name, host), char *line AND char *name AND char *h struct utmp u; int rval = 0; +#if !DISABLE_UTMP if (__opiegetutmpentry(line, &u)) { #if DEBUG syslog(LOG_DEBUG, "opielogin: __opiegetutmpentry(line=%s, &u) failed", line); @@ -60,21 +67,21 @@ int opielogin FUNCTION((line, name, host), char *line AND char *name AND char *h #if HAVE_UT_NAME strncpy(u.ut_name, name, sizeof(u.ut_name)); - u.ut_name[sizeof(u.ut_name)] = 0; + u.ut_name[sizeof(u.ut_name)-1] = 0; #else /* HAVE_UT_NAME */ #error No ut_name field in struct utmp? (Please send in a bug report) #endif /* HAVE_UT_NAME */ #if HAVE_UT_HOST strncpy(u.ut_host, host, sizeof(u.ut_host)); - u.ut_host[sizeof(u.ut_host)] = 0; + u.ut_host[sizeof(u.ut_host)-1] = 0; #endif /* HAVE_UT_HOST */ #if DOUTMPX #ifdef HAVE_ONE_ARG_GETTIMEOFDAY - gettimeofday(&u->ut_tv); + gettimeofday(&u.ut_tv); #else /* HAVE_ONE_ARG_GETTIMEOFDAY */ - gettimeofday(&u->ut_tv, NULL); + gettimeofday(&u.ut_tv, NULL); #endif /* HAVE_ONE_ARG_GETTIMEOFDAY */ #else /* DOUTMPX */ time(&u.ut_time); @@ -86,36 +93,11 @@ int opielogin FUNCTION((line, name, host), char *line AND char *name AND char *h #if DEBUG syslog(LOG_DEBUG, "opielogin: utmp suceeded"); #endif /* DEBUG */ +#endif /* !DISABLE_UTMP */ dowtmp: - { - FILE *f; - -#if DOUTMPX - updutmpx(_PATH_WTMPX, &u); -#else /* DOUTMPX */ - if (!(f = __opieopen(_PATH_WTMP, 2, 0664))) { - rval = -1; -#if DEBUG - syslog(LOG_DEBUG, "opielogin: wtmp open failed: %s (%d)", strerror(errno), errno); -#endif /* DEBUG */ - goto dosetlogin; - } - - if (fwrite(&u, sizeof(struct utmp), 1, f) != sizeof(struct utmp)) { -#if DEBUG - syslog(LOG_DEBUG, "opielogin: wtmp write failed: %s (%d)", strerror(errno), errno); -#endif /* DEBUG */ - rval = -1; - } - - fclose(f); -#endif /* DOUTMPX */ - } - -#if DEBUG - syslog(LOG_DEBUG, "opielogin: wtmp suceeded"); -#endif /* DEBUG */ + opielogwtmp(line, name, host); + opielogwtmp(NULL, NULL, NULL); dosetlogin: #if HAVE_SETLOGIN diff --git a/contrib/opie/libopie/logwtmp.c b/contrib/opie/libopie/logwtmp.c new file mode 100644 index 000000000000..efc1def3cc5c --- /dev/null +++ b/contrib/opie/libopie/logwtmp.c @@ -0,0 +1,170 @@ +/* logwtmp.c: Put an entry in the wtmp file. + +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights +Reserved. The Inner Net License Version 2 applies to these portions of +the software. +You should have received a copy of the license with this software. If +you didn't get a copy, you may request one from <license@inner.net>. + +Portions of this software are Copyright 1995 by Randall Atkinson and Dan +McDonald, All Rights Reserved. All Rights under this copyright are assigned +to the U.S. Naval Research Laboratory (NRL). The NRL Copyright Notice and +License Agreement applies to this software. + + History: + + Modified by cmetz for OPIE 2.31. Move wtmp log functions here, to + improve portability. Added DISABLE_WTMP. + Modified by cmetz for OPIE 2.22. Call gettimeofday() properly. + Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. + Ifdef around some headers. Added file close hook. + Modified at NRL for OPIE 2.1. Set process type for HPUX. + Modified at NRL for OPIE 2.0. + Originally from BSD. +*/ +/* + * Copyright (c) 1988 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include "opie_cfg.h" + +#include <sys/types.h> +#if HAVE_SYS_TIME_H +#include <sys/time.h> +#endif /* HAVE_SYS_TIME_H */ +#include <sys/stat.h> +#include <fcntl.h> +#include <utmp.h> +#if HAVE_UNISTD_H +#include <unistd.h> +#endif /* HAVE_UNISTD_H */ +#if HAVE_STRING_H +#include <string.h> +#endif /* HAVE_STRING_H */ + +#include "opie.h" + +static int fd = -1; + +#if DOUTMPX +static int fdx = -1; +#include <utmpx.h> +#endif /* DOUTMPX */ + +#ifndef _PATH_WTMP +#ifdef WTMP_FILE +#define _PATH_WTMP WTMP_FILE +#else /* WTMP_FILE */ +#ifdef PATH_WTMP_AC +#define _PATH_WTMP PATH_WTMP_AC +#endif /* PATH_WTMP_AC */ +#endif /* WTMP_FILE */ +#endif /* _PATH_WTMP */ + +#ifndef _PATH_WTMPX +#ifdef WTMPX_FILE +#define _PATH_WTMPX WTMPX_FILE +#else /* WTMPX_FILE */ +#ifdef PATH_WTMPX_AC +#define _PATH_WTMPX PATH_WTMPX_AC +#endif /* PATH_WTMPX_AC */ +#endif /* WTMPX_FILE */ +#endif /* _PATH_WTMPX */ + +/* + * Modified version of logwtmp that holds wtmp file open + * after first call, for use with ftp (which may chroot + * after login, but before logout). + */ +VOIDRET opielogwtmp FUNCTION((line, name, host), char *line AND char *name AND char *host) +{ +#if !DISABLE_WTMP + struct utmp ut; + +#if DOUTMPX && defined(_PATH_WTMPX) + struct utmpx utx; +#endif /* DOUTMPX && defined(_PATH_WTMPX) */ + struct stat buf; + + memset(&ut, 0, sizeof(struct utmp)); + + if (!line) { + close(fd); +#if DOUTMPX && defined(_PATH_WTMPX) + close(fdx); +#endif /* DOUTMPX && defined(_PATH_WTMPX) */ + } + + if (fd < 0 && (fd = open(_PATH_WTMP, O_WRONLY | O_APPEND, 0)) < 0) + return; + if (fstat(fd, &buf) == 0) { +#if HAVE_UT_TYPE && defined(USER_PROCESS) + ut.ut_type = USER_PROCESS; +#endif /* HAVE_UT_TYPE && defined(USER_PROCESS) */ +#if HAVE_UT_PID + ut.ut_pid = getpid(); +#endif /* HAVE_UT_PID */ + strncpy(ut.ut_line, line, sizeof(ut.ut_line)); + strncpy(ut.ut_name, name, sizeof(ut.ut_name)); +#if !DOUTMPX + strncpy(ut.ut_host, host, sizeof(ut.ut_host)); +#endif /* !DOUTMPX */ + time(&ut.ut_time); + if (write(fd, (char *) &ut, sizeof(struct utmp)) != + sizeof(struct utmp)) + ftruncate(fd, buf.st_size); + } + +#if DOUTMPX && defined(_PATH_WTMPX) + memset(&utx, 0, sizeof(struct utmpx)); + + if (fdx < 0 && (fdx = open(_PATH_WTMPX, O_WRONLY | O_APPEND, 0)) < 0) + return; + if (fstat(fdx, &buf) == 0) { + strncpy(utx.ut_line, line, sizeof(utx.ut_line)); + strncpy(utx.ut_name, name, sizeof(utx.ut_name)); + strncpy(utx.ut_host, host, sizeof(utx.ut_host)); +#if HAVE_GETTIMEOFDAY +#if HAVE_ONE_ARG_GETTIMEOFDAY + gettimeofday(&utx.ut_tv); +#else /* HAVE_ONE_ARG_GETTIMEOFDAY */ + gettimeofday(&utx.ut_tv, NULL); +#endif /* HAVE_ONE_ARG_GETTIMEOFDAY */ +#endif /* HAVE_GETTIMEOFDAY */ + if (write(fdx, (char *) &utx, sizeof(struct utmpx)) != sizeof(struct utmpx)) + ftruncate(fdx, buf.st_size); + } +#endif /* DOUTMPX && defined(_PATH_WTMPX) */ +#endif /* !DISABLE_WTMP */ +} diff --git a/contrib/opie/libopie/lookup.c b/contrib/opie/libopie/lookup.c index e3df6813c170..39fab48eef84 100644 --- a/contrib/opie/libopie/lookup.c +++ b/contrib/opie/libopie/lookup.c @@ -1,7 +1,7 @@ /* lookup.c: The opielookup() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/md4c.c b/contrib/opie/libopie/md4c.c index fd46857b393d..343cb8fb5016 100644 --- a/contrib/opie/libopie/md4c.c +++ b/contrib/opie/libopie/md4c.c @@ -1,7 +1,7 @@ /* md4c.c: "RSA Data Security, Inc. MD4 Message-Digest Algorithm" -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/md5c.c b/contrib/opie/libopie/md5c.c index 6b2050827049..d2a939099e8e 100644 --- a/contrib/opie/libopie/md5c.c +++ b/contrib/opie/libopie/md5c.c @@ -1,8 +1,8 @@ /* md5c.c: "RSA Data Security, Inc. MD5 Message-Digest Algorithm" "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/newseed.c b/contrib/opie/libopie/newseed.c index af4cac718e55..5073850f4849 100644 --- a/contrib/opie/libopie/newseed.c +++ b/contrib/opie/libopie/newseed.c @@ -1,17 +1,21 @@ /* newseed.c: The opienewseed() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Added time.h. Created by cmetz for OPIE 2.22. */ #include "opie_cfg.h" +#if HAVE_TIME_H +#include <time.h> +#endif /* HAVE_TIME_H */ #if HAVE_STRING_H #include <string.h> #endif /* HAVE_STRING_H */ diff --git a/contrib/opie/libopie/open.c b/contrib/opie/libopie/open.c index 0082c3446876..3a1dcccdd3c3 100644 --- a/contrib/opie/libopie/open.c +++ b/contrib/opie/libopie/open.c @@ -1,7 +1,7 @@ /* open.c: The __opieopen() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/parsechallenge.c b/contrib/opie/libopie/parsechallenge.c index 9dca1e66df4c..e3e314e2b1cc 100644 --- a/contrib/opie/libopie/parsechallenge.c +++ b/contrib/opie/libopie/parsechallenge.c @@ -1,7 +1,7 @@ /* parsechallenge.c: The _opieparsechallenge() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/libopie/passcheck.c b/contrib/opie/libopie/passcheck.c index 3b30d70aa02e..8d60931a7102 100644 --- a/contrib/opie/libopie/passcheck.c +++ b/contrib/opie/libopie/passcheck.c @@ -1,7 +1,7 @@ /* passcheck.c: The opiepasscheck() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/passwd.c b/contrib/opie/libopie/passwd.c index e50bf173d2dd..17df424f4c78 100644 --- a/contrib/opie/libopie/passwd.c +++ b/contrib/opie/libopie/passwd.c @@ -1,17 +1,19 @@ /* passwd.c: The opiepasswd() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Removed active attack protection + support. Modified by cmetz for OPIE 2.3. Split most of the function off - and turned this into a front-end for the new __opiewriterec(). - Added code to compute the key from the secret. Use the opie_ - prefix. Use new opieatob8() and opiebtoa8() return values. + and turned this into a front-end for the new __opiewriterec(). + Added code to compute the key from the secret. Use the opie_ + prefix. Use new opieatob8() and opiebtoa8() return values. Created by cmetz for OPIE 2.22. */ @@ -31,7 +33,6 @@ int opiepasswd FUNCTION((old, mode, principal, n, seed, ks), struct opie *old AN if (old) { opie.opie_flags = old->opie_flags; opie.opie_recstart = old->opie_recstart; - opie.opie_extrecstart = old->opie_extrecstart; } opie.opie_principal = principal; @@ -48,12 +49,6 @@ int opiepasswd FUNCTION((old, mode, principal, n, seed, ks), struct opie *old AN opiehash(key, MDX); if (!(opie.opie_val = opiebtoa8(opie.opie_buf, key))) return -1; - - if (opiekeycrunch(MDX | 0x10, key, seed, ks)) - return -1; - - if (!(opie.opie_reinitkey = opiebtoa8(opie.opie_extbuf, key))) - return -1; } else { if ((opieetob(key, ks) != 1) && !opieatob8(key, ks)) return 1; diff --git a/contrib/opie/libopie/randomchallenge.c b/contrib/opie/libopie/randomchallenge.c index 6e0d5b7332f1..021da77d1744 100644 --- a/contrib/opie/libopie/randomchallenge.c +++ b/contrib/opie/libopie/randomchallenge.c @@ -1,7 +1,7 @@ /* randomchallenge.c: The opierandomchallenge() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/readpass.c b/contrib/opie/libopie/readpass.c index 4dc22e2f1f65..48b5699d19c8 100644 --- a/contrib/opie/libopie/readpass.c +++ b/contrib/opie/libopie/readpass.c @@ -1,7 +1,7 @@ /* readpass.c: The opiereadpass() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,9 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Use usleep() to delay after setting + the terminal attributes; this might help certain buggy + systems. Modified by cmetz for OPIE 2.3. Use TCSAFLUSH always. Modified by cmetz for OPIE 2.22. Replaced echo w/ flags. Really use FUNCTION. @@ -194,8 +197,16 @@ char *opiereadpass FUNCTION((buf, len, flags), char *buf AND int len AND int fla } #endif /* VEOF */ +#if HAVE_USLEEP + usleep(1); +#endif /* HAVE_USLEEP */ + if (tcsetattr(0, TCSAFLUSH, &attr)) goto error; + +#if HAVE_USLEEP + usleep(1); +#endif /* HAVE_USLEEP */ } #else /* unix */ erase[0] = CONTROL('H'); diff --git a/contrib/opie/libopie/readrec.c b/contrib/opie/libopie/readrec.c index c98daaa51fe3..d26002df019d 100644 --- a/contrib/opie/libopie/readrec.c +++ b/contrib/opie/libopie/readrec.c @@ -1,19 +1,23 @@ /* readrec.c: The __opiereadrec() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Removed active attack protection + support. Fixed a debug message typo. Keep going after bogus + records. Set read flag. Created by cmetz for OPIE 2.3. */ #include "opie_cfg.h" #include <stdio.h> #include <sys/types.h> +#include <errno.h> #if HAVE_UNISTD_H #include <unistd.h> #endif /* HAVE_UNISTD_H */ @@ -66,61 +70,29 @@ static int parserec FUNCTION((opie), struct opie *opie) return 0; } -static int parseextrec FUNCTION((opie), struct opie *opie) -{ - char *c; - - if (!(c = strchr(opie->opie_extbuf, ' '))) - return -1; - - *(c++) = 0; - while(*c == ' ') c++; - - if (!(c = strchr(opie->opie_reinitkey = c, ' '))) - return -1; - - *(c++) = 0; - - return 0; -} - int __opiereadrec FUNCTION((opie), struct opie *opie) { - FILE *f = NULL, *f2 = NULL; + FILE *f = NULL; int rval = -1; - if (!(f = __opieopen(STD_KEY_FILE, 0, 0644))) { + if (!(f = __opieopen(KEY_FILE, 0, 0644))) { #if DEBUG - syslog(LOG_DEBUG, "__opiereadrec: __opieopen(STD_KEY_FILE..) failed!"); + syslog(LOG_DEBUG, "__opiereadrec: __opieopen(KEY_FILE..) failed!"); #endif /* DEBUG */ goto ret; } - if (!(f2 = __opieopen(EXT_KEY_FILE, 0, 0600))) { -#if DEBUG - syslog(LOG_DEBUG, "__opiereadrec: __opieopen(EXT_KEY_FILE..) failed!"); -#endif /* DEBUG */ - } - { int i; - if ((i = open(STD_KEY_FILE, O_RDWR)) < 0) { + if ((i = open(KEY_FILE, O_RDWR)) < 0) { opie->opie_flags &= ~__OPIE_FLAGS_RW; #if DEBUG - syslog(LOG_DEBUG, "__opiereadrec: open(STD_KEY_FILE, O_RDWR) failed: %s", strerror(errno)); + syslog(LOG_DEBUG, "__opiereadrec: open(KEY_FILE, O_RDWR) failed: %s", strerror(errno)); #endif /* DEBUG */ } else { close(i); - if ((i = open(EXT_KEY_FILE, O_RDWR)) < 0) { - opie->opie_flags &= ~__OPIE_FLAGS_RW; -#if DEBUG - syslog(LOG_DEBUG, "__opiereadrec: open(STD_KEY_FILE, O_RDWR) failed: %s", strerror(errno)); -#endif /* DEBUG */ - } else { - close(i); - opie->opie_flags |= __OPIE_FLAGS_RW; - } + opie->opie_flags |= __OPIE_FLAGS_RW; } } @@ -134,31 +106,14 @@ int __opiereadrec FUNCTION((opie), struct opie *opie) if (parserec(opie)) goto ret; - if (opie->opie_extbuf[0]) { - if (!f2) { -#if DEBUG - syslog(LOG_DEBUG, "__opiereadrec: can't read ext file, but could before?"); -#endif /* DEBUG */ - goto ret; - } - - if (fseek(f2, opie->opie_extrecstart, SEEK_SET)) - goto ret; - - if (fgets(opie->opie_extbuf, sizeof(opie->opie_extbuf), f2)) - goto ret; - - if (parseextrec(opie)) - goto ret; - } - + opie->opie_flags |= __OPIE_FLAGS_READ; rval = 0; goto ret; } if (!opie->opie_principal) return -1; - + { char *c, principal[OPIE_PRINCIPAL_MAX]; int i; @@ -180,39 +135,14 @@ int __opiereadrec FUNCTION((opie), struct opie *opie) } if (parserec(opie)) - goto ret; + continue; } while (strcmp(principal, opie->opie_principal)); - if (!f2) { - opie->opie_extbuf[0] = rval = 0; - goto ret; - } - - do { - if ((opie->opie_extrecstart = ftell(f2)) < 0) - goto ret; - - if (!fgets(opie->opie_extbuf, sizeof(opie->opie_extbuf), f2)) { - if (feof(f2)) { - opie->opie_reinitkey = NULL; - rval = 0; - } else - rval = 1; - goto ret; - } - - if (parseextrec(opie)) - goto ret; - } while (strcmp(principal, opie->opie_extbuf)); - rval = 0; } ret: if (f) fclose(f); - if (f2) - fclose(f2); return rval; } - diff --git a/contrib/opie/libopie/unlock.c b/contrib/opie/libopie/unlock.c index 35c266ddf09b..4dac0c43ab02 100644 --- a/contrib/opie/libopie/unlock.c +++ b/contrib/opie/libopie/unlock.c @@ -1,7 +1,7 @@ /* unlock.c: The opieunlock() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Bug fix. Modified by cmetz for OPIE 2.3. Do refcounts whether or not we actually lock. Fixed USER_LOCKING=0 case. Modified by cmetz for OPIE 2.22. Added reference count support. @@ -77,8 +78,7 @@ int opieunlock FUNCTION_NOARGS if (!(t = atoi(c))) goto unlockret; - if ((pid != getpid()) && (time(NULL) + OPIE_LOCK_TIMEOUT <= t) && - (!kill(pid, 0))) { + if ((pid != getpid()) && (time(0) <= OPIE_LOCK_TIMEOUT + t) && (!kill(pid, 0))) { rval = 1; goto unlockret1; } diff --git a/contrib/opie/libopie/verify.c b/contrib/opie/libopie/verify.c index 7388a8ab6fc5..52698d4137b1 100644 --- a/contrib/opie/libopie/verify.c +++ b/contrib/opie/libopie/verify.c @@ -1,13 +1,16 @@ /* verify.c: The opieverify() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Renamed "init" and "RESPONSE_INIT" + to "init-hex" and "RESPONSE_INIT_HEX". Removed active attack + protection support. Created by cmetz for OPIE 2.3 using the old verify.c as a guide. */ @@ -20,7 +23,7 @@ you didn't get a copy, you may request one from <license@inner.net>. #define RESPONSE_STANDARD 0 #define RESPONSE_WORD 1 #define RESPONSE_HEX 2 -#define RESPONSE_INIT 3 +#define RESPONSE_INIT_HEX 3 #define RESPONSE_INIT_WORD 4 #define RESPONSE_UNKNOWN 5 @@ -32,7 +35,7 @@ struct _rtrans { static struct _rtrans rtrans[] = { { RESPONSE_WORD, "word" }, { RESPONSE_HEX, "hex" }, - { RESPONSE_INIT, "init" }, + { RESPONSE_INIT_HEX, "init-hex" }, { RESPONSE_INIT_WORD, "init-word" }, { RESPONSE_STANDARD, "" }, { RESPONSE_UNKNOWN, NULL } @@ -119,11 +122,11 @@ int opieverify FUNCTION((opie, response), struct opie *opie AND char *response) i = memcmp(fkey, lastkey, sizeof(key)); } break; - case RESPONSE_INIT: + case RESPONSE_INIT_HEX: case RESPONSE_INIT_WORD: { char *c2; - char newkey[8], ckxor[8], ck[8], cv[8], cvc[8]; + char newkey[8]; char buf[OPIE_SEED_MAX + 48 + 1]; if (!(c2 = strchr(c, ':'))) @@ -131,7 +134,7 @@ int opieverify FUNCTION((opie, response), struct opie *opie AND char *response) *(c2++) = 0; - if (i == RESPONSE_INIT) { + if (i == RESPONSE_INIT_HEX) { if (!opieatob8(key, c)) goto verret; } else { @@ -173,56 +176,13 @@ int opieverify FUNCTION((opie, response), struct opie *opie AND char *response) *(c2++) = 0; - if (i == RESPONSE_INIT) { + if (i == RESPONSE_INIT_HEX) { if (!opieatob8(newkey, c)) goto verret; } else { if (opieetob(newkey, c) != 1) goto verret; } - - if (!opie->opie_reinitkey || (opie->opie_reinitkey[0] == '*')) - goto verwrt; - - if (!(c2 = strchr(c = c2, ':'))) - goto verret; - - *(c2++) = 0; - - if (i == RESPONSE_INIT) { - if (!opieatob8(ckxor, c)) - goto verret; - if (!opieatob8(cv, c2)) - goto verret; - } else { - if (opieetob(ckxor, c) != 1) - goto verret; - if (opieetob(cv, c2) != 1) - goto verret; - } - - if (!opieatob8(ck, opie->opie_reinitkey)) - goto verret; - - c = buf; - memcpy(c, ck, sizeof(ck)); c += sizeof(ck); - memcpy(c, key, sizeof(key)); c += sizeof(key); - c += sprintf(c, "%s 499 %s", algids[MDX], opie->opie_seed); - memcpy(c, newkey, sizeof(newkey)); c += sizeof(newkey); - memcpy(c, ckxor, sizeof(ckxor)); c += sizeof(ckxor); - memcpy(c, ck, sizeof(ck)); c += sizeof(ck); - opiehashlen(MDX, buf, cvc, (unsigned int)c - (unsigned int)buf); - - if (memcmp(cv, cvc, sizeof(cv))) - goto verret; - - for (i = 0; i < 8; i++) - ck[i] ^= ckxor[i]; - - if (!opiebtoa8(opie->opie_reinitkey, ck)) - goto verret; - - memcpy(key, newkey, sizeof(key)); } goto verwrt; case RESPONSE_UNKNOWN: diff --git a/contrib/opie/libopie/version.c b/contrib/opie/libopie/version.c index 48b1dc5866bc..11e3394ea105 100644 --- a/contrib/opie/libopie/version.c +++ b/contrib/opie/libopie/version.c @@ -1,7 +1,7 @@ /* version.c: The opieversion() library function. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/libopie/writerec.c b/contrib/opie/libopie/writerec.c index 697866928d14..224689902278 100644 --- a/contrib/opie/libopie/writerec.c +++ b/contrib/opie/libopie/writerec.c @@ -1,13 +1,15 @@ /* writerec.c: The __opiewriterec() library function. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Removed active attack protection + support. Fixed passwd bug. Created by cmetz for OPIE 2.3 from passwd.c. */ #include "opie_cfg.h" @@ -46,23 +48,19 @@ int __opiewriterec FUNCTION((opie), struct opie *opie) if (!(opie->opie_flags & __OPIE_FLAGS_READ)) { struct opie opie2; i = opielookup(&opie2, opie->opie_principal); + opie->opie_flags = opie2.opie_flags; + opie->opie_recstart = opie2.opie_recstart; } switch(i) { case 0: - if (!(f = __opieopen(STD_KEY_FILE, 1, 0644))) - return -1; - if (!(f2 = __opieopen(EXT_KEY_FILE, 1, 0600))) + if (!(f = __opieopen(KEY_FILE, 1, 0644))) return -1; if (fseek(f, opie->opie_recstart, SEEK_SET)) return -1; - if (fseek(f2, opie->opie_extrecstart, SEEK_SET)) - return -1; break; case 1: - if (!(f = __opieopen(STD_KEY_FILE, 2, 0644))) - return -1; - if (!(f2 = __opieopen(EXT_KEY_FILE, 2, 0600))) + if (!(f = __opieopen(KEY_FILE, 2, 0644))) return -1; break; default: @@ -74,12 +72,5 @@ int __opiewriterec FUNCTION((opie), struct opie *opie) fclose(f); - if (f2) { - if (fprintf(f2, "%-32s %-16s %-77s\n", opie->opie_principal, opie->opie_reinitkey ? opie->opie_reinitkey : __opienone, "") < 1) - return -1; - - fclose(f2); - } - return 0; } diff --git a/contrib/opie/opie.4 b/contrib/opie/opie.4 index 97eb73de2007..5a308f285784 100644 --- a/contrib/opie/opie.4 +++ b/contrib/opie/opie.4 @@ -1,7 +1,7 @@ .\" opie.4: Overview of the OPIE software. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opie.h b/contrib/opie/opie.h index 99f0e0966113..6d4d9cb6fbf7 100644 --- a/contrib/opie/opie.h +++ b/contrib/opie/opie.h @@ -1,8 +1,8 @@ /* opie.h: Data structures and values for the OPIE authentication system that a program might need. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -15,6 +15,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Removed active attack protection. Modified by cmetz for OPIE 2.3. Renamed PTR to VOIDPTR. Added re-init key and extension file fields to struct opie. Added opie_ prefix on struct opie members. Added opie_flags field @@ -32,7 +33,7 @@ License Agreement applies to this software. (skey.h). */ #ifndef _OPIE_H -#define _OPIE_H +#define _OPIE_H 1 #if _OPIE @@ -116,9 +117,6 @@ struct opie { char *opie_seed; char *opie_val; long opie_recstart; - char opie_extbuf[129]; /* > OPIE_PRINCIPAL_MAX + 1 + 16 + 2 + 1 */ - long opie_extrecstart; - char *opie_reinitkey; }; #define __OPIE_FLAGS_RW 1 diff --git a/contrib/opie/opie_cfg.h b/contrib/opie/opie_cfg.h index 57490de61307..cdfb86416e0f 100644 --- a/contrib/opie/opie_cfg.h +++ b/contrib/opie/opie_cfg.h @@ -1,7 +1,7 @@ /* opie_cfg.h: Various configuration-type pieces of information for OPIE. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,11 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Added 4.4BSD-Lite pathnames.h + definitions from ftpd. Added struct spwd definition and + HAVE_SHADOW logic for SunOS C2 shadow password support. + Moved user locking config to configure script. Removed + options.h. Modified by cmetz for OPIE 2.3. Splatted with opie_auto.h. Obseleted many symbols. Changed OPIE_PASS_{MIN,MAX} to OPIE_SECRET_{MIN,MAX}. Fixed SHADOW+UTMP definitions. @@ -41,15 +46,17 @@ License Agreement applies to this software. Written at NRL for OPIE 2.0. */ -#define VERSION "2.3" -#define DATE "Sunday, September 22, 1996" +#ifndef _OPIE_CFG_H +#define _OPIE_CFG_H 1 + +#define VERSION "2.31" +#define DATE "Thursday, March 20, 1997" #ifndef unix #define unix 1 #endif /* unix */ #include "config.h" -#include "options.h" /* System characteristics */ @@ -91,21 +98,18 @@ License Agreement applies to this software. #endif /* PATH_MAIL */ #endif /* MAIL_DIR */ -#if HAVE_SHADOW_H && HAVE_GETSPENT && HAVE_ENDSPENT -#if defined(linux) && !HAVE_ETC_SHADOW +#if HAVE_SHADOW_H && HAVE_GETSPNAM && HAVE_ENDSPENT +#if defined(linux) && !HAVE_ETC_SHADOW #define HAVE_SHADOW 0 #else /* defined(linux) && !HAVE_ETC_SHADOW */ #define HAVE_SHADOW 1 #endif /* defined(linux) && !HAVE_ETC_SHADOW */ -#endif /* HAVE_SHADOW_H && HAVE_GETSPENT && HAVE_ENDSPENT */ - -#if !HAVE_SETEUID && HAVE_SETREUID -#define seteuid(x) setreuid(-1, x) -#endif /* !HAVE_SETEUID && HAVE_SETREUID */ +#endif /* HAVE_SHADOW_H && HAVE_GETSPNAM && HAVE_ENDSPENT */ -#if !HAVE_SETEGID && HAVE_SETREGID -#define setegid(x) setregid(-1, x) -#endif /* !HAVE_SETEGID && HAVE_SETREGID */ +#if HAVE_SUNOS_C2_SHADOW && !HAVE_SHADOW +#undef HAVE_SHADOW +#define HAVE_SHADOW 1 +#endif /* HAVE_SUNOS_C2_SHADOW && !HAVE_SHADOW */ /* If the user didn't specify, default to MD5 */ #ifndef MDX @@ -124,14 +128,22 @@ License Agreement applies to this software. #define _PATH_FTPUSERS "/etc/ftpusers" #endif +#ifndef _PATH_FTPLOGINMESG +#define _PATH_FTPLOGINMESG "/etc/ftpmotd" +#endif /* _PATH_FTPLOGINMESG */ + +#ifndef _PATH_FTPWELCOME +#define _PATH_FTPWELCOME "/etc/ftpwelcome" +#endif /* _PATH_FTPWELCOME */ + +#ifndef _PATH_NOLOGIN +#define _PATH_NOLOGIN "/etc/nologin" +#endif /* _PATH_NOLOGIN */ + #ifndef TTYGRPNAME #define TTYGRPNAME "tty" /* name of group to own ttys */ #endif -#ifndef NO_LOGINS_FILE -#define NO_LOGINS_FILE "/etc/nologin" -#endif - #ifndef QUIET_LOGIN_FILE #define QUIET_LOGIN_FILE ".hushlogin" #endif @@ -140,10 +152,6 @@ License Agreement applies to this software. #define OPIE_ALWAYS_FILE ".opiealways" #endif -#ifndef OPIE_LOCK_PREFIX -#define OPIE_LOCK_PREFIX "/tmp/opie-lock." -#endif - #ifndef OPIE_LOCK_TIMEOUT #define OPIE_LOCK_TIMEOUT (30*60) #endif @@ -164,4 +172,11 @@ License Agreement applies to this software. #define POINTER unsigned char * #endif /* POINTER */ +#ifdef HAVE_SUNOS_C2_SHADOW +struct spwd { + char *sp_pwdp; +}; +#endif /* HAVE_SUNOS_C2_SHADOW */ + #define _OPIE 1 +#endif /* _OPIE_CFG_H */ diff --git a/contrib/opie/opieftpd.c b/contrib/opie/opieftpd.c index b11ece4a6b01..c3729a80727d 100644 --- a/contrib/opie/opieftpd.c +++ b/contrib/opie/opieftpd.c @@ -1,7 +1,7 @@ /* opieftpd.c: Main program for an FTP daemon. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,8 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Merged in some 4.4BSD-Lite changes. + Merged in a security fix to BSD-derived ftpds. Modified by cmetz for OPIE 2.3. Fixed the filename at the top. Moved LS_COMMAND here. Modified by cmetz for OPIE 2.2. Use FUNCTION definition et al. @@ -228,6 +230,7 @@ char *getline __P((char *, int, FILE *)); VOIDRET upper __P((char *)); static VOIDRET lostconn __P((int)); +static VOIDRET myoob __P((int)); static FILE *getdatasock __P((char *)); static FILE *dataconn __P((char *, off_t, char *)); static int checkuser __P((char *)); @@ -237,7 +240,7 @@ static int receive_data __P((FILE *, FILE *)); static char *gunique __P((char *)); static char *sgetsave __P((char *)); -int logwtmp __P((char *, char *, char *)); +int opielogwtmp __P((char *, char *, char *)); int fclose __P((FILE *)); @@ -299,6 +302,20 @@ VOIDRET lreply FUNCTION((n, fmt, p0, p1, p2, p3, p4, p5), int n AND char *fmt AN } #endif /* HAVE_ANSISTDARG */ +VOIDRET enable_signalling FUNCTION_NOARGS +{ + signal(SIGPIPE, lostconn); + if ((int)signal(SIGURG, myoob) < 0) + syslog(LOG_ERR, "signal: %m"); +} + +VOIDRET disable_signalling FUNCTION_NOARGS +{ + signal(SIGPIPE, SIG_IGN); + if ((int)signal(SIGURG, SIG_IGN) < 0) + syslog(LOG_ERR, "signal: %m"); +} + static VOIDRET lostconn FUNCTION((input), int input) { if (debug) @@ -404,9 +421,8 @@ int user FUNCTION((name), char *name) if ((pw = sgetpwnam("ftp")) != NULL) { guest = 1; askpasswd = 1; - reply(331, "Guest login ok, send ident as password."); - syslog(LOG_INFO, "Anonymous FTP connection made from host %s.", - remotehost); + reply(331, "Guest login ok, send your e-mail address as your password."); + syslog(LOG_INFO, "Anonymous FTP connection made from host %s.", remotehost); return 0; } #endif /* DOANONYMOUS */ @@ -417,8 +433,7 @@ int user FUNCTION((name), char *name) if (!strcmp(cp, shell)) break; endusershell(); - if (cp == NULL || checkuser(name) || - ((pw->pw_passwd[0] == '*') || (pw->pw_passwd[0] == '#'))) { + if (cp == NULL || checkuser(name) || ((pw->pw_passwd[0] == '*') || (pw->pw_passwd[0] == '#'))) { #if DEBUG if (!cp) syslog(LOG_DEBUG, "Couldn't find %s in the list of valid shells.", pw->pw_shell); @@ -472,8 +487,10 @@ static int checkuser FUNCTION((name), char *name) *p = '\0'; if (line[0] == '#') continue; - if (strcmp(line, name) == 0) + if (!strcmp(line, name)) { + fclose(fd); return (1); + } } fclose(fd); } @@ -486,15 +503,17 @@ static int checkuser FUNCTION((name), char *name) */ static VOIDRET end_login FUNCTION_NOARGS { + disable_signalling(); if (seteuid((uid_t) 0)) syslog(LOG_ERR, "Can't set euid"); if (logged_in) - logwtmp(ttyline, "", ""); + opielogwtmp(ttyline, "", ""); pw = NULL; logged_in = 0; #if DOANONYMOUS guest = 0; #endif /* DOANONYMOUS */ + enable_signalling(); } VOIDRET pass FUNCTION((passwd), char *passwd) @@ -525,15 +544,24 @@ VOIDRET pass FUNCTION((passwd), char *passwd) return; } #if DOANONYMOUS - } + } else + if ((passwd[0] <= ' ') || checkuser(passwd)) { + reply(530, "No identity, no service."); + syslog(LOG_DEBUG, "Bogus address: %s", passwd); + exit(0); + } #endif /* DOANONYMOUS */ login_attempts = 0; /* this time successful */ - setegid((gid_t) pw->pw_gid); + if (setegid((gid_t) pw->pw_gid) < 0) { + reply(550, "Can't set gid."); + syslog(LOG_DEBUG, "gid = %d, errno = %s(%d)", pw->pw_gid, strerror(errno), errno); + return; + } initgroups(pw->pw_name, pw->pw_gid); /* open wtmp before chroot */ sprintf(ttyline, "ftp%d", getpid()); - logwtmp(ttyline, pw->pw_name, remotehost); + opielogwtmp(ttyline, pw->pw_name, remotehost); logged_in = 1; #if DOANONYMOUS @@ -577,6 +605,25 @@ VOIDRET pass FUNCTION((passwd), char *passwd) goto bad; } #endif /* _AIX */ + /* + * Display a login message, if it exists. + * N.B. reply(230,) must follow the message. + */ + { + FILE *fd; + + if ((fd = fopen(_PATH_FTPLOGINMESG, "r")) != NULL) { + char *cp, line[128]; + + while (fgets(line, sizeof(line), fd) != NULL) { + if ((cp = strchr(line, '\n')) != NULL) + *cp = '\0'; + lreply(230, "%s", line); + } + (void) fflush(stdout); + (void) fclose(fd); + } + } #if DOANONYMOUS if (guest) { reply(230, "Guest login ok, access restrictions apply."); @@ -597,8 +644,7 @@ VOIDRET pass FUNCTION((passwd), char *passwd) sprintf(proctitle, "%s: %s", remotehost, pw->pw_name); setproctitle(proctitle); #endif /* DOTITLE */ - syslog(LOG_NOTICE, "FTP login from %s with user name %s", - remotehost, pw->pw_name); + syslog(LOG_INFO, "FTP login from %s with user name %s", remotehost, pw->pw_name); } home = pw->pw_dir; /* home dir for globbing */ umask(defumask); @@ -740,6 +786,7 @@ static FILE *getdatasock FUNCTION((mode), char *mode) if (data >= 0) return (fdopen(data, mode)); + disable_signalling(); if (seteuid((uid_t) 0)) syslog(LOG_ERR, "Can't set euid"); s = socket(AF_INET, SOCK_STREAM, 0); @@ -761,6 +808,7 @@ static FILE *getdatasock FUNCTION((mode), char *mode) } if (seteuid((uid_t) pw->pw_uid)) syslog(LOG_ERR, "Can't set euid"); + enable_signalling(); #ifdef IP_TOS on = IPTOS_THROUGHPUT; if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *) &on, sizeof(int)) < 0) @@ -768,9 +816,16 @@ static FILE *getdatasock FUNCTION((mode), char *mode) #endif return (fdopen(s, mode)); bad: + { + int t = errno; + if (seteuid((uid_t) pw->pw_uid)) syslog(LOG_ERR, "Can't set euid"); + enable_signalling(); close(s); + + errno = t; + } return (NULL); } @@ -1217,10 +1272,11 @@ static VOIDRET dolog FUNCTION((sin), struct sockaddr_in *sin) */ VOIDRET dologout FUNCTION((status), int status) { + disable_signalling(); if (logged_in) { if (seteuid((uid_t) 0)) syslog(LOG_ERR, "Can't set euid"); - logwtmp(ttyline, "", ""); + opielogwtmp(ttyline, "", ""); } /* beware of flushing buffers after a SIGPIPE */ _exit(status); @@ -1308,7 +1364,7 @@ pasv_error: */ static char *gunique FUNCTION((local), char *local) { - static char new[MAXPATHLEN]; + static char new[MAXPATHLEN+1]; struct stat st; char *cp = strrchr(local, '/'); int count = 0; @@ -1417,7 +1473,7 @@ VOIDRET send_file_list FUNCTION((whichfiles), char *whichfiles) continue; while ((dir = readdir(dirp)) != NULL) { - char nbuf[MAXPATHLEN]; + char nbuf[MAXPATHLEN+1]; if (dir->d_name[0] == '.' && (strlen(dir->d_name) == 1)) continue; @@ -1496,7 +1552,7 @@ VOIDRET setproctitle FUNCTION((fmt, a, b, c), char *fmt AND int a AND int b AND } #endif /* DOTITLE */ -void catchexit FUNCTION_NOARGS +VOIDRET catchexit FUNCTION_NOARGS { closelog(); } @@ -1595,10 +1651,8 @@ nextopt: argc--, argv++; } freopen(_PATH_DEVNULL, "w", stderr); - signal(SIGPIPE, lostconn); signal(SIGCHLD, SIG_IGN); - if ((int) signal(SIGURG, myoob) < 0) - syslog(LOG_ERR, "signal: %m"); + enable_signalling(); /* Try to handle urgent data inline */ #ifdef SO_OOBINLINE @@ -1620,20 +1674,35 @@ nextopt: tmpline[0] = '\0'; af_pwok = opieaccessfile(remotehost); -#if 0 { - struct utsname utsname; - - if (uname(&utsname) < 0) { - syslog(LOG_ERR, "uname() failed: %s", strerror(errno)); - exit(1); + FILE *fd; + char line[128]; + + /* If logins are disabled, print out the message. */ + if ((fd = fopen(_PATH_NOLOGIN,"r")) != NULL) { + while (fgets(line, sizeof(line), fd) != NULL) { + if ((cp = strchr(line, '\n')) != NULL) + *cp = '\0'; + lreply(530, "%s", line); + } + (void) fflush(stdout); + (void) fclose(fd); + reply(530, "System not available."); + exit(0); } - - reply(220, "%s FTP server ready.", utsname.nodename); + if ((fd = fopen(_PATH_FTPWELCOME, "r")) != NULL) { + while (fgets(line, sizeof(line), fd) != NULL) { + if ((cp = strchr(line, '\n')) != NULL) + *cp = '\0'; + lreply(220, "%s", line); + } + (void) fflush(stdout); + (void) fclose(fd); + /* reply(220,) must follow */ } -#else /* 0 */ + }; + reply(220, "FTP server ready."); -#endif /* 0 */ setjmp(errcatch); for (;;) diff --git a/contrib/opie/opiegen.1 b/contrib/opie/opiegen.1 index 7dc1dfde28f8..1b205b335386 100644 --- a/contrib/opie/opiegen.1 +++ b/contrib/opie/opiegen.1 @@ -1,7 +1,7 @@ .\" opiegen.1: Manual page for the opiegen(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opiegen.c b/contrib/opie/opiegen.c index 7f1ff348720a..4778f5726bdc 100644 --- a/contrib/opie/opiegen.c +++ b/contrib/opie/opiegen.c @@ -1,8 +1,8 @@ /* opiegen.c: Sample OTP generator based on the opiegenerator() library routine. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/opieinfo.1 b/contrib/opie/opieinfo.1 index c8d08f8c3d58..a3212db08dd9 100644 --- a/contrib/opie/opieinfo.1 +++ b/contrib/opie/opieinfo.1 @@ -1,7 +1,7 @@ .\" opieinfo.1: Manual page for the opieinfo(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opieinfo.c b/contrib/opie/opieinfo.c index f1b0acb48685..35692ff90250 100644 --- a/contrib/opie/opieinfo.c +++ b/contrib/opie/opieinfo.c @@ -1,8 +1,8 @@ /* opieinfo: Print a user's current OPIE sequence number and seed -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If diff --git a/contrib/opie/opiekey.1 b/contrib/opie/opiekey.1 index 74fc8cae5623..9c9e82fa1b96 100644 --- a/contrib/opie/opiekey.1 +++ b/contrib/opie/opiekey.1 @@ -1,7 +1,7 @@ .\" opiekey.1: Manual page for the opiekey(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opiekey.c b/contrib/opie/opiekey.c index 17b5ab03507f..475d48b6068c 100644 --- a/contrib/opie/opiekey.c +++ b/contrib/opie/opiekey.c @@ -4,8 +4,8 @@ as command line arguments, prompts for the user's secret pass phrase, and outputs a response. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -18,6 +18,9 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Renamed "init" and RESPONSE_INIT + to "init-hex" and RESPONSE_INIT_HEX. Removed active attack + protection support. Modified by cmetz for OPIE 2.3. OPIE_PASS_MAX changed to OPIE_SECRET_MAX. Added extended responses, which created lots of changes. Eliminated extra variable. Added -x and @@ -68,7 +71,7 @@ static VOIDRET usage FUNCTION((s), char *s) #define RESPONSE_STANDARD 0 #define RESPONSE_WORD 1 #define RESPONSE_HEX 2 -#define RESPONSE_INIT 3 +#define RESPONSE_INIT_HEX 3 #define RESPONSE_INIT_WORD 4 #define RESPONSE_UNKNOWN 5 @@ -80,7 +83,7 @@ struct _rtrans { static struct _rtrans rtrans[] = { { RESPONSE_WORD, "word" }, { RESPONSE_HEX, "hex" }, - { RESPONSE_INIT, "init" }, + { RESPONSE_INIT_HEX, "init-hex" }, { RESPONSE_INIT_WORD, "init-word" }, { RESPONSE_STANDARD, "" }, { RESPONSE_STANDARD, "standard" }, @@ -130,7 +133,6 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) int count = 1; char secret[OPIE_SECRET_MAX + 1], newsecret[OPIE_SECRET_MAX + 1]; char key[8], newkey[8]; - char cko[8], ckn[8], ckxor[8], cv[8]; char *seed, newseed[OPIE_SEED_MAX + 1]; char response[OPIE_RESPONSE_MAX + 1]; char *slash; @@ -246,7 +248,7 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) exit(1); } - if ((type == RESPONSE_INIT) || (type == RESPONSE_INIT_WORD)) { + if ((type == RESPONSE_INIT_HEX) || (type == RESPONSE_INIT_WORD)) { #if RETYPE getsecret(secret, "old ", 1); #else /* RETYPE */ @@ -268,19 +270,6 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) for (i = 0; i < 499; i++) opiehash(newkey, algorithm); - - if (opiekeycrunch(algorithm | 0x10, cko, seed, secret)) { - fprintf(stderr, "%s: key crunch failed (2)\n", argv[0]); - goto error; - } - - if (opiekeycrunch(algorithm | 0x10, ckn, newseed, newsecret)) { - fprintf(stderr, "%s: key crunch failed (3)\n", argv[0]); - goto error; - } - - for (i = 0; i < 8; i++) - ckxor[i] = cko[i] ^ ckn[i]; } else #if RETYPE getsecret(secret, "", 1); @@ -320,43 +309,21 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) strcpy(response, "hex:"); strcat(response, opiebtoh(buf, key)); break; - case RESPONSE_INIT: + case RESPONSE_INIT_HEX: case RESPONSE_INIT_WORD: - if (type == RESPONSE_INIT) { + if (type == RESPONSE_INIT_HEX) { strcpy(response, "init:"); strcat(response, opiebtoh(buf, key)); sprintf(buf, ":%s 499 %s:", algids[algorithm], newseed); strcat(response, buf); strcat(response, opiebtoh(buf, newkey)); - strcat(response, ":"); - strcat(response, opiebtoh(buf, ckxor)); - strcat(response, ":"); } else { strcpy(response, "init-word:"); strcat(response, opiebtoe(buf, key)); sprintf(buf, ":%s 499 %s:", algids[algorithm], newseed); strcat(response, buf); strcat(response, opiebtoe(buf, newkey)); - strcat(response, ":"); - strcat(response, opiebtoe(buf, ckxor)); - strcat(response, ":"); } - - c = buf; - memcpy(c, cko, sizeof(cko)); c += sizeof(cko); - memcpy(c, key, sizeof(key)); c += sizeof(key); -#ifdef HAVE_ANSISPRINTF - c += sprintf(c, "%s 499 %s", algids[algorithm], newseed); -#else /* HAVE_ANSISPRINTF */ - sprintf(c, "%s 499 %s", algids[algorithm], newseed); - while(*c) c++; -#endif /* HAVE_ANSISPRINTF */ - memcpy(c, newkey, sizeof(newkey)); c += sizeof(newkey); - memcpy(c, ckxor, sizeof(ckxor)); c += sizeof(ckxor); - memcpy(c, cko, sizeof(cko)); c += sizeof(cko); - opiehashlen(algorithm, buf, cv, (unsigned int)c - (unsigned int)buf); - - strcat(response, (type == RESPONSE_INIT) ? opiebtoh(buf, cv) : opiebtoe(buf, cv)); break; } puts(response); diff --git a/contrib/opie/opielogin.1 b/contrib/opie/opielogin.1 index 0f687cced4c0..5cfd72a7e2f9 100644 --- a/contrib/opie/opielogin.1 +++ b/contrib/opie/opielogin.1 @@ -1,7 +1,7 @@ .\" opielogin.1: Manual page for the opielogin(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opielogin.c b/contrib/opie/opielogin.c index 8189293d3b5c..c2fecb94021c 100644 --- a/contrib/opie/opielogin.c +++ b/contrib/opie/opielogin.c @@ -1,7 +1,7 @@ /* opielogin.c: The infamous /bin/login -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,10 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Use _PATH_NOLOGIN. Move Solaris + drain bamage kluge after rflag check; it breaks rlogin. + Use TCSAFLUSH instead of TCSANOW (except where it flushes + data we need). Sleep before kluging for Solaris. Modified by cmetz for OPIE 2.3. Process login environment files. Made logindevperm/fbtab handling more generic. Kluge around Solaris drain bamage differently (maybe better?). Maybe @@ -123,6 +127,9 @@ License Agreement applies to this software. #if HAVE_STDLIB_H #include <stdlib.h> #endif /* HAVE_STDLIB_H */ +#if HAVE_SYS_SELECT_H +#include <sys/select.h> +#endif /* HAVE_SYS_SELECT_H */ #ifdef QUOTA #include <sys/quota.h> @@ -317,7 +324,7 @@ static VOIDRET catch FUNCTION((i), int i) static VOIDRET catchexit FUNCTION_NOARGS { int i; - tcsetattr(STDIN_FILENO, TCSANOW, &attr); + tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr); putchar('\n'); closelog(); for (i = sysconf(_SC_OPEN_MAX); i > 2; i--) @@ -644,43 +651,10 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) } #endif /* DEBUG */ - openlog("login", LOG_ODELAY, LOG_AUTH); - - { - struct termios termios; - fd_set fds; - struct timeval timeval; - - memset(&timeval, 0, sizeof(struct timeval)); - - FD_ZERO(&fds); - FD_SET(0, &fds); - - if (select(1, &fds, NULL, NULL, &timeval)) { -#ifdef DEBUG - syslog(LOG_DEBUG, "reading user name from tty buffer"); -#endif /* DEBUG */ + for (t = sysconf(_SC_OPEN_MAX); t > 2; t--) + close(t); - if (tcgetattr(0, &termios)) { -#ifdef DEBUG - syslog(LOG_DEBUG, "tcgetattr(0, &termios) failed"); -#endif /* DEBUG */ - exit(1); - } - - termios.c_lflag &= ~ECHO; - - if (tcsetattr(0, TCSANOW, &termios)) { -#ifdef DEBUG - syslog(LOG_DEBUG, "tcsetattr(0, &termios) failed"); -#endif /* DEBUG */ - exit(1); - } - - if ((i = read(0, name, sizeof(name)-1)) > 0) - name[i] = 0; - } - } + openlog("login", LOG_ODELAY, LOG_AUTH); /* initialisation */ host[0] = '\0'; @@ -832,9 +806,6 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) } } - for (t = sysconf(_SC_OPEN_MAX); t > 2; t--) - close(t); - #ifdef TIOCNXCL /* BSDism: not sure how to rewrite for POSIX. rja */ ioctl(0, TIOCNXCL, 0); /* set non-exclusive use of tty */ @@ -848,6 +819,49 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) across the network. */ if (rflag) doremoteterm(term); + else { + struct termios termios; + fd_set fds; + struct timeval timeval; + + memset(&timeval, 0, sizeof(struct timeval)); + + FD_ZERO(&fds); + FD_SET(0, &fds); + +#if HAVE_USLEEP + usleep(1); +#endif /* HAVE_USLEEP */ + + if (select(1, &fds, NULL, NULL, &timeval)) { +#ifdef DEBUG + syslog(LOG_DEBUG, "reading user name from tty buffer"); +#endif /* DEBUG */ + + if (tcgetattr(0, &termios)) { +#ifdef DEBUG + syslog(LOG_DEBUG, "tcgetattr(0, &termios) failed"); +#endif /* DEBUG */ + exit(1); + } + + termios.c_lflag &= ~ECHO; + + if (tcsetattr(0, TCSANOW, &termios)) { +#ifdef DEBUG + syslog(LOG_DEBUG, "tcsetattr(0, &termios) failed"); +#endif /* DEBUG */ + exit(1); + } + + if ((i = read(0, name, sizeof(name)-1)) > 0) + name[i] = 0; + if ((p = strchr(name, '\r'))) + *p = 0; + if ((p = strchr(name, '\n'))) + *p = 0; + } + } /* Force termios portable control characters to the system default values as specified in termios.h. This should help the one-time password login feel the @@ -975,7 +989,7 @@ completeness, but these are set within appropriate defines for portability. */ attr.c_cflag |= HUPCL; /* hangup on close */ /* Set revised termio attributes */ - if (tcsetattr(STDIN_FILENO, TCSANOW, &attr)) + if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr)) return (-1); atexit(catchexit); @@ -1099,8 +1113,8 @@ completeness, but these are set within appropriate defines for portability. */ #endif /* DEBUG */ if (!pwok && !otpok) { - fprintf(stderr, "Can't authenticate %s!\n"); - continue; + fprintf(stderr, "Can't authenticate %s!\n", name); + exit(1); } #if NEW_PROMPTS @@ -1164,7 +1178,7 @@ completeness, but these are set within appropriate defines for portability. */ /* If user not super-user, check for logins disabled. */ if (thisuser.pw_uid) { - if (nlfd = fopen(NO_LOGINS_FILE, "r")) { + if (nlfd = fopen(_PATH_NOLOGIN, "r")) { while ((c = getc(nlfd)) != EOF) putchar(c); fflush(stdout); diff --git a/contrib/opie/opiepasswd.1 b/contrib/opie/opiepasswd.1 index 1fd91230b52a..ca3c422fab0c 100644 --- a/contrib/opie/opiepasswd.1 +++ b/contrib/opie/opiepasswd.1 @@ -1,7 +1,7 @@ .\" opiepasswd.1: Manual page for the opiepasswd(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opiepasswd.c b/contrib/opie/opiepasswd.c index 719b68f704d1..4077e8ad7855 100644 --- a/contrib/opie/opiepasswd.c +++ b/contrib/opie/opiepasswd.c @@ -1,7 +1,7 @@ /* opiepasswd.c: Add/change an OTP password in the key database. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -120,7 +120,7 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) return 1; } - while ((i = getopt(argc, argv, "fhvcn:s:")) != EOF) { + while ((i = getopt(argc, argv, "fhvcn:s:d")) != EOF) { switch (i) { case 'v': opieversion(); diff --git a/contrib/opie/opieserv.1 b/contrib/opie/opieserv.1 index edde9eb9ed51..c7e44da2da60 100644 --- a/contrib/opie/opieserv.1 +++ b/contrib/opie/opieserv.1 @@ -1,7 +1,7 @@ .\" opieserv.1: Manual page for the opieserv(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opieserv.c b/contrib/opie/opieserv.c index 241dbb39a6fd..5cc7b1607589 100644 --- a/contrib/opie/opieserv.c +++ b/contrib/opie/opieserv.c @@ -1,8 +1,8 @@ /* opieserv.c: Sample OTP server based on the opiechallenge() and opieverify() library routines. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. diff --git a/contrib/opie/opiesu.1 b/contrib/opie/opiesu.1 index 5edf24b1fccc..2bf610fe0da6 100644 --- a/contrib/opie/opiesu.1 +++ b/contrib/opie/opiesu.1 @@ -1,7 +1,7 @@ .\" opiesu.c: Manual page for the opiesu(1) program. .\" -.\" %%% portions-copyright-cmetz -.\" Portions of this software are Copyright 1996 by Craig Metz, All Rights +.\" %%% portions-copyright-cmetz-96 +.\" Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights .\" Reserved. The Inner Net License Version 2 applies to these portions of .\" the software. .\" You should have received a copy of the license with this software. If diff --git a/contrib/opie/opiesu.c b/contrib/opie/opiesu.c index 403305b5e48e..239e52dfcb88 100644 --- a/contrib/opie/opiesu.c +++ b/contrib/opie/opiesu.c @@ -1,7 +1,7 @@ /* opiesu.c: main body of code for the su(1m) program -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,8 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Fix sulog(). Replaced Getlogin() with + currentuser. Fixed fencepost error in month printed by sulog(). Modified by cmetz for OPIE 2.3. Limit the length of TERM on full login. Use HAVE_SULOG instead of DOSULOG. Modified by cmetz for OPIE 2.2. Don't try to clear non-blocking I/O. @@ -103,7 +105,13 @@ static char *cleanenv[] = {userbuf, homebuf, shellbuf, pathbuf, 0, 0}; static char *user = "root"; static char *shell = "/bin/sh"; static int fulllogin; +#if 0 static int fastlogin; +#else /* 0 */ +static int force = 0; +#endif /* 0 */ + +static char currentuser[65]; extern char **environ; static struct passwd thisuser, nouser; @@ -209,7 +217,7 @@ static int sulog FUNCTION((status, who), int status AND char *who) if (who) from = who; else - from = Getlogin(); + from = currentuser; if (!strncmp(ttynam = ttyname(2), "/dev/", 5)) ttynam += 5; @@ -223,31 +231,56 @@ static int sulog FUNCTION((status, who), int status AND char *who) } fprintf(f, "SU %02d/%02d %02d:%02d %c %s %s-%s\n", - tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, - result ? '+' : '-', ttynam, from, user); + tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, + status ? '+' : '-', ttynam, from, user); fclose(f); } #endif /* HAVE_SULOG */ int main FUNCTION((argc, argv), int argc AND char *argv[]) { - char buf[1000], *p; + char *p; struct opie opie; int i; char pbuf[256]; char opieprompt[80]; int console = 0; - -#define Getlogin() (((p = getlogin()) && *p) ? p : buf) + char *argvbuf; for (i = sysconf(_SC_OPEN_MAX); i > 2; i--) close(i); - strcat(pathbuf, DEFAULT_PATH); + openlog("su", LOG_ODELAY, LOG_AUTH); + atexit(catchexit); + + { + int argvsize = 0; + for (i = 0; i < argc; argvsize += strlen(argv[i++])); + argvsize += argc; + if (!(argvbuf = malloc(argvsize))) { + syslog(LOG_ERR, "can't allocate memory to store command line"); + exit(1); + }; + for (i = 0, *argvbuf = 0; i < argc;) { + strcat(argvbuf, argv[i]); + if (++i < argc) + strcat(argvbuf, " "); + }; + }; + + strcpy(pathbuf, DEFAULT_PATH); again: if (argc > 1 && strcmp(argv[1], "-f") == 0) { +#if 0 fastlogin++; +#else /* 0 */ +#if INSECURE_OVERRIDE + force = 1; +#else /* INSECURE_OVERRIDE */ + fprintf(stderr, "Sorry, but the -f option is not supported by this build of OPIE.\n"); +#endif /* INSECURE_OVERRIDE */ +#endif /* 0 */ argc--, argv++; goto again; } @@ -268,24 +301,35 @@ again: argv++; } - openlog("su", LOG_ODELAY, LOG_AUTH); - atexit(catchexit); - { struct passwd *pwd; + char *p = getlogin(); + char buf[32]; if ((pwd = getpwuid(getuid())) == NULL) { - syslog(LOG_CRIT, "'%s' failed for unknown uid %d on %s", argv[0], getuid(), ttyname(2)); + syslog(LOG_CRIT, "'%s' failed for unknown uid %d on %s", argvbuf, getuid(), ttyname(2)); #if HAVE_SULOG sulog(0, "unknown"); #endif /* HAVE_SULOG */ exit(1); } - strcpy(buf, pwd->pw_name); - } + strncpy(buf, pwd->pw_name, sizeof(buf)-1); + buf[sizeof(buf)-1] = 0; + + if (!p) + p = "unknown"; + + strncpy(currentuser, p, 31); + currentuser[31] = 0; + + if (p && *p && strcmp(currentuser, buf)) { + strcat(currentuser, "("); + strcat(currentuser, buf); + strcat(currentuser, ")"); + }; if (lookupuser(user)) { - syslog(LOG_CRIT, "'%s' failed for %s on %s", argv[0], Getlogin(), ttyname(2)); + syslog(LOG_CRIT, "'%s' failed for %s on %s", argvbuf, currentuser, ttyname(2)); #if HAVE_SULOG sulog(0, NULL); #endif /* HAVE_SULOG */ @@ -312,6 +356,7 @@ userok: #endif /* HAVE_SETPRIORITY && HAVE_SYS_RESOURCE_H */ } #endif /* DOWHEEL */ + }; if (!thisuser.pw_passwd[0] || getuid() == 0) goto ok; @@ -327,6 +372,11 @@ userok: fprintf(stderr, "Then run su without the -c parameter.\n"); if (opieinsecure()) { fprintf(stderr, "Sorry, but you don't seem to be on the console or a secure terminal.\n"); +#if INSECURE_OVERRIDE + if (force) + fprintf(stderr, "Warning: Continuing could disclose your secret pass phrase to an attacker!\n"); + else +#endif /* INSECURE_OVERRIDE */ exit(1); }; #if NEW_PROMPTS @@ -379,16 +429,17 @@ userok: }; }; error: - opieverify(&opie, ""); + if (!console) + opieverify(&opie, ""); fprintf(stderr, "Sorry\n"); - syslog(LOG_CRIT, "'%s' failed for %s on %s", argv[0], Getlogin(), ttyname(2)); + syslog(LOG_CRIT, "'%s' failed for %s on %s", argvbuf, currentuser, ttyname(2)); #if HAVE_SULOG sulog(0, NULL); #endif /* HAVE_SULOG */ exit(2); ok: - syslog(LOG_NOTICE, "'%s' by %s on %s", argv[0], Getlogin(), ttyname(2)); + syslog(LOG_NOTICE, "'%s' by %s on %s", argvbuf, currentuser, ttyname(2)); #if HAVE_SULOG sulog(1, NULL); #endif /* HAVE_SULOG */ @@ -423,10 +474,12 @@ ok: setpriority(PRIO_PROCESS, 0, 0); #endif /* HAVE_SETPRIORITY && HAVE_SYS_RESOURCE_H */ +#if 0 if (fastlogin) { *argv-- = "-f"; *argv = "su"; } else +#endif /* 0 */ if (fulllogin) { if (chdir(thisuser.pw_dir) < 0) { fprintf(stderr, "No directory\n"); diff --git a/contrib/opie/opietest.c b/contrib/opie/opietest.c index edccf7449a39..49f8f4d82320 100644 --- a/contrib/opie/opietest.c +++ b/contrib/opie/opietest.c @@ -8,14 +8,17 @@ It's safe to say that, if tests fail, OPIE isn't going to work right on your system. The converse is not such a safe statement. -%%% copyright-cmetz -This software is Copyright 1996 by Craig Metz, All Rights Reserved. +%%% copyright-cmetz-96 +This software is Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to this software. You should have received a copy of the license with this software. If you didn't get a copy, you may request one from <license@inner.net>. History: + Modified by cmetz for OPIE 2.31. Added a couple of new checks, + removed a few commented-out checks for functions that + no longer exist, added test-skip capability. Modified by cmetz for OPIE 2.3. Use new calling conventions for opiebtoa8()/atob8(). opiegenerator() outputs hex now. Modified by cmetz for OPIE 2.22. Test opielock()/opieunlock() @@ -27,9 +30,6 @@ you didn't get a copy, you may request one from <license@inner.net>. #include "opie.h" char buffer[1024]; -int tests_passed = 0; -int tests_failed = 0; -int ntests = 0, testn = 0; int testatob8() { @@ -140,6 +140,13 @@ int testhashmd5() return 0; } +int testinsecure() +{ + opieinsecure(); + + return 0; +} + int testkeycrunch() { static char testin1[] = "ke1234"; @@ -159,6 +166,9 @@ int testlock() { int i; + if (getuid()) + return -2; + for (i = 0; i < 3; i++) if (opielock("__opietest")) return -1; @@ -180,10 +190,25 @@ int testpasscheck() return 0; } +int testrandomchallenge() +{ + char buffer[OPIE_CHALLENGE_MAX+1]; + + opierandomchallenge(buffer); + + if (strncmp(buffer, "otp-", 4)) + return -1; + + return 0; +} + int testunlock() { int i; + if (getuid()) + return -2; + for (i = 0; i < 3; i++) if (opieunlock()) return -1; @@ -204,27 +229,33 @@ static struct opietest opietests[] = { { testbtoa8, "btoa8" }, { testbtoe, "btoe" }, { testetob, "etob" }, -/* { testchallenge, "challenge" }, */ +/* { testchallenge, "challenge" }, */ { testgenerator, "generator" }, { testgetsequence, "getsequence" }, -/* { testgetutmpentry, "getutmpentry" }, */ { testhashmd4, "hash(MD4)" }, { testhashmd5, "hash(MD5)" }, -/* { testinsecure, "insecure" }, */ + { testinsecure, "insecure" }, { testkeycrunch, "keycrunch" }, { testlock, "lock" }, -/* { testpututmpentry, "pututmpentry" }, */ -/* { testrandomchallenge, "randomchallenge" }, */ + { testrandomchallenge, "randomchallenge" }, /* { testreadpass, "readpass" }, */ { testunlock, "unlock" }, -/* { testverify, "verify" }, */ -/* { testversion, "version" }, */ +/* { testverify, "verify" }, */ { NULL, NULL } }; int main FUNCTION((argc, argv), int argc AND char *argv[]) { struct opietest *opietest; + int tests_passed = 0; + int tests_failed = 0; + int tests_skipped = 0; + int ntests = 0, testn = 0; + + if (getuid() != geteuid()) { + fprintf(stderr, "opietest: do not make this program setuid!\n"); + exit(1); + }; for (opietest = opietests; opietest->n; opietest++) ntests++; @@ -233,17 +264,25 @@ int main FUNCTION((argc, argv), int argc AND char *argv[]) for (opietest = opietests, testn = 1; opietest->n; opietest++) { printf("(%2d/%2d) testing opie%s... ", testn++, ntests, opietest->n); - if (opietest->f()) { - printf("FAILED!\n"); - tests_failed++; - } else { - printf("passed\n"); - tests_passed++; - opietest->f = NULL; + switch(opietest->f()) { + case -2: + printf("skipped\n"); + tests_skipped++; + opietest->f = NULL; + break; + case -1: + printf("FAILED!\n"); + tests_failed++; + break; + case 0: + printf("passed\n"); + tests_passed++; + opietest->f = NULL; + break; } } - printf("opietest: completed %d tests. %d tests passed, %d tests failed.\n", ntests, tests_passed, tests_failed); + printf("opietest: completed %d tests. %d tests passed, %d tests skipped, %d tests failed.\n", ntests, tests_passed, tests_skipped, tests_failed); if (tests_failed) { printf("opietest: please correct the following failures before attempting to use OPIE:\n"); for (opietest = opietests; opietest->n; opietest++) diff --git a/contrib/opie/permsfile.c b/contrib/opie/permsfile.c index 10b98c50cdd4..0d12534f4e86 100644 --- a/contrib/opie/permsfile.c +++ b/contrib/opie/permsfile.c @@ -1,8 +1,8 @@ /* permsfile.c: implement SunOS /etc/fbtab and Solaris /etc/logindevperm functionality to set device permissions on login -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -15,6 +15,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Include unistd.h. Modified by cmetz for OPIE 2.3. Check for NULL return from ftpglob(), combine some expressions, fix a typo. Made file selection a bit more generic. @@ -30,6 +31,9 @@ License Agreement applies to this software. #if HAVE_STRING_H #include <string.h> #endif /* HAVE_STRING_H */ +#if HAVE_UNISTD_H +#include <unistd.h> +#endif /* HAVE_UNISTD_H */ #include <syslog.h> #include "opie.h" diff --git a/contrib/opie/popen.c b/contrib/opie/popen.c index 22477a60d9ac..54df00bd4b4d 100644 --- a/contrib/opie/popen.c +++ b/contrib/opie/popen.c @@ -1,7 +1,7 @@ /* popen.c: A "safe" pipe open routine. -%%% portions-copyright-cmetz -Portions of this software are Copyright 1996 by Craig Metz, All Rights +%%% portions-copyright-cmetz-96 +Portions of this software are Copyright 1996-1997 by Craig Metz, All Rights Reserved. The Inner Net License Version 2 applies to these portions of the software. You should have received a copy of the license with this software. If @@ -14,6 +14,7 @@ License Agreement applies to this software. History: + Modified by cmetz for OPIE 2.31. Merged in some 4.4BSD-Lite fixes. Modified by cmetz for OPIE 2.2. Use FUNCTION declaration et al. Removed useless string. ifdef around some headers. Modified at NRL for OPIE 2.1. Optimized for only one pipe at a time. @@ -24,8 +25,8 @@ License Agreement applies to this software. */ /* - * Copyright (c) 1988 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1988, 1993, 1994 + * The Regents of the University of California. All rights reserved. * * This code is derived from software written by Ken Arnold and * published in UNIX Review, Vol. 6, No. 8. @@ -88,16 +89,18 @@ char **copyblk __P((char **)); VOIDRET blkfree __P((char **)); /* - * Special version of popen which avoids call to shell. This insures noone + * Special version of popen which avoids call to shell. This ensures noone * may create a pipe to a hidden program as a side effect of a list or dir * command. */ static pid_t child_pid = -1; static int pipe_fd; +extern char **environ; + FILE *ftpd_popen FUNCTION((program, type), char *program AND char *type) { - register char *cp; + char *cp; FILE *iop; int argc, gargc, pdes[2]; char **pop, *argv[100], *gargv[1000], *vv[2]; @@ -150,6 +153,7 @@ FILE *ftpd_popen FUNCTION((program, type), char *program AND char *type) } close(pdes[1]); } + environ = NULL; execv(gargv[0], gargv); _exit(1); } @@ -195,10 +199,12 @@ int ftpd_pclose FUNCTION((iop), FILE *iop) child_pid = -1; pipe_fd = -1; -#ifdef WEXITSTATUS - /* this is the fully POSIX compliant implementation */ - return (pid == -1 ? -1 : WEXITSTATUS(status)); -#else +#if defined(WEXITSTATUS) && defined(WIFEXITED) + if ((pid > 0) && WIFEXITED(status)) + return WEXITSTATUS(status); + + return -1; +#else /* defined(WEXITSTATUS) && defined(WIFEXITED) */ return (pid == -1 ? -1 : status.w_status); -#endif +#endif /* defined(WEXITSTATUS) && defined(WIFEXITED) */ } |