Whamcloud - gitweb
libcom_err: Fix file descriptor leak after an exec
authorTheodore Ts'o <tytso@mit.edu>
Thu, 2 Oct 2008 00:45:26 +0000 (20:45 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 2 Oct 2008 01:13:46 +0000 (21:13 -0400)
commit902be4ab7d57242feffc6b631cff1b953a7f95c9
treed3fbb76ee262e3595561ec7fa028320da126706e
parent0f589a4d5701b0cc95d90685f8cbbdc66a7be3a6
libcom_err: Fix file descriptor leak after an exec

Some applications repeatedly re-exec themselves, and if they use the
com_err library, they can leak a file descriptor for each re-exec.
Fix this by setting the close-on-exec flag on the debug file
descriptor.  In addition, if the COMERR_DEBUG environment variable
isn't set, don't open the file handle at all.

Addresses-Red-Hat-Bugzilla: #464689

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/et/error_message.c