Explorar el Código

Added setuid/setgid option to config file

Ethan Galstad hace 24 años
padre
commit
bad2bcecb4
Se han modificado 10 ficheros con 343 adiciones y 120 borrados
  1. 7 0
      Changelog
  2. 27 2
      Makefile.in
  3. 3 3
      common/common.h
  4. 13 3
      common/config.h.in
  5. 117 76
      configure
  6. 28 6
      configure.in
  7. 21 1
      nrpe.cfg.in
  8. 7 9
      src/check_nrpe.c
  9. 95 20
      src/nrpe.c
  10. 25 0
      update-version

+ 7 - 0
Changelog

@@ -3,6 +3,11 @@ NRPE Changelog
 **************
 
 
+1.5 - 06/03/2002
+----------------
+- Added setuid/setgid option to config file (suggested by Marek Cervenka) 
+
+
 1.4 - 06/01/2002
 ----------------
 - Changed STATE_UNKNOWN to value of 3 instead of -1 (old style)
@@ -121,3 +126,5 @@ NRPE Changelog
 - Changed 'allowed_ip' option in configuration file to
   'allowed_hosts' and added support for multiple hosts
 - Minor buffer overflow protection fixes
+- main() returned STATE_UNKNOWN on successful launch, changed to STATE_OK (jaclu@grm.se)
+- Added syslog support (jaclu@grm.se)

+ 27 - 2
Makefile.in

@@ -1,7 +1,7 @@
 ###############################
 # Makefile for NRPE
 #
-# Last Modified: 12-23-2001
+# Last Modified: 06-03-2002
 ###############################
 
 
@@ -12,6 +12,31 @@ SRC_COMMON=./common/
 all:
 	cd $(SRC_BASE); $(MAKE) ; cd ..
 
+	@echo ""
+	@echo "*** Compile finished ***"
+	@echo ""
+	@echo "If the NRPE daemon and client compiled without any errors, you"
+	@echo "can continue with installation.  The NRPE daemon and client"
+	@echo "binaries are located in the src/ subdirectory."
+	@echo ""
+	@echo " ** If this is your monitoring host **"
+	@echo ""
+	@echo "     - Copy the check_nrpe client to the directory that"
+	@echo "       contains your Nagios plugins."
+	@echo "     - Create a command definition in your Nagios config"
+	@echo "       file for the NRPE client.  See the README file for"
+	@echo "       more info on doing this."
+	@echo ""
+	@echo " ** If this host will be running the NRPE daemon **"
+	@echo ""
+	@echo "     - Copy the nrpe daemon to /usr/sbin, /usr/local/nagios"
+	@echo "       or wherever you feel it fits best."
+	@echo "     - Copy the sample nrpe.cfg config file to /etc,"
+	@echo "       /usr/local/nagios or wherever you feel it fits best."
+	@echo "     - Modify the /etc/services file and configure NRPE to"
+	@echo "       run under inetd, xinetd, or as a standalone daemon."
+	@echo "       See the README file for more info on doing this."
+	@echo ""
 nrpe:
 	cd $(SRC_BASE); $(MAKE) ; cd ..
 
@@ -23,7 +48,7 @@ clean:
 	cd $(SRC_BASE); $(MAKE) $@ ; cd ..
 	rm -f core
 	rm -f *~ */*~
-	rm -f config.log config.status config.cache Makefile $(SRC_COMMON)/config.h
+	rm -f config.log config.status config.cache nrpe.cfg Makefile $(SRC_COMMON)/config.h
 
 distclean: clean
 

+ 3 - 3
common/common.h

@@ -2,7 +2,7 @@
  *
  * COMMON.H - NRPE Common Include File
  * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)
- * Last Modified: 06-01-2002
+ * Last Modified: 06-03-2002
  *
  * License:
  *
@@ -22,8 +22,8 @@
  ************************************************************************/
 
 
-#define PROGRAM_VERSION "1.4"
-#define MODIFICATION_DATE "06-01-2002"
+#define PROGRAM_VERSION "1.5"
+#define MODIFICATION_DATE "06-03-2002"
 
 #define OK		0
 #define ERROR		-1

+ 13 - 3
common/config.h.in

@@ -2,7 +2,7 @@
  *
  * NRPE Common Header File
  * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)
- * Last Modified: 02-21-2002
+ * Last Modified: 06-03-2002
  *
  * License:
  *
@@ -26,10 +26,14 @@
 
 
 #undef STDC_HEADERS
-#undef HAVE_SYSLOG_H
 #undef HAVE_STRDUP
 #undef HAVE_STRSTR
 #undef HAVE_STRTOUL 
