Browse Source

Configure script updates, license mods for OpenSSL

Ethan Galstad 23 năm trước cách đây
mục cha
commit
9db532d73e
10 tập tin đã thay đổi với 194 bổ sung62 xóa
  1. 1 0
      Changelog
  2. 2 2
      common/common.h
  3. 24 3
      common/config.h.in
  4. 119 22
      configure
  5. 29 21
      configure.in
  6. 1 1
      nrpe.spec
  7. 3 3
      src/check_nrpe.c
  8. 6 6
      src/dh.h
  9. 6 4
      src/nrpe.c
  10. 3 0
      src/utils.c

+ 1 - 0
Changelog

@@ -14,6 +14,7 @@ NRPE Changelog
   config files in directories (with recursion)
 - Added native SSL support (Derrick Bennett)
 - Added my_strsep(), as Solaris doesn't have strsep()
+- Added license exemption for use with OpenSSL
 
 
 1.8 - 01/16/2003

+ 2 - 2
common/common.h

@@ -23,8 +23,8 @@
 
 #include "config.h"
 
-#define PROGRAM_VERSION "2.0b4"
-#define MODIFICATION_DATE "06-04-2003"
+#define PROGRAM_VERSION "2.0b5"
+#define MODIFICATION_DATE "06-13-2003"
 
 #define OK		0
 #define ERROR		-1

+ 24 - 3
common/config.h.in

@@ -2,7 +2,7 @@
  *
  * NRPE Common Header File
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
- * Last Modified: 04-29-2003
+ * Last Modified: 06-12-2003
  *
  * License:
  *
@@ -21,6 +21,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  ************************************************************************/
 
+#ifndef _CONFIG_H
+#define _CONFIG_H
+
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -43,17 +46,33 @@
 #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;
-typedef short int32_t;
 #endif
 #ifdef U_INT32_T_IS_ULONG
 typedef unsigned long u_int32_t;
-typedef long 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
 
@@ -200,3 +219,5 @@ typedef int int32_t;
 #include <krb5.h>
 #endif
 
+
+#endif

+ 119 - 22
configure

@@ -535,9 +535,9 @@ fi
 
 
 PKG_NAME=nrpe
-PKG_VERSION="2.0b4"
+PKG_VERSION="2.0b5"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="06-04-2003"
+PKG_REL_DATE="06-13-2003"
 
 
 ac_aux_dir=
@@ -1649,13 +1649,47 @@ cat >> confdefs.h <<EOF
 EOF
 
 
+
+echo $ac_n "checking for uint32_t""... $ac_c" 1>&6
+echo "configure:1655: 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 <<EOF
+#line 1660 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#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:1654: checking for u_int32_t" >&5
+echo "configure:1688: 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 <<EOF
-#line 1659 "configure"
+#line 1693 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1683,9 +1717,9 @@ EOF
 fi
 
 if test "$ac_cv_type_u_int32_t" = no ; then
-	if test "$ac_cv_sizeof_long" = 4 ; then
+	if test "$ac_cv_type_int32_t" = yes ; then
 		cat >> confdefs.h <<\EOF
-#define U_INT32_T_IS_ULONG 1
+#define U_INT32_T_IS_UINT32_T 1
 EOF
 
 	else
@@ -1695,9 +1729,72 @@ EOF
 EOF
 
 		else
-			if test "$ac_cv_sizeof_short" = 4 ; then
+			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:1751: 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 <<EOF
+#line 1756 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#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
@@ -1707,7 +1804,7 @@ fi
 
 
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1711: checking for main in -lnsl" >&5
+echo "configure:1808: 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
@@ -1715,14 +1812,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1719 "configure"
+#line 1816 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1743,7 +1840,7 @@ else
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1747: checking for socket in -lsocket" >&5
+echo "configure:1844: 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
@@ -1751,7 +1848,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1755 "configure"
+#line 1852 "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
@@ -1762,7 +1859,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1786,12 +1883,12 @@ fi
 for ac_func in strdup strstr strtoul initgroups
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1790: checking for $ac_func" >&5
+echo "configure:1887: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1795 "configure"
+#line 1892 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1814,7 +1911,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1915: \"$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
@@ -1840,9 +1937,9 @@ done
 
 
 echo $ac_n "checking for type of socket size""... $ac_c" 1>&6
