[Nagios-devel] NSCA pwent cleanup

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] NSCA pwent cleanup

Post by Guest »

--6o78gXsyQHm68LY/
Content-Type: multipart/mixed; boundary="iKKZt69u2Wx/rspf"
Content-Disposition: inline


--iKKZt69u2Wx/rspf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

nsca wasn't calling endpwent() and endgrent() in drop_privileges(). I'm pretty
sure that this doesn't actually hurt anything, but it's good practice, as it
frees the resources associated with the passwd and group databases.

M

--iKKZt69u2Wx/rspf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="nsca-20031024cvs-entcleanup.patch"
Content-Transfer-Encoding: quoted-printable

Index: nsca.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/nagios/nsca/src/nsca.c,v
retrieving revision 1.16
diff -u -r1.16 nsca.c
--- nsca.c 24 Oct 2003 01:31:08 -0000 1.16
+++ nsca.c 24 Oct 2003 23:23:29 -0000
@@ -1164,6 +1164,7 @@
gid=3D(gid_t)(grp->gr_gid);
else
syslog(LOG_ERR,"Warning: Could not get group entry for '%s'",group);
+ endgrent();
}
=20
/* else we were passed the GID */
@@ -1189,6 +1190,7 @@
uid=3D(uid_t)(pw->pw_uid);
else
syslog(LOG_ERR,"Warning: Could not get passwd entry for '%s'",user);
+ endpwent();
}
=20
/* else we were passed the UID */

--iKKZt69u2Wx/rspf--

--6o78gXsyQHm68LY/
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/mbW0OtZWu2tc1lARAsvlAJ9ob2jvWN19wC9WG9gv7Xm5u36ZGwCfWfRm
KbFIVOv4DfsN8aiBno2H2Js=
=B+us
-----END PGP SIGNATURE-----

--6o78gXsyQHm68LY/--





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