From bc5e5d4ed7440baeac26adbbeedc5719d9b18dac Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 6 Jul 2000 10:38:47 +0000 Subject: [PATCH] Enhanced option --enable-tcpd. --- configure | 46 ++++++++++++++++++++++++++-------------------- configure.in | 19 +++++++++++++------ server/seshigh.c | 10 +++++++++- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/configure b/configure index 6f4628e..fcfc333 100755 --- a/configure +++ b/configure @@ -24,7 +24,7 @@ ac_help="$ac_help ac_help="$ac_help --disable-comp use old encoders, i.e. disable the YAZ ASN.1 Compiler" ac_help="$ac_help - --enable-tcpd enable TCP wrapper for server if available" + --enable-tcpd[=PREFIX] enable TCP wrapper for server if available" ac_help="$ac_help --disable-threads disable threads" @@ -2096,16 +2096,21 @@ if test "${enable_tcpd+set}" = set; then : fi -if test "$enable_tcpd" = "yes"; then - echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 -echo "configure:2102: checking for working tcpd.h" >&5 +if test "$enable_tcpd" != "no"; then oldLibs=$LIBS + oldCPPFLAGS=$CPPFLAGS + if test "$enable_tcpd" != "yes"; then + LIBS="$LIBS -L$enable_tcpd/lib" + CPPFLAGS="$CPPFLAGS -I$enable_tcpd/include" + fi + echo $ac_n "checking for working tcpd.h""... $ac_c" 1>&6 +echo "configure:2108: checking for working tcpd.h" >&5 LIBS="$LIBS -lwrap -lnsl" cat > conftest.$ac_ext < - #include +#include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; int main() { @@ -2113,7 +2118,7 @@ struct request_info request_info; int i; i = hosts_access(&request_info); ; return 0; } EOF -if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* tcpd_ok=1 else @@ -2126,6 +2131,7 @@ rm -f conftest* if test "$tcpd_ok" = "0"; then echo "$ac_t""no" 1>&6 LIBS=$oldLibs + CPPFLAGS=$oldCPPFLAGS else echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -2135,12 +2141,12 @@ EOF fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2139: checking for ANSI C header files" >&5 +echo "configure:2145: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2148,7 +2154,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2165,7 +2171,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2183,7 +2189,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2204,7 +2210,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2215,7 +2221,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2251,7 +2257,7 @@ fi if test "$enable_threads" = "yes"; then echo $ac_n "checking for main in -lpthread""... $ac_c" 1>&6 -echo "configure:2255: checking for main in -lpthread" >&5 +echo "configure:2261: checking for main in -lpthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2259,14 +2265,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2294,9 +2300,9 @@ else fi echo $ac_n "checking for working POSIX Threads""... $ac_c" 1>&6 -echo "configure:2298: checking for working POSIX Threads" >&5 +echo "configure:2304: checking for working POSIX Threads" >&5 cat > conftest.$ac_ext < int func(void *p) { return 0; } @@ -2307,7 +2313,7 @@ int main() { int r = pthread_create (&pthread_id, 0, func, 0); ; return 0; } EOF -if { (eval echo configure:2311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* thread_ok=yes else diff --git a/configure.in b/configure.in index 353b500..187db9f 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl YAZ Toolkit, Index Data 1994-2000 dnl See the file LICENSE for details. -dnl $Id: configure.in,v 1.29 2000-06-19 09:49:35 adam Exp $ +dnl $Id: configure.in,v 1.30 2000-07-06 10:38:47 adam Exp $ AC_INIT(include/yaz/yaz-version.h) AM_INIT_AUTOMAKE(yaz, 1.7) dnl @@ -66,20 +66,27 @@ dnl ------ snprintf AC_CHECK_FUNCS(vsnprintf gettimeofday) dnl dnl ------ tcpd -AC_ARG_ENABLE(tcpd,[ --enable-tcpd enable TCP wrapper for server if available]) -if test "$enable_tcpd" = "yes"; then - AC_MSG_CHECKING(for working tcpd.h) +AC_ARG_ENABLE(tcpd,[ --enable-tcpd[=PREFIX] enable TCP wrapper for server if available]) +if test "$enable_tcpd" != "no"; then oldLibs=$LIBS + oldCPPFLAGS=$CPPFLAGS + if test "$enable_tcpd" != "yes"; then + LIBS="$LIBS -L$enable_tcpd/lib" + CPPFLAGS="$CPPFLAGS -I$enable_tcpd/include" + fi + AC_MSG_CHECKING(for working tcpd.h) LIBS="$LIBS -lwrap -lnsl" AC_TRY_LINK([#include - #include +#include int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING;], [struct request_info request_info; int i; - i = hosts_access(&request_info);],tcpd_ok=1, tcpd_ok=0) + i = hosts_access(&request_info);], + tcpd_ok=1, tcpd_ok=0) if test "$tcpd_ok" = "0"; then AC_MSG_RESULT(no) LIBS=$oldLibs + CPPFLAGS=$oldCPPFLAGS else AC_MSG_RESULT(yes) AC_DEFINE(HAVE_TCPD_H) diff --git a/server/seshigh.c b/server/seshigh.c index 1beb970..8923b41 100644 --- a/server/seshigh.c +++ b/server/seshigh.c @@ -3,7 +3,10 @@ * See the file LICENSE for details. * * $Log: seshigh.c,v $ - * Revision 1.104 2000-04-05 07:39:55 adam + * Revision 1.105 2000-07-06 10:38:47 adam + * Enhanced option --enable-tcpd. + * + * Revision 1.104 2000/04/05 07:39:55 adam * Added shared library support (libtool). * * Revision 1.103 2000/03/20 19:06:25 adam @@ -668,6 +671,11 @@ static int process_request(association *assoc, request *req, char **msg) *msg = "Unknown Error"; assert(req && req->state == REQUEST_IDLE); + if (req->request->which != Z_APDU_initRequest && !assoc->init) + { + *msg = "Missing InitRequest"; + return -1; + } switch (req->request->which) { case Z_APDU_initRequest: -- 1.7.10.4