Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/nrpe/files/, net-analyzer/nrpe/
Date: Sat, 31 Aug 2019 21:35:47
Message-Id: 1567287296.bc77e1137940198a2ff4ca5f62842dcfdf1bb3e4.mjo@gentoo
1 commit: bc77e1137940198a2ff4ca5f62842dcfdf1bb3e4
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sat Aug 31 20:47:22 2019 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 31 21:34:56 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc77e113
7
8 net-analyzer/nrpe: remove "unused" nrpe-{2.15-r3,3.2.1}.ebuild.
9
10 Package-Manager: Portage-2.3.69, Repoman-2.3.16
11 Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
12
13 net-analyzer/nrpe/Manifest | 1 -
14 net-analyzer/nrpe/files/nrpe-2.14-multiline.patch | 204 ---------------------
15 .../nrpe/files/nrpe-2.15-autoconf-header.patch | 24 ---
16 .../files/nrpe-2.15-metachar-security-fix.patch | 26 ---
17 net-analyzer/nrpe/files/nrpe-2.15-no-ssl.patch | 39 ----
18 net-analyzer/nrpe/files/nrpe-2.15-tcpd-et-al.patch | 50 -----
19 net-analyzer/nrpe/metadata.xml | 3 -
20 net-analyzer/nrpe/nrpe-2.15-r3.ebuild | 140 --------------
21 net-analyzer/nrpe/nrpe-3.2.1.ebuild | 77 --------
22 9 files changed, 564 deletions(-)
23
24 diff --git a/net-analyzer/nrpe/Manifest b/net-analyzer/nrpe/Manifest
25 index 8b0da4d1b7d..0091826d876 100644
26 --- a/net-analyzer/nrpe/Manifest
27 +++ b/net-analyzer/nrpe/Manifest
28 @@ -1,2 +1 @@
29 -DIST nrpe-2.15.tar.gz 419695 BLAKE2B 999ecc633cbd2dc516ff0654db3ac0cc58a88d93ae4ace1040888fe73d8fb471306d95312ac364c79b3a47300ac57c0c429a24697c37bfa639f1da55cb6bc756 SHA512 03ce9774b5112d03235dc9da075770d89d1bcc5ffa5faf221ff7ea8ec5c92ded1e1ae9222581a87cf53736d190ac047e1acce7edc2f31f26c432d786cdef0e73
30 DIST nrpe-3.2.1.tar.gz 518015 BLAKE2B c9be2bf24e3d9977a7ff5c2f0e08bfe841729289af836bb7ac6ccb2c173a519958b12cc3e90ece612ac6c2527ad472ef1464be648a66b11ff8ad483d5ad78cc1 SHA512 ec6ff42a00bd97ed80010a82e26dc35fd419f2feda65820cda0108068173c1ae44eee698833a50fd2079429a6f5eb1321c4f06b09c6708bc5fbe48f176389856
31
32 diff --git a/net-analyzer/nrpe/files/nrpe-2.14-multiline.patch b/net-analyzer/nrpe/files/nrpe-2.14-multiline.patch
33 deleted file mode 100644
34 index 3af2ef95bab..00000000000
35 --- a/net-analyzer/nrpe/files/nrpe-2.14-multiline.patch
36 +++ /dev/null
37 @@ -1,204 +0,0 @@
38 -Add support for large output
39 -
40 -http://opsview-blog.opsera.com/dotorg/2008/08/enhancing-nrpe.htmlIndex: nrpe-2.14/include/common.h
41 -===================================================================
42 -Index: nrpe-2.14/include/common.h
43 -===================================================================
44 ---- nrpe-2.14.orig/include/common.h
45 -+++ nrpe-2.14/include/common.h
46 -@@ -41,7 +41,7 @@
47 - #define DEFAULT_SOCKET_TIMEOUT 10 /* timeout after 10 seconds */
48 - #define DEFAULT_CONNECTION_TIMEOUT 300 /* timeout if daemon is waiting for connection more than this time */
49 -
50 --#define MAX_INPUT_BUFFER 2048 /* max size of most buffers we use */
51 -+#define MAX_INPUT_BUFFER 16384 /* max size of most buffers we use */
52 - #define MAX_FILENAME_LENGTH 256
53 -
54 - #define MAX_HOST_ADDRESS_LENGTH 256 /* max size of a host address */
55 -@@ -55,12 +55,14 @@
56 -
57 - #define QUERY_PACKET 1 /* id code for a packet containing a query */
58 - #define RESPONSE_PACKET 2 /* id code for a packet containing a response */
59 -+#define RESPONSE_PACKET_WITH_MORE 3 /* id code for a packet containing a response, with more data to follow */
60 -
61 - #define NRPE_PACKET_VERSION_3 3 /* packet version identifier */
62 - #define NRPE_PACKET_VERSION_2 2
63 - #define NRPE_PACKET_VERSION_1 1 /* older packet version identifiers (no longer supported) */
64 -
65 - #define MAX_PACKETBUFFER_LENGTH 1024 /* max amount of data we'll send in one query/response */
66 -+ /* WARNING - do not change this as older clients/servers will not work */
67 -
68 - typedef struct packet_struct{
69 - int16_t packet_version;
70 -Index: nrpe-2.14/src/check_nrpe.c
71 -===================================================================
72 ---- nrpe-2.14.orig/src/check_nrpe.c
73 -+++ nrpe-2.14/src/check_nrpe.c
74 -@@ -221,6 +221,11 @@ int main(int argc, char **argv){
75 - return STATE_UNKNOWN;
76 - }
77 -
78 -+ /* Altinity patch: Allow multiple packets to be received */
79 -+ /* Indentation not corrected to allow simpler patching */
80 -+ /* START MULTI_PACKET LOOP */
81 -+ do {
82 -+
83 - /* wait for the response packet */
84 - bytes_to_recv=sizeof(receive_packet);
85 - if(use_ssl==FALSE)
86 -@@ -233,31 +238,24 @@ int main(int argc, char **argv){
87 - /* reset timeout */
88 - alarm(0);
89 -
90 -- /* close the connection */
91 --#ifdef HAVE_SSL
92 -- if(use_ssl==TRUE){
93 -- SSL_shutdown(ssl);
94 -- SSL_free(ssl);
95 -- SSL_CTX_free(ctx);
96 -- }
97 --#endif
98 -- graceful_close(sd,1000);
99 --
100 - /* recv() error */
101 - if(rc<0){
102 - printf("CHECK_NRPE: Error receiving data from daemon.\n");
103 -+ graceful_close(sd,1000);
104 - return STATE_UNKNOWN;
105 - }
106 -
107 - /* server disconnected */
108 - else if(rc==0){
109 - printf("CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.\n");
110 -+ graceful_close(sd,1000);
111 - return STATE_UNKNOWN;
112 - }
113 -
114 - /* receive underflow */
115 - else if(bytes_to_recv<sizeof(receive_packet)){
116 - printf("CHECK_NRPE: Receive underflow - only %d bytes received (%d expected).\n",bytes_to_recv,sizeof(receive_packet));
117 -+ graceful_close(sd,1000);
118 - return STATE_UNKNOWN;
119 - }
120 -
121 -@@ -271,21 +269,21 @@ int main(int argc, char **argv){
122 - calculated_crc32=calculate_crc32((char *)&receive_packet,sizeof(receive_packet));
123 - if(packet_crc32!=calculated_crc32){
124 - printf("CHECK_NRPE: Response packet had invalid CRC32.\n");
125 -- close(sd);
126 -+ graceful_close(sd,1000);
127 - return STATE_UNKNOWN;
128 - }
129 -
130 - /* check packet version */
131 - if(ntohs(receive_packet.packet_version)!=NRPE_PACKET_VERSION_2){
132 - printf("CHECK_NRPE: Invalid packet version received from server.\n");
133 -- close(sd);
134 -+ graceful_close(sd,1000);
135 - return STATE_UNKNOWN;
136 - }
137 -
138 - /* check packet type */
139 -- if(ntohs(receive_packet.packet_type)!=RESPONSE_PACKET){
140 -+ if(ntohs(receive_packet.packet_type)!=RESPONSE_PACKET && ntohs(receive_packet.packet_type)!=RESPONSE_PACKET_WITH_MORE){
141 - printf("CHECK_NRPE: Invalid packet type received from server.\n");
142 -- close(sd);
143 -+ graceful_close(sd,1000);
144 - return STATE_UNKNOWN;
145 - }
146 -
147 -@@ -297,8 +295,18 @@ int main(int argc, char **argv){
148 - if(!strcmp(receive_packet.buffer,""))
149 - printf("CHECK_NRPE: No output returned from daemon.\n");
150 - else
151 -- printf("%s\n",receive_packet.buffer);
152 -- }
153 -+ printf("%s",receive_packet.buffer);
154 -+
155 -+ } while (ntohs(receive_packet.packet_type)==RESPONSE_PACKET_WITH_MORE);
156 -+ /* END MULTI_PACKET LOOP */
157 -+
158 -+ /* Finish output with newline */
159 -+ printf("\n");
160 -+
161 -+ /* close the connection */
162 -+ graceful_close(sd,1000);
163 -+
164 -+ }
165 -
166 - /* reset the alarm */
167 - else
168 -@@ -434,6 +442,14 @@ int graceful_close(int sd, int timeout){
169 - struct timeval tv;
170 - char buf[1000];
171 -
172 -+#ifdef HAVE_SSL
173 -+ if(use_ssl==TRUE){
174 -+ SSL_shutdown(ssl);
175 -+ SSL_free(ssl);
176 -+ SSL_CTX_free(ctx);
177 -+ }
178 -+#endif
179 -+
180 - /* send FIN packet */
181 - shutdown(sd,SHUT_WR);
182 - for(;;){
183 -Index: nrpe-2.14/src/nrpe.c
184 -===================================================================
185 ---- nrpe-2.14.orig/src/nrpe.c
186 -+++ nrpe-2.14/src/nrpe.c
187 -@@ -1056,6 +1056,8 @@ void handle_connection(int sock){
188 - char processed_command[MAX_INPUT_BUFFER];
189 - int result=STATE_OK;
190 - int early_timeout=FALSE;
191 -+ int bytes_copied=0;
192 -+ char *pbuffer=&buffer[0];
193 - int rc;
194 - int x;
195 - #ifdef DEBUG
196 -@@ -1272,6 +1274,14 @@ void handle_connection(int sock){
197 - if(buffer[strlen(buffer)-1]=='\n')
198 - buffer[strlen(buffer)-1]='\x0';
199 -
200 -+ /* Altinity patch to allow multi packet responses */
201 -+ /* Loop not indented to allow easier patching */
202 -+ /* START MULTI_PACKET LOOP */
203 -+ do {
204 -+
205 -+ if(debug==TRUE)
206 -+ syslog(LOG_DEBUG,"Sending response - bytes left: %d", strlen(pbuffer));
207 -+
208 - /* clear the response packet buffer */
209 - bzero(&send_packet,sizeof(send_packet));
210 -
211 -@@ -1280,11 +1290,17 @@ void handle_connection(int sock){
212 -
213 - /* initialize response packet data */
214 - send_packet.packet_version=(int16_t)htons(NRPE_PACKET_VERSION_2);
215 -- send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET);
216 - send_packet.result_code=(int16_t)htons(result);
217 -- strncpy(&send_packet.buffer[0],buffer,MAX_PACKETBUFFER_LENGTH);
218 -+ strncpy(&send_packet.buffer[0],pbuffer,MAX_PACKETBUFFER_LENGTH);
219 - send_packet.buffer[MAX_PACKETBUFFER_LENGTH-1]='\x0';
220 --
221 -+
222 -+ bytes_copied = strlen(&send_packet.buffer[0]);
223 -+ pbuffer = pbuffer+bytes_copied;
224 -+ if(strlen(pbuffer)>0)
225 -+ send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET_WITH_MORE);
226 -+ else
227 -+ send_packet.packet_type=(int16_t)htons(RESPONSE_PACKET);
228 -+
229 - /* calculate the crc 32 value of the packet */
230 - send_packet.crc32_value=(u_int32_t)0L;
231 - calculated_crc32=calculate_crc32((char *)&send_packet,sizeof(send_packet));
232 -@@ -1303,6 +1319,9 @@ void handle_connection(int sock){
233 - SSL_write(ssl,&send_packet,bytes_to_send);
234 - #endif
235 -
236 -+ } while (strlen(pbuffer) > 0);
237 -+ /* END MULTI_PACKET LOOP */
238 -+
239 - #ifdef HAVE_SSL
240 - if(ssl){
241 - complete_SSL_shutdown( ssl);
242
243 diff --git a/net-analyzer/nrpe/files/nrpe-2.15-autoconf-header.patch b/net-analyzer/nrpe/files/nrpe-2.15-autoconf-header.patch
244 deleted file mode 100644
245 index 81078c44971..00000000000
246 --- a/net-analyzer/nrpe/files/nrpe-2.15-autoconf-header.patch
247 +++ /dev/null
248 @@ -1,24 +0,0 @@
249 -diff -Nuar --exclude '*.orig' nrpe-2.15.orig/configure.in nrpe-2.15/configure.in
250 ---- nrpe-2.15.orig/configure.in 2013-09-06 08:27:13.000000000 -0700
251 -+++ nrpe-2.15/configure.in 2014-04-19 09:32:52.251766643 -0700
252 -@@ -6,7 +6,8 @@
253 -
254 - AC_INIT([nrpe],[2.15],[nagios-users@×××××××××××××××××.net],[nrpe],[http://www.nagios.org])
255 - AC_CONFIG_SRCDIR([src/nrpe.c])
256 --AC_CONFIG_HEADERS([include/config.h])
257 -+AC_CONFIG_HEADERS([include/autoconf.h])
258 - AC_CONFIG_FILES([Makefile
259 -+ include/config.h
260 - subst
261 - src/Makefile
262 -diff -Nuar --exclude '*.orig' nrpe-2.15.orig/include/config.h.in nrpe-2.15/include/config.h.in
263 ---- nrpe-2.15.orig/include/config.h.in 2013-09-06 08:27:13.000000000 -0700
264 -+++ nrpe-2.15/include/config.h.in 2014-04-19 09:33:07.620035056 -0700
265 -@@ -26,6 +26,7 @@
266 -
267 - #include <stdio.h>
268 - #include <stdlib.h>
269 -+#include "autoconf.h"
270 -
271 -
272 - #define DEFAULT_SERVER_PORT @nrpe_port@ /* default port to use */
273
274 diff --git a/net-analyzer/nrpe/files/nrpe-2.15-metachar-security-fix.patch b/net-analyzer/nrpe/files/nrpe-2.15-metachar-security-fix.patch
275 deleted file mode 100644
276 index c42f8bfdec0..00000000000
277 --- a/net-analyzer/nrpe/files/nrpe-2.15-metachar-security-fix.patch
278 +++ /dev/null
279 @@ -1,26 +0,0 @@
280 -Disallow all control characters in argument handling.
281 -
282 -This closes a security hole that allowed passing commands via the argument
283 -handling, if a newline was used to seperate the argument from the rest of the
284 -command.
285 -
286 -X-URL: http://www.exploit-db.com/exploits/32925/
287 -Signed-off-by: Robin H. Johnson <robbat2@g.o>
288 -
289 ---
290 -I didn't find any patches from upstream NRPE, so I wrote this quick one.
291 -If somebody else has a valid use for control characters in NRPE arguments, then
292 -this could be relaxed slightly.
293 -
294 -diff -Nuar --exclude '*.orig' nrpe-2.15.orig/src/nrpe.c nrpe-2.15/src/nrpe.c
295 ---- nrpe-2.15.orig/src/nrpe.c 2014-04-19 09:37:16.022373910 -0700
296 -+++ nrpe-2.15/src/nrpe.c 2014-04-19 09:46:53.237458939 -0700
297 -@@ -53,7 +53,7 @@
298 -
299 - #define DEFAULT_COMMAND_TIMEOUT 60 /* default timeout for execution of plugins */
300 - #define MAXFD 64
301 --#define NASTY_METACHARS "|`&><'\"\\[]{};"
302 -+#define NASTY_METACHARS "|`&><'\"\\[]{};\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f"
303 - #define howmany(x,y) (((x)+((y)-1))/(y))
304 - #define MAX_LISTEN_SOCKS 16
305 -
306
307 diff --git a/net-analyzer/nrpe/files/nrpe-2.15-no-ssl.patch b/net-analyzer/nrpe/files/nrpe-2.15-no-ssl.patch
308 deleted file mode 100644
309 index 3b3fc135455..00000000000
310 --- a/net-analyzer/nrpe/files/nrpe-2.15-no-ssl.patch
311 +++ /dev/null
312 @@ -1,39 +0,0 @@
313 -Without this patch, you can't build nrpe without SSL support. It was
314 -originally submitted on the Nagios forums by user Matthew L. Daniel:
315 -
316 - https://support.nagios.com/forum/viewtopic.php?t=27027
317 -
318 -It was merged into the upstream github repo (NagiosEnterprises/nrpe)
319 -in commit 3736fdeeac11a.
320 -
321 -
322 -diff --git a/src/nrpe.c b/src/nrpe.c
323 -index 4bc849b..1e55ab4 100644
324 ---- a/src/nrpe.c
325 -+++ b/src/nrpe.c
326 -@@ -102,7 +102,9 @@ int use_src=FALSE; /* Define parameter for SRC option */
327 - int listen_queue_size=DEFAULT_LISTEN_QUEUE_SIZE;
328 -
329 -
330 -+#ifdef HAVE_SSL
331 - void complete_SSL_shutdown( SSL *);
332 -+#endif
333 -
334 -
335 - int main(int argc, char **argv){
336 -@@ -1815,6 +1817,7 @@ int remove_pid_file(void){
337 - return OK;
338 - }
339 -
340 -+#ifdef HAVE_SSL
341 - void complete_SSL_shutdown( SSL *ssl) {
342 -
343 - /*
344 -@@ -1835,6 +1838,7 @@ void complete_SSL_shutdown( SSL *ssl) {
345 - if( SSL_shutdown( ssl)) break;
346 - }
347 - }
348 -+#endif/*HAVE_SSL*/
349 -
350 - /* bail if daemon is running as root */
351 - int check_privileges(void){
352
353 diff --git a/net-analyzer/nrpe/files/nrpe-2.15-tcpd-et-al.patch b/net-analyzer/nrpe/files/nrpe-2.15-tcpd-et-al.patch
354 deleted file mode 100644
355 index b8a0811b831..00000000000
356 --- a/net-analyzer/nrpe/files/nrpe-2.15-tcpd-et-al.patch
357 +++ /dev/null
358 @@ -1,50 +0,0 @@
359 -diff -Nuar --exclude '*.orig' nrpe-2.15.orig/configure.in nrpe-2.15/configure.in
360 ---- nrpe-2.15.orig/configure.in 2013-09-06 08:27:13.000000000 -0700
361 -+++ nrpe-2.15/configure.in 2014-04-19 09:20:50.406150828 -0700
362 -@@ -45,7 +45,7 @@
363 - AC_HEADER_STDC
364 - AC_HEADER_TIME
365 - AC_HEADER_SYS_WAIT
366 --AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h signal.h stdint.h strings.h string.h syslog.h tcpd.h unistd.h arpa/inet.h netinet/in.h socket.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
367 -+AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h getopt.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 socket.h sys/types.h sys/time.h sys/resource.h sys/wait.h sys/socket.h sys/stat.h)
368 -
369 - dnl Checks for typedefs, structures, and compiler characteristics.
370 - AC_C_CONST
371 -@@ -164,11 +164,20 @@
372 - AC_CHECK_LIB(nsl,main,SOCKETLIBS="$SOCKETLIBS -lnsl")
373 - AC_CHECK_LIB(socket,socket,SOCKETLIBS="$SOCKETLIBS -lsocket")
374 - AC_SUBST(SOCKETLIBS)
375 --AC_CHECK_LIB(wrap,main,[
376 -- LIBWRAPLIBS="$LIBWRAPLIBS -lwrap"
377 -+
378 -+AC_ARG_ENABLE([tcp-wrapper],
379 -+ AS_HELP_STRING([--disable-tcp-wrapper], [Disable building with TCP wrappers. *** DISABLING IS A SECURITY RISK! *** Read the SECURITY file before using this option! @<:@default=enable@:>@]))
380 -+
381 -+LIBWRAPLIBS=""
382 -+AS_IF([test "x$enable_tcp_wrapper" != "xno"], [
383 -+ AC_CHECK_LIB([wrap],[hosts_access],[
384 -+ LIBWRAPLIBS="$LIBWRAPLIBS -lwrap"
385 - AC_DEFINE(HAVE_LIBWRAP,[1],[Have the TCP wrappers library])
386 -- ])
387 -+ AC_DEFINE(HAVE_TCPD_H,[1],[Have the TCP wrappers library])
388 -+ ])
389 -+])
390 - AC_SUBST(LIBWRAPLIBS)
391 -+
392 - AC_CHECK_FUNCS(strdup strstr strtoul initgroups closesocket)
393 -
394 - dnl socklen_t check - from curl
395 -@@ -440,8 +449,11 @@
396 - AC_SUBST(TARGET_PLATFORM)
397 -
398 - AC_ARG_ENABLE([command-args],
399 -- AS_HELP_STRING([--enable-command-args],[allows clients to specify command arguments. *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!]),
400 -- AC_DEFINE_UNQUOTED(ENABLE_COMMAND_ARGUMENTS,[1],[Enable command-line arguments]))
401 -+ AS_HELP_STRING([--enable-command-args],[allows clients to specify command arguments. *** THIS IS A SECURITY RISK! *** Read the SECURITY file before using this option!]))
402 -+
403 -+AS_IF([test "x$enable_command_args" = "xyes"], [
404 -+ AC_DEFINE(ENABLE_COMMAND_ARGUMENTS,[1],[Enable command-line arguments])
405 -+])
406 -
407 - AC_ARG_ENABLE([bash-command-substitution],
408 - AS_HELP_STRING([--enable-bash-command-substitution],[allows clients to pass bash command substitutions of the form $(command). *** THIS IS A HIGH SECURITY RISK! *** Read the SECURITY file before using this option!]),
409
410 diff --git a/net-analyzer/nrpe/metadata.xml b/net-analyzer/nrpe/metadata.xml
411 index e47fd6fd83c..6d48b12e1ab 100644
412 --- a/net-analyzer/nrpe/metadata.xml
413 +++ b/net-analyzer/nrpe/metadata.xml
414 @@ -15,9 +15,6 @@
415 Nagios/Icinga master. Make sure you understand the implications
416 of this flag as it can be a security risk.
417 </flag>
418 - <flag name="minimal">
419 - Only build the check plugins for Nagios/Icinga, and not the daemon.
420 - </flag>
421 </use>
422 <upstream>
423 <remote-id type="sourceforge">nagios</remote-id>
424
425 diff --git a/net-analyzer/nrpe/nrpe-2.15-r3.ebuild b/net-analyzer/nrpe/nrpe-2.15-r3.ebuild
426 deleted file mode 100644
427 index afdbdc893c4..00000000000
428 --- a/net-analyzer/nrpe/nrpe-2.15-r3.ebuild
429 +++ /dev/null
430 @@ -1,140 +0,0 @@
431 -# Copyright 1999-2018 Gentoo Foundation
432 -# Distributed under the terms of the GNU General Public License v2
433 -
434 -EAPI=5
435 -inherit eutils systemd toolchain-funcs multilib user autotools
436 -
437 -DESCRIPTION="Nagios Remote Plugin Executor"
438 -HOMEPAGE="http://www.nagios.org/"
439 -SRC_URI="mirror://sourceforge/nagios/${P}.tar.gz"
440 -
441 -LICENSE="GPL-2+"
442 -SLOT="0"
443 -KEYWORDS="alpha amd64 hppa ppc ppc64 sparc x86"
444 -IUSE="command-args libressl minimal selinux ssl tcpd"
445 -
446 -DEPEND="
447 - ssl? (
448 - !libressl? ( dev-libs/openssl:0= )
449 - libressl? ( dev-libs/libressl:0= )
450 - )
451 - !minimal? ( tcpd? ( sys-apps/tcp-wrappers ) )"
452 -RDEPEND="${DEPEND}
453 - !minimal? (
454 - || ( net-analyzer/nagios-plugins net-analyzer/monitoring-plugins )
455 - )
456 - selinux? ( sec-policy/selinux-nagios )"
457 -
458 -pkg_setup() {
459 - enewgroup nagios
460 - enewuser nagios -1 /bin/bash /dev/null nagios
461 -
462 - elog "If you plan to use \"nrpe_check_control\" then you may want to specify"
463 - elog "different command and services files. You can override the defaults"
464 - elog "through the \"NAGIOS_COMMAND_FILE\" and \"NAGIOS_SERVICES_FILE\" environment variables."
465 - elog "NAGIOS_COMMAND_FILE=${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}"
466 - elog "NAGIOS_SERVICES_FILE=${NAGIOS_SERVICES_FILE:-/etc/services.cfg}"
467 -}
468 -
469 -src_prepare() {
470 - # Add support for large output,
471 - # http://opsview-blog.opsera.com/dotorg/2008/08/enhancing-nrpe.html
472 - epatch "${FILESDIR}"/${PN}-2.14-multiline.patch
473 -
474 - # fix configure, among others #326367, #397603
475 - epatch "${FILESDIR}"/${PN}-2.15-tcpd-et-al.patch
476 -
477 - # otherwise autoconf will overwrite the custom include/config.h.in
478 - epatch "${FILESDIR}"/${PN}-2.15-autoconf-header.patch
479 -
480 - # improve handling of metachars for security
481 - epatch "${FILESDIR}"/${PN}-2.15-metachar-security-fix.patch
482 -
483 - # Fix build with USE="-ssl".
484 - epatch "${FILESDIR}"/${PN}-2.15-no-ssl.patch
485 -
486 - sed -i -e '/define \(COMMAND\|SERVICES\)_FILE/d' \
487 - contrib/nrpe_check_control.c || die
488 -
489 - # change the default location of the pid file
490 - sed -i -e '/pid_file/s:/var/run:/run:' sample-config/nrpe.cfg.in || die
491 -
492 - # fix TFU handling of autoheader
493 - sed -i -e '/#undef/d' include/config.h.in || die
494 -
495 - eautoreconf
496 -}
497 -
498 -src_configure() {
499 - local myconf
500 - if use minimal; then
501 - myconf="--disable-tcp-wrapper --disable-command-args"
502 - else
503 - myconf="$(use_enable tcpd tcp-wrapper) $(use_enable command-args)"
504 - fi
505 -
506 - econf \
507 - --libexecdir=/usr/$(get_libdir)/nagios/plugins \
508 - --localstatedir=/var/nagios \
509 - --sysconfdir=/etc/nagios \
510 - --with-nrpe-user=nagios \
511 - --with-nrpe-group=nagios \
512 - $(use_enable ssl) \
513 - ${myconf}
514 -}
515 -
516 -src_compile() {
517 - emake -C src check_nrpe $(use minimal || echo nrpe)
518 -
519 - # Add nifty nrpe check tool
520 - $(tc-getCC) ${CPPFLAGS} ${CFLAGS} \
521 - -DCOMMAND_FILE=\"${NAGIOS_COMMAND_FILE:-/var/rw/nagios.cmd}\" \
522 - -DSERVICES_FILE=\"${NAGIOS_SERVICES_FILE:-/etc/services.cfg}\" \
523 - ${LDFLAGS} -o nrpe_check_control contrib/nrpe_check_control.c || die
524 -}
525 -
526 -src_install() {
527 - dodoc LEGAL Changelog README SECURITY \
528 - contrib/README.nrpe_check_control \
529 - $(use ssl && echo README.SSL)
530 -
531 - exeinto /usr/$(get_libdir)/nagios/plugins
532 - doexe src/check_nrpe nrpe_check_control
533 -
534 - use minimal && return 0
535 -
536 - ## NON-MINIMAL INSTALL FOLLOWS ##
537 -
538 - insinto /etc/nagios
539 - newins sample-config/nrpe.cfg nrpe.cfg
540 - fowners root:nagios /etc/nagios/nrpe.cfg
541 - fperms 0640 /etc/nagios/nrpe.cfg
542 -
543 - exeinto /usr/libexec
544 - doexe src/nrpe
545 -
546 - newinitd "${FILESDIR}"/nrpe.init nrpe
547 - systemd_dounit "${FILESDIR}/${PN}.service"
548 -
549 - insinto /etc/xinetd.d/
550 - newins "${FILESDIR}/nrpe.xinetd.2" nrpe
551 -
552 - if use tcpd; then
553 - sed -i -e '/^reload()/, /^}/ d' -e '/extra_started_commands/s:reload::' \
554 - "${D}"/etc/init.d/nrpe
555 - fi
556 -}
557 -
558 -pkg_postinst() {
559 - elog "If you are using the nrpe daemon, remember to edit"
560 - elog "the config file /etc/nagios/nrpe.cfg"
561 -
562 - if use command-args ; then
563 - ewarn ""
564 - ewarn "You have enabled command-args for NRPE. This enables"
565 - ewarn "the ability for clients to supply arguments to commands"
566 - ewarn "which should be run. "
567 - ewarn "THIS IS CONSIDERED A SECURITY RISK!"
568 - ewarn "Please read /usr/share/doc/${PF}/SECURITY.bz2 for more info"
569 - fi
570 -}
571
572 diff --git a/net-analyzer/nrpe/nrpe-3.2.1.ebuild b/net-analyzer/nrpe/nrpe-3.2.1.ebuild
573 deleted file mode 100644
574 index 3a4f9d8d251..00000000000
575 --- a/net-analyzer/nrpe/nrpe-3.2.1.ebuild
576 +++ /dev/null
577 @@ -1,77 +0,0 @@
578 -# Copyright 1999-2018 Gentoo Foundation
579 -# Distributed under the terms of the GNU General Public License v2
580 -
581 -EAPI=6
582 -inherit systemd user
583 -
584 -DESCRIPTION="Nagios Remote Plugin Executor"
585 -HOMEPAGE="https://github.com/NagiosEnterprises/nrpe"
586 -SRC_URI="${HOMEPAGE}/releases/download/${P}/${P}.tar.gz"
587 -
588 -LICENSE="GPL-2+"
589 -SLOT="0"
590 -KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
591 -IUSE="command-args libressl selinux ssl"
592 -
593 -DEPEND="sys-apps/tcp-wrappers
594 - ssl? (
595 - !libressl? ( dev-libs/openssl:0= )
596 - libressl? ( dev-libs/libressl:0= )
597 - )"
598 -RDEPEND="${DEPEND}
599 - || ( net-analyzer/nagios-plugins net-analyzer/monitoring-plugins )
600 - selinux? ( sec-policy/selinux-nagios )"
601 -
602 -pkg_setup() {
603 - enewgroup nagios
604 - enewuser nagios -1 /bin/bash /var/nagios/home nagios
605 -}
606 -
607 -src_configure() {
608 - econf \
609 - --libexecdir=/usr/$(get_libdir)/nagios/plugins \
610 - --localstatedir=/var/nagios \
611 - --sysconfdir=/etc/nagios \
612 - --with-nrpe-user=nagios \
613 - --with-nrpe-group=nagios \
614 - --with-piddir=/run \
615 - $(use_enable command-args) \
616 - $(use_enable ssl)
617 -}
618 -
619 -src_compile() {
620 - emake all
621 -}
622 -
623 -src_install() {
624 - default
625 -
626 - dodoc CHANGELOG.md SECURITY.md
627 - insinto /etc/nagios
628 - newins sample-config/nrpe.cfg nrpe.cfg
629 - fowners root:nagios /etc/nagios/nrpe.cfg
630 - fperms 0640 /etc/nagios/nrpe.cfg
631 -
632 - newinitd "startup/openrc-init" nrpe
633 - newconfd "startup/openrc-conf" nrpe
634 - systemd_newunit "startup/default-service" "${PN}.service"
635 -
636 - insinto /etc/xinetd.d/
637 - newins "${FILESDIR}/nrpe.xinetd.2" nrpe
638 -
639 - rm "${D}/usr/bin/nrpe-uninstall" || die 'failed to remove uninstall tool'
640 -}
641 -
642 -pkg_postinst(){
643 - elog 'Some users have reported incompatibilities between nrpe-2.x and'
644 - elog 'nrpe-3.x. We recommend that you use the same major version for'
645 - elog 'both your server and clients.'
646 -
647 - if use command-args ; then
648 - ewarn ''
649 - ewarn 'You have enabled command-args for NRPE. That lets clients'
650 - ewarn 'supply arguments to the commands that are run, and IS A'
651 - ewarn 'SECURITY RISK!'
652 - ewarn''
653 - fi
654 -}