-echo "configure:1844: checking for type of socket size" >&5
+echo "configure:1941: checking for type of socket size" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1846 "configure"
+#line 1943 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <sys/types.h>
@@ -1852,7 +1949,7 @@ int main() {
 int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);
 ; return 0; }
 EOF
-if { (eval echo configure:1856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define SOCKET_SIZE_TYPE size_t
@@ -1913,7 +2010,7 @@ fi
 
 if test x$check_for_ssl = xyes; then
 	echo $ac_n "checking for SSL""... $ac_c" 1>&6
-echo "configure:1917: checking for SSL" >&5
+echo "configure:2014: checking for SSL" >&5
 	found_ssl=no
 	for dir in $ssl_inc_dir /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr; do
 		ssldir="$dir"
@@ -1956,7 +2053,7 @@ EOF
 	    fi
 
 		echo $ac_n "checking for Kerberos include files""... $ac_c" 1>&6
-echo "configure:1960: checking for Kerberos include files" >&5
+echo "configure:2057: checking for Kerberos include files" >&5
 	found_kerberos=no
 	for dir in $kerberos_inc_dir /usr/kerberos/include; do
 		kerbdir="$dir"
@@ -2026,7 +2123,7 @@ fi
 # Extract the first word of "perl", so it can be a program name with args.
 set dummy perl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2030: checking for $ac_word" >&5
+echo "configure:2127: 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

+ 29 - 21
configure.in

@@ -9,9 +9,9 @@ AC_CONFIG_HEADER(common/config.h)
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 
 PKG_NAME=nrpe
-PKG_VERSION="2.0b4"
+PKG_VERSION="2.0b5"
 PKG_HOME_URL="http://www.nagios.org/"
-PKG_REL_DATE="06-04-2003"
+PKG_REL_DATE="06-13-2003"
 
 dnl Figure out how to invoke "install" and what install options to use.
 
@@ -37,40 +37,48 @@ AC_TYPE_SIZE_T
 AC_TYPE_SIGNAL
 AC_TYPE_GETGROUPS
 
-dnl Define u_int32_t if we don't have it already (Solaris)
+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_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(U_INT32_T_IS_UINT)
+		AC_DEFINE(INT32_T_IS_UINT)
 	else
 		if test "$ac_cv_sizeof_long" = 4 ; then
-			AC_DEFINE(U_INT32_T_IS_ULONG)
+			AC_DEFINE(INT32_T_IS_ULONG)
 		else
 			if test "$ac_cv_sizeof_short" = 4 ; then
-				AC_DEFINE(U_INT32_T_IS_USHORT)
+				AC_DEFINE(INT32_T_IS_USHORT)
 			fi
 		fi
 	fi
 fi
 
-dnl AC_CHECK_SIZEOF(int)
-dnl AC_CHECK_SIZEOF(short)
-dnl AC_CHECK_SIZEOF(long)
-dnl if test "$ac_cv_sizeof_int" = 4 ; then
-dnl 	AC_CHECK_TYPE(int32_t, int)
-dnl 	AC_CHECK_TYPE(u_int32_t, unsigned int)
-dnl elif test "$ac_cv_sizeof_short" = 4 ; then
-dnl 	AC_CHECK_TYPE(int32_t, short)
-dnl 	AC_CHECK_TYPE(u_int32_t, unsigned short)
-dnl elif test "$ac_cv_sizeof_long" = 4 ; then
-dnl 	AC_CHECK_TYPE(int32_t, long)
-dnl 	AC_CHECK_TYPE(u_int32_t, unsigned long)
-dnl else
-dnl 	AC_MSG_ERROR([Cannot find a type with size of 32 bits])
-dnl fi
 
 dnl Checks for library functions.
 AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")

+ 1 - 1
nrpe.spec

@@ -1,5 +1,5 @@
 %define name nrpe
-%define version 2.0b4
+%define version 2.0b5
 %define release 1
 %define nsusr nagios
 %define nsgrp nagios

+ 3 - 3
src/check_nrpe.c

@@ -4,7 +4,7 @@
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * License: GPL
  *
- * Last Modified: 06-04-2003
+ * Last Modified: 06-13-2003
  *
  * Command line: CHECK_NRPE -H <host_address> [-p port] [-c command] [-to to_sec]
  *
@@ -73,7 +73,7 @@ int main(int argc, char **argv){
 		printf("Copyright (c) 1999-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("License: GPL with exemptions (-l for more info)\n");
 #ifdef HAVE_SSL
 		printf("SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required\n");
 #endif
@@ -399,7 +399,7 @@ int process_arguments(int argc, char **argv){
 	        }
 
 	/* make sure required args were supplied */
-	if(server_name==NULL)
+	if(server_name==NULL && show_help==FALSE && show_version==FALSE  && show_license==FALSE)
 		return ERROR;
 
 

+ 6 - 6
src/dh.h

@@ -4,12 +4,12 @@
 DH *get_dh512()
 	{
 	static unsigned char dh512_p[]={
-		0xF1,0x28,0x95,0x15,0x27,0xE4,0x53,0x83,0x57,0xFD,0x65,0xB2,
-		0x18,0x7D,0x90,0x68,0xCA,0x00,0xF8,0x43,0x02,0x3D,0x44,0xCB,
-		0xD0,0x81,0x6D,0x47,0x3D,0x70,0x5C,0xCF,0x19,0xF0,0x26,0x05,
-		0x41,0xFD,0x59,0x13,0xC3,0x47,0x90,0xFC,0x38,0xC4,0xA8,0xE4,
-		0x63,0x65,0x6E,0x10,0x3F,0xE2,0x9A,0xAB,0x8B,0x73,0x83,0xF6,
-		0x84,0x87,0xF7,0x83,
+		0xF2,0xBB,0xC1,0x35,0x68,0xF3,0x1F,0x4A,0x9C,0x64,0x85,0xC8,
+		0xEB,0x9F,0x32,0xA8,0xA8,0x39,0x9B,0x5C,0x4E,0x62,0xA5,0x90,
+		0x24,0x37,0x2D,0x03,0xAD,0x8C,0x23,0x76,0xE9,0x5F,0x19,0xC8,
+		0xCB,0xC5,0xF6,0xE1,0xEA,0x40,0x06,0xBC,0x24,0xA3,0x07,0x07,
+		0xE1,0xE9,0x2A,0x33,0x67,0x42,0xAE,0x0D,0x20,0x74,0x87,0x93,
+		0x34,0xA7,0xBA,0xFB,
 		};
 	static unsigned char dh512_g[]={
 		0x02,

+ 6 - 4
src/nrpe.c

@@ -4,7 +4,7 @@
  * Copyright (c) 1999-2003 Ethan Galstad (nagios@nagios.org)
  * License: GPL
  *
- * Last Modified: 06-04-2003
+ * Last Modified: 06-13-2003
  *
  * Command line: nrpe -c <config_file> [--inetd | --daemon]
  *
@@ -101,7 +101,7 @@ int main(int argc, char **argv){
 		printf("Copyright (c) 1999-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("License: GPL with exemptions (-l for more info)\n");
 #ifdef HAVE_SSL
 		printf("SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required\n");
 #endif
@@ -198,10 +198,12 @@ int main(int argc, char **argv){
 		dh=get_dh512();
 		SSL_CTX_set_tmp_dh(ctx,dh);
 		DH_free(dh);
-		syslog(LOG_INFO,"INFO: SSL/TLS initialized. All network traffic will be encrypted.");
+		if(debug==TRUE)
+			syslog(LOG_INFO,"INFO: SSL/TLS initialized. All network traffic will be encrypted.");
 	        }
 	else{
-		syslog(LOG_INFO,"INFO: SSL/TLS NOT initialized. Network encryption DISABLED.");
+		if(debug==TRUE)
+			syslog(LOG_INFO,"INFO: SSL/TLS NOT initialized. Network encryption DISABLED.");
 	        }
 #endif
 

+ 3 - 0
src/utils.c

@@ -418,6 +418,9 @@ char *my_strsep (char **stringp, const char *delim){
 /* show license */
 void display_license(void){
 
+	printf("This program is released under the GPL (see below) with the additional\n");
+	printf("exemption that compiling, linking, and/or using OpenSSL is allowed.\n\n");
+
 	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");