summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-05-17 19:29:38 +0200
committerThomas Haller <thaller@redhat.com>2016-05-24 19:39:30 +0200
commit7f3ea165333dae747b30fba2b12f3a251cbbf77e (patch)
treee714475cb33abc1bfe60639451b6b5d4d9a0ed5c
parenta0130e412837096fb57b4b1bad90374fcf5d2f52 (diff)
downloadNetworkManager-7f3ea165333dae747b30fba2b12f3a251cbbf77e.tar.gz
logging: add new logging domain LOGD_VPN_PLUGIN
This logging domain will be used to enable debugging of the VPN plugins. However, the plugins might expose sensitive data in this mode, so exclude the new domain from "LOGD_ALL".
-rw-r--r--man/NetworkManager.conf.xml9
-rw-r--r--src/nm-logging.c3
-rw-r--r--src/nm-logging.h6
3 files changed, 15 insertions, 3 deletions
diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml
index 036f41d003..fd6d7cef59 100644
--- a/man/NetworkManager.conf.xml
+++ b/man/NetworkManager.conf.xml
@@ -460,7 +460,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
WIFI_SCAN, IP4, IP6, AUTOIP4, DNS, VPN, SHARING, SUPPLICANT,
AGENTS, SETTINGS, SUSPEND, CORE, DEVICE, OLPC, WIMAX,
INFINIBAND, FIREWALL, ADSL, BOND, VLAN, BRIDGE, DBUS_PROPS,
- TEAM, CONCHECK, DCB, DISPATCH, AUDIT, SYSTEMD.</para>
+ TEAM, CONCHECK, DCB, DISPATCH, AUDIT, SYSTEMD, VPN_PLUGIN.</para>
<para>In addition, these special domains can be used: NONE,
ALL, DEFAULT, DHCP, IP.</para>
<para>You can specify per-domain log level overrides by
@@ -507,6 +507,7 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
<member>DISPATCH : Dispatcher scripts</member>
<member>AUDIT : Audit records</member>
<member>SYSTEMD : Messages from internal libsystemd</member>
+ <member>VPN_PLUGIN : logging messages from VPN plugins</member>
<member> </member>
<member>NONE : when given by itself logging is disabled</member>
<member>ALL : all log domains</member>
@@ -517,6 +518,12 @@ unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth
<member>HW : deprecated alias for "PLATFORM"</member>
</simplelist>
</para>
+ <para>
+ In general, the logfile should not contain passwords or private data. However,
+ you are always advised to check the file before posting it online or attaching
+ to a bug report. <literal>VPN_PLUGIN</literal> is special in that it might
+ reveal private information from the VPN plugins and thus this level is excluded
+ from <literal>ALL</literal></para>
</varlistentry>
<varlistentry>
<term><varname>backend</varname></term>
diff --git a/src/nm-logging.c b/src/nm-logging.c
index 3f924236e3..d0368d000c 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -117,7 +117,7 @@ static struct {
char *logging_domains_to_string;
const LogLevelDesc level_desc[_LOGL_N];
-#define _DOMAIN_DESC_LEN 37
+#define _DOMAIN_DESC_LEN 38
/* Would be nice to use C99 flexible array member here,
* but that feature doesn't seem well supported. */
const LogDesc domain_desc[_DOMAIN_DESC_LEN];
@@ -172,6 +172,7 @@ static struct {
{ LOGD_DISPATCH, "DISPATCH" },
{ LOGD_AUDIT, "AUDIT" },
{ LOGD_SYSTEMD, "SYSTEMD" },
+ { LOGD_VPN_PLUGIN,"VPN_PLUGIN" },
{ 0, NULL }
/* keep _DOMAIN_DESC_LEN in sync */
},
diff --git a/src/nm-logging.h b/src/nm-logging.h
index fe478a50f6..f49f6ec67b 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -65,12 +65,16 @@ typedef enum { /*< skip >*/
LOGD_DISPATCH = (1LL << 33),
LOGD_AUDIT = (1LL << 34),
LOGD_SYSTEMD = (1LL << 35),
+ LOGD_VPN_PLUGIN = (1LL << 36),
__LOGD_MAX,
- LOGD_ALL = ((__LOGD_MAX - 1LL) << 1) - 1LL,
+ LOGD_ALL = (((__LOGD_MAX - 1LL) << 1) - 1LL) & ~(
+ LOGD_VPN_PLUGIN | /*not even part of ALL, because it might expose sensitive information. */
+ 0),
LOGD_DEFAULT = LOGD_ALL & ~(
LOGD_DBUS_PROPS |
LOGD_WIFI_SCAN |
+ LOGD_VPN_PLUGIN |
0),
/* aliases: */