summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-10-06 21:40:18 +0200
committerThomas Haller <thaller@redhat.com>2016-10-11 11:29:52 +0200
commit64e02a0ac79bd1bd14adcbf7cb3eba299e17a2b5 (patch)
treeac4073f25a081d6486ad2572269fb53b57bdec94
parent64951f07fb39e1c88448ba2ad72a5e710712c89d (diff)
downloadNetworkManager-64e02a0ac79bd1bd14adcbf7cb3eba299e17a2b5.tar.gz
logging: protect VPN_PLUGIN logging domain
VPN_PLUGIN is special. With # nmcli general logging level TRACE domains ALL the logging verbosity of VPN_PLUGIN domain should not be set higher then info. The user has to explicitly set it via: # nmcli general logging level TRACE domains ALL,VPN_PLUGIN:TRACE This was not the case for # nmcli general logging level TRACE Fix that.
-rw-r--r--src/nm-logging.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nm-logging.c b/src/nm-logging.c
index e695a60a25..f8ecf0c94b 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -329,6 +329,13 @@ nm_logging_setup (const char *level,
bits = 0;
+ if (domains_free) {
+ /* The caller didn't provide any domains to set (`nmcli general logging level DEBUG`).
+ * We reset all domains that were previously set, but we still want to protect
+ * VPN_PLUGIN domain. */
+ protect = LOGD_VPN_PLUGIN;
+ }
+
/* Check for combined domains */
if (!g_ascii_strcasecmp (*iter, LOGD_ALL_STRING)) {
bits = LOGD_ALL;
@@ -380,7 +387,7 @@ nm_logging_setup (const char *level,
new_logging[i] &= ~bits;
else {
new_logging[i] |= bits;
- if ( protect
+ if ( (protect & bits)
&& i < LOGL_INFO)
new_logging[i] &= ~protect;
}