[Nagios-devel] [PATCH] NDOUTILS Fix: The ndo2db debug file should

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] [PATCH] NDOUTILS Fix: The ndo2db debug file should

Post by Guest »

This is a multi-part message in MIME format.
--------------030904050901050507080208
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Devels,

Lars M. has detected a small file based race condition in ndo2db causing
the debug file creation before dropping the privileges to ndo2db_user.

Attached patch should solve the problem.

Thanks to Lars bringing this to attention.

Regards,
Hendrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkke8Q4ACgkQlI0PwfxLQjmC3QCfcSbN1jOO8Sv7fDQ4CdcNxmKl
EuMAn1sOR70QySrInGHWm9GqiQS94a1+
=h0oS
-----END PGP SIGNATURE-----

--------------030904050901050507080208
Content-Type: text/x-patch;
name="bf6cd0f038495530896ee16c1e5491eb80f72280.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="bf6cd0f038495530896ee16c1e5491eb80f72280.diff"

diff --git a/src/ndo2db.c b/src/ndo2db.c
index 19698c4..7a0fcc7 100644
--- a/src/ndo2db.c
+++ b/src/ndo2db.c
@@ -109,9 +109,6 @@ int main(int argc, char **argv){
exit(1);
}

- /* open debug log */
- ndo2db_open_debug_log();
-
/* make sure we're good to go */
if(ndo2db_check_init_reqs()!=NDO_OK){
printf("One or more required parameters is missing or incorrect.\n");
@@ -146,6 +143,9 @@ int main(int argc, char **argv){
/* drop privileges */
ndo2db_drop_privileges(ndo2db_user,ndo2db_group);

+ /* open debug log */
+ ndo2db_open_debug_log();
+
/* if we're running under inetd... */
if(ndo2db_use_inetd==NDO_TRUE){



--------------030904050901050507080208--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked