diff -Nrup NoCatSplash-nightly/Makefile.am NoCatSplash-auth/Makefile.am --- NoCatSplash-nightly/Makefile.am 2003-01-15 15:45:23.000000000 -0500 +++ NoCatSplash-auth/Makefile.am 2003-09-24 17:58:14.000000000 -0400 @@ -4,9 +4,11 @@ pkglibexec_SCRIPTS = @libexecscripts@ EXTRA_SCRIPTS = libexec/iptables/access.fw libexec/iptables/clear.fw libexec/iptables/dump.fw libexec/iptables/initialize.fw libexec/iptables/reset.fw libexec/iptables/throttle.fw libexec/loopback/access.fw libexec/loopback/clear.fw libexec/loopback/dump.fw libexec/loopback/initialize.fw htdocs_DATA = htdocs/splash.html htdocs/status.html htdocs/test.html images_DATA = htdocs/images/auth_logo.gif htdocs/images/continue.gif htdocs/images/login.gif htdocs/images/logout.gif htdocs/images/register.gif htdocs/images/reset.gif htdocs/images/skip.gif htdocs/images/update.gif -EXTRA_DIST = $(images_DATA) $(htdocs_DATA) nocat.conf.in +pgp_DATA = pgp/trustedkeys.gpg +EXTRA_DIST = $(images_DATA) $(htdocs_DATA) $(pgp_DATA) nocat.conf.in CLEANFILES = $(sysconf_DATA) nocat.conf: nocat.conf.in sed -e s,@htdocsdir\@,$(htdocsdir),g \ + -e s,@pgpdir\@,$(pgpdir),g \ -e s,@pkglibexecdir\@,$(pkglibexecdir),g < $< > $@ diff -Nrup NoCatSplash-nightly/Makefile.in NoCatSplash-auth/Makefile.in --- NoCatSplash-nightly/Makefile.in 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/Makefile.in 2003-09-24 17:58:14.000000000 -0400 @@ -87,6 +87,7 @@ htdocsdir = @htdocsdir@ imagesdir = @imagesdir@ install_sh = @install_sh@ libexecscripts = @libexecscripts@ +pgpdir = @pgpdir@ pkglibexecdir = @pkglibexecdir@ SUBDIRS = src sysconf_DATA = nocat.conf @@ -94,7 +95,8 @@ pkglibexec_SCRIPTS = @libexecscripts@ EXTRA_SCRIPTS = libexec/iptables/access.fw libexec/iptables/clear.fw libexec/iptables/dump.fw libexec/iptables/initialize.fw libexec/iptables/reset.fw libexec/iptables/throttle.fw libexec/loopback/access.fw libexec/loopback/clear.fw libexec/loopback/dump.fw libexec/loopback/initialize.fw htdocs_DATA = htdocs/splash.html htdocs/status.html htdocs/test.html images_DATA = htdocs/images/auth_logo.gif htdocs/images/continue.gif htdocs/images/login.gif htdocs/images/logout.gif htdocs/images/register.gif htdocs/images/reset.gif htdocs/images/skip.gif htdocs/images/update.gif -EXTRA_DIST = $(images_DATA) $(htdocs_DATA) nocat.conf.in +pgp_DATA = pgp/trustedkeys.gpg +EXTRA_DIST = $(images_DATA) $(htdocs_DATA) $(pgp_DATA) nocat.conf.in CLEANFILES = $(sysconf_DATA) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -104,7 +106,7 @@ CONFIG_CLEAN_FILES = SCRIPTS = $(pkglibexec_SCRIPTS) DIST_SOURCES = -DATA = $(htdocs_DATA) $(images_DATA) $(sysconf_DATA) +DATA = $(htdocs_DATA) $(images_DATA) $(pgp_DATA) $(sysconf_DATA) RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ @@ -191,6 +193,24 @@ uninstall-imagesDATA: echo " rm -f $(DESTDIR)$(imagesdir)/$$f"; \ rm -f $(DESTDIR)$(imagesdir)/$$f; \ done +pgpDATA_INSTALL = $(INSTALL_DATA) +install-pgpDATA: $(pgp_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pgpdir) + @list='$(pgp_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(pgpDATA_INSTALL) $$d$$p $(DESTDIR)$(pgpdir)/$$f"; \ + $(pgpDATA_INSTALL) $$d$$p $(DESTDIR)$(pgpdir)/$$f; \ + done + +uninstall-pgpDATA: + @$(NORMAL_UNINSTALL) + @list='$(pgp_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(pgpdir)/$$f"; \ + rm -f $(DESTDIR)$(pgpdir)/$$f; \ + done sysconfDATA_INSTALL = $(INSTALL_DATA) install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) @@ -321,7 +341,7 @@ distcleancheck_listfiles = find . -type distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkinstalldirs) $(distdir)/htdocs $(distdir)/htdocs/images + $(mkinstalldirs) $(distdir)/htdocs $(distdir)/htdocs/images $(distdir)/pgp @list='$(DISTFILES)'; for file in $$list; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ @@ -412,7 +432,7 @@ check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: - $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir) $(DESTDIR)$(htdocsdir) $(DESTDIR)$(imagesdir) $(DESTDIR)$(sysconfdir) + $(mkinstalldirs) $(DESTDIR)$(pkglibexecdir) $(DESTDIR)$(htdocsdir) $(DESTDIR)$(imagesdir) $(DESTDIR)$(pgpdir) $(DESTDIR)$(sysconfdir) install: install-recursive install-exec: install-exec-recursive @@ -455,7 +475,7 @@ info: info-recursive info-am: -install-data-am: install-htdocsDATA install-imagesDATA +install-data-am: install-htdocsDATA install-imagesDATA install-pgpDATA install-exec-am: install-pkglibexecSCRIPTS install-sysconfDATA @@ -475,7 +495,7 @@ mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-htdocsDATA uninstall-imagesDATA \ - uninstall-info-am uninstall-pkglibexecSCRIPTS \ + uninstall-info-am uninstall-pgpDATA uninstall-pkglibexecSCRIPTS \ uninstall-sysconfDATA uninstall-info: uninstall-info-recursive @@ -488,19 +508,21 @@ uninstall-info: uninstall-info-recursive install-data-recursive install-exec install-exec-am \ install-exec-recursive install-htdocsDATA install-imagesDATA \ install-info install-info-am install-info-recursive install-man \ - install-pkglibexecSCRIPTS install-recursive install-strip \ - install-sysconfDATA installcheck installcheck-am installdirs \ - installdirs-am installdirs-recursive maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive mostlyclean \ - mostlyclean-generic mostlyclean-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-htdocsDATA \ - uninstall-imagesDATA uninstall-info-am uninstall-info-recursive \ + install-pgpDATA install-pkglibexecSCRIPTS install-recursive \ + install-strip install-sysconfDATA installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive tags tags-recursive uninstall \ + uninstall-am uninstall-htdocsDATA uninstall-imagesDATA \ + uninstall-info-am uninstall-info-recursive uninstall-pgpDATA \ uninstall-pkglibexecSCRIPTS uninstall-recursive \ uninstall-sysconfDATA nocat.conf: nocat.conf.in sed -e s,@htdocsdir\@,$(htdocsdir),g \ + -e s,@pgpdir\@,$(pgpdir),g \ -e s,@pkglibexecdir\@,$(pkglibexecdir),g < $< > $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nrup NoCatSplash-nightly/configure NoCatSplash-auth/configure --- NoCatSplash-nightly/configure 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/configure 2003-09-16 23:21:03.000000000 -0400 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.53 for nocat 0.00. +# Generated by GNU Autoconf 2.57 for nocat 0.00. # # Report bugs to . # @@ -8,14 +8,6 @@ # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. - -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -24,11 +16,13 @@ fi if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -36,34 +30,42 @@ else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -74,6 +76,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -84,15 +87,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -140,6 +143,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -212,6 +217,12 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. @@ -228,7 +239,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH # Name of the host. @@ -242,6 +253,7 @@ exec 6>&1 # Initializations. # ac_default_prefix=/usr/local +ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= @@ -298,6 +310,8 @@ ac_includes_default="\ # include #endif" +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE RANLIB ac_ct_RANLIB GLIB_CONFIG GLIB_CFLAGS GLIB_LIBS CPP EGREP POW_LIB LIBOBJS SPLASHD_MODE GHTTPD_PROGRAM firewall libexecscripts pkglibexecdir htdocsdir imagesdir pgpdir LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. ac_init_help= @@ -721,6 +735,9 @@ if test ! -r $srcdir/$ac_unique_file; th { (exit 1); exit 1; }; } fi fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias @@ -896,7 +913,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -923,7 +940,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF nocat configure 0.00 -generated by GNU Autoconf 2.53 +generated by GNU Autoconf 2.57 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. @@ -938,7 +955,7 @@ This file contains any messages produced running configure, to aid debugging if configure makes a mistake. It was created by nocat $as_me 0.00, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ @@ -990,27 +1007,54 @@ _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= +ac_configure_args0= +ac_configure_args1= ac_sep= -for ac_arg +ac_must_keep_next=false +for ac_pass in 1 2 do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1021,6 +1065,7 @@ trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo + cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## @@ -1043,6 +1088,35 @@ _ASBOX esac; } echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## @@ -1050,7 +1124,7 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && @@ -1215,6 +1289,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + PACKAGE_NAME=NoCatSplash PACKAGE_TARNAME=NoCatSplash @@ -1222,7 +1297,7 @@ PACKAGE_TARNAME=NoCatSplash # Add the stamp file to the list of files AC keeps track of, # along with our hook. -ac_config_headers="$ac_config_headers src/config.h" + ac_config_headers="$ac_config_headers src/config.h" @@ -1441,15 +1516,15 @@ fi test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -1836,9 +1911,7 @@ if test $ac_prog_rejected = yes; then # 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 "$as_dir/$ac_word" ${1+"$@"} - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi @@ -1943,8 +2016,10 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. @@ -1969,14 +2044,12 @@ ac_compiler=`set X $ac_compile; echo $2` cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -1986,7 +2059,7 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. @@ -2005,26 +2078,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= -for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 -echo "$as_me: error: C compiler cannot create executables" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi @@ -2051,9 +2137,11 @@ if test "$cross_compiling" != yes; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&5 +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'." >&2;} +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi @@ -2061,7 +2149,7 @@ fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. @@ -2081,9 +2169,10 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. -for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -2091,8 +2180,10 @@ for ac_file in `(ls conftest.exe; ls con esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2110,14 +2201,12 @@ if test "${ac_cv_objext+set}" = set; the else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2134,16 +2223,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -2160,14 +2252,12 @@ if test "${ac_cv_c_compiler_gnu+set}" = else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2194,7 +2284,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2214,14 +2305,12 @@ if test "${ac_cv_prog_cc_g+set}" = set; else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2245,7 +2334,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -2267,6 +2357,102 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide @@ -2299,15 +2485,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2331,20 +2515,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c : else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_declaration -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2368,7 +2551,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c break else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext done @@ -2381,7 +2565,8 @@ fi else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c @@ -2400,7 +2585,7 @@ fi rmdir .deps 2>/dev/null -ac_config_commands="$ac_config_commands depfiles" + ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} @@ -2532,15 +2717,15 @@ echo "${ECHO_T}$am_cv_CC_dependencies_co CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` @@ -2647,6 +2832,70 @@ fi # AC_CHECK_LIB([splash], [http_request_new]) +echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 +echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 +if test "${ac_cv_lib_crypt_crypt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char crypt (); +int +main () +{ +crypt (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_crypt_crypt=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypt_crypt=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 +echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 +if test $ac_cv_lib_crypt_crypt = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPT 1 +_ACEOF + + LIBS="-lcrypt $LIBS" + +fi + + # Check whether --with-glib-prefix or --without-glib-prefix was given. if test "${with_glib_prefix+set}" = set; then withval="$with_glib_prefix" @@ -2761,7 +3010,11 @@ echo $ECHO_N "checking for GLIB - versio else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include @@ -2851,11 +3104,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) no_glib=yes fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" @@ -2882,17 +3136,15 @@ echo "${ECHO_T}no" >&6 LIBS="$LIBS $GLIB_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -2929,7 +3181,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l echo "*** rpm --erase --nodeps gtk gtk-devel" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB was incorrectly installed" echo "*** or that you have moved GLIB since it was installed. In the latter case, you" @@ -2975,18 +3228,28 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" -#include +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3003,7 +3266,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -3013,13 +3277,17 @@ rm -f conftest.err conftest.$ac_ext # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3037,7 +3305,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -3066,18 +3335,28 @@ for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" -#include +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3094,7 +3373,8 @@ if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi @@ -3104,13 +3384,17 @@ rm -f conftest.err conftest.$ac_ext # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3128,7 +3412,8 @@ if test -z "$ac_cpp_err"; then continue else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -3141,8 +3426,10 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi @@ -3153,6 +3440,21 @@ ac_link='$CC -o conftest$ac_exeext $CFLA ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then @@ -3160,48 +3462,59 @@ if test "${ac_cv_header_stdc+set}" = set else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include +int +main () +{ + + ; + return 0; +} _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3214,12 +3527,16 @@ 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 <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no @@ -3235,13 +3552,18 @@ if test $ac_cv_header_stdc = yes; then else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else -# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) @@ -3274,11 +3596,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3299,7 +3622,11 @@ if test "${ac_cv_header_sys_wait_h+set}" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #ifndef WEXITSTATUS @@ -3309,12 +3636,6 @@ else # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3340,7 +3661,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_header_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_header_sys_wait_h=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3376,7 +3698,11 @@ if eval "test \"\${$as_ac_Header+set}\" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> @@ -3396,7 +3722,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3438,7 +3765,11 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -3457,7 +3788,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3469,13 +3801,17 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3492,7 +3828,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3505,14 +3842,32 @@ case $ac_header_compiler:$ac_header_prep { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 @@ -3536,103 +3891,6 @@ done # Checks for typedefs, structures, and compiler characteristics. -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -#include "confdefs.h" -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; -esac - echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then @@ -3640,14 +3898,12 @@ if test "${ac_cv_c_const+set}" = set; th else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3717,7 +3973,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3739,14 +3996,12 @@ if test "${ac_cv_type_off_t+set}" = set; else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3773,7 +4028,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_off_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3797,14 +4053,12 @@ if test "${ac_cv_type_pid_t+set}" = set; else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -3831,7 +4085,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_pid_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3869,7 +4124,11 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -3888,7 +4147,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3900,13 +4160,17 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -3923,7 +4187,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -3936,14 +4201,32 @@ case $ac_header_compiler:$ac_header_prep { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 @@ -3977,37 +4260,44 @@ if eval "test \"\${$as_ac_var+set}\" = s else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -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 -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -4027,7 +4317,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4042,7 +4333,6 @@ _ACEOF fi done -ac_cv_func_fork_works=$ac_cv_func_fork if test "x$ac_cv_func_fork" = xyes; then echo "$as_me:$LINENO: checking for working fork" >&5 echo $ECHO_N "checking for working fork... $ECHO_C" >&6 @@ -4081,16 +4371,19 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_fork_works=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 echo "${ECHO_T}$ac_cv_func_fork_works" >&6 +else + ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in @@ -4117,11 +4410,17 @@ else else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ #include +#include #include #include +#include #if HAVE_UNISTD_H # include #endif @@ -4134,7 +4433,7 @@ else (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ -static +static void #ifdef __cplusplus sparc_address_test (int arg) # else @@ -4162,7 +4461,7 @@ main () pid_t parent = getpid (); pid_t child; - sparc_address_test (); + sparc_address_test (0); child = vfork (); @@ -4227,11 +4526,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_vfork_works=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 @@ -4284,7 +4584,11 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF @@ -4303,7 +4607,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4315,13 +4620,17 @@ echo "$as_me:$LINENO: checking $ac_heade echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err + grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 @@ -4338,7 +4647,8 @@ if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext @@ -4351,14 +4661,32 @@ case $ac_header_compiler:$ac_header_prep { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------ ## +## Report this to bug-autoconf@gnu.org. ## +## ------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 @@ -4391,37 +4719,44 @@ if eval "test \"\${$as_ac_var+set}\" = s else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -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 -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -4441,7 +4776,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4466,7 +4802,11 @@ else else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc @@ -4609,11 +4949,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 @@ -4634,7 +4975,11 @@ if test "${ac_cv_type_signal+set}" = set else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #ifdef signal @@ -4646,12 +4991,6 @@ extern "C" void (*signal (int, void (*)( void (*signal ()) (); #endif -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4675,7 +5014,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4698,7 +5038,11 @@ else else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ double strtod (); int @@ -4742,11 +5086,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ( exit $ac_status ) ac_cv_func_strtod=no fi -rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5 @@ -4760,37 +5105,44 @@ if test "${ac_cv_func_pow+set}" = set; t else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char pow (); below. */ -#include + which can conflict with char pow (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pow (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -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_pow) || defined (__stub___pow) choke me #else -f = pow; +char (*f) () = pow; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != pow; ; return 0; } @@ -4810,7 +5162,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_cv_func_pow=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_func_pow=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4828,7 +5181,11 @@ else LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus @@ -4837,12 +5194,6 @@ extern "C" /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pow (); -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif int main () { @@ -4866,7 +5217,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l ac_cv_lib_m_pow=yes else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_m_pow=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4902,37 +5254,44 @@ if eval "test \"\${$as_ac_var+set}\" = s else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" -#include "confdefs.h" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif /* 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 (); -char (*f) (); - -#ifdef F77_DUMMY_MAIN -# ifdef __cplusplus - extern "C" -# endif - int F77_DUMMY_MAIN() { return 1; } -#endif -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 -f = $ac_func; +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif +int +main () +{ +return f != $ac_func; ; return 0; } @@ -4952,7 +5311,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_l eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext @@ -4985,11 +5345,18 @@ fi if test "${with_mode+set}" = set; then withval="$with_mode" case "${withval}" in - open) splashd_mode = "open.c" ;; + open) splashd_mode="open.c" ;; + passive) splashd_mode="passive.c" ;; *) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-mode" >&5 echo "$as_me: error: bad value ${withval} for --with-mode" >&2;} { (exit 1); exit 1; }; } ;; esac + +cat >>confdefs.h <<_ACEOF +#define NC_SPLASHD_MODE "${withval}" +_ACEOF + + else splashd_mode="open.c" @@ -5103,8 +5470,18 @@ cat >>confdefs.h <<_ACEOF _ACEOF +# PGP files? +pgpdir="$pkgdatadir/pgp" + +eval "NC_PGP_PATH=`eval echo ${pgpdir}`" + +cat >>confdefs.h <<_ACEOF +#define NC_PGP_PATH "$NC_PGP_PATH" +_ACEOF + + # Build makefiles -ac_config_files="$ac_config_files Makefile src/Makefile" + ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5116,7 +5493,7 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overriden when +# `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. @@ -5151,7 +5528,7 @@ _ACEOF t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache -if cmp -s $cache_file confcache; then :; else +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file @@ -5182,6 +5559,21 @@ fi DEFS=-DHAVE_CONFIG_H +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -5210,11 +5602,12 @@ cat >$CONFIG_STATUS <<_ACEOF # configure, is in config.log if it exists. debug=false +ac_cs_recheck=false +ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -5223,11 +5616,13 @@ cat >>$CONFIG_STATUS <<\_ACEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi -# NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset @@ -5235,34 +5630,42 @@ else as_unset=false fi -(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } -(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } -(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } -(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } -(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } -(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } -(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } -(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi # Name of the executable. -as_me=`(basename "$0") 2>/dev/null || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ @@ -5273,6 +5676,7 @@ echo X/"$0" | /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` + # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' @@ -5283,15 +5687,15 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi - rm -f conftest.sh + rm -f conf$$.sh fi @@ -5340,6 +5744,8 @@ do as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} @@ -5413,6 +5819,12 @@ else fi rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + as_mkdir_p=false +fi + as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. @@ -5429,7 +5841,7 @@ as_nl=' IFS=" $as_nl" # CDPATH. -$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +$as_unset CDPATH exec 6>&1 @@ -5446,7 +5858,7 @@ _ASBOX cat >&5 <<_CSEOF This file was extended by nocat $as_me 0.00, which was -generated by GNU Autoconf 2.53. Invocation command line was +generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5486,6 +5898,7 @@ Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] @@ -5508,7 +5921,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ nocat config.status 0.00 -configured by $0, generated by GNU Autoconf 2.53, +configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -5529,25 +5942,25 @@ do --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - -*);; *) # This is not an option, so the user has probably given explicit # arguments. + ac_option=$1 ac_need_defaults=false;; esac - case $1 in + case $ac_option in # Handling of the options. _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; -_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) @@ -5562,13 +5975,16 @@ Try \`$0 --help' for more information." --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 @@ -5583,6 +5999,20 @@ Try \`$0 --help' for more information." shift done +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + _ACEOF cat >>$CONFIG_STATUS <<_ACEOF @@ -5621,6 +6051,9 @@ if $ac_need_defaults; then test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { @@ -5629,17 +6062,17 @@ $debug || } # Create a (secure) tmp directory for tmp files. -: ${TMPDIR=/tmp} + { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=$TMPDIR/cs$$-$RANDOM + tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } @@ -5727,6 +6160,7 @@ s,@GLIB_CONFIG@,$GLIB_CONFIG,;t t s,@GLIB_CFLAGS@,$GLIB_CFLAGS,;t t s,@GLIB_LIBS@,$GLIB_LIBS,;t t s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t s,@POW_LIB@,$POW_LIB,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@SPLASHD_MODE@,$SPLASHD_MODE,;t t @@ -5736,6 +6170,8 @@ s,@libexecscripts@,$libexecscripts,;t t s,@pkglibexecdir@,$pkglibexecdir,;t t s,@htdocsdir@,$htdocsdir,;t t s,@imagesdir@,$imagesdir,;t t +s,@pgpdir@,$pgpdir,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF @@ -5806,25 +6242,30 @@ echo X"$ac_file" | /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. @@ -5854,7 +6295,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -6044,7 +6485,7 @@ _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail @@ -6068,7 +6509,7 @@ do mv conftest.tail conftest.defines done rm -f conftest.defines -echo ' fi # egrep' >>$CONFIG_STATUS +echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size @@ -6108,7 +6549,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else @@ -6124,25 +6565,30 @@ echo X"$ac_file" | /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy="$ac_dir" -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file @@ -6207,7 +6653,7 @@ esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` @@ -6276,25 +6722,30 @@ echo X"$file" | /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` - { case $dirpart/$fdir in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; -esac -as_dummy=$dirpart/$fdir -for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create $dirpart/$fdir" >&2;} - { (exit 1); exit 1; }; } - ;; - esac -done; } + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" @@ -6323,8 +6774,11 @@ ac_clean_files=$ac_clean_files_save # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. diff -Nrup NoCatSplash-nightly/configure.ac NoCatSplash-auth/configure.ac --- NoCatSplash-nightly/configure.ac 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/configure.ac 2003-09-16 23:21:03.000000000 -0400 @@ -15,6 +15,7 @@ AC_PROG_RANLIB # Checks for libraries. # FIXME: Replace `main' with a function in `-lsplash': # AC_CHECK_LIB([splash], [http_request_new]) +AC_CHECK_LIB([crypt], [crypt]) AM_PATH_GLIB( 1.2.0, :, AC_MSG_ERROR([You must have glib-1.2 installed.]), [gthread] ) @@ -50,9 +51,13 @@ fi AC_ARG_WITH(mode, [ --with-mode Authentication mode (open) ], [case "${withval}" in - open) splashd_mode = "open.c" ;; + open) splashd_mode="open.c" ;; + passive) splashd_mode="passive.c" ;; *) AC_MSG_ERROR(bad value ${withval} for --with-mode) ;; - esac], + esac + AC_DEFINE_UNQUOTED(NC_SPLASHD_MODE, "${withval}", + [Which mode the gateway runs in.]) + ], splashd_mode="open.c" ) AC_SUBST(SPLASHD_MODE, "$splashd_mode") @@ -96,6 +101,12 @@ eval "NC_CONF_PATH=`eval echo ${sysconfd AC_DEFINE_UNQUOTED(NC_CONF_PATH, "$NC_CONF_PATH", [Where to find our nocat.conf, by default]) +# PGP files? +AC_SUBST(pgpdir, "$pkgdatadir/pgp") +eval "NC_PGP_PATH=`eval echo ${pgpdir}`" +AC_DEFINE_UNQUOTED(NC_PGP_PATH, "$NC_PGP_PATH", + [Where to find our PGP keys?]) + # Build makefiles AC_CONFIG_FILES([Makefile src/Makefile]) diff -Nrup NoCatSplash-nightly/nocat.conf.in NoCatSplash-auth/nocat.conf.in --- NoCatSplash-nightly/nocat.conf.in 2003-01-10 15:50:58.000000000 -0500 +++ NoCatSplash-auth/nocat.conf.in 2003-09-16 23:21:03.000000000 -0400 @@ -75,6 +75,54 @@ SplashForm splash.html # StatusForm status.html +###### Active/Passive Portal settings. +# +## +# TrustedGroups - A list of groups registered with the auth server +# that a user may claim membership in order to gain Member-class +# access through this portal. The default magic value "Any" indicates +# that a member of *any* group is granted member-class access from +# this gateway. +# +# TrustedGroups NoCat NYCWireless PersonalTelco +# +TrustedGroups Any + +## +# Owners - Optional. List all local "owner" class users here, separated +# by spaces. Owners typically get full bandwidth, and unrestricted +# access to all network resources. +# +# Owners rob@nocat.net schuyler@nocat.net + +## +# AuthServiceAddr - Required, for captive mode. Must be set to the address of +# your authentication service. You must use an IP address +# if DNS resolution isn't available at gateway startup. +# +# AuthServiceAddr 208.201.239.21 +# +AuthServiceAddr auth.nocat.net + +## +# AuthServiceURL - HTTPS URL to the login script at the authservice. +# +AuthServiceURL https://auth.nocat.net/cgi-bin/login + +## +# LogoutURL - HTTP URL to redirect user after logout. +# +LogoutURL https://auth.nocat.net/logout.html + +## +# PGPKeyPath -- The directory in which PGP keys are stored. +# NoCat tries to find this in the pgp/ directory above +# the bin/ parent directory. Set this only if you put it +# somewhere that NoCat doesn't expect. +# +# PGPKeyPath @pgpdir@ + + ### Network Topology # # FirewallPath - Where to find the firewall scripts. Files NoCatSplash-nightly/pgp/trustedkeys.gpg and NoCatSplash-auth/pgp/trustedkeys.gpg differ diff -Nrup NoCatSplash-nightly/src/Makefile.am NoCatSplash-auth/src/Makefile.am --- NoCatSplash-nightly/src/Makefile.am 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/src/Makefile.am 2003-09-15 12:55:11.000000000 -0400 @@ -2,12 +2,13 @@ CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -Wall LIBS = @LIBS@ @GLIB_LIBS@ sbin_PROGRAMS = splashd @GHTTPD_PROGRAM@ EXTRA_PROGRAMS = ghttpd -splashd_SOURCES = splashd.c -EXTRA_splashd_SOURCES = open.c -splashd_LDADD = libsplash.a @SPLASHD_MODE@ +splashd_SOURCES = splashd.c +EXTRA_splashd_SOURCES = open.c passive.c +splashd_LDADD = @SPLASHD_MODE@ libsplash.a ghttpd_SOURCES = ghttpd.c ghttpd_LDADD = libsplash.a noinst_LIBRARIES = libsplash.a libsplash_a_SOURCES = \ conf.c defaults.c firewall.c http.c \ - mime.c peer.c tpool.c util.c + mime.c peer.c tpool.c util.c gateway.c \ + sendfile.c base64.c diff -Nrup NoCatSplash-nightly/src/Makefile.in NoCatSplash-auth/src/Makefile.in --- NoCatSplash-nightly/src/Makefile.in 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/src/Makefile.in 2003-09-16 23:21:03.000000000 -0400 @@ -87,20 +87,22 @@ htdocsdir = @htdocsdir@ imagesdir = @imagesdir@ install_sh = @install_sh@ libexecscripts = @libexecscripts@ +pgpdir = @pgpdir@ pkglibexecdir = @pkglibexecdir@ CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -Wall LIBS = @LIBS@ @GLIB_LIBS@ sbin_PROGRAMS = splashd @GHTTPD_PROGRAM@ EXTRA_PROGRAMS = ghttpd -splashd_SOURCES = splashd.c -EXTRA_splashd_SOURCES = open.c -splashd_LDADD = libsplash.a @SPLASHD_MODE@ +splashd_SOURCES = splashd.c +EXTRA_splashd_SOURCES = open.c passive.c +splashd_LDADD = @SPLASHD_MODE@ libsplash.a ghttpd_SOURCES = ghttpd.c ghttpd_LDADD = libsplash.a noinst_LIBRARIES = libsplash.a libsplash_a_SOURCES = \ conf.c defaults.c firewall.c http.c \ - mime.c peer.c tpool.c util.c + mime.c peer.c tpool.c util.c gateway.c \ + sendfile.c base64.c subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -112,7 +114,8 @@ libsplash_a_AR = $(AR) cru libsplash_a_LIBADD = am_libsplash_a_OBJECTS = conf.$(OBJEXT) defaults.$(OBJEXT) \ firewall.$(OBJEXT) http.$(OBJEXT) mime.$(OBJEXT) peer.$(OBJEXT) \ - tpool.$(OBJEXT) util.$(OBJEXT) + tpool.$(OBJEXT) util.$(OBJEXT) gateway.$(OBJEXT) \ + sendfile.$(OBJEXT) base64.$(OBJEXT) libsplash_a_OBJECTS = $(am_libsplash_a_OBJECTS) EXTRA_PROGRAMS = ghttpd$(EXEEXT) sbin_PROGRAMS = splashd$(EXEEXT) @GHTTPD_PROGRAM@ @@ -133,10 +136,12 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/conf.Po ./$(DEPDIR)/defaults.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/firewall.Po ./$(DEPDIR)/ghttpd.Po \ +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/base64.Po ./$(DEPDIR)/conf.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/defaults.Po ./$(DEPDIR)/firewall.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/gateway.Po ./$(DEPDIR)/ghttpd.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/http.Po ./$(DEPDIR)/mime.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/open.Po ./$(DEPDIR)/peer.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/open.Po ./$(DEPDIR)/passive.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/peer.Po ./$(DEPDIR)/sendfile.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/splashd.Po ./$(DEPDIR)/tpool.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/util.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ @@ -221,14 +226,18 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defaults.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/firewall.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gateway.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghttpd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/peer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splashd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tpool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ diff -Nrup NoCatSplash-nightly/src/base64.c NoCatSplash-auth/src/base64.c --- NoCatSplash-nightly/src/base64.c 1969-12-31 19:00:00.000000000 -0500 +++ NoCatSplash-auth/src/base64.c 2003-09-14 02:31:05.000000000 -0400 @@ -0,0 +1,132 @@ +/* base64.c + * + * This code is based on code from base64.c from GnuPG, which is: + * + * Copyright (C) 2001, 2003 Free Software Foundation, Inc. + * + * And from uuencode.c from Busybox, which is (C) Erik Anderson. + * + * Both projects are free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include +#include +#include +#include "util.h" + +/* The base-64 character list */ +static unsigned char bintoasc[64] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; +/* The reverse base-64 list */ +static unsigned char asctobin[256] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3e, 0xff, 0xff, 0xff, 0x3f, + 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, + 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, + 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, + 0x31, 0x32, 0x33, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff +}; + +gchar *base64_decode( const gchar *from ) { + int idx = 0; + unsigned char c, c2, val = '\0'; + int n = 0; + unsigned char *buffer; + + buffer = g_new0(gchar, strlen(from)); + + for (idx = 0, c = *from; c; c = *(++from), idx = (idx + 1) % 4) { + if (c == '\n' || c == ' ' || c == '\r' || c == '\t') + continue; + + if (c == '=') { /* pad character: stop */ + if (idx == 1) + buffer[n++] = val; + break; + } + + if ((c = asctobin[(c2 = c)]) == 255) { + g_warning("invalid radix64 character %02x skipped\n", c2); + continue; + } + switch (idx) { + case 0: + val = c << 2; + break; + case 1: + val |= (c >> 4) & 3; + buffer[n++] = val; + val = (c << 4) & 0xf0; + break; + case 2: + val |= (c >> 2) & 15; + buffer[n++] = val; + val = (c << 6) & 0xc0; + break; + case 3: + val |= c & 0x3f; + buffer[n++] = val; + break; + } + + } + return buffer; +} + +/* + * Encode the string S of length LENGTH to base64 format and place it + * to STORE. STORE will be 0-terminated, and must point to a writable + * buffer of at least 1+BASE64_LENGTH(length) bytes. + * where BASE64_LENGTH(len) = (4 * ((LENGTH + 2) / 3)) + */ +gchar *base64_encode (const gchar *s, const int length) +{ + int i; + unsigned char *buffer = g_new0(gchar, strlen(s)); + unsigned char *p = buffer; + + /* Transform the 3x8 bits to 4x6 bits, as required by base64. */ + for (i = 0; i < length; i += 3) { + *p++ = bintoasc[s[0] >> 2]; + *p++ = bintoasc[((s[0] & 3) << 4) + (s[1] >> 4)]; + *p++ = bintoasc[((s[1] & 0xf) << 2) + (s[2] >> 6)]; + *p++ = bintoasc[s[2] & 0x3f]; + s += 3; + } + /* Pad the result if necessary... */ + if (i == length + 1) { + *(p - 1) = '='; + } + else if (i == length + 2) { + *(p - 1) = *(p - 2) = '='; + } + /* ...and zero-terminate it. */ + *p = '\0'; + return buffer; +} + diff -Nrup NoCatSplash-nightly/src/config.h.in NoCatSplash-auth/src/config.h.in --- NoCatSplash-nightly/src/config.h.in 2003-01-10 21:55:02.000000000 -0500 +++ NoCatSplash-auth/src/config.h.in 2003-09-16 23:21:03.000000000 -0400 @@ -15,6 +15,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `crypt' library (-lcrypt). */ +#undef HAVE_LIBCRYPT + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -96,6 +99,12 @@ /* Where to find firewall scripts? */ #undef NC_FIREWALL_PATH +/* Where to find our PGP keys? */ +#undef NC_PGP_PATH + +/* Which mode the gateway runs in. */ +#undef NC_SPLASHD_MODE + /* Name of package */ #undef PACKAGE diff -Nrup NoCatSplash-nightly/src/defaults.c NoCatSplash-auth/src/defaults.c --- NoCatSplash-nightly/src/defaults.c 2003-01-10 15:50:58.000000000 -0500 +++ NoCatSplash-auth/src/defaults.c 2003-09-15 12:55:11.000000000 -0400 @@ -23,6 +23,7 @@ struct conf_t default_conf[] = { { "GatewayName", "the NoCat Network" }, { "HomePage", "http://nocat.net/" }, { "SplashForm", "splash.html" }, + /*** No. of seconds before logins/renewals expire. ***/ { "LoginTimeout", "300" }, { "MinLoginTimeout", "60" }, @@ -32,6 +33,7 @@ struct conf_t default_conf[] = { /*** Where to look for form templates? ***/ { "DocumentRoot", NC_DOCUMENT_ROOT }, + /*** Default log level. ***/ { "Verbosity", "5" }, { "LogFacility", "internal" }, @@ -41,6 +43,12 @@ struct conf_t default_conf[] = { { "SyslogFacility", "user" }, { "SyslogIdent", "NoCat" }, + /*** PGP stuff. ***/ + { "GpgPath", "/usr/bin/gpg" }, + { "PGPKeyPath", NC_PGP_PATH }, + { "DecryptCmd", "$GpgPath --decrypt --homedir=$PGPKeyPath " + "--keyring trustedkeys.gpg --no-tty -o-" }, + /*** Trailing NULL ***/ { NULL, NULL } }; diff -Nrup NoCatSplash-nightly/src/firewall.c NoCatSplash-auth/src/firewall.c --- NoCatSplash-nightly/src/firewall.c 2003-01-12 02:50:41.000000000 -0500 +++ NoCatSplash-auth/src/firewall.c 2003-09-15 12:55:11.000000000 -0400 @@ -13,7 +13,11 @@ extern char **environ; static void fw_exec_add_env ( gchar *key, gchar *val, GPtrArray *env ) { - gchar *p = g_strdup_printf( "%s=%s", key, val ); + gchar *p; + + g_assert( key != NULL ); + g_assert( val != NULL ); + p = g_strdup_printf( "%s=%s", key, val ); g_ptr_array_add( env, p ); } @@ -44,9 +48,12 @@ static int fw_exec( gchar *action, GHash // Then add everything from the conf file g_hash_table_foreach( data, (GHFunc) fw_exec_add_env, env ); + // Add a closing NULL so execve knows where to lay off. + g_ptr_array_add( env, NULL ); + /* We're not cleaning up memory references because * hopefully the exec won't fail... */ - execve( arg[0], (char **)arg, (char **)env->pdata ); + execve( *arg, arg, (char **)env->pdata ); g_error( "execve %s failed: %m", cmd ); // Shouldn't happen. return -1; } diff -Nrup NoCatSplash-nightly/src/gateway.c NoCatSplash-auth/src/gateway.c --- NoCatSplash-nightly/src/gateway.c 1969-12-31 19:00:00.000000000 -0500 +++ NoCatSplash-auth/src/gateway.c 2003-09-24 17:58:14.000000000 -0400 @@ -0,0 +1,67 @@ +# include +# include +# include +# include "gateway.h" + +GHashTable *peer_tab; +G_LOCK_DEFINE(peer_tab); + +gchar *target_redirect ( http_request *h ) { + gchar *orig, *host = HEADER("Host"); + + if ( host != NULL ) { + orig = g_strdup_printf( "http://%s%s", HEADER("Host"), h->uri ); + } else { + orig = CONF("HomePage"); + } + + return orig; +} + + +gchar *local_host( http_request *h ) { + return g_strdup_printf( "%s:%s", h->sock_ip, CONF("GatewayPort") ); +} + +/************* Permit and deny peers *************/ + +peer *find_peer ( const char *ip ) { + peer *p; + + p = g_hash_table_lookup( peer_tab, ip ); + if (p == NULL) { + p = peer_new( nocat_conf, ip ); + g_hash_table_insert( peer_tab, (gpointer) p->ip, p ); + } + return p; +} + +void accept_peer ( http_request *h ) { + peer *p; + + G_LOCK(peer_tab); + p = find_peer( h->peer_ip ); + + g_message( "Accepting peer %s", p->ip ); + + peer_permit( nocat_conf, p ); + G_UNLOCK(peer_tab); +} + +void remove_peer ( peer *p ) { + g_message( "Removing peer %s", p->ip ); + peer_deny( nocat_conf, p ); +} + +gboolean check_peer_expire ( gchar *ip, peer *p, time_t *now ) { + g_message( "Checking peer %s for expire: %lu sec. remain", + ip, p->expire - *now ); + if (p->expire <= *now) { + remove_peer( p ); + return TRUE; + } else { + return FALSE; + } +} + + diff -Nrup NoCatSplash-nightly/src/gateway.h NoCatSplash-auth/src/gateway.h --- NoCatSplash-nightly/src/gateway.h 1969-12-31 19:00:00.000000000 -0500 +++ NoCatSplash-auth/src/gateway.h 2003-09-24 17:58:14.000000000 -0400 @@ -0,0 +1,15 @@ +# include "http.h" +# include "conf.h" +# include "util.h" +# include "peer.h" + +gchar *target_redirect ( http_request *h ); +gchar *local_host( http_request *h ); +peer *find_peer ( const gchar *ip ); +void accept_peer ( http_request *h ); +void remove_peer ( peer *p ); +gboolean check_peer_expire ( gchar *ip, peer *p, time_t *now ); + +/*** handle_request is actually defined in either open.c or passive.c ***/ +void handle_request( http_request *h ); + diff -Nrup NoCatSplash-nightly/src/http.c NoCatSplash-auth/src/http.c --- NoCatSplash-nightly/src/http.c 2003-01-16 14:52:17.000000000 -0500 +++ NoCatSplash-auth/src/http.c 2003-09-24 17:58:14.000000000 -0400 @@ -17,9 +17,6 @@ # define BUF_SIZ 16384 # endif -// not portable, apparently -# include - GIOChannel *http_bind_socket( const char *ip, int port, int queue ) { struct sockaddr_in addr; int fd, r, n = 1; @@ -159,7 +156,7 @@ GHashTable *http_parse_header (http_requ /* Strip ": " plus leading and trailing space from val */ g_strchomp( val += 2 ); // ": " - g_message("Header in: %s=%s", key, val ); + g_debug("Header in: %s=%s", key, val ); g_hash_set( head, key, val ); } } @@ -231,7 +228,7 @@ gboolean http_request_ok (http_request * http_parse_query( h, NULL ); if (h->query) { z = g_hash_as_string( h->query ); - g_message( "Query: %s", z->str ); + g_debug( "Query: %s", z->str ); g_string_free(z, 1); } h->complete++; @@ -250,62 +247,7 @@ gboolean http_request_ok (http_request * return FALSE; } -gchar *http_fix_path (const gchar *uri, const gchar *docroot) { - GString *path = g_string_new(docroot); - gchar *dotdot; - - // Remove leading slashes. - while (*uri != '\0' && *uri == '/') uri++; - - // Instantiate the string. - g_string_sprintfa(path, "/%s", uri); - - // Find ..'s and remove them. - while ((dotdot = strstr(path->str, "..")) != NULL) - g_string_erase(path, dotdot - path->str, 2 ); - - uri = path->str; - g_string_free(path, 0); // don't free the char data, we're returning it - return (gchar *)uri; -} - -gchar *http_mime_type (const gchar *path) { - guint i; - gchar *ext; - - ext = strrchr( path, '.' ); - if ( ext++ != NULL ) - for (i = 0; mime_types[i].ext != NULL; i++) { - // g_warning( "http_mime_type: %s vs %s", ext, mime_types[i].ext ); - if (strcmp(ext, mime_types[i].ext) == 0) - return mime_types[i].type; - } - - return "text/plain"; -} - -int http_open_file (const gchar *path, int *status) { - int fd; - - fd = open( path, O_RDONLY ); - if (fd == -1) { - if (errno == ENOENT) { - g_warning("File not found: %s", path); - *status = 404; - } else if (errno == EACCES) { - g_warning("Access not permitted: %s", path); - *status = 400; - } else { - g_warning("Error accessing %s: %m", path); - *status = 500; - } - return -1; - } - *status = 200; - return fd; -} - -void http_add_header ( http_request *h, gchar *key, gchar *val ) { +void http_add_header ( http_request *h, const gchar *key, gchar *val ) { if ( h->response == NULL ) h->response = g_hash_new(); g_hash_set( h->response, key, val ); @@ -333,50 +275,13 @@ GIOError http_send_header ( http_request g_string_sprintfa( hdr, "HTTP/1.1 %d %s\r\n", status, msg ); g_hash_table_foreach( h->response, (GHFunc) http_compose_header, hdr ); g_string_append( hdr, "\r\n" ); - g_message("Header out: %s", hdr->str); + g_debug("Header out: %s", hdr->str); r = g_io_channel_write( h->sock, hdr->str, hdr->len, &n ); g_string_free( hdr, 1 ); return r; } -ssize_t http_sendfile ( http_request *h, int in_fd ) { - int out_fd = g_io_channel_unix_get_fd( h->sock ); - struct stat s; - ssize_t r; - off_t len = 0; - - g_assert( in_fd > 0 ); - g_assert( out_fd > 0 ); - - r = fstat( in_fd, &s ); - if (r == -1) { - g_warning("http_sendfile stat: %m"); - return -1; - } - - r = sendfile( out_fd, in_fd, &len, s.st_size ); - if (r == -1) { - g_warning("http_sendfile send: %m"); - return -1; - } - - return r; -} - -int http_serve_file ( http_request *h, const gchar *docroot ) { - gchar *path; - guint fd, status; - - path = http_fix_path( h->uri, docroot ); - fd = http_open_file( path, &status ); - - http_add_header( h, "Content-Type", http_mime_type( path ) ); - http_send_header( h, status, fd == -1 ? "Not OK" : "OK" ); - - if ( fd != -1 ) - http_sendfile( h, fd ); - - close(fd); - g_free(path); - return ( fd != -1 ); +void http_send_redirect( http_request *h, gchar *dest ) { + http_add_header ( h, "Location", dest ); + http_send_header( h, 302, "Moved" ); } diff -Nrup NoCatSplash-nightly/src/http.h NoCatSplash-auth/src/http.h --- NoCatSplash-nightly/src/http.h 2003-01-15 13:58:45.000000000 -0500 +++ NoCatSplash-auth/src/http.h 2003-09-14 02:31:05.000000000 -0400 @@ -26,11 +26,14 @@ GHashTable *http_parse_header (http_requ GHashTable *http_parse_query (http_request *h, gchar *post); guint http_request_read (http_request *h); gboolean http_request_ok (http_request *h); +void http_add_header ( http_request *h, const gchar *key, gchar *val ); +void http_printf_header ( http_request *h, gchar *key, gchar *fmt, ... ); +GIOError http_send_header ( http_request *h, int status, const gchar *msg ); +void http_send_redirect( http_request *h, gchar *dest ); + +/* actually in sendfile.c */ gchar *http_fix_path (const gchar *uri, const gchar *docroot); gchar *http_mime_type (const gchar *path); int http_open_file (const gchar *path, int *status); -void http_add_header ( http_request *h, gchar *key, gchar *val ); -void http_printf_header ( http_request *h, gchar *key, gchar *fmt, ... ); -GIOError http_send_header ( http_request *h, int status, const gchar *msg ); ssize_t http_sendfile ( http_request *h, int in_fd ); int http_serve_file ( http_request *h, const gchar *docroot ); diff -Nrup NoCatSplash-nightly/src/open.c NoCatSplash-auth/src/open.c --- NoCatSplash-nightly/src/open.c 2003-02-27 20:53:50.000000000 -0500 +++ NoCatSplash-auth/src/open.c 2003-09-24 17:58:14.000000000 -0400 @@ -1,30 +1,20 @@ # include # include # include -# include "http.h" -# include "conf.h" -# include "util.h" +# include "gateway.h" + -void accept_peer ( http_request *h ); /************* Capture and splash *************/ void capture_peer ( http_request *h ) { - gchar *host = HEADER("Host"); - gchar *orig, *redir, *dest; - - if ( host != NULL ) { - orig = g_strdup_printf( "http://%s%s", HEADER("Host"), h->uri ); - } else { - orig = CONF("HomePage"); - } - - redir = url_encode( orig ); + gchar *dest, *orig = target_redirect(h); + gchar *redir = url_encode(orig); + dest = g_strdup_printf( "http://%s:%s/?redirect=%s", h->sock_ip, CONF("GatewayPort"), redir ); - http_add_header ( h, "Location", dest ); - http_send_header( h, 302, "Moved" ); + http_send_redirect( h, dest ); g_free( orig ); g_free( redir ); @@ -37,7 +27,7 @@ void splash_peer ( http_request *h ) { ssize_t n; GIOError r; - action = g_strdup_printf( "http://%s:%s/", h->sock_ip, CONF("GatewayPort") ); + action = local_host( h ); data = g_hash_dup( nocat_conf ); g_hash_merge( data, h->query ); g_hash_set( data, "action", action ); @@ -63,8 +53,7 @@ void splash_peer ( http_request *h ) { void handle_request( http_request *h ) { gchar *hostname = HEADER("Host"); - gchar *sockname = g_strdup_printf( "%s:%s", - h->sock_ip, CONF("GatewayPort") ); + gchar *sockname = local_host(h); g_assert( sockname != NULL ); // g_message( "got sockname: '%s'", sockname ); @@ -77,6 +66,7 @@ void handle_request( http_request *h ) { } else if (strcmp( h->uri, "/" ) == 0) { if ( QUERY("mode_login") != NULL || QUERY("mode_login.x") != NULL ) { accept_peer(h); + http_send_redirect( h, QUERY("redirect") ); } else if ( QUERY("redirect") != NULL ) { splash_peer(h); } else { diff -Nrup NoCatSplash-nightly/src/passive.c NoCatSplash-auth/src/passive.c --- NoCatSplash-nightly/src/passive.c 1969-12-31 19:00:00.000000000 -0500 +++ NoCatSplash-auth/src/passive.c 2003-09-24 17:58:14.000000000 -0400 @@ -0,0 +1,181 @@ +# include +# include +# include +# include +# include +# include "gateway.h" + +# ifndef BUF_SIZ +# define BUF_SIZ 4096 +# endif + +void capture_peer ( http_request *h, peer *p ) { + gchar *redir = target_redirect( h ); + gchar *gw_addr = local_host( h ); + GHashTable *args = g_hash_new(); + GString *dest; + + g_hash_set( args, "redirect", redir ); + g_hash_set( args, "token", get_peer_token(p) ); + g_hash_set( args, "mac", p->hw ); + g_hash_set( args, "timeout", CONF("LoginTimeout") ); + g_hash_set( args, "gateway", gw_addr ); + + dest = build_url( CONF("AuthServiceURL"), args ); + http_send_redirect( h, dest->str ); + + g_string_free( dest, 1 ); + g_hash_free( args ); + g_free( gw_addr ); + g_free( redir ); +} + +void logout_peer( http_request *h, peer *p ) { + remove_peer( p ); + http_send_redirect( h, CONF("LogoutURL") ); +} + +GHashTable *gpg_decrypt( char *ticket ) { + int rfd[2], wfd[2], r; + gchar *gpg, *msg; + gchar **arg; + GHashTable *data; + pid_t pid; + + gpg = parse_template( CONF("DecryptCmd"), nocat_conf ); + arg = g_strsplit( gpg, " ", 0 ); + + r = pipe(rfd); + if (r) { + g_error("Can't open read pipe to gpg: %m"); + return 0; + } + + r = pipe(wfd); + if (r) { + g_error("Can't open write pipe to gpg: %m"); + return NULL; + } + + pid = fork(); + if (pid == -1) { + g_error( "Can't fork to exec gpg: %m" ); + return NULL; + + } else if (pid == 0) { + dup2( wfd[0], STDIN_FILENO ); + close( wfd[1] ); + + dup2( rfd[1], STDOUT_FILENO ); + close( rfd[0] ); + + r = execv( *arg, arg ); + g_error( "execv %s (%s) failed: %m", gpg, *arg ); // Shouldn't happen. + exit(-1); + } + + close( wfd[0] ); + close( rfd[1] ); + + msg = g_new0(char, BUF_SIZ); + g_snprintf( msg, BUF_SIZ, + "-----BEGIN PGP MESSAGE-----\n\n" + "%s\n" + "-----END PGP MESSAGE-----", + ticket ); + r = write( wfd[1], msg, strlen(msg) ); + if (r == -1) + g_error( "Can't write to gpg pipe: %m" ); + close( wfd[1] ); + + r = read( rfd[0], msg, BUF_SIZ ); + g_assert( r > 0 ); + close( rfd[0] ); + msg[r] = '\0'; + + waitpid( pid, &r, 0 ); + if (! WIFEXITED( r )) + g_warning( "gpg returned error: %d (signal %d)", + WEXITSTATUS(r), WIFSIGNALED(r) ? WTERMSIG(r) : 0 ); + + data = parse_conf_string( msg ); + + g_strfreev( arg ); + g_free( gpg ); + g_free( msg ); + + return data; +} + +int verify_peer( http_request *h, peer *p ) { + GHashTable *msg; + gchar *action, *mode, *dest; + gchar *ticket = QUERY("ticket"); + GString *m; + + if (ticket == NULL) { + g_warning("Invalid ticket from peer %s", p->ip); + return 0; + } + + msg = gpg_decrypt( QUERY("ticket") ); + m = g_hash_as_string(msg); + g_message( "auth message: %s", m->str); + + // Check username if set + // Check MAC + // Check token + + // Set user + // Set groups + // Set token + + action = g_hash_table_lookup(msg, "Action"); + if (strcmp( action, "Permit" ) == 0) { + accept_peer( h ); + } else if (strcmp( action, "Deny" ) == 0) { + remove_peer( p ); + } else { + g_warning("Can't make sense of action %s!", action); + } + + + mode = g_hash_table_lookup(msg, "Mode"); + dest = g_hash_table_lookup(msg, "Redirect"); + if (strncmp(mode, "renew", 5) == 0) { + http_send_header( h, 304, "No Response" ); + } else { + http_send_redirect( h, dest ); + } + + g_hash_free( msg ); + return 1; +} + +void handle_request( http_request *h ) { + gchar *hostname = HEADER("Host"); + gchar *sockname = local_host(h); + peer *p = find_peer( h->peer_ip ); + int r; + + g_assert( sockname != NULL ); + g_assert( hostname != NULL ); + + if (hostname == NULL || strcmp( hostname, sockname ) != 0) { + capture_peer(h, p); + } else if (strcmp( h->uri, "/logout" ) == 0) { + // logout + logout_peer(h, p); + // } else if (strcmp( h->uri, "/status" ) == 0) { + // status + // display_status(h, p); + } else { + // user with a ticket + r = verify_peer(h, p); + if (!r) + capture_peer(h, p); + } + + g_free( sockname ); +} + diff -Nrup NoCatSplash-nightly/src/peer.c NoCatSplash-auth/src/peer.c --- NoCatSplash-nightly/src/peer.c 2003-01-11 00:19:58.000000000 -0500 +++ NoCatSplash-auth/src/peer.c 2003-09-24 17:58:14.000000000 -0400 @@ -1,11 +1,17 @@ # include # include # include +# include # include "peer.h" +# include "util.h" # include "firewall.h" # include "conf.h" -peer *peer_new ( const gchar *ip ) { +void peer_extend_timeout( GHashTable *conf, peer *p ) { + p->expire = time(NULL) + conf_int( conf, "LoginTimeout" ); +} + +peer *peer_new ( GHashTable *conf, const gchar *ip ) { peer *p = g_new0( peer, 1 ); g_assert( p != NULL ); g_assert( ip != NULL ); @@ -15,6 +21,8 @@ peer *peer_new ( const gchar *ip ) { peer_arp( p ); // Set connection time. p->connected = time( NULL ); + p->token[0] = '\0'; + peer_extend_timeout(conf, p); return p; } @@ -34,7 +42,7 @@ int peer_permit ( GHashTable *conf, peer return -1; } } - p->expire = time(NULL) + conf_int( conf, "LoginTimeout" ); + peer_extend_timeout(conf, p); return 0; } @@ -50,3 +58,27 @@ int peer_deny ( GHashTable *conf, peer * return 0; } +gchar *get_peer_token ( peer *p ) { + char *n; + int carry = 1; + int len = sizeof(p->token) - 1; + + g_assert( p != NULL ); + if (! *(p->token)) + strrand(p->token, len); + + for (n = p->token + len - 1; carry && n >= p->token; n--) + switch (*n) { + case '9': *n = '0'; carry = 1; break; + case 'Z': *n = 'A'; carry = 1; break; + case 'z': *n = 'a'; carry = 1; break; + default : (*n)++; carry = 0; + } + + n = md5_crypt( p->token, p->token + len - 8 ); + strncpy( p->token, n, len ); + p->token[len - 1] = '\0'; + + g_free(n); + return p->token; +} diff -Nrup NoCatSplash-nightly/src/peer.h NoCatSplash-auth/src/peer.h --- NoCatSplash-nightly/src/peer.h 2003-01-11 00:19:58.000000000 -0500 +++ NoCatSplash-auth/src/peer.h 2003-09-24 17:58:14.000000000 -0400 @@ -4,6 +4,7 @@ typedef struct peer_st { char ip[16]; /* 111.222.333.444 */ char hw[18]; /* 11:22:33:44:55:66 */ + char token[35]; char *request; time_t connected; time_t expire; @@ -11,7 +12,8 @@ typedef struct peer_st { } peer; /*** Function prototypes start here ***/ -peer *peer_new ( const gchar *ip ); +peer *peer_new ( GHashTable *conf, const gchar *ip ); void peer_free ( peer *p ); int peer_permit ( GHashTable *conf, peer *p ); int peer_deny ( GHashTable *conf, peer *p ); +gchar *get_peer_token ( peer *p ); diff -Nrup NoCatSplash-nightly/src/sendfile.c NoCatSplash-auth/src/sendfile.c --- NoCatSplash-nightly/src/sendfile.c 1969-12-31 19:00:00.000000000 -0500 +++ NoCatSplash-auth/src/sendfile.c 2003-09-15 12:55:11.000000000 -0400 @@ -0,0 +1,109 @@ +# include +# include +# include +# include +# include +# include +# include +# include "http.h" +# include "mime.h" + +// not portable, apparently +# include + +gchar *http_fix_path (const gchar *uri, const gchar *docroot) { + GString *path = g_string_new(docroot); + gchar *dotdot; + + // Remove leading slashes. + while (*uri != '\0' && *uri == '/') uri++; + + // Instantiate the string. + g_string_sprintfa(path, "/%s", uri); + + // Find ..'s and remove them. + while ((dotdot = strstr(path->str, "..")) != NULL) + g_string_erase(path, dotdot - path->str, 2 ); + + uri = path->str; + g_string_free(path, 0); // don't free the char data, we're returning it + return (gchar *)uri; +} + +gchar *http_mime_type (const gchar *path) { + guint i; + gchar *ext; + + ext = strrchr( path, '.' ); + if ( ext++ != NULL ) + for (i = 0; mime_types[i].ext != NULL; i++) { + // g_warning( "http_mime_type: %s vs %s", ext, mime_types[i].ext ); + if (strcmp(ext, mime_types[i].ext) == 0) + return mime_types[i].type; + } + + return "text/plain"; +} + +int http_open_file (const gchar *path, int *status) { + int fd; + + fd = open( path, O_RDONLY ); + if (fd == -1) { + if (errno == ENOENT) { + g_warning("File not found: %s", path); + *status = 404; + } else if (errno == EACCES) { + g_warning("Access not permitted: %s", path); + *status = 400; + } else { + g_warning("Error accessing %s: %m", path); + *status = 500; + } + return -1; + } + *status = 200; + return fd; +} + +ssize_t http_sendfile ( http_request *h, int in_fd ) { + int out_fd = g_io_channel_unix_get_fd( h->sock ); + struct stat s; + ssize_t r; + off_t len = 0; + + g_assert( in_fd > 0 ); + g_assert( out_fd > 0 ); + + r = fstat( in_fd, &s ); + if (r == -1) { + g_warning("http_sendfile stat: %m"); + return -1; + } + + r = sendfile( out_fd, in_fd, &len, s.st_size ); + if (r == -1) { + g_warning("http_sendfile send: %m"); + return -1; + } + + return r; +} + +int http_serve_file ( http_request *h, const gchar *docroot ) { + gchar *path; + guint fd, status; + + path = http_fix_path( h->uri, docroot ); + fd = http_open_file( path, &status ); + + http_add_header( h, "Content-Type", http_mime_type( path ) ); + http_send