From paul@lugnut.aps.org Wed Mar 10 20:55:43 2004 Return-Path: Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B62C216A4CE for ; Wed, 10 Mar 2004 20:55:43 -0800 (PST) Received: from ridge.aps.org (ridge.aps.org [149.28.1.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FBFF43D2F for ; Wed, 10 Mar 2004 20:55:37 -0800 (PST) (envelope-from paul@lugnut.aps.org) Received: from lugnut.aps.org (lugnut.aps.org [149.28.3.182]) by ridge.aps.org (8.9.3+Sun/8.9.3) with ESMTP id XAA11947; Wed, 10 Mar 2004 23:55:35 -0500 (EST) Received: from lugnut.aps.org (localhost [127.0.0.1]) by lugnut.aps.org (8.12.11/8.12.11) with ESMTP id i2B4tZmg082985; Wed, 10 Mar 2004 23:55:35 -0500 (EST) (envelope-from paul@lugnut.aps.org) Received: (from paul@localhost) by lugnut.aps.org (8.12.10/8.12.11/Submit) id i2B4tZqh082952; Wed, 10 Mar 2004 23:55:35 -0500 (EST) (envelope-from paul) Message-Id: <200403110455.i2B4tZqh082952@lugnut.aps.org> Date: Wed, 10 Mar 2004 23:55:35 -0500 (EST) From: Paul Dlug To: FreeBSD-gnats-submit@freebsd.org Cc: paul@nerdlabs.com Subject: [PATCH] net-mgmt/nsca: update to 2.4 X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 64083 >Category: ports >Synopsis: [PATCH] net-mgmt/nsca: update to 2.4 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Mar 10 21:00:29 PST 2004 >Closed-Date: Sun Mar 14 18:44:50 PST 2004 >Last-Modified: Sun Mar 14 18:44:50 PST 2004 >Originator: Paul Dlug >Release: FreeBSD 5.2.1-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD lugnut.aps.org 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #7: Wed Mar 3 14:23:54 EST >Description: - Fixed dependency detection Generated with FreeBSD Port Tools 0.50 >How-To-Repeat: >Fix: --- nsca-2.4.patch begins here --- diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/Makefile /usr/home/paul/myports/net-mgmt/nsca/Makefile --- /usr/ports/net-mgmt/nsca/Makefile Mon Feb 23 09:31:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/Makefile Wed Mar 10 23:54:40 2004 @@ -14,8 +14,7 @@ MAINTAINER= paul@nerdlabs.com COMMENT= Nagios Service Check Acceptor -BUILD_DEPENDS= ${NAGIOS_DIR}:${PORTSDIR}/net-mgmt/nagios -RUN_DEPENDS= ${NAGIOS_DIR}:${PORTSDIR}/net-mgmt/nagios +RUN_DEPENDS= ${LOCALBASE}/bin/nagios:${PORTSDIR}/net-mgmt/nagios LIB_DEPENDS= mcrypt.8:${PORTSDIR}/security/libmcrypt GNU_CONFIGURE= yes diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/.PLIST.mktmp /usr/home/paul/myports/net-mgmt/nsca/work/.PLIST.mktmp --- /usr/ports/net-mgmt/nsca/work/.PLIST.mktmp Wed Mar 10 23:40:53 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/.PLIST.mktmp Wed Dec 31 19:00:00 1969 @@ -1,13 +0,0 @@ -@comment $FreeBSD: ports/net-mgmt/nsca/pkg-plist,v 1.1 2003/12/13 22:47:09 sergei Exp $ -share/doc/nsca/Changelog -share/doc/nsca/LEGAL -share/doc/nsca/README -share/doc/nsca/SECURITY -@dirrm share/doc/nsca -@comment This port installs into LOCALBASE as opposed to PREFIX -@cwd /usr/local -etc/nagios/nsca.cfg.sample -etc/nagios/send_nsca.cfg.sample -libexec/nagios/nsca -libexec/nagios/send_nsca -@unexec if [ -f %D/info/dir ]; then if sed -e '1,/Menu:/d' %D/info/dir | grep -q '^[*] '; then true; else rm %D/info/dir; fi; fi diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/Changelog /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Changelog --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/Changelog Wed Jul 23 20:08:35 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Changelog Wed Dec 31 19:00:00 1969 @@ -1,94 +0,0 @@ -************** -NSCA Changelog -************** - - -2.4 - 07/23/2003 ----------------- -- Better support for u_int32_t detection -- Minor bug fixes - - -2.3 - 01/26/2003 ----------------- -- Minor changes to daemon init code -- Minor Makefile fixes - - -2.2 - 01/08/2002 ----------------- -- Hopefully better support for Solaris (u_int32_t) -- Syntax changes for command line arguments -- Added support for passive host checks (supported - only in Nagios 2.x and later) -- Added sample xinetd config file (nsca.xinetd) -- Minor mods and bug fixes - - -2.1 - 06/10/2002 ----------------- -- Fix for compiling under Solaris (Scott Cokely) -- Added setuid/setgid option to config file - - -2.0 - 02/21/2002 ----------------- -- Name and version change - - -1.2.0 - 02/12/2002 ------------------- -- Compatability between older versions has been broken! -- Server now sends client IV and timestamp, fixing - encryption problems and making it more resistent - to "replay" attacks (Ralf Ertzinger) -- Random IV is now seeded from /dev/urandom instead - of time() if possible -- Added directions on running under xinetd to README -- Implemented Beej's sendall() to handle incomplete send()s -- Added single-mode daemon code (David Luyer) -- Fixed problem with aggregated writes (David Luyer) -- Better autoconf detection of libmcrypt (Jay McCarthy) -- Added ability to dump check results to alternate - dump file if command file does not exist (i.e. NetSaint - is not running) -- Removed some old crud - - -1.1.2 - 09/22/2001 ------------------- -- Added append_to_file option to allow for opening the - command file in either write or append mode -- Explicit integer size in packet structure -- NULL IV is used for both encryption/decryption. This - leaves the daemon open to "replay" attacks, but will - disappear in future revisions when IV negotiation - between the client and daemon is implemented. - - -1.1.1 - 04/26/2001 ------------------- -- Configure script bug fix - - -1.1.0 - 02/24/2001 ------------------- -- Added encryption routines (using libmcrypt) -- Minor code enhancements/cleanups - - -1.0b3 - 12/21/2000 ------------------- -- Removed lock file code, as 0.0.7 uses a named pipe -- Documented aggregated_writes option - - -1.0b2 - 08/26/2000 ------------------- -- Added option to use write lock when updating external - command file - - -1.0b1 - 04/17/2000 ------------------- -- Initial cut diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/LEGAL /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/LEGAL --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/LEGAL Tue Jul 9 00:42:44 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/LEGAL Wed Dec 31 19:00:00 1969 @@ -1,10 +0,0 @@ - -All source code, binaries, documentation, and information contained -in this distribution are provided AS IS with NO WARRANTY OF ANY KIND, -INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR -A PARTICULAR PURPOSE. - -Nagios and the Nagios logo are registered trademarks of Ethan Galstad. -All other trademarks, servicemarks, registered trademarks, and -registered servicemarks are the property of their respective owner(s). - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/Makefile /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Makefile --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/Makefile Wed Mar 10 23:40:48 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Makefile Wed Dec 31 19:00:00 1969 @@ -1,49 +0,0 @@ -# Generated automatically from Makefile.in by configure. -############################### -# Makefile for NSCA -# -# Last Modified: 01-16-2003 -############################### - - -# Source code directories -SRC_BASE=./src/ -SRC_COMMON=./common/ - -all: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - - @echo "" - @echo "*** Compile finished ***" - @echo "" - @echo "If the compile finished without any errors, you should" - @echo "find client and server binaries in the src/ subdirectory." - @echo "" - @echo "Read the README file for more information on installing" - @echo "the binaries, creating configuration files, and using" - @echo "the server and client." - @echo "" - -nsca: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - -send_nsca: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - -install: - @echo "" - @echo "Read the README file for information on installing the" - @echo "client and server binaries." - @echo "" - -clean: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - rm -f core - rm -f *~ */*~ - -distclean: clean - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - rm -f conf.libmcrypttest config.log config.status config.cache init-script nsca.cfg Makefile send_nsca.cfg nsca.xinetd subst $(SRC_COMMON)config.h - -devclean: distclean - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/Makefile.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Makefile.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/Makefile.in Sun Jan 26 01:01:59 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/Makefile.in Wed Dec 31 19:00:00 1969 @@ -1,48 +0,0 @@ -############################### -# Makefile for NSCA -# -# Last Modified: 01-16-2003 -############################### - - -# Source code directories -SRC_BASE=./src/ -SRC_COMMON=./common/ - -all: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - - @echo "" - @echo "*** Compile finished ***" - @echo "" - @echo "If the compile finished without any errors, you should" - @echo "find client and server binaries in the src/ subdirectory." - @echo "" - @echo "Read the README file for more information on installing" - @echo "the binaries, creating configuration files, and using" - @echo "the server and client." - @echo "" - -nsca: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - -send_nsca: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - -install: - @echo "" - @echo "Read the README file for information on installing the" - @echo "client and server binaries." - @echo "" - -clean: - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - rm -f core - rm -f *~ */*~ - -distclean: clean - cd $(SRC_BASE); $(MAKE) $@ ; cd .. - rm -f conf.libmcrypttest config.log config.status config.cache init-script nsca.cfg Makefile send_nsca.cfg nsca.xinetd subst $(SRC_COMMON)config.h - -devclean: distclean - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/README /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/README --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/README Mon Mar 31 20:29:30 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/README Wed Dec 31 19:00:00 1969 @@ -1,215 +0,0 @@ -*********** -NSCA README -*********** - - -Purpose -------- -The purpose of this addon is to allow you to send service check -results to a central monitoring server running Nagios in a secure -manner. - - -Contents --------- - -There are two pieces to this addon: - - 1) nsca - This program runs as a daemon on the central server - that runs Nagios. It listens for host and service - check results from remote machines (sent using the - send_nsca program described below). Upon receiving - data from a remote client, the daemon will make a - *very* basic attempt at validating the data it has - received from the client. This is done by decrypting - the data with the password stored in the nsca.cfg - file. If the decrypted data looks okay (i.e. it was - originally encrypted by the send_ncsa program using - the same password), the daemon will make entries in - the Nagios external command file telling Nagios - to process the host or service check result. - - Notes: The nsca daemon must have sufficient rights - to open the Nagios command file for writing. Also, - Nagios will only process passive service check - results that it finds in the external command file - if the service has been defined in the host config - file (i.e. hosts.cfg) and it is being monitored. - - - 2) send_nsca - This is the client program that is used to send - service check information from a remote machine to - the nsca daemon on the central machine that runs - Nagios. Service check information is read from - the standard input in tab-delimited format as - follows: - - [tab][tab][tab][newline] - - where: - - =short name of host that the - service is associated with - =description of the service - =numeric return code - =output from service check - - Host check information is submitted in a similiar - fashion - just leave out the service description: - - [tab][tab][newline] - - -Compiling ---------- - -The code is very basic and may not work on your particular -system without some tweaking. I just haven't put a lot of effort -into this addon. Most users should be able to compile -the daemon and client piece with the following commands... - -./configure -make all - -The binaries will be located in the src/ directory after you -run 'make all' and will have to be installed manually. - - - -Installing ----------- - -The send_nsca program and associate config file (nsca.cfg) should -be placed on remote machines that you want to have communicate -with the nsca daemon. This means that you may have to compile the -send_nsca program on the remote machine, if its not the same -OS/architecture as that of the central server. - -The nsca daemon and the configuration file (nsca.cfg) should -be placed somewhere on the central server running Nagios. - -NOTES: Make sure that you specify and use the same password in - both the nsca.cfg and send_nsca.cfg files! If you use a - different password to encrypt the data than you do to - decrypt it, the nsca daemon will reject the data you send - it. - - - -Security --------- - -There are some security implications with allowing remote clients -to provide service check results to Nagios. Because of this, you -have the option of encrypting the packets that the NSCA client sends -to the NSCA daemon. Read the SECURITY file for more information on -the security risks of running NSCA, along with an explanation of what -kind of protection the encryption provides you. - - - -Running Under INETD or XINETD ------------------------------ - -If you plan on running nsca under inetd or xinetd and making use -of TCP wrappers, you need to do the following things: - - - -1) Add a line to your /etc/services file as follows (modify the port - number as you see fit) - - nsca 5667/tcp # NSCA - - - -2) Add entries for the NSCA daemon to either your inetd or xinetd - configuration files. Which one your use will depend on which - superserver is installed on your system. Both methods are described - below. NOTE: If you run nsca under inetd or xinetd, the server_port - and allowed_hosts variables in the nrpe configuration file are - ignored. - - - ***** INETD ***** - If your system uses the inetd superserver WITH tcpwrappers, add an - entry to /etc/inetd.conf as follows: - - nsca stream tcp nowait /usr/sbin/tcpd -c --inetd - - If your system uses the inetd superserver WITHOUT tcpwrappers, add an - entry to /etc/inetd.conf as follows: - - nsca stream tcp nowait -c --inetd - - - - Replace with the name of the user that nsca server should run as. - Example: nagios - - Replace with the path to the nsca binary on your system. - Example: /usr/local/nagios/nsca - - Replace with the path to the nsca config file on your system. - Example: /usr/local/nagios/nsca.cfg - - - ***** XINETD ***** - If your system uses xinetd instead of inetd, you'll probably - want to create a file called 'nsca' in your /etc/xinetd.d - directory that contains the following entries (a sample config - file called nsca.xinetd should be created in the root folder of - the distribution after you run the configure script): - - - # default: on - # description: NSCA - service nsca - { - flags = REUSE - socket_type = stream - wait = no - user = - group = - server = - server_args = -c --inetd - log_on_failure += USERID - disable = no - only_from = ... - } - - - - Replace with the name of the user that the nsca server should run as. - - Replace with the name of the group that the nsca server should run as. - - Replace with the path to the nsca binary on your system. - - Replace with the path to the nsca config file on your system. - - Replace the fields with the IP addresses of hosts which - are allowed to connect to the NSCA daemon. This only works if xinetd was - compiled with support for tcpwrappers. - - - -3) Restart inetd or xinetd will the following command (pick the - one that is appropriate for your system: - - /etc/rc.d/init.d/inet restart - - /etc/rc.d/init.d/xinetd restart - - - -4) Add entries to your /etc/hosts.allow and /etc/hosts.deny - file to enable TCP wrapper protection for the nsca service. - This is optional, although highly recommended. - - - - -Questions? ----------- - -If you have questions about this addon, or problems getting things -working, send me email. - - -- Ethan Galstad (nagios@nagios.org) - - - - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/SECURITY /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/SECURITY --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/SECURITY Wed Oct 9 21:29:50 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/SECURITY Wed Dec 31 19:00:00 1969 @@ -1,179 +0,0 @@ -******************** -NSCA SECURITY README -******************** - - -General Security Considerations -------------------------------- -Before you proceed with installing the NSCA daemon daemon on your -monitoring server, there are some security implications that you -should be aware of. - -The main thing you need to be aware of is the fact that malicious -users could potentionally use the NSCA client to send fake service -and host check results to the NSCA daemon (and thus Nagios). This -is bad for two reasons: - -1) Nagios could get fake check results and start generating - notifications (which would annoy you) or host/service - problems (like security alerts) could be cleared by the remote - user. - -2) Worse, since Nagios can be configured to run event handlers - for hosts and services, a remote user could indirectly cause - Nagios to shut down or restart a service (or do something - more serious). - -Running the NSCA daemon under inetd and making use of TCP wrappers -allows you to perform some host-based authentication of clients. -That isn't really good enough, as any user on a blessed client -machine could use the client to send fake check results to the -daemon (and thus to Nagios). - -So what's the solution? Encryption. - - - -Encrypting Communications -------------------------- -In order to avoid some of the security hassles associated with -allowing remote clients to provide Nagios with host and service -check results, we can encrypt the data being sent from the client -to the NSCA daemon. - -While encryption is good because it provides some privacy -as to the information that is being sent from the client to -the daemon, the main purpose of the encryption is to provide -the daemon with a way of authenticating the client and -seeing if they're authorized to provide check results. - -Basically the daemon says: - - "Hey, if you (the client) used the same password and - algorithm to encrypt the data as I use to decrypt it, - I'll accept the check results you're providing me..." - - - -How The Authentication Works ----------------------------- -Authentication of checks results works as follows: - -1) The user starts the NSCA client and passes the host and/or - service check results to it. A password that is used to - encrypt the data being sent to the NSCA daemon is stored in - the send_nsca config file on the client machine. - -2) The NSCA client stuff the check results into a packet (or - several packets if you send multiple results). - -3) The NSCA client computes the CRC-32 value of the packet - its about to send off and stores that value in the packet - body. - -4) The entire packet body (including the service checking - information, as well as the CRC-32 value) is encrypted - using the password stored in the send_nsca.cfg file. - Encryption of the packet is done using the algorithm - specified by the encryption_method variable in the - send_nsca.cfg file. - -... packet gets sent over the wire... - -5) The NSCA daemon recieves the packet and decrypts it using - the password stored in the nsca.cfg file. Decryption of - the packet is done using the algorithm specified by the - decryption_method variable in the nsca.cfg file. - -6) The daemon calculates the CRC-32 value of the decrypted - packet to see if it matches the CRC-32 value stored in - the packet body (this value was previously computed and - stored by the client). - -7) If the calculated CRC-32 value matches the value that is - stored in the packet body, the service check results that - are stored in the packet are assumed to be from an - authorized user. If the calculated CRC-32 value does NOT - match the value in the packet body, the results are assumed - to be from an unauthorized user and the packet (and the - host or service check results contained therein) are - discarded. - - - -What This Means ---------------- - -1) If the client uses the wrong password to encrypt the - packet, the daemon will discard it, as the CRC-32 value - stored in the packet will not match the computed value - once the packet it decrypted. - -2) If the client uses the wrong encryption method, the - daemon will discard the results, as the CRC-32 value - stored in the packet will not match the computed value - once the packet is decrypted. - -3) If someone tries to dabble with the contents of the - packet as it is being tranferred between the client and - the server, the daemon will likely discard the packet, as - the CRC-32 value of the packet will likely be invalid. - -4) Even if someone manages to figure out a way to make - the calculated CRC-32 value match the value stored - in the packet, the check results stored in the packet - that are passed along to Nagios have to match a valid - host or service definition. Nagios ignores all passive - check results that come in that are not associated with - any valid host or service definitions. - - - -Preventing "Replay" Attacks ---------------------------- - -The methods described above help ensure that the data the -NSCA daemon receives is "valid" data - i.e., it was -encrypted with the appropriate passphrase and crypto -algorithm. One problem that remains is the fact that -someone could capture the data packets being sent from the -client to the daemon and send them back to the daemon at -a later time. This is referred to as a "replay attack". -To help prevent this, the NSCA daemon generates what is -essentially a one-time, randomly generated IV that the -client must use to encrypt data for each particular -"session". The IV does not need to be secret, just unique. -The IV is used in conjunction with the password during -encryption and decryption. Encrypting a packet with the -same password but different IVs results in a different -result. Since the daemon knows what IV it generated and -sent to the client, it can verify that the data the client -sends to it has been properly encrypted. This provides -a reasonable mechanism of preventing replay attacks. - - - -Caveats -------- - -1) These assumptions rely on the fact that you are using a - reasonably secure encryption/decryption method in the - NSCA clients and NSCA daemon. - -2) These assumptions rely on the fact that you're using a - resonable secure password to encrypt/decrypt the data. - Depending on the crypto algorithm used, this could mean - length and/or randomness. As a general rule, longer - passwords or passphrases are better than shorter ones. - Insert common sense here. - -3) It is assumed that you keep tight security on the - send_nsca.cfg and nsca.cfg config files, as they contain - both the algorithm and password used to encrypt/decrypt - the packets sent between the client and daemon. - - - -Questions? Comments? Suggestions? - - -- Ethan Galstad (nagios@nagios.org) diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/aclocal.m4 /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/aclocal.m4 --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/aclocal.m4 Thu Feb 21 20:50:43 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/aclocal.m4 Wed Dec 31 19:00:00 1969 @@ -1,260 +0,0 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl Autoconf macros for libmcrypt -dnl $id$ - -# This script detects libmcrypt version and defines -# LIBMCRYPT_CFLAGS, LIBMCRYPT_LIBS -# and LIBMCRYPT24 or LIBMCRYPT22 depending on libmcrypt version -# found. - -# Modified for LIBMCRYPT -- nmav -# Configure paths for LIBGCRYPT -# Shamelessly stolen from the one of XDELTA by Owen Taylor -# Werner Koch 99-12-09 - -dnl AM_PATH_LIBMCRYPT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) -dnl Test for libmcrypt, and define LIBMCRYPT_CFLAGS and LIBMCRYPT_LIBS -dnl -AC_DEFUN(AM_PATH_LIBMCRYPT, -[dnl -dnl Get the cflags and libraries from the libmcrypt-config script -dnl -AC_ARG_WITH(libmcrypt-prefix, - [ --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)], - libmcrypt_config_prefix="$withval", libmcrypt_config_prefix="") - - if test x$libmcrypt_config_prefix != x ; then - libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix" - if test x${LIBMCRYPT_CONFIG+set} != xset ; then - LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config - fi - fi - - AC_PATH_PROG(LIBMCRYPT_CONFIG, libmcrypt-config, no) - min_libmcrypt_version=ifelse([$1], ,2.4.0,$1) - AC_MSG_CHECKING(for libmcrypt - version >= $min_libmcrypt_version) - no_libmcrypt="" - if test "$LIBMCRYPT_CONFIG" = "no" ; then -dnl libmcrypt-config was not found (pre 2.4.11 versions) -dnl Try to detect libmcrypt version - AC_TRY_RUN([ -#include -#include -#include -#include - -int -main () -{ -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - return 0; -#else -/* version 2.4 */ - return 1; -#endif /* 19991015 */ -} -], libmcrypt_config_version="2.2.0" - if test x$libmcrypt_config_prefix != x ; then - TTLIBS="-L${libmcrypt_config_prefix}/libs" - TTINCLUDE="-I${libmcrypt_config_prefix}/include" - fi - LIBMCRYPT_CFLAGS="${TTINCLUDE}" - LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt" - AC_DEFINE(LIBMCRYPT22) - -, libmcrypt_config_version="2.4.0" - if test x$libmcrypt_config_prefix != x ; then - TTLIBS="-L${libmcrypt_config_prefix}/libs" - TTINCLUDE="-I${libmcrypt_config_prefix}/include" - fi - LIBMCRYPT_CFLAGS="${TTINCLUDE}" - LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" - AC_DEFINE(LIBMCRYPT24)) - else -dnl libmcrypt-config was found - LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags` - LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs` - libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version` - AC_DEFINE(LIBMCRYPT24) - fi - - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" - LIBS="$LIBS $LIBMCRYPT_LIBS" - -dnl -dnl Now check if the installed libmcrypt is sufficiently new. Also sanity -dnl checks the results of libmcrypt-config to some extent -dnl - rm -f conf.libmcrypttest - AC_TRY_RUN([ -#include -#include -#include -#include - -#define TWO "2.2" - -int -main () -{ -#if MCRYPT_API_VERSION <= 20010201 - -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); - system ("touch conf.libmcrypttest"); - - if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) { - printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n", - "$min_libmcrypt_version", TWO ); - printf("*** was found!\n"); - return 1; - } - return 0; -#else -/* version 2.4 before 11 */ - MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); - system ("touch conf.libmcrypttest"); - mcrypt_module_close(td); - - return 0; -#endif /* 19991015 */ - -#else - - system ("touch conf.libmcrypttest"); - - if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) ) - { - printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n", - "$libmcrypt_config_version", mcrypt_check_version(NULL) ); - printf("*** was found! If libmcrypt-config was correct, then it is best\n"); - printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n"); - printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) ) - { - printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION); - printf("*** library (version %s)\n", mcrypt_check_version(NULL) ); - } - else - { - if ( mcrypt_check_version( "$min_libmcrypt_version" ) ) - { - return 0; - } - else - { - printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n", - mcrypt_check_version(NULL) ); - printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n", - "$min_libmcrypt_version" ); - printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n"); - printf("*** \n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n"); - printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; - -#endif /* 20010201 */ - -} -],, no_libmcrypt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - - - if test "x$no_libmcrypt" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - if test -f conf.libmcrypttest ; then - : - else - AC_MSG_RESULT(no) - fi - - if test -f conf.libmcrypttest ; then - : - else - echo "*** Could not run libmcrypt test program, checking why..." - CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" - LIBS="$LIBS $LIBMCRYPT_LIBS" - AC_TRY_LINK([ -#include -#include -#include -#include -], [ -#if MCRYPT_API_VERSION <= 20010201 - -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); - return 0; -#else -/* version 2.4 before 11 */ - MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); - mcrypt_module_close(td); - return 0; -#endif /* 19991015 */ -#else - -return !!mcrypt_check_version(NULL); - -#endif /* 20010201 */ - -], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong" - echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed" - echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you" - echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - - LIBMCRYPT_CFLAGS="" - LIBMCRYPT_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(LIBMCRYPT_CFLAGS) - AC_SUBST(LIBMCRYPT_LIBS) -]) - -dnl *-*wedit:notab*-* Please keep this as the last line. - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/common.h /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/common.h --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/common.h Wed Jul 23 20:08:36 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/common.h Wed Dec 31 19:00:00 1969 @@ -1,121 +0,0 @@ -/************************************************************************ - * - * COMMON.H - NSCA Common Include File - * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org) - * Last Modified: 01-07-2003 - * - * License: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - ************************************************************************/ - -#include "config.h" - - -#define PROGRAM_VERSION "2.4" -#define MODIFICATION_DATE "07-23-2003" - - -#define OK 0 -#define ERROR -1 - -#define TRUE 1 -#define FALSE 0 - -#define STATE_UNKNOWN 3 /* service state return codes */ -#define STATE_CRITICAL 2 -#define STATE_WARNING 1 -#define STATE_OK 0 - - -#define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */ - -#define MAX_INPUT_BUFFER 2048 /* max size of most buffers we use */ - -#define MAX_HOST_ADDRESS_LENGTH 256 /* max size of a host address */ - -#define MAX_HOSTNAME_LENGTH 64 -#define MAX_DESCRIPTION_LENGTH 128 -#define MAX_PLUGINOUTPUT_LENGTH 512 - -#define MAX_PASSWORD_LENGTH 512 - - -/********************* ENCRYPTION TYPES ****************/ - -#define ENCRYPT_NONE 0 /* no encryption */ -#define ENCRYPT_XOR 1 /* not really encrypted, just obfuscated */ - -#ifdef HAVE_LIBMCRYPT -#define ENCRYPT_DES 2 /* DES */ -#define ENCRYPT_3DES 3 /* 3DES or Triple DES */ -#define ENCRYPT_CAST128 4 /* CAST-128 */ -#define ENCRYPT_CAST256 5 /* CAST-256 */ -#define ENCRYPT_XTEA 6 /* xTEA */ -#define ENCRYPT_3WAY 7 /* 3-WAY */ -#define ENCRYPT_BLOWFISH 8 /* SKIPJACK */ -#define ENCRYPT_TWOFISH 9 /* TWOFISH */ -#define ENCRYPT_LOKI97 10 /* LOKI97 */ -#define ENCRYPT_RC2 11 /* RC2 */ -#define ENCRYPT_ARCFOUR 12 /* RC4 */ -#define ENCRYPT_RC6 13 /* RC6 */ /* UNUSED */ -#define ENCRYPT_RIJNDAEL128 14 /* RIJNDAEL-128 */ -#define ENCRYPT_RIJNDAEL192 15 /* RIJNDAEL-192 */ -#define ENCRYPT_RIJNDAEL256 16 /* RIJNDAEL-256 */ -#define ENCRYPT_MARS 17 /* MARS */ /* UNUSED */ -#define ENCRYPT_PANAMA 18 /* PANAMA */ /* UNUSED */ -#define ENCRYPT_WAKE 19 /* WAKE */ -#define ENCRYPT_SERPENT 20 /* SERPENT */ -#define ENCRYPT_IDEA 21 /* IDEA */ /* UNUSED */ -#define ENCRYPT_ENIGMA 22 /* ENIGMA (Unix crypt) */ -#define ENCRYPT_GOST 23 /* GOST */ -#define ENCRYPT_SAFER64 24 /* SAFER-sk64 */ -#define ENCRYPT_SAFER128 25 /* SAFER-sk128 */ -#define ENCRYPT_SAFERPLUS 26 /* SAFER+ */ -#endif - - - -/******************** MISC DEFINITIONS *****************/ - -#define TRANSMITTED_IV_SIZE 128 /* size of IV to transmit - must be as big as largest IV needed for any crypto algorithm */ - - -/*************** PACKET STRUCTURE DEFINITIONS **********/ - -#define NSCA_PACKET_VERSION_3 3 /* packet version identifier */ -#define NSCA_PACKET_VERSION_2 2 /* older packet version identifiers */ -#define NSCA_PACKET_VERSION_1 1 - -/* data packet containing service check results */ -typedef struct data_packet_struct{ - int16_t packet_version; - u_int32_t crc32_value; - u_int32_t timestamp; - int16_t return_code; - char host_name[MAX_HOSTNAME_LENGTH]; - char svc_description[MAX_DESCRIPTION_LENGTH]; - char plugin_output[MAX_PLUGINOUTPUT_LENGTH]; - }data_packet; - -/* initialization packet containing IV and timestamp */ -typedef struct init_packet_struct{ - char iv[TRANSMITTED_IV_SIZE]; - u_int32_t timestamp; - }init_packet; - - - - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/config.h /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/config.h --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/config.h Wed Mar 10 23:40:49 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/config.h Wed Dec 31 19:00:00 1969 @@ -1,245 +0,0 @@ -/* common/config.h. Generated automatically by configure. */ -/************************************************************************ - * - * NSCA Common Config Header File - * Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org) - * Last Modified: 07-22-2003 - * - * License: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - ************************************************************************/ - -#ifndef _CONFIG_H -#define _CONFIG_H - - -#include -#include - -#define DEFAULT_SERVER_PORT 5667 /* default port to use */ - - -#define STDC_HEADERS 1 -#define HAVE_SYSLOG_H 1 -#define HAVE_STRDUP 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOUL 1 -/* #undef HAVE_INITGROUPS */ -/* #undef HAVE_LIMITS_H */ -#define HAVE_SYS_RESOURCE_H 1 - -#define SOCKET_SIZE_TYPE size_t -#define GETGROUPS_T gid_t -#define RETSIGTYPE void - - -#define SIZEOF_INT 4 -#define SIZEOF_SHORT 2 -#define SIZEOF_LONG 4 - -/* stupid stuff for u_int32_t */ -/* #undef U_INT32_T_IS_USHORT */ -/* #undef U_INT32_T_IS_UINT */ -/* #undef U_INT32_T_IS_ULONG */ -/* #undef U_INT32_T_IS_UINT32_T */ - -#ifdef U_INT32_T_IS_USHORT -typedef unsigned short u_int32_t; -#endif -#ifdef U_INT32_T_IS_ULONG -typedef unsigned long u_int32_t; -#endif -#ifdef U_INT32_T_IS_UINT -typedef unsigned int u_int32_t; -#endif -#ifdef U_INT32_T_IS_UINT32_t -typedef uint32_t u_int32_t; -#endif - -/* stupid stuff for int32_t */ -/* #undef INT32_T_IS_SHORT */ -/* #undef INT32_T_IS_INT */ -/* #undef INT32_T_IS_LONG */ - -#ifdef INT32_T_IS_USHORT -typedef short int32_t; -#endif -#ifdef INT32_T_IS_ULONG -typedef long int32_t; -#endif -#ifdef INT32_T_IS_UINT -typedef int int32_t; -#endif - - -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#ifdef HAVE_STRINGS_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif - -#define HAVE_UNISTD_H 1 -#ifdef HAVE_UNISTD_H -#include -#endif - - -#define HAVE_SIGNAL_H 1 -#ifdef HAVE_SIGNAL_H -#include -#endif - -#define HAVE_SYSLOG_H 1 -#ifdef HAVE_SYSLOG_H -#include -#endif - -/* #undef HAVE_SYS_INT_TYPES_H */ -#ifdef HAVE_SYS_INT_TYPES_H -#include -#endif - -#define HAVE_SYS_STAT_H 1 -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#define HAVE_FCNTL_H 1 -#ifdef HAVE_FCNTL_H -#include -#endif - -#define HAVE_STDINT_H 1 -#ifdef HAVE_STDINT_H -#include -#endif - -#define HAVE_SYS_POLL_H 1 -#ifdef HAVE_SYS_POLL_H -#include -#endif - -#define HAVE_SYS_TYPES_H 1 -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#define HAVE_SYS_WAIT_H 1 -#ifdef HAVE_SYS_WAIT_H -#include -#endif - -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -#define HAVE_ERRNO_H 1 -#ifdef HAVE_ERRNO_H -#include -#endif - -/* needed for the time_t structures we use later... */ -#define TIME_WITH_SYS_TIME 1 -#define HAVE_SYS_TIME_H 1 -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - - -#define HAVE_SYS_SOCKET_H 1 -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -/* #undef HAVE_SOCKET */ -#ifdef HAVE_SOCKET_H -#include -#endif - -#define HAVE_NETINET_IN_H 1 -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#define HAVE_ARPA_INET_H 1 -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#define HAVE_NETDB_H 1 -#ifdef HAVE_NETDB_H -#include -#endif - -#define HAVE_CTYPE_H 1 -#ifdef HAVE_CTYPE_H -#include -#endif - -/* #undef HAVE_LIBMCRYPT */ -#ifdef HAVE_LIBMCRYPT -#include -#endif - -#define HAVE_DB_H 1 -#ifdef HAVE_DB_H -#include -#endif - -#define HAVE_PWD_H 1 -#ifdef HAVE_PWD_H -#include -#endif - -#define HAVE_GRP_H 1 -#ifdef HAVE_GRP_H -#include -#endif - -#define HAVE_INTTYPES_H 1 -#ifdef HAVE_INTTYPES_H -#include -#endif - -/* #undef HAVE_SYS_CONFIG_H */ -#ifdef HAVE_SYS_CONFIG_H -#include -#endif - -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#ifdef HAVE_INTTYPES_H -#include -#else -#ifdef HAVE_STDINT_H -#include -#endif -#endif - -#endif diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/config.h.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/config.h.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/common/config.h.in Wed Jul 23 20:08:36 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/common/config.h.in Wed Dec 31 19:00:00 1969 @@ -1,244 +0,0 @@ -/************************************************************************ - * - * NSCA Common Config Header File - * Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org) - * Last Modified: 07-22-2003 - * - * License: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - ************************************************************************/ - -#ifndef _CONFIG_H -#define _CONFIG_H - - -#include -#include - -#define DEFAULT_SERVER_PORT @nsca_port@ /* default port to use */ - - -#undef STDC_HEADERS -#undef HAVE_SYSLOG_H -#undef HAVE_STRDUP -#undef HAVE_STRSTR -#undef HAVE_STRTOUL -#undef HAVE_INITGROUPS -#undef HAVE_LIMITS_H -#undef HAVE_SYS_RESOURCE_H - -#define SOCKET_SIZE_TYPE "" -#define GETGROUPS_T "" -#define RETSIGTYPE "" - - -#undef SIZEOF_INT -#undef SIZEOF_SHORT -#undef SIZEOF_LONG - -/* stupid stuff for u_int32_t */ -#undef U_INT32_T_IS_USHORT -#undef U_INT32_T_IS_UINT -#undef U_INT32_T_IS_ULONG -#undef U_INT32_T_IS_UINT32_T - -#ifdef U_INT32_T_IS_USHORT -typedef unsigned short u_int32_t; -#endif -#ifdef U_INT32_T_IS_ULONG -typedef unsigned long u_int32_t; -#endif -#ifdef U_INT32_T_IS_UINT -typedef unsigned int u_int32_t; -#endif -#ifdef U_INT32_T_IS_UINT32_t -typedef uint32_t u_int32_t; -#endif - -/* stupid stuff for int32_t */ -#undef INT32_T_IS_SHORT -#undef INT32_T_IS_INT -#undef INT32_T_IS_LONG - -#ifdef INT32_T_IS_USHORT -typedef short int32_t; -#endif -#ifdef INT32_T_IS_ULONG -typedef long int32_t; -#endif -#ifdef INT32_T_IS_UINT -typedef int int32_t; -#endif - - -#undef HAVE_STRINGS_H -#undef HAVE_STRING_H -#ifdef HAVE_STRINGS_H -#include -#endif -#ifdef HAVE_STRINGS_H -#include -#endif - -#undef HAVE_UNISTD_H -#ifdef HAVE_UNISTD_H -#include -#endif - - -#undef HAVE_SIGNAL_H -#ifdef HAVE_SIGNAL_H -#include -#endif - -#undef HAVE_SYSLOG_H -#ifdef HAVE_SYSLOG_H -#include -#endif - -#undef HAVE_SYS_INT_TYPES_H -#ifdef HAVE_SYS_INT_TYPES_H -#include -#endif - -#undef HAVE_SYS_STAT_H -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#undef HAVE_FCNTL_H -#ifdef HAVE_FCNTL_H -#include -#endif - -#undef HAVE_STDINT_H -#ifdef HAVE_STDINT_H -#include -#endif - -#undef HAVE_SYS_POLL_H -#ifdef HAVE_SYS_POLL_H -#include -#endif - -#undef HAVE_SYS_TYPES_H -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#undef HAVE_SYS_WAIT_H -#ifdef HAVE_SYS_WAIT_H -#include -#endif - -#ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif - -#undef HAVE_ERRNO_H -#ifdef HAVE_ERRNO_H -#include -#endif - -/* needed for the time_t structures we use later... */ -#undef TIME_WITH_SYS_TIME -#undef HAVE_SYS_TIME_H -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - - -#undef HAVE_SYS_SOCKET_H -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - -#undef HAVE_SOCKET -#ifdef HAVE_SOCKET_H -#include -#endif - -#undef HAVE_NETINET_IN_H -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#undef HAVE_ARPA_INET_H -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#undef HAVE_NETDB_H -#ifdef HAVE_NETDB_H -#include -#endif - -#undef HAVE_CTYPE_H -#ifdef HAVE_CTYPE_H -#include -#endif - -#undef HAVE_LIBMCRYPT -#ifdef HAVE_LIBMCRYPT -#include -#endif - -#undef HAVE_DB_H -#ifdef HAVE_DB_H -#include -#endif - -#undef HAVE_PWD_H -#ifdef HAVE_PWD_H -#include -#endif - -#undef HAVE_GRP_H -#ifdef HAVE_GRP_H -#include -#endif - -#undef HAVE_INTTYPES_H -#ifdef HAVE_INTTYPES_H -#include -#endif - -#undef HAVE_SYS_CONFIG_H -#ifdef HAVE_SYS_CONFIG_H -#include -#endif - -#undef HAVE_INTTYPES_H -#undef HAVE_STDINT_H -#ifdef HAVE_INTTYPES_H -#include -#else -#ifdef HAVE_STDINT_H -#include -#endif -#endif - -#endif diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/config.log /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/config.log --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/config.log Wed Mar 10 23:40:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/config.log Wed Dec 31 19:00:00 1969 @@ -1,141 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -configure:571: checking for a BSD compatible install -configure:628: checking for gcc -configure:741: checking whether the C compiler (cc -O2 -pipe -funroll-loops -march=pentiumpro ) works -configure:757: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:783: checking whether the C compiler (cc -O2 -pipe -funroll-loops -march=pentiumpro ) is a cross-compiler -configure:788: checking whether we are using GNU C -configure:797: cc -E conftest.c -configure:816: checking whether cc accepts -g -configure:848: checking whether make sets ${MAKE} -configure:876: checking how to run the C preprocessor -configure:897: cc -E conftest.c >/dev/null 2>conftest.out -configure:956: checking for ANSI C header files -configure:969: cc -E conftest.c >/dev/null 2>conftest.out -configure:1036: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1060: checking whether time.h and sys/time.h may both be included -configure:1074: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1095: checking for sys/wait.h that is POSIX.1 compatible -configure:1116: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1140: checking for db.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for ctype.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for errno.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for fcntl.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for grp.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for inttypes.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for netdb.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for pwd.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for signal.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for stdint.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for strings.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for string.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for syslog.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for unistd.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for arpa/inet.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for netinet/in.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/config.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1146:24: sys/config.h: No such file or directory -configure: failed program was: -#line 1145 "configure" -#include "confdefs.h" -#include -configure:1140: checking for sys/int_types.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1146:27: sys/int_types.h: No such file or directory -configure: failed program was: -#line 1145 "configure" -#include "confdefs.h" -#include -configure:1140: checking for sys/poll.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/types.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/time.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/resource.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/socket.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/stat.h -configure:1150: cc -E conftest.c >/dev/null 2>conftest.out -configure:1140: checking for sys/wait.h -configure:1178: checking for working const -configure:1232: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1253: checking whether struct tm is in sys/time.h or time.h -configure:1266: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1287: checking for mode_t -configure:1320: checking for pid_t -configure:1353: checking for size_t -configure:1386: checking return type of signal handlers -configure:1408: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1427: checking for uid_t in sys/types.h -configure:1461: checking type of array argument to getgroups -configure:1494: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1533: checking size of int -configure:1552: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1572: checking size of short -configure:1591: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1611: checking size of long -configure:1630: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1651: checking for uint32_t -configure:1684: checking for u_int32_t -configure:1747: checking for int32_t -configure:1803: checking for main in -lnsl -configure:1818: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c -lnsl 1>&5 -/usr/bin/ld: cannot find -lnsl -configure: failed program was: -#line 1811 "configure" -#include "confdefs.h" - -int main() { -main() -; return 0; } -configure:1839: checking for socket in -lsocket -configure:1858: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c -lsocket 1>&5 -/usr/bin/ld: cannot find -lsocket -configure: failed program was: -#line 1847 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); - -int main() { -socket() -; return 0; } -configure:1882: checking for strdup -configure:1910: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1882: checking for strstr -configure:1910: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1894: warning: conflicting types for built-in function `strstr' -configure:1882: checking for strtoul -configure:1910: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure:1936: checking for type of socket size -configure:1948: cc -c -O2 -pipe -funroll-loops -march=pentiumpro conftest.c 1>&5 -configure: In function `main': -configure:1944: warning: passing arg 3 of `send' makes integer from pointer without a cast -configure:1944: warning: passing arg 4 of `send' makes integer from pointer without a cast -configure:2004: checking for libmcrypt-config -configure:2039: checking for libmcrypt - version >= 2.4.11 -configure:2209: cc -o conftest -O2 -pipe -funroll-loops -march=pentiumpro -I/usr/local/include conftest.c -L/usr/local/lib -lmcrypt 1>&5 -configure:2380: checking for perl diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/config.status /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/config.status --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/config.status Wed Mar 10 23:40:48 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/config.status Wed Dec 31 19:00:00 1969 @@ -1,397 +0,0 @@ -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host lugnut.aps.org: -# -# ./configure --prefix=/usr/local --localstatedir=/var/spool/nagios --prefix=/usr/local i386-portbld-freebsd5.2.1 -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]" -for ac_option -do - case "$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr/local --localstatedir=/var/spool/nagios --prefix=/usr/local i386-portbld-freebsd5.2.1 --no-create --no-recursion" - exec ${CONFIG_SHELL-/bin/sh} ./configure --prefix=/usr/local --localstatedir=/var/spool/nagios --prefix=/usr/local i386-portbld-freebsd5.2.1 --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "./config.status generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "$ac_cs_usage"; exit 0 ;; - *) echo "$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=. -ac_given_INSTALL="/usr/bin/install -c -o root -g wheel" - -trap 'rm -fr Makefile subst src/Makefile common/config.h conftest*; exit 1' 1 2 15 - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g; - s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF -/^[ ]*VPATH[ ]*=[^:]*$/d - -s%@SHELL@%/bin/sh%g -s%@CFLAGS@%-O2 -pipe -funroll-loops -march=pentiumpro -DHAVE_LIBMCRYPT -I/usr/local/include%g -s%@CPPFLAGS@%%g -s%@CXXFLAGS@%-O2 -pipe -funroll-loops -march=pentiumpro%g -s%@FFLAGS@%%g -s%@DEFS@%-DHAVE_CONFIG_H%g -s%@LDFLAGS@% -L/usr/local/lib -lmcrypt%g -s%@LIBS@%%g -s%@exec_prefix@%${prefix}%g -s%@prefix@%/usr/local%g -s%@program_transform_name@%s,x,x,%g -s%@bindir@%${exec_prefix}/bin%g -s%@sbindir@%${exec_prefix}/sbin%g -s%@libexecdir@%${exec_prefix}/libexec%g -s%@datadir@%${prefix}/share%g -s%@sysconfdir@%${prefix}/etc%g -s%@sharedstatedir@%${prefix}/com%g -s%@localstatedir@%/var/spool/nagios%g -s%@libdir@%${exec_prefix}/lib%g -s%@includedir@%${prefix}/include%g -s%@oldincludedir@%/usr/include%g -s%@infodir@%${prefix}/info%g -s%@mandir@%${prefix}/man%g -s%@INSTALL_PROGRAM@%install -s -o root -g wheel -m 555%g -s%@INSTALL_SCRIPT@%install -o root -g wheel -m 555%g -s%@INSTALL_DATA@%install -o root -g wheel -m 444%g -s%@INSTALL@%/usr/bin/install -c -o root -g wheel%g -s%@CC@%cc%g -s%@SET_MAKE@%%g -s%@CPP@%cc -E%g -s%@SOCKETLIBS@%%g -s%@LIBMCRYPT_CONFIG@%/usr/local/bin/libmcrypt-config%g -s%@LIBMCRYPT_CFLAGS@%-I/usr/local/include%g -s%@LIBMCRYPT_LIBS@%-L/usr/local/lib -lmcrypt%g -s%@nsca_user@%nagios%g -s%@nsca_grp@%nagios%g -s%@nsca_port@%5667%g -s%@PERL@%/usr/bin/perl%g - -CEOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi - -CONFIG_FILES=${CONFIG_FILES-"Makefile subst src/Makefile"} -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then - CONFIG_HEADERS="common/config.h" -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - cat > conftest.frag < conftest.out - rm -f conftest.in - mv conftest.out conftest.in - - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - - - -exit 0 diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/configure /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/configure --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/configure Wed Jul 23 20:08:35 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/configure Wed Dec 31 19:00:00 1969 @@ -1,2757 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_default_prefix=/usr/local/nagios -ac_help="$ac_help ---with-mcrypt-lib=DIR sets location of the mcrypt client library" -ac_help="$ac_help ---with-mcrypt-inc=DIR sets location of the mcrypt client include files" -ac_help="$ac_help - --with-libmcrypt-prefix=PFX Prefix where libmcrypt is installed (optional)" -ac_help="$ac_help ---with-nsca-user= sets user name to run NSCA" -ac_help="$ac_help ---with-nsca-grp= sets group name to run NSCA" -ac_help="$ac_help ---with-nsca-port= sets port number for NSCA to listen on" - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=src/nsca.c - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - - - -PKG_NAME=nsca -PKG_VERSION="2.4" -PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="07-23-2003" - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# ./install, which can be erroneously created by make from ./install.sh. -echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:571: checking for a BSD compatible install" >&5 -if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then - if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 - fi - fi - done - ;; - esac - done - IFS="$ac_save_IFS" - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" - else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the path is relative. - INSTALL="$ac_install_sh" - fi -fi -echo "$ac_t""$INSTALL" 1>&6 - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:628: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:658: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# -gt 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" - fi -fi -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:709: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 752 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no - else - ac_cv_prog_cc_cross=yes - fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no -fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } -fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:783: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:788: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 - -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi - -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:816: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_cc_g=yes -else - ac_cv_prog_cc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:848: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:876: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:931: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:956: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -#include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - ac_cv_header_stdc=yes -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : -else - rm -rf conftest* - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext < -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } - -EOF -if { (eval echo configure:1036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi - -fi -fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi - -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1060: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#include -int main() { -struct tm *tp; -; return 0; } -EOF -if { (eval echo configure:1074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_time=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_time" 1>&6 -if test $ac_cv_header_time = yes; then - cat >> confdefs.h <<\EOF -#define TIME_WITH_SYS_TIME 1 -EOF - -fi - -echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:1095: checking for sys/wait.h that is POSIX.1 compatible" >&5 -if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#ifndef WEXITSTATUS -#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) -#endif -#ifndef WIFEXITED -#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -#endif -int main() { -int s; -wait (&s); -s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; -; return 0; } -EOF -if { (eval echo configure:1116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_header_sys_wait_h=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_sys_wait_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 -if test $ac_cv_header_sys_wait_h = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_SYS_WAIT_H 1 -EOF - -fi - -for ac_hdr in db.h ctype.h errno.h fcntl.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/config.h sys/int_types.h sys/poll.h sys/types.h sys/time.h sys/resource.h sys/socket.h sys/stat.h sys/wait.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1140: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1178: checking for working const" >&5 -if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} - -; return 0; } -EOF -if { (eval echo configure:1232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_const=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 -if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF - -fi - -echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1253: checking whether struct tm is in sys/time.h or time.h" >&5 -if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -int main() { -struct tm *tp; tp->tm_sec; -; return 0; } -EOF -if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_struct_tm=time.h -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_struct_tm=sys/time.h -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_struct_tm" 1>&6 -if test $ac_cv_struct_tm = sys/time.h; then - cat >> confdefs.h <<\EOF -#define TM_IN_SYS_TIME 1 -EOF - -fi - -echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1287: checking for mode_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_mode_t=yes -else - rm -rf conftest* - ac_cv_type_mode_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_mode_t" 1>&6 -if test $ac_cv_type_mode_t = no; then - cat >> confdefs.h <<\EOF -#define mode_t int -EOF - -fi - -echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1320: checking for pid_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_pid_t=yes -else - rm -rf conftest* - ac_cv_type_pid_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_pid_t" 1>&6 -if test $ac_cv_type_pid_t = no; then - cat >> confdefs.h <<\EOF -#define pid_t int -EOF - -fi - -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1353: checking for size_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_size_t=yes -else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF -#define size_t unsigned -EOF - -fi - -echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1386: checking return type of signal handlers" >&5 -if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#include -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif - -int main() { -int i; -; return 0; } -EOF -if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_type_signal=void -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_type_signal=int -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_type_signal" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1427: checking for uid_t in sys/types.h" >&5 -if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "uid_t" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_uid_t=yes -else - rm -rf conftest* - ac_cv_type_uid_t=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_type_uid_t" 1>&6 -if test $ac_cv_type_uid_t = no; then - cat >> confdefs.h <<\EOF -#define uid_t int -EOF - - cat >> confdefs.h <<\EOF -#define gid_t int -EOF - -fi - -echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:1461: checking type of array argument to getgroups" >&5 -if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - ac_cv_type_getgroups=cross -else - cat > conftest.$ac_ext < -#define NGID 256 -#undef MAX -#define MAX(x, y) ((x) > (y) ? (x) : (y)) -main() -{ - gid_t gidset[NGID]; - int i, n; - union { gid_t gval; long lval; } val; - - val.lval = -1; - for (i = 0; i < NGID; i++) - gidset[i] = val.gval; - n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, - gidset); - /* Exit non-zero if getgroups seems to require an array of ints. This - happens when gid_t is short but getgroups modifies an array of ints. */ - exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); -} - -EOF -if { (eval echo configure:1494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_type_getgroups=gid_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_type_getgroups=int -fi -rm -fr conftest* -fi - -if test $ac_cv_type_getgroups = cross; then - cat > conftest.$ac_ext < -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_getgroups=gid_t -else - rm -rf conftest* - ac_cv_type_getgroups=int -fi -rm -f conftest* - -fi -fi - -echo "$ac_t""$ac_cv_type_getgroups" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1533: checking size of int" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", sizeof(int)); - return(0); -} -EOF -if { (eval echo configure:1552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_int=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_int=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_int" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1572: checking size of short" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", sizeof(short)); - return(0); -} -EOF -if { (eval echo configure:1591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_short=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_short=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_short" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1611: checking size of long" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -int main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) return(1); - fprintf(f, "%d\n", sizeof(long)); - return(0); -} -EOF -if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_long=`cat conftestval` -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_long=0 -fi -rm -fr conftest* -fi - -fi -echo "$ac_t""$ac_cv_sizeof_long" 1>&6 -cat >> confdefs.h <&6 -echo "configure:1651: checking for uint32_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_uint32_t=yes -else - rm -rf conftest* - ac_cv_type_uint32_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_uint32_t" 1>&6 -if test $ac_cv_type_uint32_t = no; then - cat >> confdefs.h <<\EOF -#define uint32_t unsigned int -EOF - -fi - -echo $ac_n "checking for u_int32_t""... $ac_c" 1>&6 -echo "configure:1684: checking for u_int32_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_u_int32_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])u_int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_u_int32_t=yes -else - rm -rf conftest* - ac_cv_type_u_int32_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_u_int32_t" 1>&6 -if test $ac_cv_type_u_int32_t = no; then - cat >> confdefs.h <<\EOF -#define u_int32_t unsigned int -EOF - -fi - -if test "$ac_cv_type_u_int32_t" = no ; then - if test "$ac_cv_type_u_int32_t" = yes ; then - cat >> confdefs.h <<\EOF -#define U_INT32_T_IS_UINT32_T 1 -EOF - - else - if test "$ac_cv_sizeof_int" = 4 ; then - cat >> confdefs.h <<\EOF -#define U_INT32_T_IS_UINT 1 -EOF - - else - if test "$ac_cv_sizeof_long" = 4 ; then - cat >> confdefs.h <<\EOF -#define U_INT32_T_IS_ULONG 1 -EOF - - else - if test "$ac_cv_sizeof_short" = 4 ; then - cat >> confdefs.h <<\EOF -#define U_INT32_T_IS_USHORT 1 -EOF - - fi - fi - fi - fi -fi - -echo $ac_n "checking for int32_t""... $ac_c" 1>&6 -echo "configure:1747: checking for int32_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_int32_t=yes -else - rm -rf conftest* - ac_cv_type_int32_t=no -fi -rm -f conftest* - -fi -echo "$ac_t""$ac_cv_type_int32_t" 1>&6 -if test $ac_cv_type_int32_t = no; then - cat >> confdefs.h <<\EOF -#define int32_t int -EOF - -fi - -if test "$ac_cv_type_int32_t" = no ; then - if test "$ac_cv_sizeof_int" = 4 ; then - cat >> confdefs.h <<\EOF -#define INT32_T_IS_UINT 1 -EOF - - else - if test "$ac_cv_sizeof_long" = 4 ; then - cat >> confdefs.h <<\EOF -#define INT32_T_IS_ULONG 1 -EOF - - else - if test "$ac_cv_sizeof_short" = 4 ; then - cat >> confdefs.h <<\EOF -#define INT32_T_IS_USHORT 1 -EOF - - fi - fi - fi -fi - -echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:1803: checking for main in -lnsl" >&5 -ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SOCKETLIBS="$SOCKETLIBS -lnsl" -else - echo "$ac_t""no" 1>&6 -fi - -echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1839: checking for socket in -lsocket" >&5 -ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SOCKETLIBS="$SOCKETLIBS -lsocket" -else - echo "$ac_t""no" 1>&6 -fi - - -for ac_func in strdup strstr strtoul -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1882: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:1910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - - -echo $ac_n "checking for type of socket size""... $ac_c" 1>&6 -echo "configure:1936: checking for type of socket size" >&5 -cat > conftest.$ac_ext < -#include -#include - -int main() { -int a = send(1, (const void *)0, (size_t *) 0, (int *) 0); -; return 0; } -EOF -if { (eval echo configure:1948: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - cat >> confdefs.h <<\EOF -#define SOCKET_SIZE_TYPE size_t -EOF - echo "$ac_t""size_t" 1>&6 -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - cat >> confdefs.h <<\EOF -#define SOCKET_SIZE_TYPE int -EOF - echo "$ac_t""int" 1>&6 -fi -rm -f conftest* - -# Check whether --with-mcrypt-lib or --without-mcrypt-lib was given. -if test "${with_mcrypt_lib+set}" = set; then - withval="$with_mcrypt_lib" - - LDFLAGS="${LDFLAGS} -L${withval}" - LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" - -fi - -# Check whether --with-mcrypt-inc or --without-mcrypt-inc was given. -if test "${with_mcrypt_inc+set}" = set; then - withval="$with_mcrypt_inc" - - CFLAGS="${CFLAGS} -I${withval}" - -fi - - - -MCRYPTLIBFOUND=yep -# Check whether --with-libmcrypt-prefix or --without-libmcrypt-prefix was given. -if test "${with_libmcrypt_prefix+set}" = set; then - withval="$with_libmcrypt_prefix" - libmcrypt_config_prefix="$withval" -else - libmcrypt_config_prefix="" -fi - - - if test x$libmcrypt_config_prefix != x ; then - libmcrypt_config_args="$libmcrypt_config_args --prefix=$libmcrypt_config_prefix" - if test x${LIBMCRYPT_CONFIG+set} != xset ; then - LIBMCRYPT_CONFIG=$libmcrypt_config_prefix/bin/libmcrypt-config - fi - fi - - # Extract the first word of "libmcrypt-config", so it can be a program name with args. -set dummy libmcrypt-config; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2004: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_LIBMCRYPT_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$LIBMCRYPT_CONFIG" in - /*) - ac_cv_path_LIBMCRYPT_CONFIG="$LIBMCRYPT_CONFIG" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_LIBMCRYPT_CONFIG="$LIBMCRYPT_CONFIG" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_LIBMCRYPT_CONFIG="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_LIBMCRYPT_CONFIG" && ac_cv_path_LIBMCRYPT_CONFIG="no" - ;; -esac -fi -LIBMCRYPT_CONFIG="$ac_cv_path_LIBMCRYPT_CONFIG" -if test -n "$LIBMCRYPT_CONFIG"; then - echo "$ac_t""$LIBMCRYPT_CONFIG" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - min_libmcrypt_version=2.4.11 - echo $ac_n "checking for libmcrypt - version >= $min_libmcrypt_version""... $ac_c" 1>&6 -echo "configure:2039: checking for libmcrypt - version >= $min_libmcrypt_version" >&5 - no_libmcrypt="" - if test "$LIBMCRYPT_CONFIG" = "no" ; then - if test "$cross_compiling" = yes; then - { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext < -#include -#include -#include - -int -main () -{ -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - return 0; -#else -/* version 2.4 */ - return 1; -#endif /* 19991015 */ -} - -EOF -if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - libmcrypt_config_version="2.2.0" - if test x$libmcrypt_config_prefix != x ; then - TTLIBS="-L${libmcrypt_config_prefix}/libs" - TTINCLUDE="-I${libmcrypt_config_prefix}/include" - fi - LIBMCRYPT_CFLAGS="${TTINCLUDE}" - LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt" - cat >> confdefs.h <<\EOF -#define LIBMCRYPT22 1 -EOF - - - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - libmcrypt_config_version="2.4.0" - if test x$libmcrypt_config_prefix != x ; then - TTLIBS="-L${libmcrypt_config_prefix}/libs" - TTINCLUDE="-I${libmcrypt_config_prefix}/include" - fi - LIBMCRYPT_CFLAGS="${TTINCLUDE}" - LIBMCRYPT_LIBS="${TTLIBS} -lmcrypt -lltdl ${LIBADD_DL}" - cat >> confdefs.h <<\EOF -#define LIBMCRYPT24 1 -EOF - -fi -rm -fr conftest* -fi - - else - LIBMCRYPT_CFLAGS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --cflags` - LIBMCRYPT_LIBS=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --libs` - libmcrypt_config_version=`$LIBMCRYPT_CONFIG $libmcrypt_config_args --version` - cat >> confdefs.h <<\EOF -#define LIBMCRYPT24 1 -EOF - - fi - - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" - LIBS="$LIBS $LIBMCRYPT_LIBS" - - rm -f conf.libmcrypttest - if test "$cross_compiling" = yes; then - echo $ac_n "cross compiling; assumed OK... $ac_c" -else - cat > conftest.$ac_ext < -#include -#include -#include - -#define TWO "2.2" - -int -main () -{ -#if MCRYPT_API_VERSION <= 20010201 - -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); - system ("touch conf.libmcrypttest"); - - if( strncmp( TWO, "$min_libmcrypt_version", strlen(TWO))) { - printf("\n*** Requested libmcrypt %s, but LIBMCRYPT (%s)\n", - "$min_libmcrypt_version", TWO ); - printf("*** was found!\n"); - return 1; - } - return 0; -#else -/* version 2.4 before 11 */ - MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); - system ("touch conf.libmcrypttest"); - mcrypt_module_close(td); - - return 0; -#endif /* 19991015 */ - -#else - - system ("touch conf.libmcrypttest"); - - if( strcmp( mcrypt_check_version(NULL), "$libmcrypt_config_version" ) ) - { - printf("\n*** 'libmcrypt-config --version' returned %s, but LIBMCRYPT (%s)\n", - "$libmcrypt_config_version", mcrypt_check_version(NULL) ); - printf("*** was found! If libmcrypt-config was correct, then it is best\n"); - printf("*** to remove the old version of LIBMCRYPT. You may also be able to fix the error\n"); - printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); - printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); - printf("*** required on your system.\n"); - printf("*** If libmcrypt-config was wrong, set the environment variable LIBMCRYPT_CONFIG\n"); - printf("*** to point to the correct copy of libmcrypt-config, and remove the file config.cache\n"); - printf("*** before re-running configure\n"); - } - else if ( strcmp(mcrypt_check_version(NULL), LIBMCRYPT_VERSION ) ) - { - printf("\n*** LIBMCRYPT header file (version %s) does not match\n", LIBMCRYPT_VERSION); - printf("*** library (version %s)\n", mcrypt_check_version(NULL) ); - } - else - { - if ( mcrypt_check_version( "$min_libmcrypt_version" ) ) - { - return 0; - } - else - { - printf("no\n*** An old version of LIBMCRYPT (%s) was found.\n", - mcrypt_check_version(NULL) ); - printf("*** You need a version of LIBMCRYPT newer than %s. The latest version of\n", - "$min_libmcrypt_version" ); - printf("*** LIBMCRYPT is always available from ftp://mcrypt.hellug.gr/pub/mcrypt.\n"); - printf("*** \n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the libmcrypt-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of LIBMCRYPT, but you can also set the LIBMCRYPT_CONFIG environment to point to the\n"); - printf("*** correct copy of libmcrypt-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - } - return 1; - -#endif /* 20010201 */ - -} - -EOF -if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - : -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - no_libmcrypt=yes -fi -rm -fr conftest* -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - - - if test "x$no_libmcrypt" = x ; then - echo "$ac_t""yes" 1>&6 - : - else - if test -f conf.libmcrypttest ; then - : - else - echo "$ac_t""no" 1>&6 - fi - - if test -f conf.libmcrypttest ; then - : - else - echo "*** Could not run libmcrypt test program, checking why..." - CFLAGS="$CFLAGS $LIBMCRYPT_CFLAGS" - LIBS="$LIBS $LIBMCRYPT_LIBS" - cat > conftest.$ac_ext < -#include -#include -#include - -int main() { - -#if MCRYPT_API_VERSION <= 20010201 - -#if MCRYPT_API_VERSION <= 19991015 -/* version 2.2 */ - int x = mcrypt_get_key_size(MCRYPT_TWOFISH_128); - return 0; -#else -/* version 2.4 before 11 */ - MCRYPT td = mcrypt_module_open("twofish", NULL, "cbc", NULL); - mcrypt_module_close(td); - return 0; -#endif /* 19991015 */ -#else - -return !!mcrypt_check_version(NULL); - -#endif /* 20010201 */ - - -; return 0; } -EOF -if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding LIBMCRYPT or finding the wrong" - echo "*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means LIBMCRYPT was incorrectly installed" - echo "*** or that you have moved LIBMCRYPT since it was installed. In the latter case, you" - echo "*** may want to edit the libmcrypt-config script: $LIBMCRYPT_CONFIG" -fi -rm -f conftest* - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - - LIBMCRYPT_CFLAGS="" - LIBMCRYPT_LIBS="" - MCRYPTLIBFOUND=nope - fi - - - - -if test $MCRYPTLIBFOUND = yep; then - CFLAGS="${CFLAGS} -DHAVE_LIBMCRYPT ${LIBMCRYPT_CFLAGS}" - LDFLAGS="${LDFLAGS} ${LIBMCRYPT_LIBS}" -fi - -if test x$MCRYPTLIBFOUND = xnope; then - echo "" - echo "" - echo "**************************************************************" - echo "MCRYPT LIBRARY (libmcrypt) COULD NOT BE LOCATED..." - echo "" - echo "The mcrypt library could not be located on your system. This" - echo "means that you will NOT be able to use any crypto algorithms" - echo "in the NSCA client or daemon." - echo "" - echo "Read the SECURITY text file for more information on why" - echo "encryption is important to ensuring that the NSCA daemon is" - echo "not abused by malicious users." - echo "" - echo "You can download libmcrypt from:" - echo "" - echo " http://mcrypt.hellug.gr/" - echo "" - echo "" - echo "NOTE: After you install the MCRYPT library on your system:" - echo "" - echo " 1. Make sure /etc/ld.so.conf has an entry for the" - echo " directory in which the MCRYPT library is installed." - echo " 2. Run 'ldconfig' to update the run-time linker options." - echo " 3. Run 'make devclean' in the NSCA distribution to clean" - echo " out any old references to your previous compile." - echo " 4. Rerun the configure script." - echo "" - echo "**************************************************************" - echo "" -fi - - -# Check whether --with-nsca_user or --without-nsca_user was given. -if test "${with_nsca_user+set}" = set; then - withval="$with_nsca_user" - nsca_user=$withval -else - nsca_user=nagios -fi - -# Check whether --with-nsca_grp or --without-nsca_grp was given. -if test "${with_nsca_grp+set}" = set; then - withval="$with_nsca_grp" - nsca_grp=$withval -else - nsca_grp=nagios -fi - -# Check whether --with-nsca_port or --without-nsca_port was given. -if test "${with_nsca_port+set}" = set; then - withval="$with_nsca_port" - nsca_port=$withval -else - nsca_port=5667 -fi - - - - -cat >> confdefs.h <&6 -echo "configure:2380: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$PERL" in - /*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_PERL="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -PERL="$ac_cv_path_PERL" -if test -n "$PERL"; then - echo "$ac_t""$PERL" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -trap '' 1 2 15 - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -DEFS=-DHAVE_CONFIG_H - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" - -trap 'rm -fr `echo "Makefile subst src/Makefile common/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@INSTALL@%$INSTALL%g -s%@CC@%$CC%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CPP@%$CPP%g -s%@SOCKETLIBS@%$SOCKETLIBS%g -s%@LIBMCRYPT_CONFIG@%$LIBMCRYPT_CONFIG%g -s%@LIBMCRYPT_CFLAGS@%$LIBMCRYPT_CFLAGS%g -s%@LIBMCRYPT_LIBS@%$LIBMCRYPT_LIBS%g -s%@nsca_user@%$nsca_user%g -s%@nsca_grp@%$nsca_grp%g -s%@nsca_port@%$nsca_port%g -s%@PERL@%$PERL%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done - -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - - -perl subst nsca.cfg -perl subst send_nsca.cfg -perl subst init-script -perl subst nsca.xinetd - - -echo "" -echo "" -echo "$ac_t""*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" 1>&6 - -echo "" -echo " General Options:" -echo " -------------------------" - -echo "$ac_t"" NSCA port: $nsca_port" 1>&6 -echo "$ac_t"" NSCA user: $nsca_user" 1>&6 -echo "$ac_t"" NSCA group: $nsca_grp" 1>&6 - - -echo "" -echo "" -echo "Review the options above for accuracy. If they look okay," -echo "type 'make all' to compile the NSCA daemon and client." -echo "" - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/configure.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/configure.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/configure.in Wed Jul 23 20:08:35 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/configure.in Wed Dec 31 19:00:00 1969 @@ -1,190 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -dnl Disable caching -define([AC_CACHE_LOAD],) -define([AC_CACHE_SAVE],) - -AC_INIT(src/nsca.c) -AC_CONFIG_HEADER(common/config.h) -AC_PREFIX_DEFAULT(/usr/local/nagios) - -PKG_NAME=nsca -PKG_VERSION="2.4" -PKG_HOME_URL="http://www.nagios.org/" -PKG_REL_DATE="07-23-2003" - -dnl Figure out how to invoke "install" and what install options to use. - -AC_PROG_INSTALL -AC_SUBST(INSTALL) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_MAKE_SET - -dnl Checks for header files. -AC_HEADER_STDC -AC_HEADER_TIME -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(db.h ctype.h errno.h fcntl.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/config.h sys/int_types.h sys/poll.h sys/types.h sys/time.h sys/resource.h sys/socket.h sys/stat.h sys/wait.h) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_STRUCT_TM -AC_TYPE_MODE_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_SIGNAL -AC_TYPE_GETGROUPS - -dnl Check lengths for later tests of u_int32_t and int32_t -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(long) - -dnl Define u_int32_t if we don't have it already (Solaris, etc.) -AC_CHECK_TYPE(uint32_t,unsigned int) -AC_CHECK_TYPE(u_int32_t,unsigned int) -if test "$ac_cv_type_u_int32_t" = no ; then - if test "$ac_cv_type_u_int32_t" = yes ; then - AC_DEFINE(U_INT32_T_IS_UINT32_T) - else - if test "$ac_cv_sizeof_int" = 4 ; then - AC_DEFINE(U_INT32_T_IS_UINT) - else - if test "$ac_cv_sizeof_long" = 4 ; then - AC_DEFINE(U_INT32_T_IS_ULONG) - else - if test "$ac_cv_sizeof_short" = 4 ; then - AC_DEFINE(U_INT32_T_IS_USHORT) - fi - fi - fi - fi -fi - -dnl Define int32_t if we don't have it already -AC_CHECK_TYPE(int32_t,int) -if test "$ac_cv_type_int32_t" = no ; then - if test "$ac_cv_sizeof_int" = 4 ; then - AC_DEFINE(INT32_T_IS_UINT) - else - if test "$ac_cv_sizeof_long" = 4 ; then - AC_DEFINE(INT32_T_IS_ULONG) - else - if test "$ac_cv_sizeof_short" = 4 ; then - AC_DEFINE(INT32_T_IS_USHORT) - fi - fi - fi -fi - -dnl Checks for library functions. -AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl") -AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket") -AC_SUBST(SOCKETLIBS) -AC_CHECK_FUNCS(strdup strstr strtoul) - -AC_MSG_CHECKING(for type of socket size) -AC_TRY_COMPILE([#include -#include -#include -], -[int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);], -[AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)], -[AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)]) - -dnl Optional mcrypt library and include paths -AC_ARG_WITH(mcrypt-lib,--with-mcrypt-lib=DIR sets location of the mcrypt client library,[ - LDFLAGS="${LDFLAGS} -L${withval}" - LD_RUN_PATH="${withval}${LD_RUN_PATH:+:}${LD_RUN_PATH}" - ]) -AC_ARG_WITH(mcrypt-inc,--with-mcrypt-inc=DIR sets location of the mcrypt client include files,[ - CFLAGS="${CFLAGS} -I${withval}" - ]) - -dnl Old checks for libmcrypt, no longer needed - 01/17/02 EG -dnl AC_CHECK_LIB(ltdl,main) -dnl AC_CHECK_LIB(mcrypt,mcrypt,MCRYPTLIBFOUND=yep) - -dnl Check for mcrypt library -MCRYPTLIBFOUND=yep -AM_PATH_LIBMCRYPT(2.4.11,,MCRYPTLIBFOUND=nope) - -dnl added for automatic use of mcrypt stark@suse.de -if test $MCRYPTLIBFOUND = yep; then - CFLAGS="${CFLAGS} -DHAVE_LIBMCRYPT ${LIBMCRYPT_CFLAGS}" - LDFLAGS="${LDFLAGS} ${LIBMCRYPT_LIBS}" -fi - -dnl Did we find the mcrypt library? -if test x$MCRYPTLIBFOUND = xnope; then - echo "" - echo "" - echo "**************************************************************" - echo "MCRYPT LIBRARY (libmcrypt) COULD NOT BE LOCATED..." - echo "" - echo "The mcrypt library could not be located on your system. This" - echo "means that you will NOT be able to use any crypto algorithms" - echo "in the NSCA client or daemon." - echo "" - echo "Read the SECURITY text file for more information on why" - echo "encryption is important to ensuring that the NSCA daemon is" - echo "not abused by malicious users." - echo "" - echo "You can download libmcrypt from:" - echo "" - echo " http://mcrypt.hellug.gr/" - echo "" - echo "" - echo "NOTE: After you install the MCRYPT library on your system:" - echo "" - echo " 1. Make sure /etc/ld.so.conf has an entry for the" - echo " directory in which the MCRYPT library is installed." - echo " 2. Run 'ldconfig' to update the run-time linker options." - echo " 3. Run 'make devclean' in the NSCA distribution to clean" - echo " out any old references to your previous compile." - echo " 4. Rerun the configure script." - echo "" - echo "**************************************************************" - echo "" -fi - - -AC_ARG_WITH(nsca_user,--with-nsca-user= sets user name to run NSCA,nsca_user=$withval,nsca_user=nagios) -AC_ARG_WITH(nsca_grp,--with-nsca-grp= sets group name to run NSCA,nsca_grp=$withval,nsca_grp=nagios) -AC_ARG_WITH(nsca_port,--with-nsca-port= sets port number for NSCA to listen on,nsca_port=$withval,nsca_port=5667) -AC_SUBST(nsca_user) -AC_SUBST(nsca_grp) -AC_SUBST(nsca_port) -AC_DEFINE_UNQUOTED(DEFAULT_SERVER_PORT,$nsca_port) - -AC_PATH_PROG(PERL,perl) -AC_OUTPUT(Makefile subst src/Makefile) - -perl subst nsca.cfg -perl subst send_nsca.cfg -perl subst init-script -perl subst nsca.xinetd - - -dnl Review options -echo "" -echo "" -AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:]) - -echo "" -echo " General Options:" -echo " -------------------------" - -AC_MSG_RESULT([ NSCA port: $nsca_port]) -AC_MSG_RESULT([ NSCA user: $nsca_user]) -AC_MSG_RESULT([ NSCA group: $nsca_grp]) - - -echo "" -echo "" -echo "Review the options above for accuracy. If they look okay," -echo "type 'make all' to compile the NSCA daemon and client." -echo "" - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/init-script /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/init-script --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/init-script Wed Mar 10 23:40:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/init-script Wed Dec 31 19:00:00 1969 @@ -1,64 +0,0 @@ -#!/bin/sh -# -# Last Modified 01-07-2003 Ethan Galstad (nagios@nagios.org) -# Notes -# This script takes care of starting and stopping the NSCA daemon. -# Modeled after init script for NRPE written by jaclu@grm.se -# -# chkconfig: 2345 80 30 -# description: nsca is a daemon for accepting service check results \ -# from applications running on other hosts. -# processname: nsca -# config: /usr/local/nagios/etc/nsca.cfg - -# Source function library -if [ -f /etc/rc.d/init.d/functions ]; then -. /etc/rc.d/init.d/functions -elif [ -f /etc/init.d/functions ]; then -. /etc/init.d/functions -elif [ -f /etc/rc.d/functions ]; then -. /etc/rc.d/functions -fi - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -NscaBin=/usr/local/bin/nsca -NscaCfg=/usr/local/etc/nsca.cfg -LockFile=/var/lock/subsys/nsca - -# See how we were called. -case "$1" in - start) - # Start daemons. - echo -n "Starting nsca: " - daemon $NscaBin -s -c $NscaCfg - RETVAL=$? - echo - touch $LockFile - ;; - stop) - # Stop daemons. - echo -n "Shutting down nsca: " - killproc nsca - echo - rm -f $LockFile - ;; - restart) - $0 stop - $0 start - ;; - status) - status nsca - ;; - *) - echo "Usage: nsca {start|stop|restart|status}" - exit 1 -esac - -exit 0 - - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/init-script.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/init-script.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/init-script.in Tue Jan 7 21:57:23 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/init-script.in Wed Dec 31 19:00:00 1969 @@ -1,64 +0,0 @@ -#!/bin/sh -# -# Last Modified 01-07-2003 Ethan Galstad (nagios@nagios.org) -# Notes -# This script takes care of starting and stopping the NSCA daemon. -# Modeled after init script for NRPE written by jaclu@grm.se -# -# chkconfig: 2345 80 30 -# description: nsca is a daemon for accepting service check results \ -# from applications running on other hosts. -# processname: nsca -# config: /usr/local/nagios/etc/nsca.cfg - -# Source function library -if [ -f /etc/rc.d/init.d/functions ]; then -. /etc/rc.d/init.d/functions -elif [ -f /etc/init.d/functions ]; then -. /etc/init.d/functions -elif [ -f /etc/rc.d/functions ]; then -. /etc/rc.d/functions -fi - -# Source networking configuration. -. /etc/sysconfig/network - -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -NscaBin=@bindir@/nsca -NscaCfg=@sysconfdir@/nsca.cfg -LockFile=/var/lock/subsys/nsca - -# See how we were called. -case "$1" in - start) - # Start daemons. - echo -n "Starting nsca: " - daemon $NscaBin -s -c $NscaCfg - RETVAL=$? - echo - touch $LockFile - ;; - stop) - # Stop daemons. - echo -n "Shutting down nsca: " - killproc nsca - echo - rm -f $LockFile - ;; - restart) - $0 stop - $0 start - ;; - status) - status nsca - ;; - *) - echo "Usage: nsca {start|stop|restart|status}" - exit 1 -esac - -exit 0 - - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/install-sh /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/install-sh --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/install-sh Sat Jun 23 12:48:53 2001 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/install-sh Wed Dec 31 19:00:00 1969 @@ -1,250 +0,0 @@ -#! /bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg Wed Mar 10 23:40:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg Wed Dec 31 19:00:00 1969 @@ -1,182 +0,0 @@ -#################################################### -# Sample NSCA Daemon Config File -# Written by: Ethan Galstad (nagios@nagios.org) -# -# Last Modified: 01-07-2002 -#################################################### - - - -# PORT NUMBER -# Port number we should wait for connections on. -# This must be a non-priveledged port (i.e. > 1024). - -server_port=5667 - - - -# SERVER ADDRESS -# Address that nrpe has to bind to in case there are -# more as one interface and we do not want nrpe to bind -# (thus listen) on all interfaces. - -#server_address=192.168.1.1 - - - -# ALLOWED HOST ADDRESSES -# This is a comma-delimited list of IP address of hosts that are allowed -# to talk to the NSCA daemon. -# -# Note: The daemon only does rudimentary checking of the client's IP -# address. I would highly recommend running as a service under -# inetd instead of as a standalone daemon and using TCP wrappers to -# limit access. - -allowed_hosts=127.0.0.1 - - - -# NSCA USER -# This determines the effective user that the NSCA daemon should run as. -# You can either supply a username or a UID. -# -# NOTE: This option is ignored if NSCA is running under either inetd or xinetd - -nsca_user=nagios - - - -# NSCA GROUP -# This determines the effective group that the NSCA daemon should run as. -# You can either supply a group name or a GID. -# -# NOTE: This option is ignored if NSCA is running under either inetd or xinetd - -nsca_group=nagios - - - -# DEBUGGING OPTION -# This option determines whether or not debugging -# messages are logged to the syslog facility. -# Values: 0 = debugging off, 1 = debugging on - -debug=0 - - - -# COMMAND FILE -# This is the location of the Nagios command file that the daemon -# should write all service check results that it receives. - -command_file=/var/spool/nagios/rw/nagios.cmd - - -# ALTERNATE DUMP FILE -# This is used to specify an alternate file the daemon should -# write service check results to in the event the command file -# does not exist. It is important to note that the command file -# is implemented as a named pipe and only exists when Nagios is -# running. You may want to modify the startup script for Nagios -# to dump the contents of this file into the command file after -# it starts Nagios. Or you may simply choose to ignore any -# check results received while Nagios was not running... - -alternate_dump_file=/var/spool/nagios/rw/nsca.dump - - - -# AGGREGATED WRITES OPTION -# This option determines whether or not the nsca daemon will -# aggregate writes to the external command file for client -# connections that contain multiple check results. If you -# are queueing service check results on remote hosts and -# sending them to the nsca daemon in bulk, you will probably -# want to enable bulk writes, as this will be a bit more -# efficient. -# Values: 0 = do not aggregate writes, 1 = aggregate writes - -aggregate_writes=0 - - - -# APPEND TO FILE OPTION -# This option determines whether or not the nsca daemon will -# will open the external command file for writing or appending. -# This option should almost *always* be set to 0! -# Values: 0 = open file for writing, 1 = open file for appending - -append_to_file=0 - - - -# MAX PACKET AGE OPTION -# This option is used by the nsca daemon to determine when client -# data is too old to be valid. Keeping this value as small as -# possible is recommended, as it helps prevent the possibility of -# "replay" attacks. This value needs to be at least as long as -# the time it takes your clients to send their data to the server. -# Values are in seconds. The max packet age cannot exceed 15 -# minutes (900 seconds). - -max_packet_age=30 - - - -# DECRYPTION PASSWORD -# This is the password/passphrase that should be used to descrypt the -# incoming packets. Note that all clients must encrypt the packets -# they send using the same password! -# IMPORTANT: You don't want all the users on this system to be able -# to read the password you specify here, so make sure to set -# restrictive permissions on this config file! - -#password= - - - -# DECRYPTION METHOD -# This option determines the method by which the nsca daemon will -# decrypt the packets it receives from the clients. The decryption -# method you choose will be a balance between security and performance, -# as strong encryption methods consume more processor resources. -# You should evaluate your security needs when choosing a decryption -# method. -# -# Note: The decryption method you specify here must match the -# encryption method the nsca clients use (as specified in -# the send_nsca.cfg file)!! -# Values: -# -# 0 = None (Do NOT use this option) -# 1 = Simple XOR (No security, just obfuscation, but very fast) -# -# 2 = DES -# 3 = 3DES (Triple DES) -# 4 = CAST-128 -# 5 = CAST-256 -# 6 = xTEA -# 7 = 3WAY -# 8 = BLOWFISH -# 9 = TWOFISH -# 10 = LOKI97 -# 11 = RC2 -# 12 = ARCFOUR -# -# 14 = RIJNDAEL-128 -# 15 = RIJNDAEL-192 -# 16 = RIJNDAEL-256 -# -# 19 = WAKE -# 20 = SERPENT -# -# 22 = ENIGMA (Unix crypt) -# 23 = GOST -# 24 = SAFER64 -# 25 = SAFER128 -# 26 = SAFER+ -# - -decryption_method=1 - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg.in Tue Jan 7 21:57:23 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.cfg.in Wed Dec 31 19:00:00 1969 @@ -1,182 +0,0 @@ -#################################################### -# Sample NSCA Daemon Config File -# Written by: Ethan Galstad (nagios@nagios.org) -# -# Last Modified: 01-07-2002 -#################################################### - - - -# PORT NUMBER -# Port number we should wait for connections on. -# This must be a non-priveledged port (i.e. > 1024). - -server_port=@nsca_port@ - - - -# SERVER ADDRESS -# Address that nrpe has to bind to in case there are -# more as one interface and we do not want nrpe to bind -# (thus listen) on all interfaces. - -#server_address=192.168.1.1 - - - -# ALLOWED HOST ADDRESSES -# This is a comma-delimited list of IP address of hosts that are allowed -# to talk to the NSCA daemon. -# -# Note: The daemon only does rudimentary checking of the client's IP -# address. I would highly recommend running as a service under -# inetd instead of as a standalone daemon and using TCP wrappers to -# limit access. - -allowed_hosts=127.0.0.1 - - - -# NSCA USER -# This determines the effective user that the NSCA daemon should run as. -# You can either supply a username or a UID. -# -# NOTE: This option is ignored if NSCA is running under either inetd or xinetd - -nsca_user=@nsca_user@ - - - -# NSCA GROUP -# This determines the effective group that the NSCA daemon should run as. -# You can either supply a group name or a GID. -# -# NOTE: This option is ignored if NSCA is running under either inetd or xinetd - -nsca_group=@nsca_grp@ - - - -# DEBUGGING OPTION -# This option determines whether or not debugging -# messages are logged to the syslog facility. -# Values: 0 = debugging off, 1 = debugging on - -debug=0 - - - -# COMMAND FILE -# This is the location of the Nagios command file that the daemon -# should write all service check results that it receives. - -command_file=@localstatedir@/rw/nagios.cmd - - -# ALTERNATE DUMP FILE -# This is used to specify an alternate file the daemon should -# write service check results to in the event the command file -# does not exist. It is important to note that the command file -# is implemented as a named pipe and only exists when Nagios is -# running. You may want to modify the startup script for Nagios -# to dump the contents of this file into the command file after -# it starts Nagios. Or you may simply choose to ignore any -# check results received while Nagios was not running... - -alternate_dump_file=@localstatedir@/rw/nsca.dump - - - -# AGGREGATED WRITES OPTION -# This option determines whether or not the nsca daemon will -# aggregate writes to the external command file for client -# connections that contain multiple check results. If you -# are queueing service check results on remote hosts and -# sending them to the nsca daemon in bulk, you will probably -# want to enable bulk writes, as this will be a bit more -# efficient. -# Values: 0 = do not aggregate writes, 1 = aggregate writes - -aggregate_writes=0 - - - -# APPEND TO FILE OPTION -# This option determines whether or not the nsca daemon will -# will open the external command file for writing or appending. -# This option should almost *always* be set to 0! -# Values: 0 = open file for writing, 1 = open file for appending - -append_to_file=0 - - - -# MAX PACKET AGE OPTION -# This option is used by the nsca daemon to determine when client -# data is too old to be valid. Keeping this value as small as -# possible is recommended, as it helps prevent the possibility of -# "replay" attacks. This value needs to be at least as long as -# the time it takes your clients to send their data to the server. -# Values are in seconds. The max packet age cannot exceed 15 -# minutes (900 seconds). - -max_packet_age=30 - - - -# DECRYPTION PASSWORD -# This is the password/passphrase that should be used to descrypt the -# incoming packets. Note that all clients must encrypt the packets -# they send using the same password! -# IMPORTANT: You don't want all the users on this system to be able -# to read the password you specify here, so make sure to set -# restrictive permissions on this config file! - -#password= - - - -# DECRYPTION METHOD -# This option determines the method by which the nsca daemon will -# decrypt the packets it receives from the clients. The decryption -# method you choose will be a balance between security and performance, -# as strong encryption methods consume more processor resources. -# You should evaluate your security needs when choosing a decryption -# method. -# -# Note: The decryption method you specify here must match the -# encryption method the nsca clients use (as specified in -# the send_nsca.cfg file)!! -# Values: -# -# 0 = None (Do NOT use this option) -# 1 = Simple XOR (No security, just obfuscation, but very fast) -# -# 2 = DES -# 3 = 3DES (Triple DES) -# 4 = CAST-128 -# 5 = CAST-256 -# 6 = xTEA -# 7 = 3WAY -# 8 = BLOWFISH -# 9 = TWOFISH -# 10 = LOKI97 -# 11 = RC2 -# 12 = ARCFOUR -# -# 14 = RIJNDAEL-128 -# 15 = RIJNDAEL-192 -# 16 = RIJNDAEL-256 -# -# 19 = WAKE -# 20 = SERPENT -# -# 22 = ENIGMA (Unix crypt) -# 23 = GOST -# 24 = SAFER64 -# 25 = SAFER128 -# 26 = SAFER+ -# - -decryption_method=1 - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd Wed Mar 10 23:40:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd Wed Dec 31 19:00:00 1969 @@ -1,15 +0,0 @@ -# default: on -# description: NSCA (Nagios Service Check Acceptor) -service nsca -{ - flags = REUSE - socket_type = stream - wait = no - user = nagios - group = nagios - server = /usr/local/bin/nsca - server_args = -c /usr/local/etc/nsca.cfg --inetd - log_on_failure += USERID - disable = no - only_from = 127.0.0.1 -} diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd.in Tue Jan 7 21:57:23 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/nsca.xinetd.in Wed Dec 31 19:00:00 1969 @@ -1,15 +0,0 @@ -# default: on -# description: NSCA (Nagios Service Check Acceptor) -service nsca -{ - flags = REUSE - socket_type = stream - wait = no - user = @nsca_user@ - group = @nsca_grp@ - server = @bindir@/nsca - server_args = -c @sysconfdir@/nsca.cfg --inetd - log_on_failure += USERID - disable = no - only_from = 127.0.0.1 -} diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg Wed Mar 10 23:40:50 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg Wed Dec 31 19:00:00 1969 @@ -1,63 +0,0 @@ -#################################################### -# Sample NSCA Client Config File -# Written by: Ethan Galstad (nagios@nagios.org) -# -# Last Modified: 02-21-2002 -#################################################### - - -# ENCRYPTION PASSWORD -# This is the password/passphrase that should be used to encrypt the -# outgoing packets. Note that the nsca daemon must use the same -# password when decrypting the packet! -# IMPORTANT: You don't want all the users on this system to be able -# to read the password you specify here, so make sure to set -# restrictive permissions on this config file! - -#password= - - - -# ENCRYPTION METHOD -# This option determines the method by which the send_nsca client will -# encrypt the packets it sends to the nsca daemon. The encryption -# method you choose will be a balance between security and performance, -# as strong encryption methods consume more processor resources. -# You should evaluate your security needs when choosing an encryption -# method. -# -# Note: The encryption method you specify here must match the -# decryption method the nsca daemon uses (as specified in -# the nsca.cfg file)!! -# Values: -# 0 = None (Do NOT use this option) -# 1 = Simple XOR (No security, just obfuscation, but very fast) -# -# 2 = DES -# 3 = 3DES (Triple DES) -# 4 = CAST-128 -# 5 = CAST-256 -# 6 = xTEA -# 7 = 3WAY -# 8 = BLOWFISH -# 9 = TWOFISH -# 10 = LOKI97 -# 11 = RC2 -# 12 = ARCFOUR -# -# 14 = RIJNDAEL-128 -# 15 = RIJNDAEL-192 -# 16 = RIJNDAEL-256 -# -# 19 = WAKE -# 20 = SERPENT -# -# 22 = ENIGMA (Unix crypt) -# 23 = GOST -# 24 = SAFER64 -# 25 = SAFER128 -# 26 = SAFER+ -# - -encryption_method=1 - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg.in Tue Jun 11 00:30:38 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/send_nsca.cfg.in Wed Dec 31 19:00:00 1969 @@ -1,63 +0,0 @@ -#################################################### -# Sample NSCA Client Config File -# Written by: Ethan Galstad (nagios@nagios.org) -# -# Last Modified: 02-21-2002 -#################################################### - - -# ENCRYPTION PASSWORD -# This is the password/passphrase that should be used to encrypt the -# outgoing packets. Note that the nsca daemon must use the same -# password when decrypting the packet! -# IMPORTANT: You don't want all the users on this system to be able -# to read the password you specify here, so make sure to set -# restrictive permissions on this config file! - -#password= - - - -# ENCRYPTION METHOD -# This option determines the method by which the send_nsca client will -# encrypt the packets it sends to the nsca daemon. The encryption -# method you choose will be a balance between security and performance, -# as strong encryption methods consume more processor resources. -# You should evaluate your security needs when choosing an encryption -# method. -# -# Note: The encryption method you specify here must match the -# decryption method the nsca daemon uses (as specified in -# the nsca.cfg file)!! -# Values: -# 0 = None (Do NOT use this option) -# 1 = Simple XOR (No security, just obfuscation, but very fast) -# -# 2 = DES -# 3 = 3DES (Triple DES) -# 4 = CAST-128 -# 5 = CAST-256 -# 6 = xTEA -# 7 = 3WAY -# 8 = BLOWFISH -# 9 = TWOFISH -# 10 = LOKI97 -# 11 = RC2 -# 12 = ARCFOUR -# -# 14 = RIJNDAEL-128 -# 15 = RIJNDAEL-192 -# 16 = RIJNDAEL-256 -# -# 19 = WAKE -# 20 = SERPENT -# -# 22 = ENIGMA (Unix crypt) -# 23 = GOST -# 24 = SAFER64 -# 25 = SAFER128 -# 26 = SAFER+ -# - -encryption_method=1 - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/Makefile /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/Makefile --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/Makefile Wed Mar 10 23:40:49 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/Makefile Wed Dec 31 19:00:00 1969 @@ -1,35 +0,0 @@ -# Generated automatically from Makefile.in by configure. -############################### -# Makefile for NSCA -# -# Last Modified: 03-31-2003 -############################### - - -# Source code directories -SRC_COMMON=../common - -CC=cc -CFLAGS=-O2 -pipe -funroll-loops -march=pentiumpro -DHAVE_LIBMCRYPT -I/usr/local/include -DHAVE_CONFIG_H -LDFLAGS= -L/usr/local/lib -lmcrypt -SOCKETLIBS= - -CP=@CP@ - - -all: nsca send_nsca - -nsca: nsca.c netutils.c netutils.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) nsca.c netutils.c utils.c - -send_nsca: send_nsca.c netutils.c netutils.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) send_nsca.c netutils.c utils.c - -clean: - rm -f core nsca send_nsca - rm -f *~ */*~ - -distclean: clean - rm -f Makefile - -devclean: distclean diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/Makefile.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/Makefile.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/Makefile.in Mon Mar 31 22:48:14 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/Makefile.in Wed Dec 31 19:00:00 1969 @@ -1,34 +0,0 @@ -############################### -# Makefile for NSCA -# -# Last Modified: 03-31-2003 -############################### - - -# Source code directories -SRC_COMMON=../common - -CC=@CC@ -CFLAGS=@CFLAGS@ @DEFS@ -LDFLAGS=@LDFLAGS@ @LIBS@ -SOCKETLIBS=@SOCKETLIBS@ - -CP=@CP@ - - -all: nsca send_nsca - -nsca: nsca.c netutils.c netutils.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) nsca.c netutils.c utils.c - -send_nsca: send_nsca.c netutils.c netutils.h utils.c utils.h $(SRC_COMMON)/common.h $(SRC_COMMON)/config.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(SOCKETLIBS) send_nsca.c netutils.c utils.c - -clean: - rm -f core nsca send_nsca - rm -f *~ */*~ - -distclean: clean - rm -f Makefile - -devclean: distclean diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/netutils.c /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/netutils.c --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/netutils.c Thu Oct 24 23:59:49 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/netutils.c Wed Dec 31 19:00:00 1969 @@ -1,275 +0,0 @@ -/**************************************************************************** - * - * NETUTILS.C - NSCA Network Utilities - * - * License: GPL - * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org) - * - * Last Modified: 10-24-2002 - * - * Description: - * - * This file contains common network functions used in nrpe and check_nrpe. - * - * License Information: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ****************************************************************************/ - -#include "../common/common.h" -#include "netutils.h" - - - -/* opens a connection to a remote host/tcp port */ -int my_tcp_connect(char *host_name,int port,int *sd){ - int result; - - result=my_connect(host_name,port,sd,"tcp"); - - return result; - } - - -/* opens a tcp or udp connection to a remote host */ -int my_connect(char *host_name,int port,int *sd,char *proto){ - struct sockaddr_in servaddr; - struct hostent *hp; - struct protoent *ptrp; - int result; - - bzero((char *)&servaddr,sizeof(servaddr)); - servaddr.sin_family=AF_INET; - servaddr.sin_port=htons(port); - - /* try to bypass using a DNS lookup if this is just an IP address */ - if(!my_inet_aton(host_name,&servaddr.sin_addr)){ - - /* else do a DNS lookup */ - hp=gethostbyname((const char *)host_name); - if(hp==NULL){ - printf("Invalid host name '%s'\n",host_name); - return STATE_UNKNOWN; - } - - memcpy(&servaddr.sin_addr,hp->h_addr,hp->h_length); - } - - /* map transport protocol name to protocol number */ - if(((ptrp=getprotobyname(proto)))==NULL){ - printf("Cannot map \"%s\" to protocol number\n",proto); - return STATE_UNKNOWN; - } - - /* create a socket */ - *sd=socket(PF_INET,(!strcmp(proto,"udp"))?SOCK_DGRAM:SOCK_STREAM,ptrp->p_proto); - if(*sd<0){ - printf("Socket creation failed\n"); - return STATE_UNKNOWN; - } - - /* open a connection */ - result=connect(*sd,(struct sockaddr *)&servaddr,sizeof(servaddr)); - if(result<0){ - switch(errno){ - case ECONNREFUSED: - printf("Connection refused by host\n"); - break; - case ETIMEDOUT: - printf("Timeout while attempting connection\n"); - break; - case ENETUNREACH: - printf("Network is unreachable\n"); - break; - default: - printf("Connection refused or timed out\n"); - } - - return STATE_CRITICAL; - } - - return STATE_OK; - } - - - -/* This code was taken from Fyodor's nmap utility, which was originally taken from - the GLIBC 2.0.6 libraries because Solaris doesn't contain the inet_aton() funtion. */ -int my_inet_aton(register const char *cp, struct in_addr *addr){ - register unsigned int val; /* changed from u_long --david */ - register int base, n; - register char c; - u_int parts[4]; - register u_int *pp = parts; - - c=*cp; - - for(;;){ - - /* - * Collect number up to ``.''. - * Values are specified as for C: - * 0x=hex, 0=octal, isdigit=decimal. - */ - if (!isdigit((int)c)) - return (0); - val=0; - base=10; - - if(c=='0'){ - c=*++cp; - if(c=='x'||c=='X') - base=16,c=*++cp; - else - base=8; - } - - for(;;){ - if(isascii((int)c) && isdigit((int)c)){ - val=(val*base)+(c -'0'); - c=*++cp; - } - else if(base==16 && isascii((int)c) && isxdigit((int)c)){ - val=(val<<4) | (c+10-(islower((int)c)?'a':'A')); - c = *++cp; - } - else - break; - } - - if(c=='.'){ - - /* - * Internet format: - * a.b.c.d - * a.b.c (with c treated as 16 bits) - * a.b (with b treated as 24 bits) - */ - if(pp>=parts+3) - return (0); - *pp++=val; - c=*++cp; - } - else - break; - } - - /* Check for trailing characters */ - if(c!='\0' && (!isascii((int)c) || !isspace((int)c))) - return (0); - - /* Concoct the address according to the number of parts specified */ - n=pp-parts+1; - switch(n){ - - case 0: - return (0); /* initial nondigit */ - - case 1: /* a -- 32 bits */ - break; - - case 2: /* a.b -- 8.24 bits */ - if(val>0xffffff) - return (0); - val|=parts[0]<<24; - break; - - case 3: /* a.b.c -- 8.8.16 bits */ - if(val>0xffff) - return (0); - val|=(parts[0]<< 24) | (parts[1]<<16); - break; - - case 4: /* a.b.c.d -- 8.8.8.8 bits */ - if(val>0xff) - return (0); - val|=(parts[0]<<24) | (parts[1]<<16) | (parts[2]<<8); - break; - } - - if(addr) - addr->s_addr=htonl(val); - - return (1); - } - - - -/* sends all data - thanks to Beej's Guide to Network Programming */ -int sendall(int s, char *buf, int *len){ - int total=0; - int bytesleft=*len; - int n; - - while(total<*len){ - n=send(s,buf+total,bytesleft,0); - if(n==-1) - break; - total+=n; - bytesleft-=n; - } - - /* return number of bytes actually send here */ - *len=total; - - /* return -1 on failure, 0 on success */ - return n==-1?-1:0; - } - - -/* receives all data - modelled after sendall() */ -int recvall(int s, char *buf, int *len, int timeout){ - int total=0; - int bytesleft=*len; - int n; - time_t start_time; - time_t current_time; - - /* clear the receive buffer */ - bzero(buf,*len); - - time(&start_time); - - /* receive all data */ - while(total<*len){ - - /* receive some data */ - n=recv(s,buf+total,bytesleft,0); - - /* no data has arrived yet (non-blocking socket) */ - if(n==-1 && errno==EAGAIN){ - time(¤t_time); - if(current_time-start_time>timeout) - break; - sleep(1); - continue; - } - - /* receive error or client disconnect */ - else if(n<=0) - break; - - /* apply bytes we received */ - total+=n; - bytesleft-=n; - } - - /* return number of bytes actually received here */ - *len=total; - - /* return <=0 on failure, bytes received on success */ - return (n<=0)?n:total; - } diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/netutils.h /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/netutils.h --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/netutils.h Thu Feb 21 20:50:43 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/netutils.h Wed Dec 31 19:00:00 1969 @@ -1,45 +0,0 @@ -/************************************************************************************************ - * - * NETUTILS.H - NSCA Network Utilities Include File - * - * License: GPL - * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org) - * - * Last Modified: 02-21-2002 - * - * Description: - * - * This file contains common include files and function definitions used in many of the plugins. - * - * License Information: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ************************************************************************************************/ - -#include "../common/config.h" - -int my_tcp_connect(char *,int,int *); -int my_connect(char *,int,int *,char *); - -int my_inet_aton(register const char *,struct in_addr *); - -int sendall(int,char *,int *); -int recvall(int,char *,int *,int); - - - - - Binary files /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/nsca and /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/nsca differ diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/nsca.c /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/nsca.c --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/nsca.c Wed Jul 23 20:08:36 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/nsca.c Wed Dec 31 19:00:00 1969 @@ -1,1224 +0,0 @@ -/******************************************************************************* - * - * NSCA.C - Nagios Service Check Acceptor - * Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org) - * License: GPL - * - * Last Modified: 07-23-2003 - * - * Command line: NSCA -c [mode] - * - * Description: - * - * This program is designed to run as a daemon on the main Nagios machine - * and accept service check results from remote hosts. - * - ******************************************************************************/ - -#include "../common/common.h" -#include "../common/config.h" -#include "netutils.h" -#include "utils.h" - - -static char allowed_hosts[MAX_INPUT_BUFFER]; -static int server_port=DEFAULT_SERVER_PORT; -static char server_address[16]="0.0.0.0"; -static int socket_timeout=DEFAULT_SOCKET_TIMEOUT; - -static char config_file[MAX_INPUT_BUFFER]="nsca.cfg"; -static char alternate_dump_file[MAX_INPUT_BUFFER]="/dev/null"; -static char command_file[MAX_INPUT_BUFFER]=""; -static char password[MAX_INPUT_BUFFER]=""; - -static void handle_events(void); -static void wait_for_connections(void); -static void handle_connection(int,void *); -static void accept_connection(int,void *); -static void handle_connection_read(int,void *); -static int process_arguments(int,char **); -static int read_config_file(char *); -static int is_an_allowed_host(char *); -static int open_command_file(void); -static void close_command_file(void); -static void install_child_handler(void); -static int drop_privileges(char *,char *); -static int write_check_result(char *,char *,int,char *,time_t); -static void do_exit(int); - -static enum { OPTIONS_ERROR, SINGLE_PROCESS_DAEMON, MULTI_PROCESS_DAEMON, INETD } mode=SINGLE_PROCESS_DAEMON; -static int debug=FALSE; -static int aggregate_writes=FALSE; -static int decryption_method=ENCRYPT_XOR; -static int append_to_file=FALSE; -static unsigned long max_packet_age=30; - -char *nsca_user=NULL; -char *nsca_group=NULL; - -int show_help=FALSE; -int show_license=FALSE; -int show_version=FALSE; - -static FILE *command_file_fp=NULL; - -struct handler_entry{ - void (*handler)(int, void *); - void *data; - int fd; - }; - -struct handler_entry *rhand=NULL; -struct handler_entry *whand=NULL; -struct pollfd *pfds=NULL; -int maxrhand=0; -int maxwhand=0; -int maxpfds=0; -int nrhand=0; -int nwhand=0; -int npfds=0; - - - -int main(int argc, char **argv){ - char buffer[MAX_INPUT_BUFFER]; - int result; - - - /* process command-line arguments */ - result=process_arguments(argc,argv); - - if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE){ - - if(result!=OK) - printf("Incorrect command line arguments supplied\n"); - printf("\n"); - printf("NSCA - Nagios Service Check Acceptor\n"); - printf("Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org)\n"); - printf("Version: %s\n",PROGRAM_VERSION); - printf("Last Modified: %s\n",MODIFICATION_DATE); - printf("License: GPL\n"); - printf("Encryption Routines: "); -#ifdef HAVE_LIBMCRYPT - printf("AVAILABLE"); -#else - printf("NOT AVAILABLE"); -#endif - printf("\n"); - printf("\n"); - } - - if(result!=OK || show_help==TRUE){ - printf("Usage: %s -c [mode]\n",argv[0]); - printf("\n"); - printf("Options:\n"); - printf(" = Name of config file to use\n"); - printf(" [mode] = Determines how NSCA should run. Valid modes:\n"); - printf(" --inetd = Run as a service under inetd or xinetd\n"); - printf(" --daemon = Run as a standalone multi-process daemon\n"); - printf(" --single = Run as a standalone single-process daemon (default)\n"); - printf("\n"); - printf("Notes:\n"); - printf("This program is designed to accept passive check results from\n"); - printf("remote hosts that use the send_nsca utility. Can run as a service\n"); - printf("under inetd or xinetd (read the docs for info on this), or as a\n"); - printf("standalone daemon.\n"); - printf("\n"); - } - - if(show_license==TRUE) - display_license(); - - if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE) - do_exit(STATE_UNKNOWN); - - - /* open a connection to the syslog facility */ - openlog("nsca",LOG_PID,LOG_DAEMON); - - /* make sure the config file uses an absolute path */ - if(config_file[0]!='/'){ - - /* save the name of the config file */ - strncpy(buffer,config_file,sizeof(buffer)); - buffer[sizeof(buffer)-1]='\0'; - - /* get absolute path of current working directory */ - strcpy(config_file,""); - getcwd(config_file,sizeof(config_file)); - - /* append a forward slash */ - strncat(config_file,"/",sizeof(config_file)-2); - config_file[sizeof(config_file)-1]='\0'; - - /* append the config file to the path */ - strncat(config_file,buffer,sizeof(config_file)-strlen(config_file)-1); - config_file[sizeof(config_file)-1]='\0'; - } - - /* read the config file */ - result=read_config_file(config_file); - - /* exit if there are errors... */ - if(result==ERROR) - do_exit(STATE_CRITICAL); - - /* generate the CRC 32 table */ - generate_crc32_table(); - - - /* how should we handle client connections? */ - switch(mode){ - - case INETD: - /* if we're running under inetd, handle one connection and get out */ - handle_connection(0,NULL); - break; - - case MULTI_PROCESS_DAEMON: - /* older style, mult-process daemon */ - /* execution cascades below... */ - install_child_handler(); - - case SINGLE_PROCESS_DAEMON: - /* daemonize and start listening for requests... */ - if(fork()==0){ - - /* we're a daemon - set up a new process group */ - setsid(); - - /* ignore SIGHUP */ - signal(SIGHUP, SIG_IGN); - - /* close standard file descriptors */ - close(0); - close(1); - close(2); - - /* redirect standard descriptors to /dev/null */ - open("/dev/null",O_RDONLY); - open("/dev/null",O_WRONLY); - open("/dev/null",O_WRONLY); - - /* drop privileges */ - drop_privileges(nsca_user,nsca_group); - - /* wait for connections */ - wait_for_connections(); - } - break; - - default: - break; - } - - /* We are now running in daemon mode, or the connection handed over by inetd has - been completed, so the parent process exits */ - do_exit(STATE_OK); - - /* keep the compilers happy... */ - return STATE_OK; - } - - - -/* exit cleanly */ -static void do_exit(int return_code){ - - /* close the command file if its still open */ - if (command_file_fp!=NULL) - close_command_file(); - - /*** CLEAR SENSITIVE INFO FROM MEMORY ***/ - - /* overwrite password */ - clear_buffer(password,sizeof(password)); - - /* disguise decryption method */ - decryption_method=-1; - - exit(return_code); - } - - - -/* read in the configuration file */ -static int read_config_file(char *filename){ - FILE *fp; - char input_buffer[MAX_INPUT_BUFFER]; - char *varname; - char *varvalue; - int line; - - /* open the config file for reading */ - fp=fopen(filename,"r"); - - /* exit if we couldn't open the config file */ - if(fp==NULL){ - syslog(LOG_ERR,"Could not open config file '%s' for reading\n",filename); - return ERROR; - } - - line=0; - while(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){ - - line++; - - /* skip comments and blank lines */ - if(input_buffer[0]=='#') - continue; - if(input_buffer[0]=='\0') - continue; - if(input_buffer[0]=='\n') - continue; - - /* get the variable name */ - varname=strtok(input_buffer,"="); - if(varname==NULL){ - syslog(LOG_ERR,"No variable name specified in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - - /* get the variable value */ - varvalue=strtok(NULL,"\n"); - if(varvalue==NULL){ - syslog(LOG_ERR,"No variable value specified in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - - if(!strcmp(varname,"server_port")){ - server_port=atoi(varvalue); - if((server_port<1024 && (geteuid()!=0)) || server_port<0){ - syslog(LOG_ERR,"Invalid port number specified in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - } - else if(!strcmp(varname,"server_address")){ - strncpy(server_address,varvalue,sizeof(server_address) - 1); - server_address[sizeof(server_address)-1]='\0'; - } - else if(!strcmp(varname,"allowed_hosts")){ - if(strlen(varvalue)>sizeof(allowed_hosts)-1){ - syslog(LOG_ERR,"Allowed hosts list too long in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - strncpy(allowed_hosts,varvalue,sizeof(allowed_hosts)); - allowed_hosts[sizeof(allowed_hosts)-1]='\0'; - } - else if(strstr(input_buffer,"command_file")){ - if(strlen(varvalue)>sizeof(command_file)-1){ - syslog(LOG_ERR,"Command file name is too long in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - strncpy(command_file,varvalue,sizeof(command_file)-1); - command_file[sizeof(command_file)-1]='\0'; - } - else if(strstr(input_buffer,"alternate_dump_file")){ - if(strlen(varvalue)>sizeof(alternate_dump_file)-1){ - syslog(LOG_ERR,"Alternate dump file name is too long in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - strncpy(alternate_dump_file,varvalue,sizeof(alternate_dump_file)-1); - alternate_dump_file[sizeof(alternate_dump_file)-1]='\0'; - } - else if(strstr(input_buffer,"password")){ - if(strlen(varvalue)>sizeof(password)-1){ - syslog(LOG_ERR,"Password is too long in config file '%s' - Line %d\n",filename,line); - return ERROR; - } - strncpy(password,varvalue,sizeof(password)-1); - password[sizeof(password)-1]='\0'; - } - else if(strstr(input_buffer,"decryption_method")){ - - decryption_method=atoi(varvalue); - - switch(decryption_method){ - case ENCRYPT_NONE: - case ENCRYPT_XOR: - break; -#ifdef HAVE_LIBMCRYPT - case ENCRYPT_DES: - case ENCRYPT_3DES: - case ENCRYPT_CAST128: - case ENCRYPT_CAST256: - case ENCRYPT_XTEA: - case ENCRYPT_3WAY: - case ENCRYPT_BLOWFISH: - case ENCRYPT_TWOFISH: - case ENCRYPT_LOKI97: - case ENCRYPT_RC2: - case ENCRYPT_ARCFOUR: - case ENCRYPT_RIJNDAEL128: - case ENCRYPT_RIJNDAEL192: - case ENCRYPT_RIJNDAEL256: - case ENCRYPT_WAKE: - case ENCRYPT_SERPENT: - case ENCRYPT_ENIGMA: - case ENCRYPT_GOST: - case ENCRYPT_SAFER64: - case ENCRYPT_SAFER128: - case ENCRYPT_SAFERPLUS: - break; -#endif - default: - syslog(LOG_ERR,"Invalid decryption method (%d) in config file '%s' - Line %d\n",decryption_method,filename,line); -#ifndef HAVE_LIBMCRYPT - if(decryption_method>=2) - syslog(LOG_ERR,"Daemon was not compiled with mcrypt library, so decryption is unavailable.\n"); -#endif - return ERROR; - } - } - else if(strstr(input_buffer,"debug")){ - if(atoi(varvalue)>0) - debug=TRUE; - else - debug=FALSE; - } - else if(strstr(input_buffer,"aggregate_writes")){ - if(atoi(varvalue)>0) - aggregate_writes=TRUE; - else - aggregate_writes=FALSE; - } - else if(strstr(input_buffer,"append_to_file")){ - if(atoi(varvalue)>0) - append_to_file=TRUE; - else - append_to_file=FALSE; - } - else if(!strcmp(varname,"max_packet_age")){ - max_packet_age=strtoul(varvalue,NULL,10); - if(max_packet_age>900){ - syslog(LOG_ERR,"Max packet age cannot be greater than 15 minutes (900 seconds).\n"); - return ERROR; - } - } - - else if(!strcmp(varname,"nsca_user")) - nsca_user=strdup(varvalue); - - else if(!strcmp(varname,"nsca_group")) - nsca_group=strdup(varvalue); - - else{ - syslog(LOG_ERR,"Unknown option specified in config file '%s' - Line %d\n",filename,line); - - return ERROR; - } - } - - /* close the config file */ - fclose(fp); - - return OK; - } - - - -/* get rid of all the children we can... */ -static void reap_children(int sig){ - - while(waitpid(-1,NULL,WNOHANG)>0); - - return; - } - - - -/* install reap_children() signal handler */ -static void install_child_handler(void){ - struct sigaction sa; - - sa.sa_handler=reap_children; - sa.sa_flags=SA_NOCLDSTOP; - sigaction(SIGCHLD,&sa,NULL); - - return; - } - - - -/* register a file descriptor to be polled for an event set */ -static void register_poll(short events, int fd){ - int i; - - /* if it's already in the list, just flag the events */ - for(i=0;i maxpfds){ - maxpfds++; - pfds=realloc(pfds, sizeof(struct pollfd) * maxpfds); - } - - pfds[npfds].fd=fd; - pfds[npfds].events=events; - npfds++; - } - - - -/* register a read handler */ -static void register_read_handler(int fd, void (*fp)(int, void *), void *data){ - int i; - - /* register our interest in this descriptor */ - register_poll(POLLIN,fd); - - /* if it's already in the list, just update the handler */ - for(i=0;i maxrhand){ - maxrhand++; - rhand=realloc(rhand, sizeof(struct handler_entry) * maxrhand); - } - - rhand[nrhand].fd=fd; - rhand[nrhand].handler=fp; - rhand[nrhand].data=data; - nrhand++; - } - - - -/* register a write handler */ -static void register_write_handler(int fd, void (*fp)(int, void *), void *data){ - int i; - - /* register our interest in this descriptor */ - register_poll(POLLOUT,fd); - - /* if it's already in the list, just update the handler */ - for(i=0;i maxwhand){ - maxwhand++; - whand=realloc(whand, sizeof(struct handler_entry) * maxwhand); - } - - whand[nwhand].fd=fd; - whand[nwhand].handler=fp; - whand[nwhand].data=data; - nwhand++; - } - - - -/* find read handler */ -static int find_rhand(int fd){ - int i; - - for(i=0;i=0) - break; - if(errno==EWOULDBLOCK || errno==EINTR){ - if(mode==MULTI_PROCESS_DAEMON) - sleep(1); - else - return; - } - else - break; - } - - /* hey, there was an error... */ - if(new_sd<0){ - - /* log error to syslog facility */ - syslog(LOG_ERR,"Network server accept failure (%d: %s)",errno,strerror(errno)); - - /* close socket prior to exiting */ - close(sock); - return; - } - - /* fork() if we have to... */ - if(mode==MULTI_PROCESS_DAEMON){ - - pid=fork(); - if(pid){ - /* parent doesn't need the new connection */ - close(new_sd); - return; - } - else{ - /* child does not need to listen for connections */ - close(sock); - } - } - - /* find out who just connected... */ - addrlen=sizeof(addr); - rc=getpeername(new_sd,&addr,&addrlen); - - if(rc<0){ - /* log error to syslog facility */ - syslog(LOG_ERR,"Error: Network server getpeername() failure (%d: %s)",errno,strerror(errno)); - - /* close socket prior to exiting */ - close(new_sd); - if(mode==MULTI_PROCESS_DAEMON) - do_exit(STATE_CRITICAL); - return; - } - - nptr=(struct sockaddr_in *)&addr; - - /* log info to syslog facility */ - if(debug==TRUE) - syslog(LOG_DEBUG,"Connection from %s port %d",inet_ntoa(nptr->sin_addr),nptr->sin_port); - - /* is this is blessed machine? */ - snprintf(connecting_host,sizeof(connecting_host),"%s",inet_ntoa(nptr->sin_addr)); - connecting_host[sizeof(connecting_host)-1]='\0'; - - if(!is_an_allowed_host(connecting_host)){ - - /* log error to syslog facility */ - syslog(LOG_ERR,"Host %s is not allowed to talk to us!", inet_ntoa(nptr->sin_addr)); - close(new_sd); - if(mode==MULTI_PROCESS_DAEMON) - do_exit(STATE_CRITICAL); - return; - } - else{ - - /* log info to syslog facility */ - if(debug==TRUE) - syslog(LOG_DEBUG,"Host address checks out ok"); - - if(mode==SINGLE_PROCESS_DAEMON) - /* mark the connection as ready to be handled */ - register_write_handler(new_sd, handle_connection, NULL); - else - /* handle the client connection */ - handle_connection(new_sd, NULL); - } - } - - - -/* handle a client connection */ -static void handle_connection(int sock, void *data){ - init_packet send_packet; - int bytes_to_send; - int rc; - int flags; - time_t packet_send_time; - struct crypt_instance *CI; - - - /* log info to syslog facility */ - if(debug==TRUE) - syslog(LOG_INFO,"Handling the connection..."); - - /* socket should be non-blocking */ - fcntl(sock,F_GETFL,&flags); - fcntl(sock,F_SETFL,flags|O_NONBLOCK); - - /* initialize encryption/decryption routines (server generates the IV to use and send to the client) */ - if(encrypt_init(password,decryption_method,NULL,&CI)!=OK){ - close(sock); - if(mode==MULTI_PROCESS_DAEMON) - do_exit(STATE_CRITICAL); - return; - } - - /* create initial packet to send to client (contains random IV and timestamp) */ - memcpy(&send_packet.iv[0],CI->transmitted_iv,TRANSMITTED_IV_SIZE); - time(&packet_send_time); - send_packet.timestamp=(u_int32_t)htonl(packet_send_time); - - /* send client the initial packet */ - bytes_to_send=sizeof(send_packet); - rc=sendall(sock,(char *)&send_packet,&bytes_to_send); - - /* there was an error sending the packet */ - if(rc==-1){ - syslog(LOG_ERR,"Could not send init packet to client\n"); - encrypt_cleanup(decryption_method,CI); - close(sock); - if(mode==MULTI_PROCESS_DAEMON) - do_exit(STATE_CRITICAL); - return; - } - - /* for some reason we didn't send all the bytes we were supposed to */ - else if(bytes_to_sendcurrent_time){ - syslog(LOG_ERR,"Dropping packet with future timestamp."); - /*return;*/ - close(sock); - if(mode==SINGLE_PROCESS_DAEMON) - return; - else - do_exit(STATE_OK); - } - else{ - packet_age=(unsigned long)(current_time-packet_time); - if(packet_age > max_packet_age){ - syslog(LOG_ERR,"Dropping packet with stale timestamp - packet was %lu seconds old.",packet_age); - /*return;*/ - close(sock); - if(mode==SINGLE_PROCESS_DAEMON) - return; - else - do_exit(STATE_OK); - } - } - - /**** GET THE SERVICE CHECK INFORMATION ****/ - - /* plugin return code */ - return_code=ntohs(receive_packet.return_code); - - /* host name */ - strncpy(host_name,receive_packet.host_name,sizeof(host_name)-1); - host_name[sizeof(host_name)-1]='\0'; - - /* service description */ - strncpy(svc_description,receive_packet.svc_description,sizeof(svc_description)-1); - svc_description[sizeof(svc_description)-1]='\0'; - - /* plugin output */ - strncpy(plugin_output,receive_packet.plugin_output,sizeof(plugin_output)-1); - plugin_output[sizeof(plugin_output)-1]='\0'; - - /* log info to syslog facility */ - if(debug==TRUE){ - if(!strcmp(svc_description,"")) - syslog(LOG_NOTICE,"HOST CHECK -> Host Name: '%s', Return Code: '%d', Output: '%s'",host_name,return_code,plugin_output); - else - syslog(LOG_NOTICE,"SERVICE CHECK -> Host Name: '%s', Service Description: '%s', Return Code: '%d', Output: '%s'",host_name,svc_description,return_code,plugin_output); - } - - /* write the check result to the external command file. - * Note: it's OK to hang at this point if the write doesn't succeed, as there's - * no way we could handle any other connection properly anyway. so we don't - * use poll() - which fails on a pipe with any data, so it would cause us to - * only ever write one command at a time into the pipe. - */ - write_check_result(host_name,svc_description,return_code,plugin_output,time(NULL)); - - return; - } - - - -/* checks to see if a given host is allowed to talk to us */ -static int is_an_allowed_host(char *connecting_host){ - char temp_buffer[MAX_INPUT_BUFFER]; - char *temp_ptr; - - strncpy(temp_buffer,allowed_hosts,sizeof(temp_buffer)); - temp_buffer[sizeof(temp_buffer)-1]='\0'; - - for(temp_ptr=strtok(temp_buffer,",");temp_ptr!=NULL;temp_ptr=strtok(NULL,",")){ - if(!strcmp(connecting_host,temp_ptr)) - return 1; - } - - return 0; - } - - -/* writes service/host check results to the Nagios command file */ -static int write_check_result(char *host_name, char *svc_description, int return_code, char *plugin_output, time_t check_time){ - - if(aggregate_writes==FALSE){ - if(open_command_file()==ERROR) - return ERROR; - } - - if(!strcmp(svc_description,"")) - fprintf(command_file_fp,"[%lu] PROCESS_HOST_CHECK_RESULT;%s;%d;%s\n",(unsigned long)check_time,host_name,return_code,plugin_output); - else - fprintf(command_file_fp,"[%lu] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n",(unsigned long)check_time,host_name,svc_description,return_code,plugin_output); - - if(aggregate_writes==FALSE) - close_command_file(); - else - /* if we don't fflush() then we're writing in 4k non-CR-terminated blocks, and - * anything else (eg. pscwatch) which writes to the file will be writing into - * the middle of our commands. - */ - fflush(command_file_fp); - - return OK; - } - - - -/* opens the command file for writing */ -static int open_command_file(void){ - struct stat statbuf; - - /* file is already open */ - if(command_file_fp!=NULL) - return OK; - - /* command file doesn't exist - monitoring app probably isn't running... */ - if(stat(command_file,&statbuf)){ - - if(debug==TRUE) - syslog(LOG_ERR,"Command file '%s' does not exist, attempting to use alternate dump file '%s' for output",command_file,alternate_dump_file); - - /* try and write checks to alternate dump file */ - command_file_fp=fopen(alternate_dump_file,"a"); - if(command_file_fp==NULL){ - if(debug==TRUE) - syslog(LOG_ERR,"Could not open alternate dump file '%s' for appending",alternate_dump_file); - return ERROR; - } - - return OK; - } - - /* open the command file for writing or appending */ - command_file_fp=fopen(command_file,(append_to_file==TRUE)?"a":"w"); - if(command_file_fp==NULL){ - if(debug==TRUE) - syslog(LOG_ERR,"Could not open command file '%s' for %s",command_file,(append_to_file==TRUE)?"appending":"writing"); - return ERROR; - } - - return OK; - } - - - -/* closes the command file */ -static void close_command_file(void){ - - fclose(command_file_fp); - command_file_fp=NULL; - - return; - } - - - -/* process command line arguments */ -int process_arguments(int argc, char **argv){ - int x; - - if(argc<2){ - show_help=TRUE; - return OK; - } - - /* process arguments */ - for(x=2;x<=argc;x++){ - - /* show usage */ - if(!strcmp(argv[x-1],"-h") || !strcmp(argv[x-1],"--help")) - show_help=TRUE; - - /* show license */ - else if(!strcmp(argv[x-1],"-l") || !strcmp(argv[x-1],"--license")) - show_license=TRUE; - - /* show version */ - else if(!strcmp(argv[x-1],"-V") || !strcmp(argv[x-1],"--version")) - show_version=TRUE; - - else if(!strcmp(argv[x-1],"-d") || !strcmp(argv[x-1],"--daemon")) - mode=MULTI_PROCESS_DAEMON; - - else if(!strcmp(argv[x-1],"-s") || !strcmp(argv[x-1],"--single")) - mode=SINGLE_PROCESS_DAEMON; - - else if(!strcmp(argv[x-1],"-i") || !strcmp(argv[x-1],"--inetd")) - mode=INETD; - - /* config file */ - else if(!strcmp(argv[x-1],"-c")){ - - if(xgr_gid); - else - syslog(LOG_ERR,"Warning: Could not get group entry for '%s'",group); - } - - /* else we were passed the GID */ - else - gid=(gid_t)atoi(group); - - /* set effective group ID if other than current EGID */ - if(gid!=getegid()){ - - if(setgid(gid)==-1) - syslog(LOG_ERR,"Warning: Could not set effective GID=%d",(int)gid); - } - } - - - /* set effective user ID */ - if(user!=NULL){ - - /* see if this is a user name */ - if(strspn(user,"0123456789")pw_uid); - else - syslog(LOG_ERR,"Warning: Could not get passwd entry for '%s'",user); - } - - /* else we were passed the UID */ - else - uid=(uid_t)atoi(user); - -#ifdef HAVE_INITGROUPS - - if(uid!=geteuid()){ - - /* initialize supplementary groups */ - if(initgroups(user,gid)==-1){ - if(errno==EPERM) - syslog(LOG_ERR,"Warning: Unable to change supplementary groups using initgroups()"); - else{ - syslog(LOG_ERR,"Warning: Possibly root user failed dropping privileges with initgroups()"); - return ERROR; - } - } - } -#endif - - if(setuid(uid)==-1) - syslog(LOG_ERR,"Warning: Could not set effective UID=%d",(int)uid); - } - - return OK; - } Binary files /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca and /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca differ diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca.c /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca.c --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca.c Wed Jul 23 20:08:36 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/send_nsca.c Wed Dec 31 19:00:00 1969 @@ -1,601 +0,0 @@ -/********************************************************************************** - * - * SEND_NSCA.C - NSCA Client - * License: GPL - * Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org) - * - * Last Modified: 07-23-2003 - * - * Command line: SEND_NSCA [-p port] [-to to_sec] [-c config_file] - * - * Description: - * - * - *********************************************************************************/ - -/*#define DEBUG*/ - -#include "../common/common.h" -#include "../common/config.h" -#include "netutils.h" -#include "utils.h" - -time_t start_time,end_time; - -int server_port=DEFAULT_SERVER_PORT; -char server_name[MAX_HOST_ADDRESS_LENGTH]; -char password[MAX_INPUT_BUFFER]=""; -char config_file[MAX_INPUT_BUFFER]="send_nsca.cfg"; -char delimiter[2]="\t"; - -char received_iv[TRANSMITTED_IV_SIZE]; - -int socket_timeout=DEFAULT_SOCKET_TIMEOUT; - -int warning_time=0; -int check_warning_time=FALSE; -int critical_time=0; -int check_critical_time=FALSE; -int encryption_method=ENCRYPT_XOR; -time_t packet_timestamp; -struct crypt_instance *CI=NULL; - -int show_help=FALSE; -int show_license=FALSE; -int show_version=FALSE; - - -int process_arguments(int,char **); -int read_config_file(char *); -int read_init_packet(int); -void alarm_handler(int); -void clear_password(void); -static void do_exit(int); - - - - -int main(int argc, char **argv){ - int sd; - int rc; - int result; - data_packet send_packet; - int bytes_to_send; - char input_buffer[MAX_INPUT_BUFFER]; - char *temp_ptr; - char host_name[MAX_HOSTNAME_LENGTH]; - char svc_description[MAX_DESCRIPTION_LENGTH]; - char plugin_output[MAX_PLUGINOUTPUT_LENGTH]; - int total_packets=0; - int16_t return_code; - u_int32_t calculated_crc32; - char *ptr1, *ptr2, *ptr3, *ptr4; - - - /* process command-line arguments */ - result=process_arguments(argc,argv); - - if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE){ - - if(result!=OK) - printf("Incorrect command line arguments supplied\n"); - printf("\n"); - printf("NSCA Client %s\n",PROGRAM_VERSION); - printf("Copyright (c) 2000-2003 Ethan Galstad (nagios@nagios.org)\n"); - printf("Last Modified: %s\n",MODIFICATION_DATE); - printf("License: GPL\n"); - printf("Encryption Routines: "); -#ifdef HAVE_LIBMCRYPT - printf("AVAILABLE"); -#else - printf("NOT AVAILABLE"); -#endif - printf("\n"); - printf("\n"); - } - - if(result!=OK || show_help==TRUE){ - printf("Usage: %s -H [-p port] [-to to_sec] [-d delim] [-c config_file]\n",argv[0]); - printf("\n"); - printf("Options:\n"); - printf(" = The IP address of the host running the NSCA daemon\n"); - printf(" [port] = The port on which the daemon is running - default is %d\n",DEFAULT_SERVER_PORT); - printf(" [to_sec] = Number of seconds before connection attempt times out.\n"); - printf(" (default timeout is %d seconds)\n",DEFAULT_SOCKET_TIMEOUT); - printf(" [delim] = Delimiter to use when parsing input (defaults to a tab)\n"); - printf(" [config_file] = Name of config file to use\n"); - printf("\n"); - printf("Note:\n"); - printf("This utility is used to send passive check results to the NSCA daemon. Host and\n"); - printf("Service check data that is to be sent to the NSCA daemon is read from standard\n"); - printf("input. Input should be provided in the following format (tab-delimited unless\n"); - printf("overriden with -d command line argument, one entry per line):\n"); - printf("\n"); - printf("Service Checks:\n"); - printf("[tab][tab][tab][newline]\n\n"); - printf("Host Checks:\n"); - printf("[tab][tab][newline]\n"); - printf("\n"); - } - - if(show_license==TRUE) - display_license(); - - if(result!=OK || show_help==TRUE || show_license==TRUE || show_version==TRUE) - do_exit(STATE_UNKNOWN); - - - - /* read the config file */ - result=read_config_file(config_file); - - /* exit if there are errors... */ - if(result==ERROR){ - printf("Error: Config file '%s' contained errors...\n",config_file); - do_exit(STATE_CRITICAL); - } - - /* generate the CRC 32 table */ - generate_crc32_table(); - - /* initialize alarm signal handling */ - signal(SIGALRM,alarm_handler); - - /* set socket timeout */ - alarm(socket_timeout); - - time(&start_time); - - /* try to connect to the host at the given port number */ - result=my_tcp_connect(server_name,server_port,&sd); - - /* we couldn't connect */ - if(result!=STATE_OK){ - printf("Error: Could not connect to host %s on port %d\n",server_name,server_port); - do_exit(STATE_CRITICAL); - } - -#ifdef DEBUG - printf("Connected okay...\n"); -#endif - - /* read the initialization packet containing the IV and timestamp */ - result=read_init_packet(sd); - if(result!=OK){ - printf("Error: Could not read init packet from server\n"); - close(sd); - do_exit(STATE_CRITICAL); - } - -#ifdef DEBUG - printf("Got init packet from server\n"); -#endif - - /* initialize encryption/decryption routines with the IV we received from the server */ - if(encrypt_init(password,encryption_method,received_iv,&CI)!=OK){ - printf("Error: Failed to initialize encryption libraries for method %d\n",encryption_method); - close(sd); - do_exit(STATE_CRITICAL); - } - -#ifdef DEBUG - printf("Initialized encryption routines\n"); -#endif - - - /**** WE'RE CONNECTED AND READY TO SEND ****/ - - /* read all data from STDIN until there isn't anymore */ - while(fgets(input_buffer,sizeof(input_buffer)-1,stdin)){ - - if(feof(stdin)) - break; - - strip(input_buffer); - - if(!strcmp(input_buffer,"")) - continue; - - /* get the host name */ - ptr1=strtok(input_buffer,delimiter); - if(ptr1==NULL) - continue; - - /* get the service description or return code */ - ptr2=strtok(NULL,delimiter); - if(ptr2==NULL) - continue; - - /* get the return code or plugin output */ - ptr3=strtok(NULL,delimiter); - if(ptr3==NULL) - continue; - - /* get the plugin output - if NULL, this is a host check result */ - ptr4=strtok(NULL,"\n"); - - strncpy(host_name,ptr1,sizeof(host_name)-1); - host_name[sizeof(host_name)-1]='\x0'; - if(ptr4==NULL){ - strcpy(svc_description,""); - return_code=atoi(ptr2); - if(plugin_output[strlen(plugin_output)-1]=='\n') - plugin_output[strlen(plugin_output)-1]='\x0'; - strncpy(plugin_output,ptr3,sizeof(plugin_output)-1); - } - else{ - strncpy(svc_description,ptr2,sizeof(svc_description)-1); - return_code=atoi(ptr3); - strncpy(plugin_output,ptr4,sizeof(plugin_output)-1); - } - svc_description[sizeof(svc_description)-1]='\x0'; - plugin_output[sizeof(plugin_output)-1]='\x0'; - - /* increment count of packets we're sending */ - total_packets++; - - /* clear the packet buffer */ - bzero(&send_packet,sizeof(send_packet)); - - /* fill the packet with semi-random data */ - randomize_buffer((char *)&send_packet,sizeof(send_packet)); - - /* copy the data we want to send into the packet */ - send_packet.packet_version=(int16_t)htons(NSCA_PACKET_VERSION_3); - send_packet.return_code=(int16_t)htons(return_code); - strcpy(&send_packet.host_name[0],host_name); - strcpy(&send_packet.svc_description[0],svc_description); - strcpy(&send_packet.plugin_output[0],plugin_output); - - /* use timestamp provided by the server */ - send_packet.timestamp=(u_int32_t)htonl(packet_timestamp); - - /* calculate the crc 32 value of the packet */ - send_packet.crc32_value=(u_int32_t)0L; - calculated_crc32=calculate_crc32((char *)&send_packet,sizeof(send_packet)); - send_packet.crc32_value=(u_int32_t)htonl(calculated_crc32); - - /* encrypt the packet */ - encrypt_buffer((char *)&send_packet,sizeof(send_packet),password,encryption_method,CI); - - /* send the packet */ - bytes_to_send=sizeof(send_packet); - rc=sendall(sd,(char *)&send_packet,&bytes_to_send); - - /* there was an error sending the packet */ - if(rc==-1){ - printf("Error: Could not send data to host\n"); - close(sd); - do_exit(STATE_UNKNOWN); - } - - /* for some reason we didn't send all the bytes we were supposed to */ - else if(bytes_to_send2) - return ERROR; - } - - return OK; - } - - - -/* handle timeouts */ -void alarm_handler(int sig){ - - printf("Error: Timeout after %d seconds\n",socket_timeout); - - do_exit(STATE_CRITICAL); - } - - - -/* read in the configuration file */ -int read_config_file(char *filename){ - FILE *fp; - char input_buffer[MAX_INPUT_BUFFER]; - char *temp_buffer; - char *varname; - char *varvalue; - int line; - - - /* open the config file for reading */ - fp=fopen(filename,"r"); - - /* exit if we couldn't open the config file */ - if(fp==NULL){ - printf("Could not open config file '%s' for reading.\n",filename); - return ERROR; - } - - line=0; - while(fgets(input_buffer,MAX_INPUT_BUFFER-1,fp)){ - - line++; - - /* skip comments and blank lines */ - if(input_buffer[0]=='#') - continue; - if(input_buffer[0]=='\x0') - continue; - if(input_buffer[0]=='\n') - continue; - - /* get the variable name */ - varname=strtok(input_buffer,"="); - if(varname==NULL){ - - printf("No variable name specified in config file '%s' - Line %d\n",filename,line); - - return ERROR; - } - - /* get the variable value */ - varvalue=strtok(NULL,"\n"); - if(varvalue==NULL){ - - printf("No variable value specified in config file '%s' - Line %d\n",filename,line); - - return ERROR; - } - - if(strstr(input_buffer,"password")){ - if(strlen(varvalue)>sizeof(password)-1){ - - printf("Password is too long in config file '%s' - Line %d\n",filename,line); - - return ERROR; - } - strncpy(password,varvalue,sizeof(password)); - password[sizeof(password)-1]='\x0'; - } - - else if(strstr(input_buffer,"encryption_method")){ - - encryption_method=atoi(varvalue); - - switch(encryption_method){ - case ENCRYPT_NONE: - break; - case ENCRYPT_XOR: - break; - -#ifdef HAVE_LIBMCRYPT - case ENCRYPT_DES: - break; - case ENCRYPT_3DES: - break; - case ENCRYPT_CAST128: - break; - case ENCRYPT_CAST256: - break; - case ENCRYPT_XTEA: - break; - case ENCRYPT_3WAY: - break; - case ENCRYPT_BLOWFISH: - break; - case ENCRYPT_TWOFISH: - break; - case ENCRYPT_LOKI97: - break; - case ENCRYPT_RC2: - break; - case ENCRYPT_ARCFOUR: - break; - case ENCRYPT_RIJNDAEL128: - break; - case ENCRYPT_RIJNDAEL192: - break; - case ENCRYPT_RIJNDAEL256: - break; - case ENCRYPT_WAKE: - break; - case ENCRYPT_SERPENT: - break; - case ENCRYPT_ENIGMA: - break; - case ENCRYPT_GOST: - break; - case ENCRYPT_SAFER64: - break; - case ENCRYPT_SAFER128: - break; - case ENCRYPT_SAFERPLUS: - break; -#endif - default: - printf("Invalid encryption method (%d) in config file '%s' - Line %d\n",encryption_method,filename,line); -#ifndef HAVE_LIBMCRYPT - if(encryption_method>=2) - printf("Client was not compiled with mcrypt library, so encryption is unavailable.\n"); -#endif - return ERROR; - } - } - - else{ - printf("Unknown option specified in config file '%s' - Line %d\n",filename,line); - - return ERROR; - } - - } - - - /* close the config file */ - fclose(fp); - - return OK; - } - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/utils.c /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/utils.c --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/utils.c Wed Oct 9 21:29:50 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/utils.c Wed Dec 31 19:00:00 1969 @@ -1,472 +0,0 @@ -/**************************************************************************** - * - * UTILS.C - Utility functions for NSCA - * - * License: GPL - * Copyright (c) 2000-2002 Ethan Galstad (nagios@nagios.org) - * - * Last Modified: 10-09-2002 - * - * Description: - * - * This file contains common unctions used in nsca and send_nsca - * - * License Information: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ****************************************************************************/ - -#include "../common/common.h" -#include "utils.h" - - -/*#define DEBUG*/ - -static unsigned long crc32_table[256]; - - - - -/* build the crc table - must be called before calculating the crc value */ -void generate_crc32_table(void){ - unsigned long crc, poly; - int i, j; - - poly=0xEDB88320L; - for(i=0;i<256;i++){ - crc=i; - for(j=8;j>0;j--){ - if(crc & 1) - crc=(crc>>1)^poly; - else - crc>>=1; - } - crc32_table[i]=crc; - } - - return; - } - - -/* calculates the CRC 32 value for a buffer */ -unsigned long calculate_crc32(char *buffer, int buffer_size){ - register unsigned long crc; - int this_char; - int current_index; - - crc=0xFFFFFFFF; - - for(current_index=0;current_index>8) & 0x00FFFFFF) ^ crc32_table[(crc ^ this_char) & 0xFF]; - } - - return (crc ^ 0xFFFFFFFF); - } - - - -/* initializes encryption routines */ -int encrypt_init(char *password,int encryption_method,char *received_iv,struct crypt_instance **CIptr){ -#ifdef HAVE_LIBMCRYPT - int i; - int iv_size; -#endif - struct crypt_instance *CI; - - CI=malloc(sizeof(struct crypt_instance)); - *CIptr=CI; - - if(CI==NULL){ - syslog(LOG_ERR, "Could not allocate memory for crypt instance"); - return ERROR; - } - - /* server generates IV used for encryption */ - if(received_iv==NULL) - generate_transmitted_iv(CI->transmitted_iv); - - /* client recieves IV from server */ - else - memcpy(CI->transmitted_iv,received_iv,TRANSMITTED_IV_SIZE); - -#ifdef HAVE_LIBMCRYPT - CI->blocksize=1; /* block size = 1 byte w/ CFB mode */ - CI->keysize=7; /* default to 56 bit key length */ - CI->mcrypt_mode="cfb"; /* CFB = 8-bit cipher-feedback mode */ - CI->mcrypt_algorithm="unknown"; -#endif - - /* XOR or no encryption */ - if(encryption_method==ENCRYPT_NONE || encryption_method==ENCRYPT_XOR) - return OK; - -#ifdef HAVE_LIBMCRYPT - - /* get the name of the mcrypt encryption algorithm to use */ - switch(encryption_method){ - case ENCRYPT_DES: - CI->mcrypt_algorithm=MCRYPT_DES; - break; - case ENCRYPT_3DES: - CI->mcrypt_algorithm=MCRYPT_3DES; - break; - case ENCRYPT_CAST128: - CI->mcrypt_algorithm=MCRYPT_CAST_128; - break; - case ENCRYPT_CAST256: - CI->mcrypt_algorithm=MCRYPT_CAST_256; - break; - case ENCRYPT_XTEA: - CI->mcrypt_algorithm=MCRYPT_XTEA; - break; - case ENCRYPT_3WAY: - CI->mcrypt_algorithm=MCRYPT_3WAY; - break; - case ENCRYPT_BLOWFISH: - CI->mcrypt_algorithm=MCRYPT_BLOWFISH; - break; - case ENCRYPT_TWOFISH: - CI->mcrypt_algorithm=MCRYPT_TWOFISH; - break; - case ENCRYPT_LOKI97: - CI->mcrypt_algorithm=MCRYPT_LOKI97; - break; - case ENCRYPT_RC2: - CI->mcrypt_algorithm=MCRYPT_RC2; - break; - case ENCRYPT_ARCFOUR: - CI->mcrypt_algorithm=MCRYPT_ARCFOUR; - break; - case ENCRYPT_RIJNDAEL128: - CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_128; - break; - case ENCRYPT_RIJNDAEL192: - CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_192; - break; - case ENCRYPT_RIJNDAEL256: - CI->mcrypt_algorithm=MCRYPT_RIJNDAEL_256; - break; - case ENCRYPT_WAKE: - CI->mcrypt_algorithm=MCRYPT_WAKE; - break; - case ENCRYPT_SERPENT: - CI->mcrypt_algorithm=MCRYPT_SERPENT; - break; - case ENCRYPT_ENIGMA: - CI->mcrypt_algorithm=MCRYPT_ENIGMA; - break; - case ENCRYPT_GOST: - CI->mcrypt_algorithm=MCRYPT_GOST; - break; - case ENCRYPT_SAFER64: - CI->mcrypt_algorithm=MCRYPT_SAFER_SK64; - break; - case ENCRYPT_SAFER128: - CI->mcrypt_algorithm=MCRYPT_SAFER_SK128; - break; - case ENCRYPT_SAFERPLUS: - CI->mcrypt_algorithm=MCRYPT_SAFERPLUS; - break; - - default: - CI->mcrypt_algorithm="unknown"; - break; - } - -#ifdef DEBUG - syslog(LOG_INFO,"Attempting to initialize '%s' crypto algorithm...",CI->mcrypt_algorithm); -#endif - - /* open encryption module */ - if((CI->td=mcrypt_module_open(CI->mcrypt_algorithm,NULL,CI->mcrypt_mode,NULL))==MCRYPT_FAILED){ - syslog(LOG_ERR,"Could not open mcrypt algorithm '%s' with mode '%s'",CI->mcrypt_algorithm,CI->mcrypt_mode); - return ERROR; - } - -#ifdef DEBUG - syslog(LOG_INFO,"Using '%s' as crypto algorithm...",CI->mcrypt_algorithm); -#endif - - /* determine size of IV buffer for this algorithm */ - iv_size=mcrypt_enc_get_iv_size(CI->td); - if(iv_size>TRANSMITTED_IV_SIZE){ - syslog(LOG_ERR,"IV size for crypto algorithm exceeds limits"); - return ERROR; - } - - /* allocate memory for IV buffer */ - if((CI->IV=(char *)malloc(iv_size))==NULL){ - syslog(LOG_ERR,"Could not allocate memory for IV buffer"); - return ERROR; - } - - /* fill IV buffer with first bytes of IV that is going to be used to crypt (determined by server) */ - for(i=0;iIV[i]=CI->transmitted_iv[i]; - - /* get maximum key size for this algorithm */ - CI->keysize=mcrypt_enc_get_key_size(CI->td); - - /* generate an encryption/decription key using the password */ - if((CI->key=(char *)malloc(CI->keysize))==NULL){ - syslog(LOG_ERR,"Could not allocate memory for encryption/decryption key"); - return ERROR; - } - bzero(CI->key,CI->keysize); - - if(CI->keysizekey,password,CI->keysize); - else - strncpy(CI->key,password,strlen(password)); - - /* initialize encryption buffers */ - mcrypt_generic_init(CI->td,CI->key,CI->keysize,CI->IV); - -#endif - - return OK; - } - - - -/* encryption routine cleanup */ -void encrypt_cleanup(int encryption_method, struct crypt_instance *CI){ - - /* no crypt instance */ - if(CI==NULL) - return; - -#ifdef HAVE_LIBMCRYPT - /* mcrypt cleanup */ - if(encryption_method!=ENCRYPT_NONE && encryption_method!=ENCRYPT_XOR) - mcrypt_generic_end(CI->td); -#endif - - free(CI); - - return; - } - - - -/* generates IV to use for encrypted communications (function is called by server only, client uses IV it receives from server) */ -static void generate_transmitted_iv(char *transmitted_iv){ - FILE *fp; - int x; - int seed=0; - - /*********************************************************/ - /* fill IV buffer with data that's as random as possible */ - /*********************************************************/ - - /* try to get seed value from /dev/urandom, as its a better source of entropy */ - fp=fopen("/dev/urandom","r"); - if(fp!=NULL){ - seed=fgetc(fp); - fclose(fp); - } - - /* else fallback to using the current time as the seed */ - else - seed=(int)time(NULL); - - /* generate pseudo-random IV */ - srand(seed); - for(x=0;x=TRANSMITTED_IV_SIZE) - x=0; - - buffer[y]^=CI->transmitted_iv[x]; - } - - /* rotate over password... */ - password_length=strlen(password); - for(y=0,x=0;y=password_length) - x=0; - - buffer[y]^=password[x]; - } - - return; - } - -#ifdef HAVE_LIBMCRYPT - /* use mcrypt routines */ - else{ - - /* encrypt each byte of buffer, one byte at a time (CFB mode) */ - for(x=0;xtd,&buffer[x],1); - } -#endif - - return; - } - - -/* decrypt a buffer */ -void decrypt_buffer(char *buffer,int buffer_size, char *password, int encryption_method, struct crypt_instance *CI){ - int x=0; - -#ifdef DEBUG - syslog(LOG_INFO,"Decrypting with algorithm #%d",encryption_method); -#endif - - /* no crypt instance */ - if(CI==NULL) - return; - - /* no encryption */ - if(encryption_method==ENCRYPT_NONE) - return; - - /* XOR "decryption" is the same as encryption */ - else if(encryption_method==ENCRYPT_XOR) - encrypt_buffer(buffer,buffer_size,password,encryption_method,CI); - -#ifdef HAVE_LIBMCRYPT - /* use mcrypt routines */ - else{ - - /* encrypt each byte of buffer, one byte at a time (CFB mode) */ - for(x=0;xtd,&buffer[x],1); - } -#endif - - return; - } - - - -/* fill a buffer with semi-random data */ -void randomize_buffer(char *buffer,int buffer_size){ - FILE *fp; - int x; - int seed; - - /**** FILL BUFFER WITH RANDOM ALPHA-NUMERIC CHARACTERS ****/ - - /*************************************************************** - Only use alpha-numeric characters becase plugins usually - only generate numbers and letters in their output. We - want the buffer to contain the same set of characters as - plugins, so its harder to distinguish where the real output - ends and the rest of the buffer (padded randomly) starts. - ***************************************************************/ - - /* try to get seed value from /dev/urandom, as its a better source of entropy */ - fp=fopen("/dev/urandom","r"); - if(fp!=NULL){ - seed=fgetc(fp); - fclose(fp); - } - - /* else fallback to using the current time as the seed */ - else - seed=(int)time(NULL); - - srand(seed); - for(x=0;x=1;x--){ - index=x-1; - if(buffer[index]==' ' || buffer[index]=='\r' || buffer[index]=='\n' || buffer[index]=='\t') - buffer[index]='\x0'; - else - break; - } - - return; - } - - - -/* wipes an area of memory clean */ -void clear_buffer(char *buffer, int buffer_length){ - - /* NULL all bytes of buffer */ - memset(buffer,'\x0',buffer_length); - - return; - } - - - -/* show license */ -void display_license(void){ - - printf("This program is free software; you can redistribute it and/or modify\n"); - printf("it under the terms of the GNU General Public License as published by\n"); - printf("the Free Software Foundation; either version 2 of the License, or\n"); - printf("(at your option) any later version.\n\n"); - printf("This program is distributed in the hope that it will be useful,\n"); - printf("but WITHOUT ANY WARRANTY; without even the implied warranty of\n"); - printf("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"); - printf("GNU General Public License for more details.\n\n"); - printf("You should have received a copy of the GNU General Public License\n"); - printf("along with this program; if not, write to the Free Software\n"); - printf("Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n"); - - return; - } diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/utils.h /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/utils.h --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/src/utils.h Thu Feb 21 20:50:43 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/src/utils.h Wed Dec 31 19:00:00 1969 @@ -1,72 +0,0 @@ -/********************************************************************************* - * - * UTILS.H - Header file for NSCA utility functions - * - * License: GPL - * Copyright (c) 2000-2002 Ethan Galstad (nagios@nagios.org) - * - * Last Modified: 02-21-2002 - * - * Description: - * - * - * License Information: - * - * This program is 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * 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., 675 Mass Ave, Cambridge, MA 02139, USA. - * - ********************************************************************************/ - -#ifndef _UTILS_H -#define _UTILS_H - -#include "../common/config.h" - -struct crypt_instance { - char transmitted_iv[TRANSMITTED_IV_SIZE]; -#ifdef HAVE_LIBMCRYPT - MCRYPT td; - char *key; - char *IV; - char block_buffer; - int blocksize; - int keysize; - char *mcrypt_algorithm; - char *mcrypt_mode; -#endif - }; - -void generate_crc32_table(void); -unsigned long calculate_crc32(char *, int); - -int encrypt_init(char *,int,char *,struct crypt_instance **); -void encrypt_cleanup(int,struct crypt_instance *); - -static void generate_transmitted_iv(char *transmitted_iv); - -void encrypt_buffer(char *,int,char *,int,struct crypt_instance *); -void decrypt_buffer(char *,int,char *,int,struct crypt_instance *); - -void randomize_buffer(char *,int); - -void strip(char *); - -void clear_buffer(char *,int); - -void display_license(void); - -#endif - - - diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/subst /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/subst --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/subst Wed Mar 10 23:40:48 2004 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/subst Wed Dec 31 19:00:00 1969 @@ -1,46 +0,0 @@ -#!/usr/bin/perl -w - -my ${exec_prefix}; -my ${prefix}; - -${prefix}="/usr/local"; -${exec_prefix}="${prefix}"; -while ($f = shift @ARGV) { - - if (-x "/bin/mktemp") { - $TEMP = `/bin/mktemp $f.$$.XXXXXX`; - die 'Cannot make temporary file $TEMP' if($?); - chomp $TEMP; - } else { - $XXXXXX = rand; - $TEMP = "$f.$$.$XXXXXX"; - } - - open(IN,"<$f.in"); - open(OUT,">$TEMP") || die 'Cannot make temporary file $TEMP'; - - while () { - s|\@nsca_user\@|nagios|g; - s|\@nsca_grp\@|nagios|g; - s|\@nsca_port\@|5667|g; - s|\@libexecdir\@|${exec_prefix}/libexec|g; # put all --with-vars before directories - s|\@localstatedir\@|/var/spool/nagios|g; - s|\@sysconfdir\@|${prefix}/etc|g; - s|\@datadir\@|${prefix}/share|g; - s|\@sbindir\@|${exec_prefix}/sbin|g; - s|\@bindir\@|${exec_prefix}/bin|g; - s|\$\{exec_prefix\}|${prefix}|g; # must be next to last - s|\$\{prefix\}|/usr/local|g; # must be last - print OUT $_; - } - - close IN; - close OUT; - - if ((! -e $f) || (`diff $f $TEMP`)) { - `mv $TEMP $f`; - } else { - unlink $TEMP; - } - -} diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/subst.in /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/subst.in --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/subst.in Tue Jan 7 21:57:23 2003 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/subst.in Wed Dec 31 19:00:00 1969 @@ -1,46 +0,0 @@ -#!/usr/bin/perl -w - -my ${exec_prefix}; -my ${prefix}; - -${prefix}="@prefix@"; -${exec_prefix}="@exec_prefix@"; -while ($f = shift @ARGV) { - - if (-x "/bin/mktemp") { - $TEMP = `/bin/mktemp $f.$$.XXXXXX`; - die 'Cannot make temporary file $TEMP' if($?); - chomp $TEMP; - } else { - $XXXXXX = rand; - $TEMP = "$f.$$.$XXXXXX"; - } - - open(IN,"<$f.in"); - open(OUT,">$TEMP") || die 'Cannot make temporary file $TEMP'; - - while () { - s|\@nsca_user\@|@nsca_user@|g; - s|\@nsca_grp\@|@nsca_grp@|g; - s|\@nsca_port\@|@nsca_port@|g; - s|\@libexecdir\@|@libexecdir@|g; # put all --with-vars before directories - s|\@localstatedir\@|@localstatedir@|g; - s|\@sysconfdir\@|@sysconfdir@|g; - s|\@datadir\@|@datadir@|g; - s|\@sbindir\@|@sbindir@|g; - s|\@bindir\@|@bindir@|g; - s|\$\{exec_prefix\}|@exec_prefix@|g; # must be next to last - s|\$\{prefix\}|@prefix@|g; # must be last - print OUT $_; - } - - close IN; - close OUT; - - if ((! -e $f) || (`diff $f $TEMP`)) { - `mv $TEMP $f`; - } else { - unlink $TEMP; - } - -} diff -ruN --exclude=CVS /usr/ports/net-mgmt/nsca/work/nsca-2.4/update-version /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/update-version --- /usr/ports/net-mgmt/nsca/work/nsca-2.4/update-version Tue Jun 11 00:30:38 2002 +++ /usr/home/paul/myports/net-mgmt/nsca/work/nsca-2.4/update-version Wed Dec 31 19:00:00 1969 @@ -1,25 +0,0 @@ -#!/bin/sh - -if [ "x$1" = "x" ] -then - echo "Usage: $0 " - exit 1 -fi - -# Get date (two formats) -LONGDATE=`date "+%B %d, %Y"` -SHORTDATE=`date "+%m-%d-%Y"` - -# Update version number and release date in common code -perl -i -p -e "s/VERSION \".*\"/VERSION \"$1\"/;" common/common.h -perl -i -p -e "s/MODIFICATION_DATE \".*\"/MODIFICATION_DATE \"$SHORTDATE\"/;" common/common.h - -# Update version number and release date in main code -perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/nsca.c -perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/send_nsca.c - -# Update version number and release date in configure script and configure.in -perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure -perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure -perl -i -p -e "s/PKG_VERSION=.*/PKG_VERSION=\"$1\"/;" configure.in -perl -i -p -e "s/PKG_REL_DATE=.*\"/PKG_REL_DATE=\"$SHORTDATE\"/;" configure.in --- nsca-2.4.patch ends here --- >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: pav State-Changed-When: Sun Mar 14 18:44:43 PST 2004 State-Changed-Why: Committed, thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=64083 >Unformatted: