summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav <g.gupta@samsung.com>2020-12-15 12:58:52 +0530
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-12-15 17:47:03 +0100
commit6ef03f7a0db321dd241776252b293f9f1d7bb704 (patch)
tree7bc99c997b504a5209b443c5177eb09674de4789
parent17f8a21fd069d7a3269496a59911c3b20fa1b324 (diff)
downloadsystemd-6ef03f7a0db321dd241776252b293f9f1d7bb704.tar.gz
Handle escape characters in interface name
Updated the patch as per review comments.
-rw-r--r--src/libsystemd/sd-bus/bus-internal.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/bus-internal.c b/src/libsystemd/sd-bus/bus-internal.c
index c66056dcc4..ced330857a 100644
--- a/src/libsystemd/sd-bus/bus-internal.c
+++ b/src/libsystemd/sd-bus/bus-internal.c
@@ -92,7 +92,14 @@ bool interface_name_is_valid(const char *p) {
*q == '_';
if (!good) {
- log_debug("The interface %s is invalid as it contains special character %c", p, *q);
+ if (DEBUG_LOGGING) {
+ _cleanup_free_ char *iface = NULL;
+ iface = cescape(p);
+ if (!iface)
+ log_oom();
+ else
+ log_debug("The interface %s is invalid as it contains special character %c", iface, *q);
+ }
return false;
}