+#undef HAVE_INITGROUPS
+
+#undef HAVE_PWD_H
+#undef HAVE_GRP_H
+#undef HAVE_SYSLOG_H
 #undef HAVE_LIMITS_H
 #undef HAVE_SYS_RESOURCE_H
 
@@ -140,5 +144,11 @@
 #include <ctype.h>
 #endif
 
-
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+ 
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
 

+ 117 - 76
configure

@@ -11,7 +11,11 @@
 ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
-ac_default_prefix=/usr/local/netsaint
+ac_default_prefix=/usr/local/nagios
+ac_help="$ac_help
+--with-nrpe-user=<user> sets user name to run NRPE"
+ac_help="$ac_help
+--with-nrpe-grp=<grp> sets group name to run NRPE"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -525,6 +529,11 @@ fi
 
 
 
+PKG_NAME=nrpe
+PKG_VERSION="1.5"
+PKG_HOME_URL="http://www.nagios.org/"
+PKG_REL_DATE="06-03-2002"
+
 
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
@@ -557,7 +566,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # 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:561: checking for a BSD compatible install" >&5
+echo "configure:570: 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
@@ -614,7 +623,7 @@ 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:618: checking for $ac_word" >&5
+echo "configure:627: 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
@@ -644,7 +653,7 @@ 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:648: checking for $ac_word" >&5
+echo "configure:657: 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
@@ -695,7 +704,7 @@ fi
       # 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:699: checking for $ac_word" >&5
+echo "configure:708: 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
@@ -727,7 +736,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:731: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:740: 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.
@@ -738,12 +747,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 742 "configure"
+#line 751 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:756: \"$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
@@ -769,12 +778,12 @@ 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:773: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:782: 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:778: checking whether we are using GNU C" >&5
+echo "configure:787: 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
@@ -783,7 +792,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:796: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -802,7 +811,7 @@ 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:806: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:815: 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
@@ -834,7 +843,7 @@ else
 fi
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:838: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:847: 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
@@ -862,7 +871,7 @@ fi
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:866: checking how to run the C preprocessor" >&5
+echo "configure:875: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -877,13 +886,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 881 "configure"
+#line 890 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:887: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:896: \"$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
   :
@@ -894,13 +903,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 898 "configure"
+#line 907 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:913: \"$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
   :
@@ -911,13 +920,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 915 "configure"
+#line 924 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:930: \"$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
   :
@@ -942,12 +951,12 @@ fi
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:946: checking for ANSI C header files" >&5
+echo "configure:955: 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 <<EOF
-#line 951 "configure"
+#line 960 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -955,7 +964,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:968: \"$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*
@@ -972,7 +981,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 976 "configure"
+#line 985 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -990,7 +999,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 994 "configure"
+#line 1003 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1011,7 +1020,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1015 "configure"
+#line 1024 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1022,7 +1031,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1046,12 +1055,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1050: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1059: 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 <<EOF
-#line 1055 "configure"
+#line 1064 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1060,7 +1069,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:1064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1073: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -1081,12 +1090,12 @@ EOF
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1085: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1094: 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 <<EOF
-#line 1090 "configure"
+#line 1099 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -1102,7 +1111,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:1106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -1122,21 +1131,21 @@ EOF
 
 fi
 
-for ac_hdr in ctype.h errno.h fcntl.h netdb.h signal.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h
+for ac_hdr in ctype.h errno.h fcntl.h grp.h netdb.h pwd.h signal.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1130: checking for $ac_hdr" >&5
+echo "configure:1139: 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
-#line 1135 "configure"
+#line 1144 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1149: \"$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*
@@ -1164,12 +1173,12 @@ done
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1168: checking for working const" >&5
+echo "configure:1177: 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 <<EOF
-#line 1173 "configure"
+#line 1182 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1218,7 +1227,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1239,12 +1248,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1243: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1252: 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 <<EOF
-#line 1248 "configure"
+#line 1257 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -1252,7 +1261,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:1256: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -1273,12 +1282,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1277: checking for mode_t" >&5
+echo "configure:1286: 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 <<EOF
-#line 1282 "configure"
+#line 1291 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1306,12 +1315,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1310: checking for pid_t" >&5
+echo "configure:1319: 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 <<EOF
-#line 1315 "configure"
+#line 1324 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1339,12 +1348,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1343: checking for size_t" >&5
+echo "configure:1352: 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 <<EOF
-#line 1348 "configure"
+#line 1357 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1372,12 +1381,12 @@ EOF
 fi
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1376: checking return type of signal handlers" >&5
+echo "configure:1385: 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 <<EOF
-#line 1381 "configure"
+#line 1390 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1394,7 +1403,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1413,12 +1422,12 @@ EOF
 
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:1417: checking for uid_t in sys/types.h" >&5
+echo "configure:1426: 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
-#line 1422 "configure"
+#line 1431 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -1447,7 +1456,7 @@ EOF
 fi
 
 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:1451: checking type of array argument to getgroups" >&5
