[cpp-sp] branch master updated: SSPCPP-712 - Shibd leaks file handles after config reload

Scott Cantor cantor.2 at osu.edu
Mon Apr 16 21:14:54 EDT 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=4ab7ce96468b2b75ed3a391fe15abcd363e30a3c

The following commit(s) were added to refs/heads/master by this push:
       new  4ab7ce9   SSPCPP-712 - Shibd leaks file handles after config reload
4ab7ce9 is described below

commit 4ab7ce96468b2b75ed3a391fe15abcd363e30a3c
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Apr 16 21:13:31 2018 -0400

    SSPCPP-712 - Shibd leaks file handles after config reload
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-712
    
    Config logging on first load only, set ownAppender flags.
---
 configs/shibd.logger.in            | 3 +++
 shibsp/impl/XMLServiceProvider.cpp | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/configs/shibd.logger.in b/configs/shibd.logger.in
index d79e2f0..cd95fc7 100644
--- a/configs/shibd.logger.in
+++ b/configs/shibd.logger.in
@@ -29,11 +29,14 @@ log4j.category.XMLTooling.libcurl=INFO
 # logs XML being signed or verified if set to DEBUG
 log4j.category.XMLTooling.Signature.Debugger=INFO, sig_log
 log4j.additivity.XMLTooling.Signature.Debugger=false
+log4j.ownAppenders.XMLTooling.Signature.Debugger=true
 
 # the tran log blocks the "default" appender(s) at runtime
 # Level should be left at INFO for this category
 log4j.category.Shibboleth-TRANSACTION=INFO, tran_log
 log4j.additivity.Shibboleth-TRANSACTION=false
+log4j.ownAppenders.Shibboleth-TRANSACTION=true
+
 # uncomment to suppress particular event types
 #log4j.category.Shibboleth-TRANSACTION.AuthnRequest=WARN
 #log4j.category.Shibboleth-TRANSACTION.Login=WARN
diff --git a/shibsp/impl/XMLServiceProvider.cpp b/shibsp/impl/XMLServiceProvider.cpp
index 16e8a91..46a70a5 100644
--- a/shibsp/impl/XMLServiceProvider.cpp
+++ b/shibsp/impl/XMLServiceProvider.cpp
@@ -2053,7 +2053,11 @@ XMLConfigImpl::XMLConfigImpl(const DOMElement* e, bool first, XMLConfig* outer,
     // Initialize logging manually in order to redirect log messages as soon as possible.
     // If no explicit config is supplied, we now assume the caller has done this, so that
     // setuid processes can potentially do this as root.
-    if (conf.isEnabled(SPConfig::Logging)) {
+
+    // We also no longer do this on reloads, as this results in race conditions that could
+    // crash the process.
+
+    if (first && conf.isEnabled(SPConfig::Logging)) {
         string logconf;
         if (conf.isEnabled(SPConfig::OutOfProcess))
             logconf = XMLHelper::getAttrString(SHAR, nullptr, logger);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list