Here are several fixes for nrpe & check_nrpe. Let me know if you'd prefer me to break this up into multiple requests. Kind of kept finding new stuff as I went along.
Fix various warnings when building with -Wall.
Various misc fixes, mainly left over code.
Split my_system() into separate functions for child & parent.
Rewrite my_system_*() IO loops to handle async & large buffers.
Due to scheduling and various implementations, we can't depend on read/write having data/space available. It's also possible to fill the send buffer before we exit so need to read data while waiting for child to exit.
I've tested with 10000, 60000, 70000 sized outputs. The 10000 & 60000 hashes match, and as expected the 70000 gets truncated.
Will probably help with #271
Fix debug display of acl IP addresses
Would always show same address due to shared buffer.
Show correct address family when setting up listen addresses.
Would always say IPv4 no matter which family the address was.
Only make requested binary
Top level Makefile didn't pass command to child so would always make all
Don't compile utils.c twice, once for each program.
utils.c is shared between both programs.
Fix a few pedantic warnings, mostly prototype related.
Fix use of uninitialized variable.
Clear any existing ACLs before parsing new config.
Would get duplicate ACL entries if allowed_hosts was used multiple times in config or on every SIGHUP.
Also would try to dump IPv6 ACLs as IPv4.
Fix various leaks detected by valgrind.
All config options that use strdup() would leak memory if used more than once or on SIGHUP.
Only allocate fdset when size changes and ensure we free it.
Here are several fixes for
nrpe
&check_nrpe
. Let me know if you'd prefer me to break this up into multiple requests. Kind of kept finding new stuff as I went along.Fix various warnings when building with
-Wall
.Various misc fixes, mainly left over code.
my_system()
into separate functions for child & parent.Rewrite
my_system_*()
IO loops to handle async & large buffers.Due to scheduling and various implementations, we can't depend on read/write having data/space available. It's also possible to fill the send buffer before we exit so need to read data while waiting for child to exit. I've tested with 10000, 60000, 70000 sized outputs. The 10000 & 60000 hashes match, and as expected the 70000 gets truncated. Will probably help with #271
Fix debug display of acl IP addresses
Would always show same address due to shared buffer.
Show correct address family when setting up listen addresses.
Would always say
IPv4
no matter which family the address was.Only make requested binary
Top level Makefile didn't pass command to child so would always
make all
Don't compile utils.c twice, once for each program.
utils.c
is shared between both programs.Clear any existing ACLs before parsing new config.
Would get duplicate ACL entries if allowed_hosts was used multiple times in config or on every
SIGHUP
. Also would try to dump IPv6 ACLs as IPv4.Fix various leaks detected by valgrind.
All config options that use
strdup()
would leak memory if used more than once or onSIGHUP
. Only allocatefdset
when size changes and ensure we free it.