diff --git a/CHANGES b/CHANGES index 6ad5b47..59137d8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,16 @@ CHANGES ======= +version 7.0.0 (Feb 18, 2001): + - GNU configure-based packaging!!! + All work done by Mark D. Roth . + Thank you! + - Removed conserver/cons.h and moved options into --with + and --enable configure arguments + - ioctl() bug found by Ross Parker + - Removed last of the "loopback preference" code in + console/console.c - should have been removed a long time ago + version 6.1.7 (Dec 14, 2000): - Documented no parity option in conserver.cf.man - Lowered default CONNECTTIMEOUT to 10 seconds @@ -91,5 +101,5 @@ before version 6.05: and enhancements of various types were applied. # -# $Id: CHANGES,v 1.20 2000-12-14 16:32:46-08 bryan Exp $ +# $Id: CHANGES,v 1.23 2001-02-18 22:36:45-08 bryan Exp $ # diff --git a/INSTALL b/INSTALL index e75c083..e5f40b7 100644 --- a/INSTALL +++ b/INSTALL @@ -3,24 +3,30 @@ Quickie Instructions - - Edit 'conserver/cons.h' (if necessary) + - Run './configure' - - Run 'make' - - - If all is well, run 'make install install.man' + - If all is well, run 'make install' - Now set up config files, etc. (see below) - Things will install in /usr/local. If you'd like to use a different - prefix, use 'make PREFIX=/your/path install'. - - Detailed Instructions - - First thing to do is set up a custom conserver/cons.h file. If you - like all the defaults provided in conserver/port.h, your set. - Just use the default cons.h cons.h file. Here are some of the - more important #defines to look for: + - First thing to do is determine if you want different defaults. A + './configure --help' will show you the basics. If you like all + the defaults shown, your set. If not, here are the conserver + unique options: + + --with-port=PORT Specify port number [conserver] + --with-master=MASTER Specify master server hostname [console] + --with-cffile=CFFILE Specify config filename [conserver.cf] + --with-pwdfile=PWDFILE Specify password filename [conserver.passwd] + --with-maxmemb=MAXMEMB Specify maximum consoles per process [8] + --with-maxgrp=MAXGRP Specify maximum number of processes [32] + --enable-8bit Enable 8bit data path + --with-timeout=TIMEOUT Specify connect() timeout in seconds [10] + + Not surprisingly, some match the old conserver/cons.h items...here + they are for reference: PORT or SERVICE - Socket used to communicate HOST - Hostname of console server @@ -29,45 +35,52 @@ Detailed Instructions MAXMEMB - Number of consoles per child process MAXGRP - Number of child processes - - Now run 'make'. If you're platform is supported you'll get a nice - message about "Configuring for ..." and the programs should compile. - If not, you'll have to adjust the settings, or slightly worse, - port the software. For adjusting the settings (like using a - different compiler or something), check out the .settings file. - 'make config', which is done for you, symlinks it to port/. - If you have to port the software, follow the instructions you - received. + - Run './configure'. This will detect system specific + information. The --prefix option will redirect where things are + installed. Other options are available as well...try + './configure --help'. - - Once things build, you can run 'make install install.man'. - This will put things into the /usr/local tree. If you'd like - things deposited elsewhere, you can use 'make PREFIX=/your/path - install install.man'. We like to use something like 'make - PREFIX=/tools/conserver install install.man'. + - Now run 'make'. Hopefully things will compile. + + - Once things build, you can run 'make install'. + + - If you'd like to build the autologin application, you'll need to + run 'make autologin'. If you'd like it installed, use 'make + autologin.install'. - Now that the binaries are in place, we need to set up the configuration files and such. - If you used a blank cons.h file or defined a service name (SERVICE - token above), you'll need to enter a definition in your services - file (directly, via NIS, or whatever). Here's what we use: + + Does your conserver master hostname exist? This is the + hostname specified with the --with-master option. By default + the hostname is "console", so make sure it's in DNS, hosts + files, or whatever. - console 782/tcp conserver # console server + + If you used a symbolic name for the --with-port option (by + default it uses "conserver", so the answer would be yes), + you'll need to enter a definition in your services file + (directly, via NIS, or whatever). Here's what we use: - If you defined PORT, you shouldn't have to worry about this step. + console 782/tcp conserver # console server - Next, make sure conserver runs during boot. The init script - we use under Solaris is installed in /etc/conserver.rc. - Use that or some form of it for your own /etc/init.d script or an - entry in startup files (/etc/rc, /etc/rc.local, or whatever). + If you used a number, you shouldn't have to worry about this + step. - Now for the fun stuff. You need to create a conserver.cf and - conserver.passwd file. Those are defined with the CONFIG and - PASSWD_FILE settings. If you ever need to know what values - were compiled into conserver, run 'conserver -V'. See the - conserver.cf/INSTALL file for instructions on setup of these files. + + Next, make sure conserver runs during boot. The init script we + use under Solaris is installed in /etc/conserver.rc. + Use that or some form of it for your own /etc/init.d script or + an entry in startup files (/etc/rc, /etc/rc.local, or + whatever). + + + Now for the fun stuff. You need to create a conserver.cf and + conserver.passwd file. Those are defined with the + --with-cffile and --with-pwdfile settings. If you ever need to + know what values were compiled into conserver, run 'conserver + -V'. See the conserver.cf/INSTALL file for instructions on + setup of these files. - That's it! Just start up the console server and enjoy! # -# $Id: INSTALL,v 1.6 2000-03-02 02:26:50-08 bryan Exp $ +# $Id: INSTALL,v 1.8 2001-02-18 21:50:14-08 bryan Exp $ # diff --git a/Makefile b/Makefile deleted file mode 100644 index a198cf0..0000000 --- a/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# $Id: Makefile,v 1.8 2000-03-06 18:08:31-08 bryan Exp $ -# -# Master Makefile -# - -SUBDIRS=conserver console conserver.cf - -all clean install install.man: FRC - @if [ ! -f .settings ]; then \ - echo "Running a 'make config' for you"; \ - ${MAKE} config; \ - fi - @if [ -f .settings ]; then \ - s=`cat .settings | grep -v '^#'`; \ - settings=`echo $$s`; \ - if [ -n "${PREFIX}" ]; then settings="'PREFIX=${PREFIX}' $$settings"; fi; \ - for s in ${SUBDIRS}; do \ - ( cd $$s; eval ${MAKE} $$settings $@ ) \ - done; \ - else \ - echo; \ - echo "There is a problem with your platform type. Try running"; \ - echo "'make config' and look into the errors"; \ - echo; \ - exit; \ - fi - @if [ "$@" = "clean" ]; then rm .settings; fi - -config: - @p=`port/system 2>/dev/null`; \ - if [ -n "$$p" ]; then \ - rm -f .settings; \ - ln -s port/$$p .settings; \ - echo "Configured for $$p"; \ - else \ - echo "*** Can't determine system type."; \ - echo "*** See ./port for porting issues."; \ - fi - -FRC: - -SHELL=/bin/sh diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..01b0e14 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,43 @@ +### Path settings +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +mandir = @mandir@ +libdir = @libdir@ +includedir = @includedir@ +sysconfdir = @sysconfdir@ + +@SET_MAKE@ + + +### Makefile rules - no user-servicable parts below + +SUBDIRS = conserver console conserver.cf + +all: + for n in $(SUBDIRS); do \ + ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \ + done + +autologin: + ( cd autologin && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; + +autologin.install: + ( cd autologin && $(MAKE) install $(MAKE_FLAGS) ) || exit 1; + +install: + for n in $(SUBDIRS); do \ + ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \ + done + +clean: + for n in $(SUBDIRS); do \ + ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \ + done + +distclean: + for n in $(SUBDIRS); do \ + ( cd $$n && $(MAKE) $@ $(MAKE_FLAGS) ) || exit 1; \ + done + rm -f config.cache config.log config.status config.h Makefile + diff --git a/README b/README index 6be3675..1d85f34 100644 --- a/README +++ b/README @@ -1,32 +1,62 @@ README ====== + Maintainer/Enhancer Bryan Stansell (bryan@conserver.com) of Certainty Solutions, Inc. - - formerly Global Networking and Computing (GNAC) + formerly Global Networking and Computing (GNAC). + + +Big new version released! + + 7.0.0 is out! What's so great about 7.0.0? GNU's autoconf has been + integrated by Mark Roth (roth@feep.net)! I met Mark at the [1]LISA + conference last December and he (quite quickly) provided the patches. + I've been dragging my heels getting it out to others, but it's now + available. + + Now that I have autoconf capabilities, I've taken out the need to edit + the conserver/cons.h file - everything is now a --with or --enable + configure argument (makes sense, doesn't it!?!). As with any X.0.0 + release, I may have introduced something bad into the code for systems + I don't have access to, so be careful. + + I've successfully built 7.0.0 on Solaris and Linux. I've been told the + client has built successfully under cygwin on NT (progress on the NT + front!). Last report shows FreeBSD as a failure (any coders out there + with FreeBSD have time to send me patches?). If anyone successfully + builds and installs the software under other operating systems, I'd + love to hear about it. + + +Finally, a FAQ! + + Here's the start of a conserver [2]FAQ. Got any additions? Let me + know. Mailing Lists - There are currently two mailing lists available at conserver.com. - announce@conserver.com is an announcement-only mailing list for + There are currently two mailing lists available. + [3]announce@conserver.com is an announcement-only mailing list for informing of new versions, major developments, etc. - users@conserver.com is for general Q&A, discussions, ideas, etc for - conserver users. See http://www.conserver.com/ for pointers to - these and possibly future lists. + [4]users@conserver.com is for general Q&A, discussions, ideas, etc + for conserver users. You can sign up my sending a message to + list-request@conserver.com with a subject of "subscribe" or head + over to the online [5]web pages. Origin The console server software found here is a heavily modified - version originally written by Tom Fine (fine@cis.ohio-state.edu) - and then Kevin S Braunsdorf (ksb+conserver@sa.fedex.com). Patches + version originally written by Tom Fine (fine@head-cfa.harvard.edu) + and then Kevin S Braunsdorf (ksb+conserver@sa.fedex.com). Patches from Robert Olson (olson@mcs.anl.gov) were then applied to get network console support. Arnold de Leon (arnold@corp.webtv.net) then fixed various bugs and - added enhancements while at Synopsys. I then took the result and + added enhancements while at Synopsys. I then took the result and continued fixing things and adding features we found useful. Certainty Solutions has been supporting my coding efforts (in too many ways to list) since 1996. @@ -34,16 +64,16 @@ Origin The conserver.com Distribution - The result is a combination of many people's work. This version is - being released in hopes that it will help others. There is no + The result is a combination of many people's work. This version is + being released in hopes that it will help others. There is no warranty or support implied by the distribution of the software. - As of version 6.1.7, the packaging and numbering sheme has - changed. I used to package conserver as conserver-GNAC-v.vv. - Since GNAC (now Certainty Solutions) has changed it's name I've + As of version 6.1.7, the packaging and numbering scheme has + changed. I used to package conserver as conserver-GNAC-v.vv. Since + GNAC (now [6]Certainty Solutions) has changed it's name I've decided to drop the GNAC portion and use a 3 digit version number - (conserver-v.v.v). Why change the version numbering? I need to - differenciate this thread of the code from the original authors and + (conserver-v.v.v). Why change the version numbering? I need to + differentiate this thread of the code from the original authors and I couldn't come up with a good replacement for the GNAC name - sad, but true. @@ -55,11 +85,20 @@ Downloading Other Good Information - Zonker Harris has fabulous documents regarding the hookup - of consoles to terminal servers and other such devices. His - Greater Scroll of Console Knowledge is a great place to start - (http://www.conserver.com/consoles/). + Zonker Harris has fabulous documents regarding the hookup of + consoles to terminal servers and other such devices. His + [13]Greater Scroll of Console Knowledge is a great place to start. + + +References + + 1. http://www.usenix.org/publications/library/proceedings/lisa2000/ + 2. http://www.conserver.com/FAQ + 3. mailto:announce@conserver.com + 4. mailto:users@conserver.com + 5. https://www.conserver.com/mailman/listinfo + 6. http://www.certaintysolutions.com/ # -# $Id: README,v 1.12 2000-12-14 16:31:04-08 bryan Exp $ +# $Id: README,v 1.14 2001-02-18 22:49:41-08 bryan Exp $ # diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 0000000..8ab004f --- /dev/null +++ b/acconfig.h @@ -0,0 +1,41 @@ +/* + * Socket used to communicate + * Choose either PORT or SERVICE... + */ +#undef SERVICENAME +#undef PORTNUMBER + +/* + * Hostname of console server + */ +#undef MASTERHOST + +/* + * Config file path + */ +#undef CONFIGFILE + +/* + * Password file path + */ +#undef PASSWDFILE + +/* + * Number of consoles per child process + */ +#undef MAXMEMB + +/* + * Number of child processes + */ +#undef MAXGRP + +/* + * Clear parity (high-bit) [true/false setting] + */ +#undef CPARITY + +/* + * TCP connection timeout + */ +#undef CONNECTTIMEOUT diff --git a/autologin/Makefile b/autologin/Makefile deleted file mode 100644 index ff1ce8b..0000000 --- a/autologin/Makefile +++ /dev/null @@ -1,83 +0,0 @@ -# -# $Id: Make.host,v 1.13 94/06/03 15:32:46 nuspl Exp $ -# -# Makefile for autologin -# -# Jeff W. Stewart, Purdue University Computing Center -# - -DESTDIR= -BINDIR= ${DESTDIR}/usr/local/etc - -INCLUDE= -DEBUG= -g -DEFS= -DPUCC -DSUN5 -CFLAGS= ${DEBUG} ${DEFS} ${INCLUDE} - -GENC= main.c -GENH= main.h -GEN= ${GENC} ${GENH} -HDR= -SRC= autologin.c -OBJ= autologin.o main.o -SOURCE= README autologin.man autologin.m Makefile ${SRC} ${HDR} - - - -all: autologin - -autologin: ${OBJ} - ${CC} ${CFLAGS} -o autologin ${OBJ} - -main.h: main.c - -main.c: autologin.m - mkcmd std_help.m std_version.m autologin.m - -(cmp -s prog.c main.c || (cp prog.c main.c && echo main.c updated)) - -(cmp -s prog.h main.h || (cp prog.h main.h && echo main.h updated)) - rm -f prog.[ch] - -# On keep (EPIX), putenv.o is extracted (ar x) from /usr/lib/libc.a -# and setgroups.o is extracted from libbsd.a -# -putenv.o: - ar x /usr/lib/libc.a $@ - -setgroups.o: - ar x /usr/lib/libbsd.a $@ - -getut.o: - ar x /sysv/usr/lib/libc.a $@ - -clean: FRC - rm -f autologin *.o errs core Makefile.bak a.out lint.errs ${GEN} - -lint: ${HDR} ${SRC} ${GEN} FRC - lint -h ${CDEFS} ${INCLUDE} ${GEN} ${SRC} - -install: all - install -c -s -m 755 autologin ${BINDIR} - -distrib: - distrib -c ${BINDIR}/autologin - -depend: ${HDR} ${SRC} ${GEN} - maketd -a ${HDR} ${SRC} ${GEN} - -spotless: clean - rcsclean Makefile ${HDR} ${SRC} - -source: ${SOURCE} - -${SOURCE}: - co -q $@ - -FRC: - -# DO NOT DELETE THIS LINE - maketd DEPENDS ON IT - -main.o: main.c - -autologin.o: autologin.c main.h - -# *** Do not add anything here - It will go away. *** diff --git a/autologin/Makefile.in b/autologin/Makefile.in new file mode 100644 index 0000000..988f403 --- /dev/null +++ b/autologin/Makefile.in @@ -0,0 +1,51 @@ +### Path settings +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sysconfdir = @sysconfdir@ + +### Installation programs and flags +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s +LN_S = @LN_S@ +MKDIR = @MKDIR@ + +### Compiler and link options +CC = @CC@ +CFLAGS = @CFLAGS@ # -DPUCC -DSUN5 +DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" +CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) $(DEFS) @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +@SET_MAKE@ + + +### Makefile rules - no user-servicable parts below + +AUTOLOGIN_OBJS = main.o autologin.o +AUTOLOGIN_HDRS = ../config.h $(top_srcdir)/compat.h $(srcdir)/main.h +ALL = autologin + + +all: $(ALL) + +.PHONY: clean distclean install + +autologin: $(AUTOLOGIN_OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o autologin $(AUTOLOGIN_OBJS) $(LIBS) + +%.o: $(srcdir)/%.c $(AUTOLOGIN_HDRS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +clean: + rm -f *~ *.o $(ALL) core + +distclean: clean + rm -f Makefile + +install: + $(MKDIR) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) autologin $(DESTDIR)$(bindir) + diff --git a/autologin/autologin.c b/autologin/autologin.c index feb3ae4..9309157 100644 --- a/autologin/autologin.c +++ b/autologin/autologin.c @@ -10,6 +10,8 @@ * * This program was written to be run out of inittab. */ +#include + #include #include #include @@ -18,165 +20,27 @@ #include #include #include -#include +#include -#include -#if !defined IBMR2 -extern char *sys_errlist[]; -#define strerror(Me) (sys_errlist[Me]) -#endif - -#define NEED_PUTENV (!(defined(IBMR2) || defined(EPIX) || defined(SUNOS) || defined(SUN5))) - -#if S81 -#include -#else -#include -#endif - -#if SUN5 -#define USE_UTENT 1 -#include -#include - -static int -getdtablesize() -{ - auto struct rlimit rl; - - (void)getrlimit(RLIMIT_NOFILE, &rl); - return rl.rlim_cur; -} -#endif - -/* yucky kludges - */ -#ifdef EPIX -#include "/bsd43/usr/include/ttyent.h" -#include -#define NGROUPS_MAX 8 -#define getsid(Mp) (Mp) -#define getdtablesize() 64 -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -typedef int mode_t; -extern struct passwd *getpwnam(); -extern struct group *getgrnam(); -#define USE_TC 1 -#define USE_UTENT 1 -#else - -#if defined IBMR2 -#include -#define setsid() getpid() -#define getsid(Mp) (Mp) -#define HAVE_GETUSERATTR 1 -#define USE_TC 1 -#define USE_UTENT 1 -#else - -#if defined V386 -typedef int mode_t; -#define getdtablesize() OPEN_MAX -#define setsid() getpid() -#define getsid(Mp) (Mp) -#define setgroups(x, y) 0 -#include -#include -#define USE_IOCTL 1 -#define USE_TC 1 -#else - -#if defined S81 -#include -#include -typedef int mode_t; -#define setsid() getpid() -#define getsid(Mp) (Mp) -#define USE_IOCTL 1 -#define USE_TC 0 -#define USE_OLD_UTENT 1 -#else - -#if defined(NETBSD) -#include -#include -#include -#include -#include -#define setsid() getpid() -#define getsid(Mp) (Mp) -#define USE_IOCTL 1 -#define USE_OLD_UTENT 1 -#define PATH_SU "/usr/ucb/su" -#define UTMP_PATH "/var/run/utmp" -#else - -#if defined(FREEBSD) -#include -#include -#include -#include -#include -#define setsid() getpid() -#define getsid(Mp) (Mp) -#define USE_IOCTL 1 -#define USE_OLD_UTENT 1 -#define PATH_SU "/usr/ucb/su" -#else - -#include -#endif /* NETBSD */ -#endif /* 386bsd or equiv */ -#endif /* sequent */ -#endif /* intel v386 */ -#endif /* find termios */ -#endif /* find any term stuff */ - - -#ifdef SUNOS -#include -#include -#define setsid() getpid() -#define getsid(Mp) (Mp) -#endif - -#if ! defined V386 -#include -#endif - -#ifdef IBMR2 -#include -#include -#endif /* IBMR2 */ - -#include "main.h" +#include #define TTYMODE 0600 #ifndef O_RDWR -#define O_RDWR 2 +# define O_RDWR 2 #endif -#ifndef NGROUPS_MAX -#define NGROUPS_MAX 8 +#ifndef UTMP_FILE +# if defined(_PATH_UTMP) +# define UTMP_FILE _PATH_UTMP +# else +# define UTMP_FILE "/etc/utmp" +# endif #endif -#if !defined(UTMP_FILE) -#if defined(_PATH_UTMP) -#define UTMP_FILE _PATH_UTMP -#else -#define UTMP_FILE "/etc/utmp" -#endif -#endif - -#if !defined(PATH_SU) #define PATH_SU "/bin/su" -#endif /* * Global variables @@ -185,7 +49,7 @@ typedef int mode_t; #ifndef lint char *rcsid = "$Id: autologin.c,v 1.22 93/09/04 21:48:41 ksb Exp $"; #endif /* not lint */ -char *progname; +extern char *progname; gid_t awGrps[NGROUPS_MAX]; int iGrps = 0; @@ -210,23 +74,28 @@ Process() char *pcCmd = (char *)0, *pcDevTty = (char *)0; char *pcTmp; -#ifdef IBMR2 +#ifdef HAVE_GETUSERATTR char *pcGrps; -#endif /* IBMR2 */ +#endif struct passwd *pwd; struct stat st; -#if USE_IOCTL - auto struct sgttyb n_sty; -#if USE_TC - auto struct tc n_tchars; -#else - auto struct tchars n_tchars; -#endif -#if HAVE_JOBS - auto struct ltchars n_ltchars; -#endif -#else +#ifdef HAVE_TERMIOS_H struct termios n_tio; +#else +# ifdef TIOCNOTTY +# ifdef O_CBREAK + auto struct tc n_tchars; +# else + auto struct tchars n_tchars; +# endif +# ifdef TIOCGLTC + auto struct ltchars n_ltchars; +# endif +# else +# ifdef TIOCGETP + auto struct sgttyb n_sty; +# endif +# endif #endif @@ -289,7 +158,7 @@ Process() if (0 != stat(pcDevTty, &st)) { (void) fprintf(stderr, "%s: Can't stat %s: %s\n", progname, pcDevTty, strerror(errno)); ++iErrs; -#ifdef IBMR2 +#if defined(VCHR) && defined(VMPC) } else if (VCHR != st.st_type && VMPC != st.st_type) { (void) fprintf(stderr, "%s: %s is not a character device\n", progname, pcDevTty); ++iErrs; @@ -351,39 +220,36 @@ Process() /* put the tty in out process group */ -#if ! (EPIX || SUN5) -#if USE_TC +#ifdef HAVE_TCGETPGRP if (-1 >= (i = tcgetpgrp(0))){ (void) fprintf(stderr, "%s: tcgetpgrp: %s\n", progname, strerror(errno)); } #endif -#if USE_SETPGRP +#ifndef SETPGRP_VOID if (-1 != i && setpgrp(0, i) ){ (void) fprintf(stderr, "%s: setpgrp: %s, i = %d\n", progname, strerror(errno), i); } #endif -#if USE_TC +#ifdef HAVE_TCSETPGRP if (tcsetpgrp(0, iNewGrp)){ (void) fprintf(stderr, "%s: tcsetpgrp: %s\n", progname, strerror(errno)); } #endif -#if USE_SETPGRP +#ifndef SETPGRP_VOID if (-1 != iNewGrp && setpgrp(0, iNewGrp)){ (void) fprintf(stderr, "%s: setpgrp: %s, iNewGrp = %d\n", progname, strerror(errno), iNewGrp); } -#endif - #endif /* put the tty in the correct mode */ -#if USE_IOCTL +#ifndef HAVE_TERMIOS_H if (0 != ioctl(0, TIOCGETP, (char *)&n_sty)) { fprintf(stderr, "%s: iotcl: getp: %s\n", progname, strerror(errno)); exit(10); } -#if USE_TC +#ifdef O_CBREAK n_sty.sg_flags &= ~(O_CBREAK); n_sty.sg_flags |= (O_CRMOD|O_ECHO); #else @@ -411,7 +277,7 @@ Process() return; } #endif -#if HAVE_JOBS +#ifdef TIOCGLTC if (-1 == ioctl(0, TIOCGLTC, (char *)&n_ltchars)) { fprintf(stderr, "%s: ioctl: gltc: %s\n", progname, strerror(errno)); return; @@ -426,7 +292,7 @@ Process() } #endif #else /* not using ioctl, using POSIX or sun stuff */ -#if USE_TC +#ifdef HAVE_TCGETATTR if (0 != tcgetattr(0, &n_tio)) { (void) fprintf(stderr, "%s: tcgetattr: %s\n", progname, strerror(errno)); exit(1); @@ -455,19 +321,21 @@ Process() n_tio.c_cc[VSTART] = '\021'; /* ^Q */ n_tio.c_cc[VSTOP] = '\023'; /* ^S */ n_tio.c_cc[VSUSP] = '\032'; /* ^Z */ -#if USE_TC +#ifdef HAVE_TCSETATTR if (0 != tcsetattr(0, TCSANOW, &n_tio)) { (void) fprintf(stderr, "%s: tcsetattr: %s\n", progname, strerror(errno)); exit(1); /* NOTREACHED */ } #else +#ifndef HAVE_TERMIOS_H if (0 != ioctl(0, TCSETS, &n_tio)) { (void) fprintf(stderr, "%s: ioctl: TCSETS: %s\n", progname, strerror(errno)); exit(1); /* NOTREACHED */ } #endif +#endif #endif /* setup tty */ if (fMakeUtmp) { @@ -488,7 +356,7 @@ Process() } } -#if NEED_PUTENV +#ifndef HAVE_PUTENV int putenv(pcAssign) char *pcAssign; @@ -567,20 +435,7 @@ char *pctty; pcDev = pctty; } -#if USE_OLD_UTENT - /* look through /etc/utmp by hand (sigh) - */ - iFound = iPos = 0; - while (sizeof(utmp) == read(fdUtmp, & utmp, sizeof(utmp))) { - if (0 == strncmp(utmp.ut_line, pcDev, sizeof(utmp.ut_line))) { - ++iFound; - break; - } - iPos++; - } - (void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name)); -#else -#if USE_UTENT +#ifdef HAVE_GETUTENT /* look through getutent's by pid */ (void)setutent(); @@ -603,6 +458,7 @@ char *pctty; (void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line)); } #else +#ifdef HAVE_SETTTYENT { register struct ttyent *ty; @@ -623,6 +479,18 @@ char *pctty; (void)strncpy(utmp.ut_line, pcDev, sizeof(utmp.ut_line)); (void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name)); (void)strncpy(utmp.ut_host, "(autologin)", sizeof(utmp.ut_host)); +#else + /* look through /etc/utmp by hand (sigh) + */ + iFound = iPos = 0; + while (sizeof(utmp) == read(fdUtmp, & utmp, sizeof(utmp))) { + if (0 == strncmp(utmp.ut_line, pcDev, sizeof(utmp.ut_line))) { + ++iFound; + break; + } + iPos++; + } + (void)strncpy(utmp.ut_name, pclogin, sizeof(utmp.ut_name)); #endif #endif utmp.ut_time = time((time_t *) 0); diff --git a/autologin/main.c b/autologin/main.c index 53b5f87..e698203 100644 --- a/autologin/main.c +++ b/autologin/main.c @@ -3,173 +3,15 @@ * built by mkcmd version 7.6 Gamma */ +#include + #include #include -#include -extern int errno; -extern char *malloc(), *calloc(), *realloc(); - -#define ENVOPT 0 -#define GETARG 0 -#define GETOPT 1 -/* from std_help.m */ -/* from std_version.m */ -/* from autologin.m */ -/* $Id: T.c,v 7.2 94/07/11 00:42:06 ksb Exp $ - * literal text included from a tempate - * based on Keith Bostic's getopt in comp.sources.unix volume1 - * modified for mkcmd use.... by ksb@cc.purdue.edu (Kevin Braunsdorf) - */ - -#if GETOPT || GETARG -/* IBMR2 (AIX in the real world) defines - * optind and optarg in and confuses the hell out - * of the C compiler. So we use those externs. I guess we will - * have to stop using the old names. -- ksb - */ -#ifdef _AIX -#include -#else -static int - optind = 1; /* index into parent argv vector */ -static char - *optarg; /* argument associated with option */ -#endif -#endif /* only if we use them */ - -#if ENVOPT -/* breakargs - break a string into a string vector for execv. - * - * Note, when done with the vector, merely "free" the vector. - * Written by Stephen Uitti, PUCC, Nov '85 for the new version - * of "popen" - "nshpopen", that doesn't use a shell. - * (used here for the as filters, a newer option). - * - * breakargs is copyright (C) Purdue University, 1985 - * - * Permission is hereby given for its free reproduction and - * modification for All purposes. - * This notice and all embedded copyright notices be retained. - */ - -/* this trys to emulate shell quoting, but I doubt it does a good job (ksb) - * [[ but not substitution -- that would be silly ]] - */ -static char * -u_mynext(u_pcScan, u_pcDest) -register char *u_pcScan, *u_pcDest; -{ - register int u_fQuote; - - for (u_fQuote = 0; *u_pcScan != '\000' && (u_fQuote||(*u_pcScan != ' ' && *u_pcScan != '\t')); ++u_pcScan) { - switch (u_fQuote) { - default: - case 0: - if ('"' == *u_pcScan) { - u_fQuote = 1; - continue; - } else if ('\'' == *u_pcScan) { - u_fQuote = 2; - continue; - } - break; - case 1: - if ('"' == *u_pcScan) { - u_fQuote = 0; - continue; - } - break; - case 2: - if ('\'' == *u_pcScan) { - u_fQuote = 0; - continue; - } - break; - } - if ((char*)0 != u_pcDest) { - *u_pcDest++ = *u_pcScan; - } - } - if ((char*)0 != u_pcDest) { - *u_pcDest = '\000'; - } - return u_pcScan; -} - -/* given an envirionment variable insert it in the option list (ksb) - * (exploded with the above routine) - */ -static int -u_envopt(cmd, pargc, pargv) -char *cmd, *(**pargv); -int *pargc; -{ - register char *p; /* tmp */ - register char **v; /* vector of commands returned */ - register unsigned sum; /* bytes for malloc */ - register int i, j; /* number of args */ - register char *s; /* save old position */ - - while (*cmd == ' ' || *cmd == '\t') - cmd++; - p = cmd; /* no leading spaces */ - i = 1 + *pargc; - sum = sizeof(char *) * i; - while (*p != '\000') { /* space for argv[]; */ - ++i; - s = p; - p = u_mynext(p, (char *)0); - sum += sizeof(char *) + 1 + (unsigned)(p - s); - while (*p == ' ' || *p == '\t') - p++; - } - ++i; - /* vector starts at v, copy of string follows NULL pointer - * the extra 7 bytes on the end allow use to be alligned - */ - v = (char **)malloc(sum+sizeof(char *)+7); - if (v == NULL) - return 0; - p = (char *)v + i * sizeof(char *); /* after NULL pointer */ - i = 0; /* word count, vector index */ - v[i++] = (*pargv)[0]; - while (*cmd != '\000') { - v[i++] = p; - cmd = u_mynext(cmd, p); - p += strlen(p)+1; - while (*cmd == ' ' || *cmd == '\t') - ++cmd; - } - for (j = 1; j < *pargc; ++j) - v[i++] = (*pargv)[j]; - v[i] = NULL; - *pargv = v; - *pargc = i; - return i; -} -#endif /* u_envopt called */ - -#if GETARG -/* - * return each non-option argument one at a time, EOF for end of list - */ -static int -u_getarg(nargc, nargv) -int nargc; -char **nargv; -{ - if (nargc <= optind) { - optarg = (char *) 0; - return EOF; - } - optarg = nargv[optind++]; - return 0; -} -#endif /* u_getarg called */ +#include -#if GETOPT +#ifndef HAVE_GETOPT static int optopt; /* character checked for validity */ @@ -178,9 +20,9 @@ static int * does +arg if you give a last argument of "+", else give (char *)0 */ static int -u_getopt(nargc, nargv, ostr, estr) +getopt(nargc, nargv, ostr) int nargc; -char **nargv, *ostr, *estr; +char **nargv, *ostr; { register char *oli; /* option letter list index */ static char EMSG[] = ""; /* just a null place */ @@ -191,10 +33,6 @@ char **nargv, *ostr, *estr; return EOF; if (nargv[optind][0] != '-') { register int iLen; - if ((char *)0 != estr && 0 == strncmp(estr, nargv[optind], iLen = strlen(estr))) { - optarg = nargv[optind++]+iLen; - return '+'; - } return EOF; } place = nargv[optind]; @@ -239,10 +77,7 @@ char **nargv, *ostr, *estr; } return optopt; /* dump back option letter */ } -#endif /* u_getopt called */ -#undef ENVOPT -#undef GETARG -#undef GETOPT +#endif /* ! HAVE_GETOPT */ char *progname = "$Id$", @@ -274,12 +109,9 @@ int #ifndef u_terse #define u_terse (au_terse[0]) #endif -/* from std_help.m */ -/* from std_version.m */ -/* from autologin.m */ static char *rcsid = - "$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $"; + "$Id: autologin.m,v 1.2 92/07/28 13:18:34 ksb Exp $"; /* * parser @@ -302,7 +134,7 @@ char **argv; progname = argv[0]; else ++progname; - while (EOF != (u_curopt = u_getopt(argc, argv, sbOpt, (char *)0))) { + while (EOF != (u_curopt = getopt(argc, argv, sbOpt))) { switch (u_curopt) { case '*': fprintf(stderr, "%s: option `-%c\' needs a parameter\n", progname, optopt); diff --git a/compat.h b/compat.h new file mode 100644 index 0000000..e8bfb75 --- /dev/null +++ b/compat.h @@ -0,0 +1,185 @@ +#include + + +/* hpux doesn't have getdtablesize() and they don't provide a macro + * in non-KERNEL cpp mode + */ +#ifndef HAVE_GETDTABLESIZE +# ifdef HAVE_GETRLIMIT +static int +getdtablesize() +{ + auto struct rlimit rl; + + (void)getrlimit(RLIMIT_NOFILE, &rl); + return rl.rlim_cur; +} +# else /* ! HAVE_GETRLIMIT */ +# ifndef OPEN_MAX +# define OPEN_MAX 64 +# endif +# define getdtablesize() OPEN_MAX +# endif /* HAVE_GETRLIMIT */ +#endif /* ! HAVE_GETDTABLESIZE */ + +#if STDC_HEADERS +# include +# include +#else +# include +# ifndef HAVE_STRCHR +# define strchr index +# define strrchr rindex +# endif +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +/* if you do not have fd_set's here is a possible emulation + */ +#ifdef HAVE_SYS_SELECT_H +# include +#endif + +#ifndef FD_ZERO +typedef long fd_set; + +# define FD_ZERO(a) {*(a)=0;} +# define FD_SET(d,a) {*(a) |= (1 << (d));} +# define FD_CLR(d,a) {*(a) &= ~(1 << (d));} +# define FD_ISSET(d,a) (*(a) & (1 << (d))) +#endif + +#ifdef HAVE_SYS_IOCTL_H +# include +#endif +#ifdef HAVE_SYS_IOCTL_COMPAT_H +# include +#endif + +#ifdef HAVE_TERMIOS_H +# include /* POSIX */ +#else +# ifdef HAVE_TERMIO_H +# include /* SysV */ +# else +# ifdef HAVE_SGTTY_H +# include /* BSD */ +# endif +# endif +#endif + +#ifdef HAVE_STROPTS_H +# include +#endif + + +#ifdef HAVE_TTYENT_H +# include +#endif + +#ifdef HAVE_SYS_TTOLD_H +# include +#endif + + +/* which type does wait(2) take for status location + */ +#include +#if HAVE_SYS_WAIT_H +# include +#else +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif + +#ifdef HAVE_SIGACTION +extern void Set_signal(int isg, RETSIGTYPE (*disp)(int)); +#else +# define Set_signal(sig, disp) (void)signal((sig), (disp)) +#endif + +#include +#if !defined(HAVE_STRERROR) +extern int errno; +extern char *sys_errlist[]; +# define strerror(Me) (sys_errlist[Me]) +#endif + +#if HAVE_H_ERRLIST +extern int h_errno; +extern char *h_errlist[]; +# define hstrerror(Me) (h_errlist[Me]) +#else +# define hstrerror(Me) "host lookup error" +#endif + + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + + +#if HAVE_SHADOW_H +# include +#endif + +#ifdef HAVE_CRYPT_H +# include +#endif + +#ifdef HAVE_GETOPT_H +# include +#endif + +#ifdef HAVE_SYS_VLIMIT_H +# include +#else +# include +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif + +#ifdef HAVE_SYS_UIO_H +# include +#endif + +#ifdef HAVE_SYS_PROC_H +# include +#endif + +#ifdef HAVE_SYS_AUDIT_H +# include +#endif + +#ifdef HAVE_USERSEC_H +#include +#endif + + +#ifndef NGROUPS_MAX +# define NGROUPS_MAX 8 +#endif + +#ifndef HAVE_GETSID +# define getsid(Mp) (Mp) +#endif + +#ifndef HAVE_SETSID +# define setsid() getpid() +#endif + +#ifndef HAVE_SETGROUPS +# define setgroups(x, y) 0 +#endif + diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..ed6a8c9 --- /dev/null +++ b/config.h.in @@ -0,0 +1,234 @@ +/* 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. */ +#ifndef _ALL_SOURCE +#undef _ALL_SOURCE +#endif + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define if you have that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to `int' if doesn't define. */ +#undef mode_t + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define if the `setpgrp' function takes no argument. */ +#undef SETPGRP_VOID + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* + * Socket used to communicate + * Choose either PORT or SERVICE... + */ +#undef SERVICENAME +#undef PORTNUMBER + +/* + * Hostname of console server + */ +#undef MASTERHOST + +/* + * Config file path + */ +#undef CONFIGFILE + +/* + * Password file path + */ +#undef PASSWDFILE + +/* + * Number of consoles per child process + */ +#undef MAXMEMB + +/* + * Number of child processes + */ +#undef MAXGRP + +/* + * Clear parity (high-bit) [true/false setting] + */ +#undef CPARITY + +/* + * TCP connection timeout + */ +#undef CONNECTTIMEOUT + +/* Define if you have the flock function. */ +#undef HAVE_FLOCK + +/* Define if you have the getdtablesize function. */ +#undef HAVE_GETDTABLESIZE + +/* Define if you have the getopt function. */ +#undef HAVE_GETOPT + +/* Define if you have the getpseudo function. */ +#undef HAVE_GETPSEUDO + +/* Define if you have the getrlimit function. */ +#undef HAVE_GETRLIMIT + +/* Define if you have the getsid function. */ +#undef HAVE_GETSID + +/* Define if you have the getspnam function. */ +#undef HAVE_GETSPNAM + +/* Define if you have the getuserattr function. */ +#undef HAVE_GETUSERATTR + +/* Define if you have the getutent function. */ +#undef HAVE_GETUTENT + +/* Define if you have the memcmp function. */ +#undef HAVE_MEMCMP + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the memset function. */ +#undef HAVE_MEMSET + +/* Define if you have the ptsname function. */ +#undef HAVE_PTSNAME + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the setgroups function. */ +#undef HAVE_SETGROUPS + +/* Define if you have the setlinebuf function. */ +#undef HAVE_SETLINEBUF + +/* Define if you have the setpgrp function. */ +#undef HAVE_SETPGRP + +/* Define if you have the setsid function. */ +#undef HAVE_SETSID + +/* Define if you have the setsockopt function. */ +#undef HAVE_SETSOCKOPT + +/* Define if you have the setttyent function. */ +#undef HAVE_SETTTYENT + +/* Define if you have the setvbuf function. */ +#undef HAVE_SETVBUF + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the tcgetattr function. */ +#undef HAVE_TCGETATTR + +/* Define if you have the tcgetpgrp function. */ +#undef HAVE_TCGETPGRP + +/* Define if you have the tcsendbreak function. */ +#undef HAVE_TCSENDBREAK + +/* Define if you have the tcsetattr function. */ +#undef HAVE_TCSETATTR + +/* Define if you have the tcsetpgrp function. */ +#undef HAVE_TCSETPGRP + +/* Define if you have the wait3 function. */ +#undef HAVE_WAIT3 + +/* Define if you have the header file. */ +#undef HAVE_CRYPT_H + +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define if you have the header file. */ +#undef HAVE_SGTTY_H + +/* Define if you have the header file. */ +#undef HAVE_SHADOW_H + +/* Define if you have the header file. */ +#undef HAVE_STROPTS_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_AUDIT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_IOCTL_COMPAT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PROC_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_TTOLD_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_UIO_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_VLIMIT_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIO_H + +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_TTYENT_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the header file. */ +#undef HAVE_USERSEC_H + +/* Define if you have the crypt library (-lcrypt). */ +#undef HAVE_LIBCRYPT + +/* Define if you have the nsl library (-lnsl). */ +#undef HAVE_LIBNSL + +/* Define if you have the socket library (-lsocket). */ +#undef HAVE_LIBSOCKET + +/* Define if does not define sig_atomic_t */ +#undef sig_atomic_t + +/* Define if does not define socklen_t */ +#undef socklen_t + diff --git a/configure b/configure new file mode 100755 index 0000000..4f31596 --- /dev/null +++ b/configure @@ -0,0 +1,2462 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-port=PORT Specify port number [conserver]" +ac_help="$ac_help + --with-master=MASTER Specify master server hostname [console]" +ac_help="$ac_help + --with-cffile=CFFILE Specify config filename [conserver.cf] " +ac_help="$ac_help + --with-pwdfile=PWDFILE Specify password filename [conserver.passwd] " +ac_help="$ac_help + --with-maxmemb=MAXMEMB Specify maximum consoles per process [16]" +ac_help="$ac_help + --with-maxgrp=MAXGRP Specify maximum number of processes [32]" +ac_help="$ac_help + --enable-8bit Enable 8bit data path " +ac_help="$ac_help + --with-timeout=TIMEOUT Specify connect() timeout in seconds [10]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# 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 +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=conserver/main.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + + +if test -z "$CFLAGS"; then + CFLAGS="-O" +fi +MKDIR="mkdir -p -m 755" + + + +echo $ac_n "checking for port number specification""... $ac_c" 1>&6 +echo "configure:552: checking for port number specification" >&5 +# Check whether --with-port or --without-port was given. +if test "${with_port+set}" = set; then + withval="$with_port" + if test "$withval" != yes -a "$withval" != no; then + if expr "$withval" : '.*[^0-9]' >/dev/null 2>&1; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for master conserver hostname""... $ac_c" 1>&6 +echo "configure:587: checking for master conserver hostname" >&5 +# Check whether --with-master or --without-master was given. +if test "${with_master+set}" = set; then + withval="$with_master" + if test "$withval" != yes; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for configuration filename""... $ac_c" 1>&6 +echo "configure:614: checking for configuration filename" >&5 +# Check whether --with-cffile or --without-cffile was given. +if test "${with_cffile+set}" = set; then + withval="$with_cffile" + if test "$withval" != yes; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for password filename""... $ac_c" 1>&6 +echo "configure:641: checking for password filename" >&5 +# Check whether --with-pwdfile or --without-pwdfile was given. +if test "${with_pwdfile+set}" = set; then + withval="$with_pwdfile" + if test "$withval" != yes; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for MAXMEMB setting""... $ac_c" 1>&6 +echo "configure:668: checking for MAXMEMB setting" >&5 +# Check whether --with-maxmemb or --without-maxmemb was given. +if test "${with_maxmemb+set}" = set; then + withval="$with_maxmemb" + if test "$withval" != yes; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for MAXGRP setting""... $ac_c" 1>&6 +echo "configure:695: checking for MAXGRP setting" >&5 +# Check whether --with-maxgrp or --without-maxgrp was given. +if test "${with_maxgrp+set}" = set; then + withval="$with_maxgrp" + if test "$withval" != yes; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for 8bit setting""... $ac_c" 1>&6 +echo "configure:722: checking for 8bit setting" >&5 +# Check whether --enable-8bit or --disable-8bit was given. +if test "${enable_8bit+set}" = set; then + enableval="$enable_8bit" + cat >> confdefs.h <&6 +else + cat >> confdefs.h <&6 +fi + + +echo $ac_n "checking for connect() timeout""... $ac_c" 1>&6 +echo "configure:741: checking for connect() timeout" >&5 +# Check whether --with-timeout or --without-timeout was given. +if test "${with_timeout+set}" = set; then + withval="$with_timeout" + if test "$withval" -gt 0 -o "$withval" -lt 300; then + cat >> confdefs.h <&6 + else + cat >> confdefs.h <&6 + fi +else + cat >> confdefs.h <&6 +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:770: 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 + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +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:800: 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 + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:851: 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 + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + 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:883: 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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 894 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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* +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${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +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:925: 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:930: 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 + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +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:958: 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_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +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 + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1020: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1073: 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 + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:1094: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1123: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for AIX""... $ac_c" 1>&6 +echo "configure:1203: checking for AIX" >&5 +cat > conftest.$ac_ext <&5 | + egrep "yes" >/dev/null 2>&1; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF +#define _ALL_SOURCE 1 +EOF + +else + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1227: 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 <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:1281: \"$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 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + + + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1304: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1317: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_hdr in sys/ioctl.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1411: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +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 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + +for ac_hdr in termios.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1452: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1462: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +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 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +if test "$ac_cv_header_termios_h" != "yes"; then + for ac_hdr in termio.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1493: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +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 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_header_termio_h" != "yes"; then + for ac_hdr in sgtty.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1534: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +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 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + if test "$ac_cv_header_sgtty_h" != "yes"; then + { echo "configure: error: no usable terminal interface detected" 1>&2; exit 1; } + fi + fi +fi + +for ac_hdr in unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/proc.h sys/ioctl_compat.h usersec.h sys/select.h stropts.h sys/audit.h shadow.h sys/time.h crypt.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1580: 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 +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1590: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +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 +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 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1617: checking whether time.h and sys/time.h may both be included" >&5 +if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_time" 1>&6 +if test $ac_cv_header_time = yes; then + cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:1652: 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 < +#include +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:1673: \"$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 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:1694: checking for mode_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1727: 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 < +#include +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1749: \"$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 +cat >> confdefs.h <&6 +echo "configure:1769: checking if sig_atomic_t is defined" >&5 +if eval "test \"`echo '$''{'ac_cv_type_sig_atomic_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < + +int main() { + + sig_atomic_t sigatom; + sigatom = 1; + +; return 0; } +EOF +if { (eval echo configure:1786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_type_sig_atomic_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_sig_atomic_t=no + +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6 +if test "$ac_cv_type_sig_atomic_t" != "yes"; then + cat >> confdefs.h <<\EOF +#define sig_atomic_t volatile int +EOF + +fi + +echo $ac_n "checking if socklen_t is defined""... $ac_c" 1>&6 +echo "configure:1809: checking if socklen_t is defined" >&5 +if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < + +int main() { + + socklen_t len = 0; + printf("len == %d\n", len); + +; return 0; } +EOF +if { (eval echo configure:1826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_type_socklen_t=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_socklen_t=no + +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 +if test "$ac_cv_type_socklen_t" != "yes"; then + cat >> confdefs.h <<\EOF +#define socklen_t int +EOF + +fi + + + +for ac_func in getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent wait3 getspnam setlinebuf setvbuf getpseudo ptsname flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1853: 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 < +/* 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:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 <&6 +fi +done + +echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 +echo "configure:1906: checking whether setpgrp takes no argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext < +#endif + +/* + * If this system has a BSD-style setpgrp, which takes arguments, exit + * successfully. + */ +main() +{ + if (setpgrp(1,1) == -1) + exit(0); + else + exit(1); +} + +EOF +if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_setpgrp_void=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_setpgrp_void=yes +fi +rm -fr conftest* +fi + + +fi + +echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6 +if test $ac_cv_func_setpgrp_void = yes; then + cat >> confdefs.h <<\EOF +#define SETPGRP_VOID 1 +EOF + +fi + + + +echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +echo "configure:1960: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 +rm -f conftest* +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 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:2007: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 +rm -f conftest* +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 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 +echo "configure:2054: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 +rm -f conftest* +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 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --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 | + case `(ac_space=' '; set | grep ac_space) 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 + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + 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.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@MKDIR@%$MKDIR%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@LN_S@%$LN_S%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CPP@%$CPP%g +s%@LIBOBJS@%$LIBOBJS%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 <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # 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%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $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 +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +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. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + 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 + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..8c2abef --- /dev/null +++ b/configure.in @@ -0,0 +1,200 @@ +dnl ### Normal initialization. ###################################### +AC_INIT(conserver/main.c) +AC_CONFIG_HEADER(config.h) + + +dnl ### Set some option defaults. ################################### +if test -z "$CFLAGS"; then + CFLAGS="-O" +fi +MKDIR="mkdir -p -m 755" +AC_SUBST(MKDIR) + + +dnl ### Custom settings. ############################################ +AC_MSG_CHECKING(for port number specification) +AC_ARG_WITH(port, + [ --with-port=PORT Specify port number [conserver]], + [if test "$withval" != yes -a "$withval" != no; then + if expr "$withval" : '.*[[^0-9]]' >/dev/null 2>&1; then + AC_DEFINE_UNQUOTED(SERVICENAME, "$withval") + AC_MSG_RESULT(/etc/services name '$withval') + else + AC_DEFINE_UNQUOTED(PORTNUMBER, $withval) + AC_MSG_RESULT(port $withval) + fi + else + AC_DEFINE_UNQUOTED(SERVICENAME, "conserver") + AC_MSG_RESULT(/etc/services name 'conserver') + fi], + [AC_DEFINE_UNQUOTED(SERVICENAME, "conserver") + AC_MSG_RESULT(/etc/services name 'conserver')]) + +AC_MSG_CHECKING(for master conserver hostname) +AC_ARG_WITH(master, + [ --with-master=MASTER Specify master server hostname [console]], + [if test "$withval" != yes; then + AC_DEFINE_UNQUOTED(MASTERHOST, "$withval") + AC_MSG_RESULT('$withval') + else + AC_DEFINE_UNQUOTED(MASTERHOST, "console") + AC_MSG_RESULT('console') + fi], + [AC_DEFINE_UNQUOTED(MASTERHOST, "console") + AC_MSG_RESULT('console')]) + +AC_MSG_CHECKING(for configuration filename) +AC_ARG_WITH(cffile, + [ --with-cffile=CFFILE Specify config filename [conserver.cf] ], + [if test "$withval" != yes; then + AC_DEFINE_UNQUOTED(CONFIGFILE, "$withval") + AC_MSG_RESULT('$withval') + else + AC_DEFINE_UNQUOTED(CONFIGFILE, "conserver.cf") + AC_MSG_RESULT('conserver.cf') + fi], + [AC_DEFINE_UNQUOTED(CONFIGFILE, "conserver.cf") + AC_MSG_RESULT('conserver.cf')]) + +AC_MSG_CHECKING(for password filename) +AC_ARG_WITH(pwdfile, + [ --with-pwdfile=PWDFILE Specify password filename [conserver.passwd] ], + [if test "$withval" != yes; then + AC_DEFINE_UNQUOTED(PASSWDFILE, "$withval") + AC_MSG_RESULT('$withval') + else + AC_DEFINE_UNQUOTED(PASSWDFILE, "conserver.passwd") + AC_MSG_RESULT('conserver.passwd') + fi], + [AC_DEFINE_UNQUOTED(PASSWDFILE, "conserver.passwd") + AC_MSG_RESULT('conserver.passwd')]) + +AC_MSG_CHECKING(for MAXMEMB setting) +AC_ARG_WITH(maxmemb, + [ --with-maxmemb=MAXMEMB Specify maximum consoles per process [16]], + [if test "$withval" != yes; then + AC_DEFINE_UNQUOTED(MAXMEMB, $withval) + AC_MSG_RESULT($withval) + else + AC_DEFINE_UNQUOTED(MAXMEMB, 16) + AC_MSG_RESULT(16) + fi], + [AC_DEFINE_UNQUOTED(MAXMEMB, 16) + AC_MSG_RESULT(16)]) + +AC_MSG_CHECKING(for MAXGRP setting) +AC_ARG_WITH(maxgrp, + [ --with-maxgrp=MAXGRP Specify maximum number of processes [32]], + [if test "$withval" != yes; then + AC_DEFINE_UNQUOTED(MAXGRP, $withval) + AC_MSG_RESULT($withval) + else + AC_DEFINE_UNQUOTED(MAXGRP, 32) + AC_MSG_RESULT(32) + fi], + [AC_DEFINE_UNQUOTED(MAXGRP, 32) + AC_MSG_RESULT(32)]) + +AC_MSG_CHECKING(for 8bit setting) +AC_ARG_ENABLE(8bit, + [ --enable-8bit Enable 8bit data path ], + [AC_DEFINE_UNQUOTED(CPARITY, 0) + AC_MSG_RESULT(yes)], + [AC_DEFINE_UNQUOTED(CPARITY, 1) + AC_MSG_RESULT(no)]) + +AC_MSG_CHECKING(for connect() timeout) +AC_ARG_WITH(timeout, + [ --with-timeout=TIMEOUT Specify connect() timeout in seconds [10]], + [if test "$withval" -gt 0 -o "$withval" -lt 300; then + AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, $withval) + AC_MSG_RESULT($withval) + else + AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10) + AC_MSG_RESULT(10) + fi], + [AC_DEFINE_UNQUOTED(CONNECTTIMEOUT, 10) + AC_MSG_RESULT(10)]) + +dnl ### Check for compiler et al. ################################### +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + + +dnl ### Compiler characteristics. ################################## +AC_AIX +AC_C_CONST + + +dnl ### Checks for header files. ################################### +AC_HEADER_STDC +AC_CHECK_HEADERS(sys/ioctl.h) + +dnl ### POSIX terminal I/O +AC_CHECK_HEADERS(termios.h) +if test "$ac_cv_header_termios_h" != "yes"; then + dnl ### SysV terminal I/O + AC_CHECK_HEADERS(termio.h) + if test "$ac_cv_header_termio_h" != "yes"; then + dnl ### BSD terminal I/O + AC_CHECK_HEADERS(sgtty.h) + if test "$ac_cv_header_sgtty_h" != "yes"; then + AC_MSG_ERROR([no usable terminal interface detected]) + fi + fi +fi + +AC_CHECK_HEADERS(unistd.h getopt.h sys/vlimit.h sys/resource.h ttyent.h sys/ttold.h sys/uio.h sys/proc.h sys/ioctl_compat.h usersec.h sys/select.h stropts.h sys/audit.h shadow.h sys/time.h crypt.h) +AC_HEADER_TIME +AC_HEADER_SYS_WAIT +AC_TYPE_MODE_T +AC_TYPE_SIGNAL + +AC_CACHE_CHECK([if sig_atomic_t is defined], ac_cv_type_sig_atomic_t, + AC_TRY_LINK([ + #include + ], [ + sig_atomic_t sigatom; + sigatom = 1; + ], + ac_cv_type_sig_atomic_t=yes, + ac_cv_type_sig_atomic_t=no + ) +) +if test "$ac_cv_type_sig_atomic_t" != "yes"; then + AC_DEFINE(sig_atomic_t, volatile int, [Define if does not define sig_atomic_t]) +fi + +AC_CACHE_CHECK([if socklen_t is defined], ac_cv_type_socklen_t, + AC_TRY_LINK([ + #include + ], [ + socklen_t len = 0; + printf("len == %d\n", len); + ], + ac_cv_type_socklen_t=yes, + ac_cv_type_socklen_t=no + ) +) +if test "$ac_cv_type_socklen_t" != "yes"; then + AC_DEFINE(socklen_t, int, [Define if does not define socklen_t]) +fi + + + +dnl ### Check for needed functions. ################################ +AC_CHECK_FUNCS(getopt strerror getrlimit getsid setsid getuserattr setgroups tcgetpgrp tcsetpgrp tcgetattr tcsetattr tcsendbreak setpgrp getutent setttyent wait3 getspnam setlinebuf setvbuf getpseudo ptsname flock sigaction setsockopt getdtablesize putenv memset memcpy memcmp) +AC_FUNC_SETPGRP + + +dnl ### Check for libraries. ####################################### +AC_CHECK_LIB(socket,socket) +AC_CHECK_LIB(nsl,gethostbyname) +AC_CHECK_LIB(crypt,crypt) + + +dnl ### Create output files. ####################################### +AC_SUBST(LIBOBJS) +AC_OUTPUT(Makefile conserver/Makefile conserver.cf/Makefile console/Makefile autologin/Makefile) diff --git a/conserver.cf/Makefile b/conserver.cf/Makefile deleted file mode 100644 index d4db0ee..0000000 --- a/conserver.cf/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# $Id: Makefile,v 1.6 1999-04-12 21:29:57-07 bryan Exp $ -# -# Makefile for conserver.cf -# - -PREFIX=/usr/local -BIN=${PREFIX}/bin -ETC=${PREFIX}/etc -MAN=${PREFIX}/man -MANSECT=4 - -all: - -clean: FRC - rm -f Makefile.bak *.tbl core errs lint.out tags - -depend: - -dirs: - -install: - -${MAN}/man${MANSECT}: - ${INSTALL} -d $@ - -install.man: ${MAN}/man${MANSECT} - tbl conserver.cf.man > conserver.cf.tbl - ${INSTALL} -c conserver.cf.tbl ${MAN}/man${MANSECT}/conserver.cf.${MANSECT} - -FRC: diff --git a/conserver.cf/Makefile.in b/conserver.cf/Makefile.in new file mode 100644 index 0000000..3916c99 --- /dev/null +++ b/conserver.cf/Makefile.in @@ -0,0 +1,28 @@ +### Path settings +srcdir = @srcdir@ +prefix = @prefix@ +mandir = @mandir@ +sysconfdir = @sysconfdir@ + +### Installation programs and flags +INSTALL = @INSTALL@ +MKDIR = @MKDIR@ +@SET_MAKE@ + + +### Makefile rules - no user-servicable parts below + +all: + +.PHONY: clean distclean install + +clean: + rm -f *~ *.o $(ALL) core + +distclean: clean + rm -f Makefile + +install: + $(MKDIR) $(DESTDIR)$(mandir)/man8 + $(INSTALL) conserver.cf.man $(DESTDIR)$(mandir)/man8/conserver.cf.8 + diff --git a/conserver/Makefile b/conserver/Makefile deleted file mode 100644 index ca4b740..0000000 --- a/conserver/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# $Id: Makefile,v 1.12 1999-02-02 17:02:25-08 bryan Exp $ -# -# Makefile for console server -# - -PROG=conserver -PREFIX=/usr/local -BIN=${PREFIX}/bin -ETC=${PREFIX}/etc -MAN=${PREFIX}/man -MANSECT=8 - -CFLAGS= ${DEBUG} ${CDEFS} ${INCLUDE} - -HDR= cons.h \ - access.h client.h consent.h group.h main.h master.h \ - readcfg.h -SRC= access.c client.c consent.c group.c main.c master.c \ - readcfg.c fallback.c -OBJ= access.o client.o consent.o group.o main.o master.o \ - readcfg.o fallback.o -INIT= conserver.rc - -all: ${PROG} - -${PROG}: ${OBJ} - ${CC} -o $@ ${CFLAGS} ${OBJ} ${LIBS} - -clean: FRC - rm -f Makefile.bak ${PROG} *.tbl a.out *.o core errs lint.out tags - -depend: ${HDR} ${SRC} FRC - makedepend ${CDEFS} ${INCLUDE} ${SRC} - -dirs: ${BIN} ${ETC} - -install: all dirs ${INIT} FRC - ${INSTALL} -cs ${PROG} ${BIN}/${PROG} - ${INSTALL} -c ${INIT} ${ETC}/${INIT} - -${MAN}/man${MANSECT}: - ${INSTALL} -d $@ - -install.man: ${MAN}/man${MANSECT} - tbl conserver.man > conserver.tbl - ${INSTALL} -c conserver.tbl ${MAN}/man${MANSECT}/conserver.${MANSECT} - -lint: ${HDR} ${SRC} FRC - lint -h ${CDEFS} ${INCLUDE} ${SRC} - -tags: ${HDR} ${SRC} - ctags -t ${HDR} ${SRC} - -/ ${BIN} ${ETC}: - ${INSTALL} -d $@ - -FRC: - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -access.o: cons.h port.h access.h consent.h client.h group.h readcfg.h main.h -client.o: cons.h port.h consent.h client.h -consent.o: cons.h port.h consent.h client.h main.h -fallback.o: cons.h port.h -group.o: cons.h port.h consent.h client.h access.h group.h version.h main.h -main.o: cons.h port.h consent.h client.h group.h master.h access.h readcfg.h -main.o: version.h -master.o: cons.h port.h consent.h client.h group.h access.h master.h -master.o: readcfg.h version.h main.h -readcfg.o: cons.h port.h consent.h client.h group.h access.h readcfg.h -readcfg.o: master.h main.h diff --git a/conserver/Makefile.in b/conserver/Makefile.in new file mode 100644 index 0000000..0b4eddc --- /dev/null +++ b/conserver/Makefile.in @@ -0,0 +1,59 @@ +### Path settings +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +sbindir = @sbindir@ +sysconfdir = @sysconfdir@ +mandir = @mandir@ + +### Installation programs and flags +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s +LN_S = @LN_S@ +MKDIR = @MKDIR@ + +### Compiler and link options +CC = @CC@ +CFLAGS = @CFLAGS@ # -DPUCC -DSUN5 +DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" +CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) $(DEFS) @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +@SET_MAKE@ + + +### Makefile rules - no user-servicable parts below + +CONSERVER_OBJS = access.o client.o consent.o group.o main.o master.o \ + readcfg.o fallback.o +CONSERVER_HDRS = ../config.h $(top_srcdir)/compat.h $(srcdir)/cons.h $(srcdir)/access.h \ + $(srcdir)/client.h $(srcdir)/consent.h $(srcdir)/group.h \ + $(srcdir)/main.h $(srcdir)/master.h $(srcdir)/readcfg.h +ALL = conserver + + +all: $(ALL) + +.PHONY: clean distclean install + +conserver: $(CONSERVER_OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o conserver $(CONSERVER_OBJS) $(LIBS) + +%.o: $(srcdir)/%.c $(CONSERVER_HDRS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +clean: + rm -f *~ *.o $(ALL) core + +distclean: clean + rm -f Makefile + +install: + $(MKDIR) $(DESTDIR)$(sbindir) + $(INSTALL_PROGRAM) conserver $(DESTDIR)$(sbindir) + $(MKDIR) $(DESTDIR)$(mandir)/man8 + $(INSTALL) conserver.man $(DESTDIR)$(mandir)/man8/conserver.8 + $(MKDIR) $(DESTDIR)$(sysconfdir) + $(INSTALL) conserver.rc $(DESTDIR)$(sysconfdir) + diff --git a/conserver/access.c b/conserver/access.c index 005ef3c..edf6176 100644 --- a/conserver/access.c +++ b/conserver/access.c @@ -1,5 +1,5 @@ /* - * $Id: access.c,v 5.15 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: access.c,v 5.17 2001-02-08 15:31:07-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -38,37 +38,31 @@ static char copyright[] = "@(#) Copyright 1992 Purdue Research Foundation.\nAll rights reserved.\n"; #endif +#include + #include #include -#include #include #include #include -#include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "access.h" -#include "consent.h" -#include "client.h" -#include "group.h" -#include "readcfg.h" -#include "main.h" +#include + +#include +#include +#include +#include +#include +#include +#include -#if USE_STRINGS -#include -#else -#include -#endif /* in the routines below (the init code) we can bomb if malloc fails (ksb) diff --git a/conserver/client.c b/conserver/client.c index 3a2973a..007ca6e 100644 --- a/conserver/client.c +++ b/conserver/client.c @@ -1,5 +1,5 @@ /* - * $Id: client.c,v 5.22 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: client.c,v 5.24 2001-02-08 15:31:40-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -37,46 +37,41 @@ static char copyright[] = "@(#) Copyright 1992 Purdue Research Foundation.\nAll rights reserved.\n"; #endif + +#include + #include #include -#include #include #include #include -#include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" +#include + +#include +#include +#include -#if USE_STRINGS -#include -#else -#include -#endif /* find the next guy who wants to write on the console (ksb) */ -CLIENT * +CONSCLIENT * FindWrite(pCL) -CLIENT *pCL; +CONSCLIENT *pCL; { /* return the first guy to have the `want write' bit set * (tell him of the promotion, too) we could look for the * most recent or some such... I guess it doesn't matter that * much. */ - for (/*passed in*/; (CLIENT *)0 != pCL; pCL = pCL->pCLnext) { + for (/*passed in*/; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) { if (!pCL->fwantwr) continue; if (!pCL->pCEto->fup || pCL->pCEto->fronly) @@ -90,7 +85,7 @@ CLIENT *pCL; } return pCL; } - return (CLIENT *)0; + return (CONSCLIENT *)0; } #if HAVE_IDENTD @@ -99,7 +94,7 @@ CLIENT *pCL; * limits. We call identd/tap/auth to get info and compare */ IdentifyMe(pCL) -CLIENT *pCL; +CONSCLIENT *pCL; { /* ZZZ */ /* we would have to getsockname(fdClient) @@ -261,7 +256,7 @@ static HELP aHLTable[] = { */ void HelpUser(pCL) -CLIENT *pCL; +CONSCLIENT *pCL; { register int i, j, iCmp; static char diff --git a/conserver/client.h b/conserver/client.h index c8641f4..eec178b 100644 --- a/conserver/client.h +++ b/conserver/client.h @@ -1,5 +1,5 @@ /* - * $Id: client.h,v 5.14 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: client.h,v 5.15 2001-02-03 20:17:02-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -55,8 +55,8 @@ typedef struct client { /* Connection Information: */ short fwantwr; /* (client) wants to write */ short fecho; /* echo commands (not set by machines) */ char acid[128]; /* login and location of client */ - long tym; /* time of connect */ - long typetym; /* time of last keystroke */ + time_t tym; /* time of connect */ + time_t typetym; /* time of last keystroke */ char actym[32]; /* pre-formatted time */ struct consent *pCEwant, /* what machine we would like to be on */ @@ -75,9 +75,9 @@ typedef struct client { /* Connection Information: */ int mcursor; /* the length of the message */ struct sockaddr_in cnct_port; /* where from */ -} CLIENT; +} CONSCLIENT; extern char *FmtCtl(); extern void Replay(); extern void HelpUser(); -extern CLIENT *FindWrite(); +extern CONSCLIENT *FindWrite(); diff --git a/conserver/cons-default.h b/conserver/cons-default.h deleted file mode 100644 index 116ffcb..0000000 --- a/conserver/cons-default.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * $Id: cons-default.h,v 1.7 2000-12-13 12:31:07-08 bryan Exp $ - * - * Copyright conserver.com, 2000 - * - * Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com) - * - * Copyright GNAC, Inc., 1998 - */ - -/* - * Socket used to communicate - * Choose either PORT or SERVICE... - */ -/*#define PORT 782*/ -#define SERVICE "conserver" - -/* - * Hostname of console server - */ -#define HOST "console" - -/* - * Config file path - */ -#define CONFIG "/etc/conserver.cf" - -/* - * Password file path - */ -#define PASSWD_FILE "/etc/conserver.passwd" - -/* - * Number of consoles per child process - */ -#define MAXMEMB 8 - -/* - * Number of child processes - */ -#define MAXGRP 32 - -/* - * Clear parity (high-bit) [true/false setting] - */ -#define CPARITY 1 - -/* - * TCP connection timeout - */ -#define CONNECTTIMEOUT 10 diff --git a/conserver/cons-gnac.h b/conserver/cons-gnac.h deleted file mode 100644 index 52bf3d1..0000000 --- a/conserver/cons-gnac.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * $Id: cons-gnac.h,v 5.44 2000-12-13 12:31:07-08 bryan Exp $ - * - * Copyright conserver.com, 2000 - * - * Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com) - * - * Copyright GNAC, Inc., 1998 - */ diff --git a/conserver/cons-test.h b/conserver/cons-test.h deleted file mode 100644 index 740ba7f..0000000 --- a/conserver/cons-test.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * $Id: cons-test.h,v 1.6 2000-12-13 12:31:07-08 bryan Exp $ - * - * Copyright conserver.com, 2000 - * - * Maintainer/Enhancer: Bryan Stansell (bryan@conserver.com) - * - * Copyright GNAC, Inc., 1998 - */ - -#define PORT 7777 -#define HOST "localhost" -#define CONFIG "../conserver.cf/test.cf" -#define PASSWD_FILE "./conserver.passwd" diff --git a/conserver/cons.h b/conserver/cons.h deleted file mode 120000 index 6a9c985..0000000 --- a/conserver/cons.h +++ /dev/null @@ -1 +0,0 @@ -cons-default.h \ No newline at end of file diff --git a/conserver/consent.c b/conserver/consent.c index a817207..a2dbfc7 100644 --- a/conserver/consent.c +++ b/conserver/consent.c @@ -1,5 +1,5 @@ /* - * $Id: consent.c,v 5.36 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: consent.c,v 5.39 2001-02-17 08:36:13-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -42,52 +42,27 @@ static char copyright[] = "@(#) Copyright 1992 Purdue Research Foundation.\nAll rights reserved.\n"; #endif +#include + #include #include -#include #include #include #include -#include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" -#include "main.h" +#include -#if USE_TERMIO -#include - -#else -#if USE_TERMIOS -#include -#include - -#else /* use ioctl stuff */ -#include -#include -#endif -#endif - -#if USE_STREAMS -#include -#endif - -#if USE_STRINGS -#include -#else -#include -#endif +#include +#include +#include +#include struct hostcache *hostcachelist=NULL; @@ -131,24 +106,23 @@ char *pcMode; PARITY parity[] = { -#if USE_TERMIOS -#if !defined(PAREXT) -#define PAREXT 0 -#endif +#if HAVE_TERMIOS_H {' ', 0, 0}, /* Blank for network */ +# if !defined(PAREXT) +# define PAREXT 0 +# endif {'e', PARENB|CS7, 0}, /* even */ {'m', PARENB|CS7|PARODD|PAREXT, 0}, /* mark */ {'o', PARENB|CS7|PARODD, 0}, /* odd */ {'p', CS8, 0}, /* pass 8 bits, no parity */ {'s', PARENB|CS7|PAREXT, 0}, /* space */ -#else - {' ', 0, 0}, /* Blank for network */ +#else /* ! HAVE_TERMIOS_H */ {'e', EVENP, ODDP}, /* even */ {'m', EVENP|ODDP, 0}, /* mark */ {'o', ODDP, EVENP}, /* odd */ -#if defined(PASS8) +# if defined(PASS8) {'p', PASS8,EVENP|ODDP},/* pass 8 bits, no parity */ -#endif +# endif {'s', 0, EVENP|ODDP} /* space */ #endif }; @@ -177,7 +151,7 @@ char *pcMode; } -#if USE_TERMIOS +#if HAVE_TERMIOS_H /* setup a tty device (ksb) */ static int @@ -243,18 +217,21 @@ CONSENT *pCE; return -1; } -#if USE_STREAMS +# if HAVE_STROPTS_H /* * eat all the streams modules upto and including ttcompat */ - while (ioctl(pCE->fdtty, I_FIND, "ttcompat") == 0) { + while (ioctl(pCE->fdtty, I_FIND, "ttcompat") == 1) { (void)ioctl(pCE->fdtty, I_POP, 0); } -#endif +# endif pCE->fup = 1; return 0; } -#else + +#else /* ! HAVE_TERMIOS_H */ + +# ifdef HAVE_SGTTY_H /* setup a tty device (ksb) */ @@ -277,14 +254,12 @@ CONSENT *pCE; pCE->fronly = 1; } -#if USE_SOFTCAR -#if defined(TIOCSSOFTCAR) +# if defined(TIOCSSOFTCAR) if (-1 == ioctl(pCE->fdtty, TIOCSSOFTCAR, &fSoftcar)) { fprintf(stderr, "%s: softcar: %d: %s\n", progname, pCE->fdtty, strerror(errno)); return -1; } -#endif -#endif +# endif /* stty 9600 raw cs7 */ @@ -333,18 +308,20 @@ CONSENT *pCE; fprintf(stderr, "%s: ioctl6: %d: %s\n", progname, pCE->fdtty, strerror(errno)); return -1; } -#if USE_STREAMS +# if HAVE_STROPTS_H /* pop off the un-needed streams modules (on a sun3 machine esp.) * (Idea by jrs@ecn.purdue.edu) */ while (ioctl(pCE->fdtty, I_POP, 0) == 0) { /* eat all the streams modules */; } -#endif +# endif pCE->fup = 1; return 0; } -#endif +# endif /* HAVE_SGTTY_H */ + +#endif /* HAVE_TERMIOS_H */ #if DO_VIRTUAL /* setup a virtual device (ksb) @@ -353,16 +330,18 @@ static int VirtDev(pCE) CONSENT *pCE; { -#if USE_TERMIOS +# if HAVE_TERMIOS_H static struct termios n_tio; -#else +# else +# ifdef HAVE_SGTTY_H auto struct sgttyb sty; auto struct tchars m_tchars; auto struct ltchars m_ltchars; -#endif -#if HAVE_RLIMIT +# endif +# endif +# if HAVE_RLIMIT auto struct rlimit rl; -#endif +# endif auto int i, iNewGrp; auto int fd; extern char **environ; @@ -391,12 +370,12 @@ CONSENT *pCE; /* setup new process with clean filew descriptors */ -#if HAVE_RLIMIT +# if HAVE_RLIMIT getrlimit(RLIMIT_NOFILE, &rl); i = rl.rlim_cur; -#else +# else i = getdtablesize(); -#endif +# endif for (/* i above */; i-- > 2; ) { close(i); } @@ -404,45 +383,50 @@ CONSENT *pCE; */ close(1); close(0); -#if defined(TIOCNOTTY) +# if defined(TIOCNOTTY) if (-1 != (i = open("/dev/tty", 2, 0))) { ioctl(i, TIOCNOTTY, (char *)0); close(i); } -#endif +# endif -#if HAVE_SETSID +# if HAVE_SETSID iNewGrp = setsid(); if (-1 == iNewGrp) { fprintf(stderr, "%s: %s: setsid: %s\n", progname, pCE->server, strerror(errno)); iNewGrp = getpid(); } -#else +# else iNewGrp = getpid(); -#endif +# endif if (0 != open(pCE->acslave, 2, 0) || 1 != dup(0)) { fprintf(stderr, "%s: %s: fd sync error\n", progname, pCE->server); exit(1); } -#if HAVE_PTSNAME +# if HAVE_PTSNAME /* SYSVr4 semantics for opening stream ptys (gregf) * under PTX (others?) we have to push the compatibility * streams modules `ptem' and `ld' */ (void)ioctl(0, I_PUSH, "ptem"); (void)ioctl(0, I_PUSH, "ld"); -#endif -#if HAVE_LDTERM +# endif +# if HAVE_LDTERM (void)ioctl(0, I_PUSH, "ptem"); (void)ioctl(0, I_PUSH, "ldterm"); -#endif -#if HAVE_STTY_LD +# endif +# if HAVE_STTY_LD (void)ioctl(0, I_PUSH, "stty_ld"); -#endif +# endif -#if USE_TERMIOS - if (0 != ioctl(0, TCGETS, & n_tio)) { +# if HAVE_TERMIOS_H +# ifdef HAVE_TCGETATTR + if (0 != tcgetattr(0, &n_tio)) +# else + if (0 != ioctl(0, TCGETS, & n_tio)) +# endif + { fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno)); exit(1); } @@ -462,13 +446,18 @@ CONSENT *pCE; n_tio.c_cc[VSTART] = '\021'; n_tio.c_cc[VSTOP] = '\023'; n_tio.c_cc[VSUSP] = '\032'; - if (0 != ioctl(0, TCSETS, & n_tio)) { +# ifdef HAVE_TCSETATTR + if (0 != tcsetattr(0, TCSANOW, & n_tio)) +# else + if (0 != ioctl(0, TCSETS, & n_tio)) +# endif + { fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno)); exit(1); } tcsetpgrp(0, iNewGrp); -#else +# else /* ! HAVE_TERMIOS_H */ /* stty 9600 raw cs7 */ if (-1 == ioctl(0, TIOCGETP, (char *)&sty)) { @@ -520,10 +509,14 @@ CONSENT *pCE; /* give us a process group to work in */ ioctl(0, TIOCGPGRP, (char *)&i); +# ifndef SETPGRP_VOID setpgrp(0, i); +# endif ioctl(0, TIOCSPGRP, (char *)&iNewGrp); +# ifndef SETPGRP_VOID setpgrp(0, iNewGrp); -#endif +# endif +# endif /* HAVE_TERMIOS_H */ close(2); (void)dup(1); /* better be 2, but it is too late now */ @@ -555,7 +548,7 @@ CONSENT *pCE; exit(1); /*NOTREACHED*/ } -#endif +#endif /* DO_VIRTUAL */ /* down a console, virtual or real (ksb) */ @@ -682,7 +675,7 @@ int useHostCache; { struct sockaddr_in port; struct hostent *hp; - int one = 1; + size_t one = 1; int flags; fd_set fds; struct timeval tv; @@ -695,9 +688,9 @@ int useHostCache; return; } -#if USLEEP_FOR_SLOW_PORTS +# if USLEEP_FOR_SLOW_PORTS usleep( USLEEP_FOR_SLOW_PORTS ); /* Sleep for slow network ports */ -#endif +# endif bzero(&port, sizeof(port)); @@ -776,11 +769,7 @@ int useHostCache; if (getsockopt(pCE->fdtty, SOL_SOCKET, SO_ERROR, (char*)&flags, &one) < 0) { -#if defined(SUN5) - fprintf(stderr, "%s: connect: %s (%d@%s): %s: forcing down\n", -#else fprintf(stderr, "%s: getsockopt SO_ERROR: %s (%d@%s): %s: forcing down\n", -#endif progname, pCE->server, ntohs(port.sin_port), pCE->networkConsoleHost, strerror(errno)); ConsDown(pCE, pfdSet); @@ -800,9 +789,9 @@ int useHostCache; * Poke the connection to get the annex to wake up and * register this connection. */ -#ifdef POKE_ANNEX +# ifdef POKE_ANNEX write(pCE->fdtty, "\r\n", 2); -#endif +# endif } else if (-1 == (pCE->fdtty = open(pCE->dfile, O_RDWR|O_NDELAY, 0600))) { fprintf(stderr, "%s: open: %s: %s\n", progname, pCE->dfile, strerror(errno)); (void)close(pCE->fdlog); @@ -824,7 +813,7 @@ int useHostCache; { TtyDev(pCE); } -#else +#else /* ! DO_VIRTUAL */ if (-1 == (pCE->fdtty = open(pCE->dfile, O_RDWR|O_NDELAY, 0600))) { fprintf(stderr, "%s: open: %s: %s\n", progname, pCE->dfile, strerror(errno)); (void)close(pCE->fdlog); @@ -836,5 +825,5 @@ int useHostCache; /* ok, now setup the device */ TtyDev(pCE); -#endif +#endif /* DO_VIRTUAL */ } diff --git a/conserver/consent.h b/conserver/consent.h index d4c659d..814eb25 100644 --- a/conserver/consent.h +++ b/conserver/consent.h @@ -1,5 +1,5 @@ /* - * $Id: consent.h,v 5.15 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: consent.h,v 5.16 2001-02-03 20:19:14-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -84,7 +84,7 @@ typedef struct consent { /* console information */ int fdtty; /* the port to talk to machine on */ short int fup; /* we setup this line? */ short int fronly; /* we can only read this console */ - short int iend; /* like icursor in CLIENT */ + short int iend; /* like icursor in CONSCLIENT */ short int inamelen; /* strlen(server) */ struct client *pCLon; /* clients on this console */ struct client *pCLwr; /* client that is writting on console */ diff --git a/conserver/fallback.c b/conserver/fallback.c index 935f0ad..921892e 100644 --- a/conserver/fallback.c +++ b/conserver/fallback.c @@ -1,5 +1,5 @@ /* - * $Id: fallback.c,v 5.22 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: fallback.c,v 5.24 2001-02-08 15:31:58-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -13,6 +13,9 @@ * * Mike Rowan (mtr@mace.cc.purdue.edu) */ + +#include + #include #include #include @@ -20,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -29,34 +31,12 @@ #include #include -#include "cons.h" -#include "port.h" +#include -#if HAVE_PTSNAME -/* for grantpt() and unlockpt() (gregf) - */ -#include -#endif - -#if NEED_UNISTD_H -#include -#endif - -#if USE_STRINGS -#include -#else -#include -#endif +#include #if DO_VIRTUAL && ! HAVE_PTYD -extern int errno; -#if !HAVE_STRERROR -extern char *sys_errlist[], *strchr(); -#define strerror(Me) (sys_errlist[Me]) -#endif - - static char *__pty_host; static char *__pty_fmt; @@ -69,42 +49,42 @@ static int iLogPri = LOG_DEBUG; * everything that uses pty's. For the most part, we'll be trying to * make /dev/ptyq* the "free" pty's. */ -#if defined(sun) +# if defined(sun) static char charone[] = "prstuvwxyzPQRSTUVWq"; -#else -#if defined(dynix) +# else +# if defined(dynix) static char charone[] = "prstuvwxyzPQRSTUVWq"; -#else -#if defined(ultrix) +# else +# if defined(ultrix) static char charone[] = "prstuvwxyzPQRSTUVWq"; -#else +# else /* all the world's a vax ;-) */ static char charone[] = "prstuvwxyzPQRSTUVWq"; -#endif -#endif -#endif +# endif +# endif +# endif static char chartwo[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; -#if (defined(_AIX) || defined(PTX4)) +# if (defined(_AIX) || defined(PTX4)) static char acMaster[] = "/dev/ptc/XXXXXXXXX"; static char acSlave[] = "/dev/pts/XXXXXXXXX"; -#else +# else static char acMaster[] = "/dev/ptyXX"; static char acSlave[] = "/dev/ttyXX"; -#endif /* _AIX */ +# endif /* _AIX */ -#if !HAVE_GETPSEUDO -#ifdef _AIX +# if !HAVE_GETPSEUDO +# ifdef _AIX /* * get a pty for the user (emulate the neato sequent call) (mm) */ @@ -131,8 +111,8 @@ char **master, **slave; return fd; } -#else -#if HAVE_PTSNAME +# else +# if HAVE_PTSNAME /* get a pty for the user -- emulate the neato sequent call under (gregf) * DYNIX/ptx v4.0 @@ -165,7 +145,7 @@ char **master, **slave; return fd; } -#else +# else /* * get a pty for the user (emulate the neato sequent call) (ksb) */ @@ -218,9 +198,9 @@ char **master, **slave; *slave = acSlave; return fd; } -#endif /* PTX version */ -#endif /* _AIX */ -#endif /* !HAVE_GETPSEUDO */ +# endif /* PTX version */ +# endif /* _AIX */ +# endif /* !HAVE_GETPSEUDO */ /* * get a Joe pty bacause the daemon is not with us, sadly. (ksb) diff --git a/conserver/group.c b/conserver/group.c index aaa5675..553429c 100644 --- a/conserver/group.c +++ b/conserver/group.c @@ -1,5 +1,5 @@ /* - * $Id: group.c,v 5.63 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: group.c,v 5.65 2001-02-08 15:31:40-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -57,80 +57,45 @@ static char copyright[] = @(#) Copyright 1992 Purdue Research Foundation.\n\ All rights reserved.\n"; #endif + +#include + #include #include #include #include #include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" -#include "access.h" -#include "group.h" -#include "version.h" -#include "main.h" +#include + +#include +#include +#include +#include +#include +#include +#include #if DO_VIRTUAL -#if HAVE_PTYD -#include "local/openpty.h" -#else +# if HAVE_PTYD +# include "local/openpty.h" +# else extern int FallBack(); -#endif /* ptyd */ +# endif /* ptyd */ #endif /* virtual consoles */ -#if USE_SYS_TIME_H -#include -#else -#include -#endif -#include - -#if USE_TERMIO -#include - -#else -#if USE_TERMIOS -#include -#include - -#else /* use ioctl stuff */ -#include -#include -#endif -#endif - -#if USE_STREAMS -#include -#endif - -#if USE_STRINGS -#include -#else -#include -#endif - #include -#if HAVE_SHADOW -#include -#endif - -extern char *crypt(), *calloc(); -extern time_t time(); /* flags that a signal has occurred */ -static SIGFLAG fSawReOpen, fSawReUp, fSawMark, fSawGoAway; +static sig_atomic_t fSawReOpen, fSawReUp, fSawMark, fSawGoAway; /* Is this passwd a match for this user's passwd? (gregf/ksb) * look up passwd in shadow file if we have to, if we are @@ -141,7 +106,7 @@ CheckPass(pwd, pcEPass, pcWord) struct passwd *pwd; char *pcEPass, *pcWord; { -#if HAVE_SHADOW +#if HAVE_GETSPNAM register struct spwd *spwd; #endif @@ -150,7 +115,7 @@ char *pcEPass, *pcWord; return 1; } } -#if HAVE_SHADOW +#if HAVE_GETSPNAM if ('x' == pwd->pw_passwd[0] && '\000' == pwd->pw_passwd[1]) { if ((struct spwd *)0 != (spwd = getspnam(pwd->pw_name))) return 0 == strcmp(spwd->sp_pwdp, crypt(pcWord, spwd->sp_pwdp)); @@ -163,12 +128,12 @@ char *pcEPass, *pcWord; /* on an HUP close and re-open log files so lop can trim them (ksb) * lucky for us: log file fd's can change async from the group driver! */ -static SIGRETS +static RETSIGTYPE FlagReOpen(sig) int sig; { fSawReOpen = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION (void)signal(SIGHUP, FlagReOpen); #endif } @@ -196,12 +161,12 @@ ReOpen() } } -static SIGRETS +static RETSIGTYPE FlagReUp(sig) int sig; { fSawReUp = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION (void)signal(SIGUSR1, FlagReUp); #endif } @@ -227,12 +192,12 @@ ReUp() } } -static SIGRETS +static RETSIGTYPE FlagMark(sig) int sig; { fSawMark = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION signal(SIGALRM, FlagMark); #endif } @@ -240,7 +205,7 @@ FlagMark(sig) static void Mark() { - long tyme; + time_t tyme; char acOut[BUFSIZ]; char styme[26]; register int i; @@ -250,7 +215,7 @@ Mark() return; } - tyme = time((long *)0); + tyme = time((time_t *)0); (void)strcpy(styme, ctime(&tyme)); styme[24] = '\000'; /* [-- MARK -- `date`] */ @@ -273,13 +238,13 @@ SendClientsMsg(pGE, message) GRPENT *pGE; char *message; { - register CLIENT *pCL; + register CONSCLIENT *pCL; if ((GRPENT *)0 == pGE) { return; } - for (pCL = pGE->pCLall; (CLIENT *)0 != pCL; pCL = pCL->pCLscan) { + for (pCL = pGE->pCLall; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLscan) { if (pCL->fcon) { (void)write(pCL->fd, message, strlen(message)); } @@ -293,7 +258,7 @@ GRPENT *pGE; SendClientsMsg(pGE, "[-- Console server shutting down --]\r\n"); } -static SIGRETS +static RETSIGTYPE FlagGoAway(sig) int sig; { @@ -329,11 +294,11 @@ DeUtmp() if (-1 == pCE->fdtty || 0 == pCE->fvirtual) { continue; } -#if HAVE_PTYD +# if HAVE_PTYD (void)closepty(pCE->acslave, pCE->dfile, OPTY_UTMP, pCE->fdlog); -#else +# else (void)close(pCE->fdlog); -#endif +# endif } exit(0); _exit(0); @@ -345,19 +310,19 @@ DeUtmp() * which will send us here to clean up the exit code. The lack of a * reader on the pseudo will cause us to notice the death in Kiddie... */ -static SIGRETS +static RETSIGTYPE ReapVirt(sig) int sig; { register int i, pid; auto long tyme; - auto WAIT_T UWbuf; + auto int UWbuf; -#if HAVE_WAIT3 +# if HAVE_WAIT3 while (-1 != (pid = wait3(& UWbuf, WNOHANG, (struct rusage *)0))) { -#else +# else while (-1 != (pid = wait(& UWbuf))) { -#endif +# endif if (0 == pid) { break; } @@ -368,7 +333,7 @@ int sig; } } } -#endif +#endif /* DO_VIRUAL */ static char acStop[] = { /* buffer for oob stop command */ @@ -376,7 +341,7 @@ static char acStop[] = { /* buffer for oob stop command */ }; int CheckPasswd(pCLServing, pw_string) -CLIENT *pCLServing; +CONSCLIENT *pCLServing; char *pw_string; { struct passwd *pwd; @@ -384,7 +349,7 @@ char *pw_string; char buf[100]; char *server, *servers, *this_pw, *user; char username[64]; /* same as acid */ -#if HAVE_SHADOW +#if HAVE_GETSPNAM register struct spwd *spwd; #endif @@ -421,7 +386,7 @@ char *pw_string; if (strcmp(this_pw, "*passwd*") == 0) { this_pw = NULL; if ((struct passwd *)0 != (pwd = getpwnam(user))) { - #if HAVE_SHADOW +#if HAVE_GETSPNAM if ('x' == pwd->pw_passwd[0] && '\000' == pwd->pw_passwd[1]) { if ((struct spwd *)0 != (spwd = getspnam(pwd->pw_name))) { this_pw = spwd->sp_pwdp; @@ -429,9 +394,9 @@ char *pw_string; } else { this_pw = pwd->pw_passwd; } - #else +#else this_pw = pwd->pw_passwd; - #endif +#endif } } if (this_pw == NULL) @@ -545,7 +510,7 @@ Kiddie(pGE, sfd) register GRPENT *pGE; int sfd; { - register CLIENT + register CONSCLIENT *pCL, /* console we must scan/notify */ *pCLServing, /* client we are serving */ *pCLFree; /* head of free list */ @@ -558,25 +523,23 @@ int sfd; register struct passwd *pwd; register char *pcPass; register long tyme; - long tymee; + time_t tymee; char stymee[26]; auto CONSENT CECtl; /* our control `console' */ auto char cType; auto int maxfd, so; auto fd_set rmask, rinit; auto char acOut[BUFSIZ], acIn[BUFSIZ], acNote[132*2]; - auto CLIENT dude[MAXMEMB]; /* alloc one set per console */ + auto CONSCLIENT dude[MAXMEMB]; /* alloc one set per console */ #if HAVE_RLIMIT struct rlimit rl; #endif -#if USE_TERMIO - auto struct sgttyb sty; -#else -#if USE_TERMIOS +#if HAVE_TERMIOS_H auto struct termios sbuf; -#else /* ioctl, like BSD4.2 */ +#else +# if HAVE_SGTTY_H auto struct sgttyb sty; -#endif +# endif #endif /* turn off signals that master() might have turned on @@ -595,7 +558,7 @@ int sfd; pCE = pGE->pCElist; for (iConsole = 0; iConsole < pGE->imembers; ++iConsole) { pCE[iConsole].fup = 0; - pCE[iConsole].pCLon = pCE[iConsole].pCLwr = (CLIENT *)0; + pCE[iConsole].pCLon = pCE[iConsole].pCLwr = (CONSCLIENT *)0; #if DO_VIRTUAL pCE[iConsole].fdlog = -1; if (0 == pCE[iConsole].fvirtual) { @@ -604,13 +567,13 @@ int sfd; } /* open a pty for each vitrual console */ -#if HAVE_PTYD +# if HAVE_PTYD pCE[iConsole].fdtty = openpty(pCE[iConsole].acslave, pCE[iConsole].dfile, OPTY_UTMP, 0); -#else /* oops, get ptyd soon */ +# else /* oops, get ptyd soon */ /* we won't get a utmp entry... *sigh* */ pCE[iConsole].fdtty = FallBack(pCE[iConsole].acslave, pCE[iConsole].dfile); -#endif /* find openpty */ +# endif /* find openpty */ #else pCE[iConsole].fdlog = pCE[iConsole].fdtty = -1; #endif @@ -658,7 +621,7 @@ int sfd; for (i = 0; i < MAXMEMB-1; ++i) { dude[i].pCLnext = & dude[i+1]; } - dude[MAXMEMB-1].pCLnext = (CLIENT *)0; + dude[MAXMEMB-1].pCLnext = (CONSCLIENT *)0; /* on a SIGHUP we should close and reopen our log files */ @@ -675,7 +638,7 @@ int sfd; /* the MAIN loop a group server */ - pGE->pCLall = (CLIENT *)0; + pGE->pCLall = (CONSCLIENT *)0; while (1) { /* check signal flags */ if (fSawGoAway) { @@ -747,7 +710,7 @@ int sfd; /* output all console info nobody is attached */ - if (fAll && (CLIENT *)0 == pCEServing->pCLwr) { + if (fAll && (CONSCLIENT *)0 == pCEServing->pCLwr) { /* run through the console ouptut, * add each character to the output line * drop and reset if we have too much @@ -765,7 +728,7 @@ int sfd; /* write console info to clients (not suspended) */ - for (pCL = pCEServing->pCLon; (CLIENT *)0 != pCL; pCL = pCL->pCLnext) { + for (pCL = pCEServing->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) { if (pCL->fcon) { (void)write(pCL->fd, acIn, nr); } @@ -775,7 +738,7 @@ int sfd; /* anything from a connection? */ - for (pCLServing = pGE->pCLall; (CLIENT *)0 != pCLServing; pCLServing = pCLServing->pCLscan) { + for (pCLServing = pGE->pCLall; (CONSCLIENT *)0 != pCLServing; pCLServing = pCLServing->pCLscan) { if (!FD_ISSET(pCLServing->fd, &rmask)) { continue; } @@ -795,12 +758,12 @@ drop: * close gap in table, restart loop */ if (&CECtl != pCEServing) { - tymee = time((long *)0); + tymee = time((time_t *)0); (void)strcpy(stymee, ctime(&tymee)); stymee[24] = '\000'; printf("%s: %s: logout %s [%s]\n", progname, pCEServing->server, pCLServing->acid, stymee); } - if (fNoinit && (CLIENT *)0 == + if (fNoinit && (CONSCLIENT *)0 == pCLServing->pCEto->pCLon->pCLnext) ConsDown(pCLServing->pCEto, &rinit); @@ -826,11 +789,11 @@ drop: * lists (all clients, and this console) */ pCLServing->fcon = 0; - if ((CLIENT *)0 != pCLServing->pCLnext) { + if ((CONSCLIENT *)0 != pCLServing->pCLnext) { pCLServing->pCLnext->ppCLbnext = pCLServing->ppCLbnext; } *(pCLServing->ppCLbnext) = pCLServing->pCLnext; - if ((CLIENT *)0 != pCLServing->pCLscan) { + if ((CONSCLIENT *)0 != pCLServing->pCLscan) { pCLServing->pCLscan->ppCLbscan = pCLServing->ppCLbscan; } *(pCLServing->ppCLbscan) = pCLServing->pCLscan; @@ -847,7 +810,7 @@ drop: /* update last keystroke time */ - pCLServing->typetym = tyme = time((long *)0); + pCLServing->typetym = tyme = time((time_t *)0); #if CPARITY /* clear parity from the network @@ -968,7 +931,7 @@ drop: } pCLServing->icursor = 0; - /* in the CONFIG file gave this group a + /* in the CONFIGFILE file gave this group a * password use it before root's * password (for malowany) */ @@ -987,7 +950,7 @@ drop: shift_console: /* remove from current host */ - if ((CLIENT *)0 != pCLServing->pCLnext) { + if ((CONSCLIENT *)0 != pCLServing->pCLnext) { pCLServing->pCLnext->ppCLbnext = pCLServing->ppCLbnext; } *(pCLServing->ppCLbnext) = pCLServing->pCLnext; @@ -1000,7 +963,7 @@ drop: /* inform operators of the change */ /* if (fVerbose) { */ - tymee = time((long *)0); + tymee = time((time_t *)0); (void)strcpy(stymee, ctime(&tymee)); stymee[24] = '\000'; if (&CECtl == pCEServing) { @@ -1016,7 +979,7 @@ drop: pCLServing->pCEto = pCEServing; pCLServing->pCLnext = pCEServing->pCLon; pCLServing->ppCLbnext = & pCEServing->pCLon; - if ((CLIENT *)0 != pCLServing->pCLnext) { + if ((CONSCLIENT *)0 != pCLServing->pCLnext) { pCLServing->pCLnext->ppCLbnext = & pCLServing->pCLnext; } pCEServing->pCLon = pCLServing; @@ -1030,7 +993,7 @@ drop: CSTROUT(pCLServing->fd, "line to host is down]\r\n"); } else if (pCEServing->fronly) { CSTROUT(pCLServing->fd, "host is read-only]\r\n"); - } else if ((CLIENT *)0 == pCEServing->pCLwr) { + } else if ((CONSCLIENT *)0 == pCEServing->pCLwr) { pCEServing->pCLwr = pCLServing; pCLServing->fwr = 1; CSTROUT(pCLServing->fd, "attached]\r\n"); @@ -1067,7 +1030,7 @@ drop: CSTROUT(pCLServing->fd, " -- line down]\r\n"); } else if (pCEServing->fronly) { CSTROUT(pCLServing->fd, " -- read-only]\r\n"); - } else if ((CLIENT *)0 == pCEServing->pCLwr) { + } else if ((CONSCLIENT *)0 == pCEServing->pCLwr) { pCEServing->pCLwr = pCLServing; pCLServing->fwr = 1; if ( pCEServing->nolog ) { @@ -1126,19 +1089,19 @@ drop: } else { -#if USE_TERMIO +#if HAVE_TERMIO_H if (-1 == ioctl(pCEServing->fdtty, TCSBRK, (char *)0)) { CSTROUT(pCLServing->fd, "failed]\r\n"); continue; } #else -#if USE_TCBREAK +# if HAVE_TCSENDBREAK if (-1 == tcsendbreak(pCEServing->fdtty, 0)) { CSTROUT(pCLServing->fd, "failed]\r\n"); continue; } -#else -#if USE_TERMIOS +# else +# if HAVE_TERMIOS_H if (-1 == ioctl(pCEServing->fdtty, TIOCSBRK, (char *)0)) { CSTROUT(pCLServing->fd, "failed]\r\n"); continue; @@ -1149,8 +1112,8 @@ drop: CSTROUT(pCLServing->fd, "failed]\r\n"); continue; } -#endif -#endif +# endif +# endif #endif } CSTROUT(pCLServing->fd, "sent]\r\n"); @@ -1234,7 +1197,7 @@ drop: sprintf(acOut, "line to host is down]\r\n"); } else if (pCEServing->fronly) { sprintf(acOut, "host is read-only]\r\n"); - } else if ((CLIENT *)0 == (pCL = pCEServing->pCLwr)) { + } else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) { pCEServing->pCLwr = pCLServing; pCLServing->fwr = 1; if ( pCEServing->nolog ) { @@ -1266,7 +1229,7 @@ drop: } #endif -#if USE_TERMIOS +#if HAVE_TERMIOS_H if (-1 == tcgetattr(pCEServing->fdtty, & sbuf)) { CSTROUT(pCLServing->fd, "failed]\r\n"); continue; @@ -1314,13 +1277,13 @@ drop: } pCLServing->fwr = 0; - pCEServing->pCLwr = (CLIENT *)0; + pCEServing->pCLwr = (CONSCLIENT *)0; ConsDown(pCEServing, &rinit); CSTROUT(pCLServing->fd, "line down]\r\n"); /* tell all who closed it */ sprintf(acOut, "[line down by %s]\r\n", pCLServing->acid); - for (pCL = pCEServing->pCLon; (CLIENT *)0 != pCL; pCL = pCL->pCLnext) { + for (pCL = pCEServing->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) { if (pCL == pCLServing) continue; if (pCL->fcon) { @@ -1352,7 +1315,7 @@ drop: } else { sprintf(acOut, "attached]\r\n"); } - if ((CLIENT *)0 != (pCL = pCEServing->pCLwr)) { + if ((CONSCLIENT *)0 != (pCL = pCEServing->pCLwr)) { if (pCL == pCLServing) { if ( pCEServing->nolog ) { CSTROUT(pCLServing->fd, "ok (nologging)]\r\n"); @@ -1383,7 +1346,7 @@ drop: */ sprintf(acOut, "group %s]\r\n", CECtl.server); (void)write(pCLServing->fd, acOut, strlen(acOut)); - for (pCL = pGE->pCLall; (CLIENT *)0 != pCL; pCL = pCL->pCLscan) { + for (pCL = pGE->pCLall; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLscan) { if (&CECtl == pCL->pCEto) continue; sprintf(acOut, " %-24.24s %c %-7.7s %5s %.32s\r\n", pCL->acid, pCL == pCLServing ? '*' : ' ', pCL->fcon ? (pCL->fwr ? "attach" : "spy") : "stopped", IdleTyme(tyme - pCL->typetym), pCL->pCEto->server); @@ -1465,7 +1428,7 @@ drop: sprintf(acOut, "line to host is still down]\r\n"); } else if (pCEServing->fronly) { sprintf(acOut, "up read-only]\r\n"); - } else if ((CLIENT *)0 == (pCL = pCEServing->pCLwr)) { + } else if ((CONSCLIENT *)0 == (pCL = pCEServing->pCLwr)) { pCEServing->pCLwr = pCLServing; pCLServing->fwr = 1; sprintf(acOut, "up -- attached]\r\n"); @@ -1528,7 +1491,7 @@ drop: case 'W': sprintf(acOut, "who %s]\r\n", pCEServing->server); (void)write(pCLServing->fd, acOut, strlen(acOut)); - for (pCL = pCEServing->pCLon; (CLIENT *)0 != pCL; pCL = pCL->pCLnext) { + for (pCL = pCEServing->pCLon; (CONSCLIENT *)0 != pCL; pCL = pCL->pCLnext) { sprintf(acOut, " %-24.24s %c %-7.7s %5s %s\r\n", pCL->acid, pCL == pCLServing ? '*' : ' ', pCL->fcon ? (pCL->fwr ? "attach" : "spy") : "stopped", IdleTyme(tyme - pCL->typetym), pCL->actym); (void)write(pCLServing->fd, acOut, strlen(acOut)); } @@ -1554,23 +1517,23 @@ drop: if (pCEServing->pCLwr == pCLServing) { pCLServing->fwr = 0; pCLServing->fwantwr = 0; - pCEServing->pCLwr = (CLIENT *)0; + pCEServing->pCLwr = (CONSCLIENT *)0; } break; case '\t': /* toggle tab expand */ CSTROUT(pCLServing->fd, "tabs]\r\n"); -#if USE_TERMIO +#if HAVE_TERMIO_H /* ZZZ */ #else -#if USE_TERMIOS +# if HAVE_TERMIOS_H if (-1 == tcgetattr(pCEServing->fdtty, & sbuf)) { CSTROUT(pCLServing->fd, "failed]\r\n"); continue; } -#if !defined(XTABS) /* XXX hack */ -#define XTABS TAB3 -#endif +# if !defined(XTABS) /* XXX hack */ +# define XTABS TAB3 +# endif if (XTABS == (TABDLY&sbuf.c_oflag)) { sbuf.c_oflag &= ~TABDLY; sbuf.c_oflag |= TAB0; @@ -1582,9 +1545,9 @@ drop: CSTROUT(pCLServing->fd, "failed]\r\n"); continue; } -#else +# else /* ZZZ */ -#endif +# endif #endif break; @@ -1606,7 +1569,7 @@ drop: } #endif -#if USE_TERMIOS +#if HAVE_TERMIOS_H if (-1 == tcgetattr(pCEServing->fdtty, & sbuf)) { CSTROUT(pCLServing->fd, "[failed]\r\n"); continue; @@ -1662,7 +1625,7 @@ unknown: /* accept new connections and deal with them */ so = sizeof(struct sockaddr_in); - pCLFree->fd = accept(sfd, (struct sockaddr *)&pCLFree->cnct_port, &so); + pCLFree->fd = accept(sfd, (struct sockaddr *)&pCLFree->cnct_port, (socklen_t *)&so); if (pCLFree->fd < 0) { fprintf(stderr, "%s: accept: %s\n", progname, strerror(errno)); continue; @@ -1672,7 +1635,7 @@ unknown: * the source machine as being local. */ so = sizeof(in_port); - if (-1 == getpeername(pCLFree->fd, (struct sockaddr *)&in_port, &so)) { + if (-1 == getpeername(pCLFree->fd, (struct sockaddr *)&in_port, (socklen_t *)&so)) { CSTROUT(pCLFree->fd, "getpeername failed\r\n"); (void)close(pCLFree->fd); continue; @@ -1697,7 +1660,7 @@ unknown: /* init the identification stuff */ sprintf(pCL->acid, "client@%.*s", sizeof(pCL->acid)-10, hpPeer->h_name); - pCL->typetym = pCL->tym = time((long *)0); + pCL->typetym = pCL->tym = time((time_t *)0); (void)strcpy(pCL->actym, ctime(&(pCL->tym))); pCL->actym[24] = '\000'; @@ -1706,7 +1669,7 @@ unknown: pCL->pCEto = & CECtl; pCL->pCLnext = CECtl.pCLon; pCL->ppCLbnext = & CECtl.pCLon; - if ((CLIENT *)0 != pCL->pCLnext) { + if ((CONSCLIENT *)0 != pCL->pCLnext) { pCL->pCLnext->ppCLbnext = & pCL->pCLnext; } CECtl.pCLon = pCL; @@ -1715,7 +1678,7 @@ unknown: */ pCL->pCLscan = pGE->pCLall; pCL->ppCLbscan = & pGE->pCLall; - if ((CLIENT *)0 != pCL->pCLscan) { + if ((CONSCLIENT *)0 != pCL->pCLscan) { pCL->pCLscan->ppCLbscan = & pCL->pCLscan; } pGE->pCLall = pCL; @@ -1743,9 +1706,9 @@ unknown: /* remove from the free list * if we ran out of static connections calloc some... */ - if ((CLIENT *)0 == pCLFree) { - pCLFree = (CLIENT *)calloc(2, sizeof(CLIENT)); - if ((CLIENT *)0 == pCLFree) { + if ((CONSCLIENT *)0 == pCLFree) { + pCLFree = (CONSCLIENT *)calloc(2, sizeof(CONSCLIENT)); + if ((CONSCLIENT *)0 == pCLFree) { CSTROUT(2, "no memory in console server, help\n"); } else { pCLFree->pCLnext = &pCLFree[1]; @@ -1768,10 +1731,10 @@ GRPENT *pGE; /* get a socket for listening */ -#if USE_STRINGS - (void)bzero((char *)&lstn_port, sizeof(lstn_port)); -#else +#if HAVE_MEMSET (void)memset((void *)&lstn_port, 0, sizeof(lstn_port)); +#else + (void)bzero((char *)&lstn_port, sizeof(lstn_port)); #endif lstn_port.sin_family = AF_INET; *(u_long *)&lstn_port.sin_addr = INADDR_ANY; @@ -1796,7 +1759,7 @@ GRPENT *pGE; } so = sizeof(lstn_port); - if (-1 == getsockname(sfd, (struct sockaddr *)&lstn_port, &so)) { + if (-1 == getsockname(sfd, (struct sockaddr *)&lstn_port, (socklen_t *)&so)) { fprintf(stderr, "%s: getsockname: %s\n", progname, strerror(errno)); exit(9); } @@ -1830,10 +1793,10 @@ GRPENT *pGE; /*NOTREACHED*/ } -#if USE_SIGACTION +#ifdef HAVE_SIGACTION void Set_signal(sig, disp) int sig; - SIGRETS (*disp)(int); + RETSIGTYPE (*disp)(int); { struct sigaction sa; diff --git a/conserver/group.h b/conserver/group.h index 204365a..1fc7642 100644 --- a/conserver/group.h +++ b/conserver/group.h @@ -1,5 +1,5 @@ /* - * $Id: group.h,v 5.11 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: group.h,v 5.12 2001-02-03 20:21:00-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -41,7 +41,7 @@ typedef struct grpent { /* group info */ int pid; /* pid of server for group */ int imembers; /* number of consoles in this group */ CONSENT *pCElist; /* list of consoles in this group */ - CLIENT *pCLall; /* all clients to scan after select */ + CONSCLIENT *pCLall; /* all clients to scan after select */ char passwd[MAXPSWDLEN];/* encrypted password for this group */ } GRPENT; diff --git a/conserver/main.c b/conserver/main.c index 79d71fe..e685a6e 100644 --- a/conserver/main.c +++ b/conserver/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 5.37 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: main.c,v 5.39 2001-02-08 15:31:58-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -26,52 +26,50 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ + +#include + #include #include -#include #include #include #include -#include -#include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" -#include "group.h" -#include "master.h" -#include "access.h" -#include "readcfg.h" -#include "version.h" -#if USE_STRINGS -#include -#else -#include -#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include char rcsid[] = - "$Id: main.c,v 5.37 2000-12-13 12:31:07-08 bryan Exp $"; + "$Id: main.c,v 5.39 2001-02-08 15:31:58-08 bryan Exp $"; char *progname = rcsid; int fAll = 1, fVerbose = 0, fSoftcar = 0, fNoinit = 0, fDebug = 0, fVersion = 0; int fDaemon = 0; char chDefAcc = 'r'; -char *pcConfig = CONFIG; -char *pcPasswd = PASSWD_FILE; + +#define FULLCFPATH SYSCONFDIR "/" CONFIGFILE; +#define FULLPDPATH SYSCONFDIR "/" PASSWDFILE; + +char *pcConfig = FULLCFPATH; +char *pcPasswd = FULLPDPATH; int domainHack = 0; -#if defined(SERVICE) -char acService[] = SERVICE; +#if defined(SERVICENAME) +char acService[] = SERVICENAME; #endif struct sockaddr_in in_port; @@ -175,7 +173,7 @@ Version() #else printf("%s: high-bit of data *not* stripped (8-bit clean)\n", progname); #endif -#if defined(SERVICE) +#if defined(SERVICENAME) { struct servent *pSE; if ((struct servent *)0 == (pSE = getservbyname(acService, "tcp"))) { @@ -189,8 +187,8 @@ Version() printf(" on port %d\n", ntohs((u_short)pSE->s_port)); } #else -#if defined(PORT) - printf("%s: on port %d\n", progname, PORT); +#if defined(PORTNUMBER) + printf("%s: on port %d\n", progname, PORTNUMBER); #else printf("%s: no service or port compiled in\n", progname); exit(1); @@ -228,10 +226,10 @@ char **argv; } (void)setpwent(); -#if USE_SETLINEBUF +#if HAVE_SETLINEBUF setlinebuf(stderr); #endif -#if USE_SETVBUF +#if HAVE_SETVBUF setvbuf(stderr, NULL, _IOLBF, BUFSIZ); #endif @@ -244,10 +242,10 @@ char **argv; fprintf(stderr, "%s: wrong address size (4 != %d) or adress family (%d != %d)\n", progname, hpMe->h_length, AF_INET, hpMe->h_addrtype); exit(1); } -#if USE_STRINGS - (void)bcopy(hpMe->h_addr, &acMyAddr[0], hpMe->h_length); -#else +#if HAVE_MEMCPY (void)memcpy(&acMyAddr[0], hpMe->h_addr, hpMe->h_length); +#else + (void)bcopy(hpMe->h_addr, &acMyAddr[0], hpMe->h_length); #endif while (EOF != (i = getopt(argc, argv, acOpts))) { @@ -312,7 +310,7 @@ char **argv; exit(0); } -#if HAVE_SHADOW +#if HAVE_GETSPNAM /* Why force root??? Cause of getsp*() calls... */ if (0 != geteuid()) { fprintf(stderr, "%s: must be the superuser\n", progname); @@ -328,7 +326,7 @@ char **argv; } ReadCfg(pcConfig, fpConfig); -#if USE_FLOCK +#if HAVE_FLOCK /* we lock the configuration file so that two identical * conservers will not be running together (but two with * different configurations can run on the same host). @@ -345,10 +343,10 @@ char **argv; SetDefAccess(hpMe); } -#if USE_SETLINEBUF +#if HAVE_SETLINEBUF setlinebuf(stdout); #endif -#if USE_SETVBUF +#if HAVE_SETVBUF setvbuf(stdout, NULL, _IOLBF, BUFSIZ); #endif diff --git a/conserver/main.h b/conserver/main.h index 090ebfa..251fac4 100644 --- a/conserver/main.h +++ b/conserver/main.h @@ -1,5 +1,5 @@ /* - * $Id: main.h,v 5.15 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: main.h,v 5.16 2001-02-08 15:31:58-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -47,7 +47,7 @@ extern char acMyHost[]; extern char acMyAddr[]; extern int domainHack; -#if defined(SERVICE) +#if defined(SERVICENAME) extern char acService[]; #endif diff --git a/conserver/master.c b/conserver/master.c index 561c27e..02384de 100644 --- a/conserver/master.c +++ b/conserver/master.c @@ -1,5 +1,5 @@ /* - * $Id: master.c,v 5.27 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: master.c,v 5.29 2001-02-08 15:32:28-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -26,58 +26,44 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#include + #include #include -#include #include #include #include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" -#include "group.h" -#include "access.h" -#include "master.h" -#include "readcfg.h" -#include "version.h" -#include "main.h" +#include -#if USE_STRINGS -#include -#else -#include -#endif - -#if USE_SYS_TIME_H -#include -#else -#include -#endif -#include - -extern char *crypt(); -extern time_t time(); - -static SIGFLAG fSawQuit, fSawHUP, fSawUSR1, fSawCHLD; +#include +#include +#include +#include +#include +#include +#include +#include +#include -static SIGRETS + +static sig_atomic_t fSawQuit, fSawHUP, fSawUSR1, fSawCHLD; + + +static RETSIGTYPE FlagSawCHLD(sig) int sig; { fSawCHLD = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION (void)signal(SIGCHLD, FlagSawCHLD); #endif } @@ -89,8 +75,8 @@ static void FixKids() { register int i, pid; - auto long tyme; - auto WAIT_T UWbuf; + auto time_t tyme; + auto int UWbuf; #if HAVE_WAIT3 while (-1 != (pid = wait3(& UWbuf, WNOHANG, (struct rusage *)0))) { @@ -115,7 +101,7 @@ FixKids() /* this kid kid is dead, start another */ Spawn(& aGroups[i]); - tyme = time((long *)0); + tyme = time((time_t *)0); printf("%s: %s: exit(%d), restarted %s", progname, aGroups[i].pCElist[0].server, WEXITSTATUS(UWbuf), ctime(&tyme)); } } @@ -124,29 +110,29 @@ FixKids() /* kill all the kids and exit. * Called when master process receives SIGTERM */ -static SIGRETS +static RETSIGTYPE QuitIt(arg) int arg; { fSawQuit = 1; } -static SIGRETS +static RETSIGTYPE FlagSawHUP(arg) int arg; { fSawHUP = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION (void)signal(SIGHUP, FlagSawHUP); #endif } -static SIGRETS +static RETSIGTYPE FlagSawUSR1(arg) int arg; { fSawUSR1 = 1; -#if !USE_SIGACTION +#if !HAVE_SIGACTION (void)signal(SIGUSR1, FlagSawUSR1); #endif } @@ -198,14 +184,14 @@ REMOTE /* set up port for master to listen on */ -#if USE_STRINGS - (void)bzero((char *)&master_port, sizeof(master_port)); -#else +#if HAVE_MEMSET (void)memset((void *)&master_port, 0, sizeof(master_port)); +#else + (void)bzero((char *)&master_port, sizeof(master_port)); #endif master_port.sin_family = AF_INET; *(u_long *)&master_port.sin_addr = INADDR_ANY; -#if defined(SERVICE) +#if defined(SERVICENAME) { struct servent *pSE; if ((struct servent *)0 == (pSE = getservbyname(acService, "tcp"))) { @@ -215,11 +201,11 @@ REMOTE master_port.sin_port = pSE->s_port; } #else -#if defined(PORT) - master_port.sin_port = htons((u_short)PORT); -#else +# if defined(PORTNUMBER) + master_port.sin_port = htons((u_short)PORTNUMBER); +# else fprintf(stderr, "%s: no port or service compiled in?\n", progname); -#endif +# endif #endif if ((msfd=socket(AF_INET, SOCK_STREAM, 0)) < 0) { @@ -268,7 +254,7 @@ REMOTE continue; } so = sizeof(response_port); - cfd = accept(msfd, (struct sockaddr *)&response_port, &so); + cfd = accept(msfd, (struct sockaddr *)&response_port, (socklen_t *)&so); if (cfd < 0) { fprintf(stderr, "%s: accept: %s\n", progname, strerror(errno)); continue; @@ -276,7 +262,7 @@ REMOTE so = sizeof(in_port); - if (-1 == getpeername(cfd, (struct sockaddr *)&in_port, &so)) { + if (-1 == getpeername(cfd, (struct sockaddr *)&in_port, (socklen_t *)&so)) { CSTROUT(cfd, "getpeername failed\r\n"); (void)close(cfd); continue; diff --git a/conserver/port.h b/conserver/port.h index 132c6b7..1f37832 100644 --- a/conserver/port.h +++ b/conserver/port.h @@ -1,5 +1,5 @@ /* - * $Id: port.h,v 1.17 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: port.h,v 1.20 2001-02-08 15:32:49-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -8,6 +8,8 @@ * Copyright GNAC, Inc., 1998 */ +#include + /* * Copyright 1992 Purdue Research Foundation, West Lafayette, Indiana * 47907. All rights reserved. @@ -34,131 +36,27 @@ * 4. This notice may not be removed or altered. */ -/* - * this is the configuration file for the Ohio State/PUCC console - * server. Just define the macros below to somehting that looks good - * and give it a go. It'll complain (under conserver -V) if things - * look really bad. - * - * all PTX, PTX2, and PTX4 code added by gregf@sequent.com (gregf) - */ -#if !( defined(SUN5) || defined(BSDOS3) || defined(LINUX2) || defined(IRIX6) ) -#error "Platform needs to be defined. See port.h" -#endif - -#if (defined(PTX2) || defined(PTX4)) -#define PTX -#endif - -/* some machine specific details - */ -#if !defined(USE_OLDSEL) -#if defined(IBMR2) -#include -#endif -#endif -#if !defined(HAVE_UWAIT) -#define HAVE_UWAIT !(defined(IBMR2)||defined(SUN5)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(BSDOS3)||defined(IRIX6)) -#endif - -#if !defined(HAVE_WAIT3) -#define HAVE_WAIT3 !(defined(SUN5)||defined(PTX)) -#endif - -/* This is the port number used in the connection. It can use either - * /etc/services or a hardcoded port (SERVICE name has precedence). - * (You can -D one in the Makefile to override these.) - */ -/* #define PORT 782 /* only if you cannot put in /etc/services */ -#if !defined(SERVICE) -#if !defined(PORT) -#define SERVICE "conserver" -#endif -#endif - /* Wait for a part of a second before slapping console server. * Good for CISCO terminal servers that get upset when you * attack with intense socket connections */ #if !defined(USLEEP_FOR_SLOW_PORTS) -#define USLEEP_FOR_SLOW_PORTS 100000 -#endif - -/* The name of the host which will act as the console server - */ -#if !defined(HOST) -#define HOST "console" -#endif - -/* How long should we wait for a TCP socket to be created when talking - * to network terminal servers? 10 second default - */ -#if !defined(CONNECTTIMEOUT) -#define CONNECTTIMEOUT 10 +# define USLEEP_FOR_SLOW_PORTS 100000 #endif /* the default escape sequence used to give meta commands */ #if !defined(DEFATTN) -#define DEFATTN '\005' +# define DEFATTN '\005' #endif #if !defined(DEFESC) -#define DEFESC 'c' -#endif - -/* Location of the configuration file - */ -#if !defined(CONFIG) -#define CONFIG "/etc/conserver.cf" -#endif - -/* Location of ANL designed passwd file */ -#if !defined(PASSWD_FILE) -#define PASSWD_FILE "/etc/conserver.passwd" -#endif - -/* The maximum number of serial lines that can be handled by a child process - */ -#if !defined(MAXMEMB) -#define MAXMEMB 8 -#endif - - -/* The maximum number of child processes spawned. - */ -#if !defined(MAXGRP) -#define MAXGRP 32 +# define DEFESC 'c' #endif /* the max number of characters conserver will replay for you (the r command) */ #if !defined(MAXREPLAY) -#define MAXREPLAY (80*25) -#endif - -/* if the encrypted passwd is in a shadow file, define HAVE_SHADOW (gregf) - */ -#if !defined(HAVE_SHADOW) -#define HAVE_SHADOW (defined(PTX)||defined(SUN5)||defined(IRIX6)) -#endif - -/* we'd like to line buffer our output, if we know how - */ -#if !defined(USE_SETLINEBUF) -#define USE_SETLINEBUF (!(defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(PTX))) -#endif - -/* we'd like to line buffer our output, if we know how; PTX uses setvbuf (gregf) - */ -#if !defined(USE_SETVBUF) -#define USE_SETVBUF (defined(PTX)) -#endif - -/* hpux doesn't have getdtablesize() and they don't provide a macro - * in non-KERNEL cpp mode - */ -#if defined(HPUX7)||defined(HPUX8)||defined(HPUX9) -#define getdtablesize() 64 +# define MAXREPLAY (80*25) #endif /* the console server will provide a pseudo-device console which @@ -167,7 +65,7 @@ * might wanna use it). Turn this on only if you (might) need it. */ #if !defined(DO_VIRTUAL) -#define DO_VIRTUAL 1 +# define DO_VIRTUAL 1 #endif #if DO_VIRTUAL @@ -176,188 +74,11 @@ * on some emulation code?? (XXX) */ #if !defined(HAVE_PTYD) -#define HAVE_PTYD (defined(S81)||defined(VAX8800)) -#endif - -#if !defined(HAVE_GETPSEUDO) -#define HAVE_GETPSEUDO (defined(PTX2)) -#endif - -#if !defined(HAVE_PTSNAME) -#define HAVE_PTSNAME (defined(PTX4)) -#endif - -#if !defined(HAVE_LDTERM) -#define HAVE_LDTERM (defined(SUN5)) -#endif - -#if !defined(HAVE_STTY_LD) -#define HAVE_STTY_LD (defined(IRIX5)) +# define HAVE_PTYD (defined(S81)||defined(VAX8800)) #endif #endif /* virtual (process on a pseudo-tty) console support */ -#if !defined(HAVE_SETSID) -#define HAVE_SETSID (defined(IBMR2)||defined(SUN5)||defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6)||defined(BSDOS3)) -#endif - -/* should we use flock to keep multiple conservers from hurting each other? - * PTX has lockf... should probably port code to work with this (gregf) - */ -#if !defined(USE_FLOCK) -#define USE_FLOCK (!(defined(IBMR2)||defined(SUN5)||defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(LINUX2)||defined(IRIX6)||defined(BSDOS3))) -#endif - -/* should we try to pop streams modules off? - */ -#if !defined(USE_STREAMS) -#define USE_STREAMS (defined(SUN4)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(IRIX6)) -#endif - -/* if we do not have old style tty emulation use termios.h - */ -#if !defined(USE_TERMIO) -#define USE_TERMIO (defined(ETA10)||defined(V386)) -#endif -#if !defined(USE_TERMIOS) -#define USE_TERMIOS (defined(HPUX7)||defined(HPUX8)||defined(HPUX9)||defined(SUN5)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6)||defined(SUN4)) -#endif -#if !defined(USE_TCBREAK) -#define USE_TCBREAK (defined(PTX)||defined(BSDOS3)||defined(LINUX2)||defined(SUN5)) -#endif - -/* if we have define this to 1, else define to 0 - */ -#if !defined(USE_STRINGS) -#define USE_STRINGS (defined(SUN4)||defined(DYNIX)||defined(EPIX)||defined(IRIX5)||defined(IRIX6)||defined(BSDOS3)) -#endif - -#if !defined(NEED_UNISTD_H) -#define NEED_UNISTD_H (defined(SUN5)||defined(PTX)) -#endif - -#if !defined(USE_SYS_TIME_H) -#define USE_SYS_TIME_H (!defined(PTX)) -#endif - -#if USE_STRINGS -#if !defined(strchr) -#define strchr index -#endif -#if !defined(strrchr) -#define strrchr rindex -#endif -#endif - -/* used to force the server process to clear parity, which is for farmers - */ -#if !defined(CPARITY) -#define CPARITY 1 -#endif - - -/* if you do not have fd_set's here is a possible emulation - */ -#if USE_OLDSEL -typedef long fd_set; - -#define FD_ZERO(a) {*(a)=0;} -#define FD_SET(d,a) {*(a) |= (1 << (d));} -#define FD_CLR(d,a) {*(a) &= ~(1 << (d));} -#define FD_ISSET(d,a) (*(a) & (1 << (d))) -#endif - -#if USE_TERMIOS -#if defined(LINUX2) -#include -#endif -#if defined(HPUX7)||defined(HPUX8)||defined(HPUX9) -#define TCGETS _IOR('T', 16, struct termios) -#define TCSETS _IOW('T', 17, struct termios) -#endif -#if defined(PTX2) -#define TCGETS TCGETP -#define TCSETS TCSETP -#endif -#endif - -/* which type does wait(2) take for status location - */ -#if HAVE_UWAIT -#define WAIT_T union wait -#if ! defined WEXITSTATUS -#define WEXITSTATUS(x) ((x).w_retcode) -#endif -#else -#define WAIT_T int -#endif - -/* which type signal handlers return on this machine - */ -#if defined(sun) || defined(NEXT2) || defined(SUN5) || defined(PTX) || defined(IRIX5) || defined(BSDOS3) || defined(LINUX2) || defined(IRIX6) -#define SIGRETS void -#else -#define SIGRETS int -#endif - -/* which type to use for global flags set by signal handlers */ -#if defined(SUN5) -#define SIGFLAG volatile sig_atomic_t -#else -#define SIGFLAG int -#endif - -#if !defined(USE_SIGACTION) -#define USE_SIGACTION (defined(SUN4)||defined(SUN5)||defined(LINUX2)) -#endif - -#if USE_SIGACTION -extern void Set_signal(int isg, SIGRETS (*disp)(int)); -#else -#define Set_signal(sig, disp) (void)signal((sig), (disp)) -#endif - -/* do we have a (working) setsockopt call - */ -#if !defined(HAVE_SETSOCKOPT) -#define HAVE_SETSOCKOPT (defined(sun)||defined(PTX)||defined(LINUX2)||defined(IRIX6)||defined(BSDOS3)) -#endif - -/* does this system have the ANSI strerror() function? - */ -#if !defined(HAVE_STRERROR) -#define HAVE_STRERROR (defined(IBMR2)||defined(ETA10)||defined(V386)||defined(SUN5)||defined(NEXT2)||defined(HPUX8)||defined(HPUX9)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6)||defined(BSDOS3)) -#endif -#if ! HAVE_STRERROR -extern int errno; -extern char *sys_errlist[]; -#define strerror(Me) (sys_errlist[Me]) -#endif - -#if !defined(HAVE_H_ERRLIST) -#define HAVE_H_ERRLIST (defined(SUN4)||defined(SUN3)||defined(FREEBSD)|defined(NETBSD)||defined(PTX)||defined(IRIX5)||defined(LINUX2)||defined(IRIX6)||defined(BSDOS3)) -#endif -#if HAVE_H_ERRLIST -extern int h_errno; -extern char *h_errlist[]; -#define hstrerror(Me) (h_errlist[Me]) -#else -#define hstrerror(Me) "host lookup error" -#endif - -#if !defined(HAVE_RLIMIT) -#if (defined(SUN5)||defined(PTX4)||defined(LINUX2)||defined(BSDOS3)||defined(IRIX6)) -#define HAVE_RLIMIT 1 -#else -#define HAVE_RLIMIT 0 -#endif -#endif - -/* that's all. just run - * make - * ./conserver -V - */ - /* communication constants */ #define OB_SUSP 'Z' /* suspended by server */ @@ -378,7 +99,7 @@ extern char *h_errlist[]; #if defined(lint) extern int shut_up_lint; #else -#define shut_up_lint 0 +# define shut_up_lint 0 #endif /* this macro efficently outputs a constant string to a fd @@ -389,4 +110,3 @@ extern int shut_up_lint; write(Mfd, _ac, sizeof(_ac)-1); \ } while (shut_up_lint) -extern char *calloc(), *malloc(), *realloc(); diff --git a/conserver/readcfg.c b/conserver/readcfg.c index fb94df7..1e51dab 100644 --- a/conserver/readcfg.c +++ b/conserver/readcfg.c @@ -1,5 +1,5 @@ /* - * $Id: readcfg.c,v 5.28 2000-12-13 12:31:07-08 bryan Exp $ + * $Id: readcfg.c,v 5.30 2001-02-08 15:32:28-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -29,38 +29,32 @@ /* * Network console modifications by Robert Olson, olson@mcs.anl.gov. */ + +#include + #include #include -#include #include #include #include -#include -#include #include #include #include #include #include -#include #include #include -#include "cons.h" -#include "port.h" -#include "consent.h" -#include "client.h" -#include "group.h" -#include "access.h" -#include "readcfg.h" -#include "master.h" -#include "main.h" +#include -#if USE_STRINGS -#include -#else -#include -#endif +#include +#include +#include +#include +#include +#include +#include +#include GRPENT @@ -93,9 +87,9 @@ register FILE *fp; register CONSENT *pCE; register REMOTE **ppRC; char LogDirectory[MAXLOGLEN]; - long tyme; + time_t tyme; - tyme = time((long *)0); + tyme = time((time_t *)0); LogDirectory[0] = '\000'; pGEAll = aGroups; /* fill in these structs */ pCE = aConsoles; @@ -172,10 +166,10 @@ register FILE *fp; } if ( 0 != -#if USE_STRINGS - bcmp(&acMyAddr[0], hpMe->h_addr, hpMe->h_length) -#else +#if HAVE_MEMCMP memcmp(&acMyAddr[0], hpMe->h_addr, hpMe->h_length) +#else + bcmp(&acMyAddr[0], hpMe->h_addr, hpMe->h_length) #endif ) { diff --git a/conserver/version.h b/conserver/version.h index 625d343..75ef5b7 100644 --- a/conserver/version.h +++ b/conserver/version.h @@ -1,5 +1,5 @@ /* - * $Id: version.h,v 1.19 2000-12-14 16:21:18-08 bryan Exp $ + * $Id: version.h,v 1.20 2001-02-17 08:37:24-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -8,4 +8,4 @@ * Copyright GNAC, Inc., 1998 */ -#define THIS_VERSION "conserver.com version 6.1.7" +#define THIS_VERSION "conserver.com version 7.0.0" diff --git a/console/Makefile b/console/Makefile deleted file mode 100644 index c4c68f2..0000000 --- a/console/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# $Id: Makefile,v 1.11 1999-01-25 15:38:39-08 bryan Exp $ -# -# Makefile for console client progran -# - -PROG=console -PREFIX=/usr/local -BIN=${PREFIX}/bin -ETC=${PREFIX}/etc -MAN=${PREFIX}/man -MANSECT=8 - -C=../conserver - -LINCLUDE= ${INCLUDE} -I$C -CFLAGS= ${DEBUG} ${CDEFS} ${LINCLUDE} - -HDR= -SRC= console.c -OBJ= console.o - -all: ${PROG} - -${PROG}: ${OBJ} - ${CC} -o $@ ${CFLAGS} ${OBJ} ${LIBS} - -clean: FRC - rm -f Makefile.bak ${PROG} *.tbl a.out *.o core errs lint.out tags - -depend: ${HDR} ${SRC} FRC - makedepend ${CDEFS} ${LINCLUDE} ${SRC} - -dirs: ${BIN} - -install: all dirs FRC - ${INSTALL} -cs ${PROG} ${BIN}/${PROG} - -${MAN}/man${MANSECT}: - ${INSTALL} -d $@ - -install.man: ${MAN}/man${MANSECT} - tbl console.man > console.tbl - ${INSTALL} -c console.tbl ${MAN}/man${MANSECT}/console.${MANSECT} - -lint: ${HDR} ${SRC} FRC - lint -h ${CDEFS} ${LINCLUDE} ${SRC} - -tags: ${HDR} ${SRC} - ctags -t ${HDR} ${SRC} - -/ ${BIN}: - ${INSTALL} -d $@ - -FRC: - -# DO NOT DELETE THIS LINE -- make depend depends on it. - -console.o: ../conserver/cons.h ../conserver/port.h ../conserver/version.h diff --git a/console/Makefile.in b/console/Makefile.in new file mode 100644 index 0000000..e443e39 --- /dev/null +++ b/console/Makefile.in @@ -0,0 +1,54 @@ +### Path settings +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +bindir = @bindir@ +sysconfdir = @sysconfdir@ +mandir = @mandir@ + +### Installation programs and flags +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s +LN_S = @LN_S@ +MKDIR = @MKDIR@ + +### Compiler and link options +CC = @CC@ +CFLAGS = @CFLAGS@ # -DPUCC -DSUN5 +DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)\" +CPPFLAGS = -I.. -I$(top_srcdir) -I$(srcdir) -I$(top_srcdir)/conserver $(DEFS) @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +@SET_MAKE@ + + +### Makefile rules - no user-servicable parts below + +CONSOLE_OBJS = console.o +CONSOLE_HDRS = ../config.h $(top_srcdir)/compat.h $(top_srcdir)/conserver/port.h +ALL = console + + +all: $(ALL) + +.PHONY: clean distclean install + +console: $(CONSOLE_OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -o console $(CONSOLE_OBJS) $(LIBS) + +%.o: $(srcdir)/%.c $(CONSOLE_HDRS) + $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + +clean: + rm -f *~ *.o $(ALL) core + +distclean: clean + rm -f Makefile + +install: + $(MKDIR) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) console $(DESTDIR)$(bindir) + $(MKDIR) $(DESTDIR)$(mandir)/man1 + $(INSTALL) console.man $(DESTDIR)$(mandir)/man8/console.1 + diff --git a/console/console.c b/console/console.c index ac4bbce..f1de0a7 100644 --- a/console/console.c +++ b/console/console.c @@ -1,5 +1,5 @@ /* - * $Id: console.c,v 5.31 2000-12-13 12:31:56-08 bryan Exp $ + * $Id: console.c,v 5.35 2001-02-18 22:00:47-08 bryan Exp $ * * Copyright conserver.com, 2000 * @@ -27,62 +27,32 @@ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +#include + #include -#include #include -#include #include #include #include #include #include #include -#include #include -#include "cons.h" -#include "port.h" -#include "version.h" +#include -#if USE_STRINGS -#include -#else -#include -#endif +#include +#include -#if USE_TERMIOS -#include -#include - -#else -#if USE_TERMIO -#include - -#else /* use ioctl stuff */ -#include -#include -#endif -#endif - -extern char *getenv(); -extern char *getpass(); -extern char *calloc(), *realloc(); -/* extern short htons(); */ -extern int errno; - -#if !HAVE_STRERROR -extern char *sys_errlist[]; -#define strerror(Me) (sys_errlist[Me]) -#endif static char rcsid[] = - "$Id: console.c,v 5.31 2000-12-13 12:31:56-08 bryan Exp $"; + "$Id: console.c,v 5.35 2001-02-18 22:00:47-08 bryan Exp $"; static char *progname = rcsid; int fVerbose = 0, fReplay = 0, fRaw = 0; int chAttn = -1, chEsc = -1; char *pcInMaster = /* which machine is current */ - HOST; + MASTERHOST; /* panic -- we have no more momory */ @@ -187,7 +157,7 @@ char **ppc; static void Version() { - register unsigned char *puc; +/* register unsigned char *puc; */ printf("%s: %s\n", progname, THIS_VERSION); printf("%s: initial master server `%s\'\n", progname, pcInMaster); @@ -195,8 +165,8 @@ Version() putCtlc(DEFATTN, stdout); putCtlc(DEFESC, stdout); printf("\'\n"); - puc = (unsigned char *)&local_port.sin_addr; - printf("%s: loopback address for %s is %d.%d.%d.%d\n", progname, acMyName, puc[0], puc[1], puc[2], puc[3]); +/* puc = (unsigned char *)&local_port.sin_addr; + printf("%s: loopback address for %s is %d.%d.%d.%d\n", progname, acMyName, puc[0], puc[1], puc[2], puc[3]); */ } @@ -284,23 +254,25 @@ short sPort; register int s; register struct hostent *hp; -#if USE_STRINGS - (void)bzero((char *)pPort, sizeof(*pPort)); -#else +#if HAVE_MEMSET memset((void *)pPort, '\000', sizeof(*pPort)); +#else + (void)bzero((char *)pPort, sizeof(*pPort)); #endif +/* if (0 == strcmp(pcToHost, strcpy(acThisHost, acMyName))) { (void)strcpy(pcToHost, acLocalhost); -#if USE_STRINGS - (void)bcopy((char *)&local_port.sin_addr, (char *)&pPort->sin_addr, sizeof(local_port.sin_addr)); -#else +#if HAVE_MEMCPY memcpy((char *)&pPort->sin_addr, (char *)&local_port.sin_addr, sizeof(local_port.sin_addr)); -#endif - } else if ((struct hostent *)0 != (hp = gethostbyname(pcToHost))) { -#if USE_STRINGS - (void)bcopy((char *)hp->h_addr, (char *)&pPort->sin_addr, hp->h_length); #else + (void)bcopy((char *)&local_port.sin_addr, (char *)&pPort->sin_addr, sizeof(local_port.sin_addr)); +#endif + } else */ + if ((struct hostent *)0 != (hp = gethostbyname(pcToHost))) { +#if HAVE_MEMCPY memcpy((char *)&pPort->sin_addr, (char *)hp->h_addr, hp->h_length); +#else + (void)bcopy((char *)hp->h_addr, (char *)&pPort->sin_addr, hp->h_length); #endif } else { fprintf(stderr, "%s: gethostbyname: %s: %s\n", progname, pcToHost, hstrerror(h_errno)); @@ -340,16 +312,16 @@ short sPort; * correct mode for us to do our thing */ static int screwy = 0; -#if USE_TERMIOS +#if HAVE_TERMIOS_H static struct termios o_tios; #else -#if USE_TERMIO +# if HAVE_TERMIO_H static struct termio o_tio; -#else +# else static struct sgttyb o_sty; static struct tchars o_tchars; static struct ltchars o_ltchars; -#endif +# endif #endif @@ -361,23 +333,28 @@ static struct ltchars o_ltchars; static void c2raw() { -#if USE_TERMIOS +#if HAVE_TERMIOS_H auto struct termios n_tios; #else -#if USE_TERMIO +# if HAVE_TERMIO_H auto struct termio n_tio; -#else +# else auto struct sgttyb n_sty; auto struct tchars n_tchars; auto struct ltchars n_ltchars; -#endif +# endif #endif if (!isatty(0) || 0 != screwy) return; -#if USE_TERMIOS - if (0 != ioctl(0, TCGETS, & o_tios)) { +#ifdef HAVE_TERMIOS_H +# ifdef HAVE_TCGETATTR + if (0 != tcgetattr(0, & o_tios)) +# else + if (0 != ioctl(0, TCGETS, & o_tios)) +# endif + { fprintf(stderr, "%s: iotcl: getsw: %s\n", progname, strerror(errno)); exit(10); } @@ -387,12 +364,17 @@ c2raw() n_tios.c_lflag &= ~(ICANON|ISIG|ECHO); n_tios.c_cc[VMIN] = 1; n_tios.c_cc[VTIME] = 0; - if (0 != ioctl(0, TCSETS, & n_tios)) { +# ifdef HAVE_TCSETATTR + if (0 != tcsetattr(0, TCSANOW, & n_tios)) +# else + if (0 != ioctl(0, TCSETS, & n_tios)) +# endif + { fprintf(stderr, "%s: getarrt: %s\n", progname, strerror(errno)); exit(10); } #else -#if USE_TERMIO +# ifdef HAVE_TERMIO_H if (0 != ioctl(0, TCGETA, & o_tio)) { fprintf(stderr, "%s: iotcl: geta: %s\n", progname, strerror(errno)); exit(10); @@ -407,7 +389,7 @@ c2raw() fprintf(stderr, "%s: iotcl: seta: %s\n", progname, strerror(errno)); exit(10); } -#else +# else if (0 != ioctl(0, TIOCGETP, (char *)&o_sty)) { fprintf(stderr, "%s: iotcl: getp: %s\n", progname, strerror(errno)); exit(10); @@ -449,7 +431,7 @@ c2raw() fprintf(stderr, "%s: ioctl: sltc: %s\n", progname, strerror(errno)); return; } -#endif +# endif #endif screwy = 1; } @@ -462,16 +444,20 @@ c2cooked() { if (!screwy) return; -#if USE_TERMIOS +#ifdef HAVE_TERMIOS_H +# ifdef HAVE_TCSETATTR + tcsetattr(0, TCSANOW, &o_tios); +# else (void)ioctl(0, TCSETS, (char *)&o_tios); +# endif #else -#if USE_TERMIO +# ifdef HAVE_TERMIO_H (void)ioctl(0, TCSETA, (char *)&o_tio); -#else +# else (void)ioctl(0, TIOCSETP, (char *)&o_sty); (void)ioctl(0, TIOCSETC, (char *)&o_tchars); (void)ioctl(0, TIOCSLTC, (char *)&o_ltchars); -#endif +# endif #endif screwy = 0; } @@ -549,7 +535,7 @@ char *pcBuf, *pcWant; return strcmp(pcBuf, pcWant); } -#if defined(SERVICE) +#if defined(SERVICENAME) static struct servent *pSE; #endif @@ -586,16 +572,16 @@ char *pcPorts, *pcMaster, *pcTo, *pcCmd, *pcWho; } if ('\000' == *pcPorts) { -#if defined(SERVICE) +#if defined(SERVICENAME) /* in net order -- ksb */ j = pSE->s_port; #else -#if defined(PORT) - j = htons(PORT); -#else +# if defined(PORTNUMBER) + j = htons(PORTNUMBER); +# else fprintf(stderr, "%s: no port or service compiled in?\n", progname); exit(8); -#endif +# endif #endif } else if (!isdigit(pcPorts[0])) { fprintf(stderr, "%s: %s: %s\n", progname, pcMaster, pcPorts); @@ -627,7 +613,7 @@ static int SawUrg = 0; * an out of band command to suspend ourself. We just tell the reader * routine we saw one */ -SIGRETS +RETSIGTYPE oob(sig) int sig; { @@ -705,7 +691,7 @@ char *pcMaster, *pcMach, *pcHow, *pcUser; fprintf(stderr, "%s: fcntl: %d: %s\n", progname, s, strerror(errno)); } #else -#if defined(SIOCSPGRP) +# if defined(SIOCSPGRP) { auto int iTemp; /* on the HP-UX systems if different @@ -715,7 +701,7 @@ char *pcMaster, *pcMach, *pcHow, *pcUser; fprintf(stderr, "%s: ioctl: %d: %s\n", progname, s, strerror(errno)); } } -#endif +# endif #endif #if defined(SIGURG) (void)signal(SIGURG, oob); @@ -1167,9 +1153,9 @@ char **argv; ++progname; } -#if defined(SERVICE) - if ((struct servent *)0 == (pSE = getservbyname(SERVICE, "tcp"))) { - fprintf(stderr, "%s: getservbyname: %s: %s\n", progname, SERVICE, strerror(errno)); +#if defined(SERVICENAME) + if ((struct servent *)0 == (pSE = getservbyname(SERVICENAME, "tcp"))) { + fprintf(stderr, "%s: getservbyname: %s: %s\n", progname, SERVICENAME, strerror(errno)); exit(1); } #endif @@ -1192,10 +1178,10 @@ char **argv; exit(2); } if ((struct hostent *)0 != (hp = gethostbyname(acLocalhost))) { -#if USE_STRINGS - (void)bcopy((char *)hp->h_addr, (char *)&local_port.sin_addr, hp->h_length); -#else +#if HAVE_MEMCPY memcpy((char *)&local_port.sin_addr, (char *)hp->h_addr, hp->h_length); +#else + (void)bcopy((char *)hp->h_addr, (char *)&local_port.sin_addr, hp->h_length); #endif } else { acLocalhost[0] = '\000'; diff --git a/install-sh b/install-sh new file mode 100644 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/port/BSDOS3 b/port/BSDOS3 deleted file mode 100644 index 49b2cf1..0000000 --- a/port/BSDOS3 +++ /dev/null @@ -1,8 +0,0 @@ -# $Id: BSDOS3,v 1.2 1999-01-14 13:33:09-08 bryan Exp $ -# -'CC=gcc' -'INSTALL=/usr/ucb/install' -'INCLUDE=' -'DEBUG=-O' -'CDEFS=-DBSDOS3' -'LIBS=' diff --git a/port/IRIX6 b/port/IRIX6 deleted file mode 100644 index e298106..0000000 --- a/port/IRIX6 +++ /dev/null @@ -1,8 +0,0 @@ -# $Id: IRIX6,v 1.1 1999-01-15 15:28:51-08 bryan Exp $ -# -'CC=cc' -'INSTALL=/sbin/install' -'INCLUDE=' -'DEBUG=-O' -'CDEFS=-DIRIX6' -'LIBS=' diff --git a/port/Linux2 b/port/Linux2 deleted file mode 100644 index c648f25..0000000 --- a/port/Linux2 +++ /dev/null @@ -1,8 +0,0 @@ -# $Id: Linux2,v 1.1 1999-01-14 22:25:08-08 bryan Exp $ -# -'CC=gcc' -'INSTALL=/usr/bin/install' -'INCLUDE=' -'DEBUG=-O' -'CDEFS=-DLINUX2' -'LIBS=-lcrypt' diff --git a/port/README b/port/README deleted file mode 100644 index 91db856..0000000 --- a/port/README +++ /dev/null @@ -1,48 +0,0 @@ - Porting - ======= - -Well, porting should be a fairly simple process. There are three things -that need to be set up to get things to work. First, you need to modify -the 'system' script so that it can properly detect your system and -associate it with a name. Next, create a file in this directory of the -same name with the proper makefile definitions. You should be able to -just copy the SunOS5 file to the name you created and modify the values -defined. One of the important things to do is create a token name to be -used during compilation (see the CDEFS lines - Solaris 5.X uses SUN5, for -example). This token will then be used in the ../conserver/port.h file. - -So, as an example, say you're porting to the "Unix OS" version 6.4. -You'd add a line like the following to the system script: - - UnixOS-6.*) p="UnixOS6" ;; - -Then you'd create a UnixOS6 file in this directory with the contents of: - - # Sample UnixOS6 file - # - 'CC=gcc' - 'INSTALL=/usr/ucb/install' - 'INCLUDE=' - 'DEBUG=-O' - 'CDEFS=-DUNIXOS6' - 'LIBS=' - -Again, the key is the -DUNIXOS6 line...the others should be whatever is -required to get things to build. - -Now you need to go define UNIXOS6 in ../conserver/port.h and have -it define the appropriate things. You'll need to add UNIXOS6 to the -line above '#error "Platform needs to be defined. See port.h"' and -then work through the file inserting UNIXOS6 at the appropriate spots. -Hopefully that's all you'll need to get the software to build. If, for -some reason, a porting issue is not dealt with properly in the source -files, you may need to adjust other .c and .h files. But, hopefully not. -Most of the tricky stuff can be adjusted via the port.h file. - -That's about all the instructions I have. If I've missed anything -important, I'll be more than happy to supplement these instructions. -Just let me know. Just let me know. - -# -# $Id: README,v 1.1 1999-01-22 13:24:21-08 bryan Exp $ -# diff --git a/port/SunOS5 b/port/SunOS5 deleted file mode 100644 index fa6cc9d..0000000 --- a/port/SunOS5 +++ /dev/null @@ -1,8 +0,0 @@ -# $Id: SunOS5,v 1.2 1999-01-14 13:33:09-08 bryan Exp $ -# -'CC=gcc' -'INSTALL=/usr/ucb/install' -'INCLUDE=' -'DEBUG=-O' -'CDEFS=-DSUN5' -'LIBS=-lsocket -lnsl' diff --git a/port/system b/port/system deleted file mode 100755 index ce2cf3e..0000000 --- a/port/system +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# $Id: system,v 1.4 1999-01-15 15:35:44-08 bryan Exp $ -# - -PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb - -s=`uname -s` -r=`uname -r` - -case "$s-$r" in - SunOS-5.*) p="SunOS5" ;; - BSD/OS-3.*) p="BSDOS3" ;; - Linux-2.*) p="Linux2" ;; - IRIX-6.*) p="IRIX6" ;; - *) p="" ;; -esac - -echo $p