From 6ef03f7a0db321dd241776252b293f9f1d7bb704 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Tue, 15 Dec 2020 12:58:52 +0530 Subject: [PATCH] Handle escape characters in interface name Updated the patch as per review comments. --- src/libsystemd/sd-bus/bus-internal.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; }