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.
This commit is contained in:
Thomas Haller
2016-10-06 21:40:18 +02:00
parent 64951f07fb
commit 64e02a0ac7

View File

@@ -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;
}