+echo "configure:1460: 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
@@ -1455,7 +1464,7 @@ else
   ac_cv_type_getgroups=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 1459 "configure"
+#line 1468 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Rendell for this test.  */
@@ -1480,7 +1489,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1493: \"$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
@@ -1494,7 +1503,7 @@ fi
 
 if test $ac_cv_type_getgroups = cross; then
         cat > conftest.$ac_ext <<EOF
-#line 1498 "configure"
+#line 1507 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -1519,7 +1528,7 @@ EOF
 
 
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1523: checking for main in -lnsl" >&5
+echo "configure:1532: 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
@@ -1527,14 +1536,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1531 "configure"
+#line 1540 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:1538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1547: \"$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
@@ -1555,7 +1564,7 @@ else
 fi
 
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1559: checking for socket in -lsocket" >&5
+echo "configure:1568: 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
@@ -1563,7 +1572,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1567 "configure"
+#line 1576 "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
@@ -1574,7 +1583,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1587: \"$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
@@ -1595,15 +1604,15 @@ else
 fi
 
 
-for ac_func in strdup strstr strtoul
+for ac_func in strdup strstr strtoul initgroups
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1602: checking for $ac_func" >&5
+echo "configure:1611: 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 1607 "configure"
+#line 1616 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1626,7 +1635,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1639: \"$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
@@ -1652,9 +1661,9 @@ done
 
 
 echo $ac_n "checking for type of socket size""... $ac_c" 1>&6
-echo "configure:1656: checking for type of socket size" >&5
+echo "configure:1665: checking for type of socket size" >&5
 cat > conftest.$ac_ext <<EOF
-#line 1658 "configure"
+#line 1667 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <sys/types.h>
@@ -1664,7 +1673,7 @@ int main() {
 int a = send(1, (const void *)0, (size_t *) 0, (int *) 0);
 ; return 0; }
 EOF
-if { (eval echo configure:1668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define SOCKET_SIZE_TYPE size_t
@@ -1681,6 +1690,27 @@ EOF
 fi
 rm -f conftest*
 
+
+# Check whether --with-nrpe_user or --without-nrpe_user was given.
+if test "${with_nrpe_user+set}" = set; then
+  withval="$with_nrpe_user"
+  nrpe_user=$withval
+else
+  nrpe_user=nagios
+fi
+
+# Check whether --with-nrpe_grp or --without-nrpe_grp was given.
+if test "${with_nrpe_grp+set}" = set; then
+  withval="$with_nrpe_grp"
+  nrpe_grp=$withval
+else
+  nrpe_grp=nagios
+fi
+
+
+
+
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -1782,7 +1812,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "Makefile src/Makefile common/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "Makefile src/Makefile nrpe.cfg common/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -1822,6 +1852,8 @@ s%@CC@%$CC%g
 s%@SET_MAKE@%$SET_MAKE%g
 s%@CPP@%$CPP%g
 s%@SOCKETLIBS@%$SOCKETLIBS%g
+s%@nrpe_user@%$nrpe_user%g
+s%@nrpe_grp@%$nrpe_grp%g
 
 CEOF
 EOF
@@ -1863,7 +1895,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile nrpe.cfg"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
@@ -2042,13 +2074,22 @@ rm -fr confdefs* $ac_clean_files
 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
 
 
+
 echo ""
 echo ""
-echo "Type 'make all' to compile the NRPE daemon and client."
-echo ""
-
+echo "$ac_t""*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:" 1>&6
 
+echo ""
+echo " General Options:"
+echo " -------------------------"
 
+echo "$ac_t"" NRPE user:  $nrpe_user" 1>&6
+echo "$ac_t"" NRPE group: $nrpe_grp" 1>&6
 
 
+echo ""
+echo ""
+echo "Review the options above for accuracy.  If they look okay,"
+echo "type 'make all' to compile the NRPE daemon and client."
+echo ""
 

+ 28 - 6
configure.in

@@ -3,6 +3,11 @@ AC_INIT(src/nrpe.c)
 AC_CONFIG_HEADER(common/config.h)
 AC_PREFIX_DEFAULT(/usr/local/nagios)
 
+PKG_NAME=nrpe
+PKG_VERSION="1.5"
+PKG_HOME_URL="http://www.nagios.org/"
+PKG_REL_DATE="06-03-2002"
+
 dnl Figure out how to invoke "install" and what install options to use.
 
 AC_PROG_INSTALL
@@ -16,7 +21,7 @@ dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(ctype.h errno.h fcntl.h netdb.h signal.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
+AC_CHECK_HEADERS(ctype.h errno.h fcntl.h grp.h netdb.h pwd.h signal.h strings.h string.h syslog.h unistd.h arpa/inet.h netinet/in.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -31,7 +36,7 @@ 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_CHECK_FUNCS(strdup strstr strtoul initgroups)
 
 AC_MSG_CHECKING(for type of socket size)
 AC_TRY_COMPILE([#include <stdlib.h>
@@ -42,15 +47,32 @@ AC_TRY_COMPILE([#include <stdlib.h>
 [AC_DEFINE(SOCKET_SIZE_TYPE, size_t) AC_MSG_RESULT(size_t)],
 [AC_DEFINE(SOCKET_SIZE_TYPE, int) AC_MSG_RESULT(int)])
 
-AC_OUTPUT(Makefile src/Makefile)
 
+AC_ARG_WITH(nrpe_user,--with-nrpe-user=<user> sets user name to run NRPE,nrpe_user=$withval,nrpe_user=nagios)
+AC_ARG_WITH(nrpe_grp,--with-nrpe-grp=<grp> sets group name to run NRPE,nrpe_grp=$withval,nrpe_grp=nagios)
+AC_SUBST(nrpe_user)
+AC_SUBST(nrpe_grp)
+
+
+AC_OUTPUT(Makefile src/Makefile nrpe.cfg)
+
+
+dnl Review options
 echo ""
 echo ""
-echo "Type 'make all' to compile the NRPE daemon and client."
-echo ""
-
+AC_MSG_RESULT([*** Configuration summary for $PKG_NAME $PKG_VERSION $PKG_REL_DATE ***:])
 
+echo ""
+echo " General Options:"
+echo " -------------------------"
 
+AC_MSG_RESULT([ NRPE user:  $nrpe_user])
+AC_MSG_RESULT([ NRPE group: $nrpe_grp])
 
 
+echo ""
+echo ""
+echo "Review the options above for accuracy.  If they look okay,"
+echo "type 'make all' to compile the NRPE daemon and client."
+echo ""
 

+ 21 - 1
nrpe.cfg → nrpe.cfg.in

@@ -2,7 +2,7 @@
 # Sample NRPE Config File 
 # Written by: Ethan Galstad (nagios@nagios.org)
 # 
-# Last Modified: 06-01-2002
+# Last Modified: 06-03-2002
 #
 # NOTES:
 # This is a sample configuration file for the NRPE daemon.  It needs to be
@@ -45,6 +45,26 @@ allowed_hosts=127.0.0.1
 
 
 
+# NRPE USER
+# This determines the effective user that the NRPE daemon should run as.  
+# You can either supply a username or a UID.
+# 
+# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
+
+nrpe_user=@nrpe_user@
+
+
+
+# NRPE GROUP
+# This determines the effective group that the NRPE daemon should run as.  
+# You can either supply a group name or a GID.
+# 
+# NOTE: This option is ignored if NRPE is running under either inetd or xinetd
+
+nrpe_group=@nrpe_grp@
+
+
+
 # DEBUGGING OPTION
 # This option determines whether or not debugging messages are logged to the
 # syslog facility.

+ 7 - 9
src/check_nrpe.c

@@ -1,22 +1,20 @@
 /********************************************************************************************
  *
- * CHECK_NRPE.C
- *
- * Program: NRPE plugin for Nagios
- * License: GPL
+ * CHECK_NRPE.C - NRPE Plugin For Nagios
  * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)
+ * License: GPL
  *
- * Last Modified: 06-01-2002
+ * Last Modified: 06-03-2002
  *
  * Command line: CHECK_NRPE <host_address> [-p port] [-c command] [-wt warn_time] \
  *                          [-ct crit_time] [-to to_sec]
  *
  * Description:
  *
- * This plugin will attempt to connect to the Nagios remote plugin executor daemon on the
- * specified server and port.  The daemon will attempt to run the command defined as
- * [command].  Program output and return code are sent back from the daemon and displayed
- * as this plugin's own output and return code.
+ * This plugin will attempt to connect to the NRPE daemon on the specified server and port.
+ * The daemon will attempt to run the command defined as [command].  Program output and
+ * return code are sent back from the daemon and displayed as this plugin's own output and
+ * return code.
  *
  ********************************************************************************************/
 

+ 95 - 20
src/nrpe.c

@@ -4,7 +4,7 @@
  * Copyright (c) 1999-2002 Ethan Galstad (nagios@nagios.org)
  * License: GPL
  *
- * Last Modified: 06-01-2002
+ * Last Modified: 06-03-2002
  *
  * Command line: nrpe [-i | -d] <config_file>
  *
@@ -16,13 +16,6 @@
  * such as check_users, check_load, check_disk, etc. without
  * having to use rsh or ssh.
  * 
- * Modifications:
- * 
- * Vers 1.0b4-2   2000-01-03 jaclu@grm.se
- * 
- * main() returned STATE_UNKNOWN on successfull launch, changed to STATE_OK
- * I also added syslog support
- * 
  ******************************************************************************/
 
 #include "../common/common.h"
@@ -30,15 +23,9 @@
 #include "nrpe.h"
 #include "netutils.h"
 
-
 #define COMMAND_TIMEOUT		60			/* timeout for execution of plugins */
 #define MAXFD                   64
 
-char allowed_hosts[MAX_INPUT_BUFFER];
-int server_port=DEFAULT_SERVER_PORT;
-char server_address[16]="0.0.0.0";
-int socket_timeout=DEFAULT_SOCKET_TIMEOUT;
-command *command_list=NULL;
 
 void wait_for_connections(void);
 void handle_connection(int);
@@ -46,14 +33,26 @@ int read_config_file(char *);
 int add_command(char *,char *);
 command *find_command(char *);
 void sighandler(int);
+int drop_privileges(char *,char *);
 void free_memory(void);
 int is_an_allowed_host(char *);
 
 int my_system(char *,int,int *,char *,int);            	/* executes a command via popen(), but also protects against timeouts */
 void my_system_sighandler(int);				/* handles timeouts when executing commands via my_system() */
 
-int use_inetd=TRUE;
-int debug=FALSE;
+
+char    allowed_hosts[MAX_INPUT_BUFFER];
+int     server_port=DEFAULT_SERVER_PORT;
+char    server_address[16]="0.0.0.0";
+int     socket_timeout=DEFAULT_SOCKET_TIMEOUT;
+
+command *command_list=NULL;
+
+char    *nrpe_user=NULL;
+char    *nrpe_group=NULL;
+
+int     use_inetd=TRUE;
+int     debug=FALSE;
 
 
 
@@ -162,10 +161,8 @@ int main(int argc, char **argv){
 		chdir("/");
 		umask(0);
 
-		/*
-		for(i=0;i<MAXFD;i++)
-			close(i);
-		*/
+		/* drop privileges */
+		drop_privileges(nrpe_user,nrpe_group);
 
 		/* wait for connections */
 		wait_for_connections();
@@ -265,6 +262,12 @@ int read_config_file(char *filename){
 				debug=FALSE;
 		        }
 
+                else if(!strcmp(varname,"nrpe_user"))
+			nrpe_user=strdup(varvalue);
+
+                else if(!strcmp(varname,"nrpe_group"))
+			nrpe_group=strdup(varvalue);
+
 		else{
 			syslog(LOG_ERR,"Unknown option specified in config file '%s' - Line %d\n",filename,line);
 
@@ -850,3 +853,75 @@ void my_system_sighandler(int sig){
 	exit(STATE_CRITICAL);
         }
 
+
+
+/* drops privileges */
+int drop_privileges(char *user, char *group){
+	uid_t uid=-1;
+	gid_t gid=-1;
+	struct group *grp;
+	struct passwd *pw;
+
+	/* set effective group ID */
+	if(group!=NULL){
+		
+		/* see if this is a group name */
+		if(strspn(group,"0123456789")<strlen(group)){
+			grp=(struct group *)getgrnam(group);
+			if(grp!=NULL)
+				gid=(gid_t)(grp->gr_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")<strlen(user)){
+			pw=(struct passwd *)getpwnam(user);
+			if(pw!=NULL)
+				uid=(uid_t)(pw->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;
+        }

+ 25 - 0
update-version

@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ "x$1" = "x" ]
+then
+	echo "Usage: $0 <release number>"
+	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/nrpe.c
+perl -i -p -e "s/Last Modified: [0-9].*/Last Modified: $SHORTDATE/;" src/check_nrpe.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