From: Gaurav Date: Tue, 15 Dec 2020 07:28:52 +0000 (+0530) Subject: Handle escape characters in interface name X-Git-Tag: v248-rc1~505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ef03f7a0db321dd241776252b293f9f1d7bb704;p=thirdparty%2Fsystemd.git Handle escape characters in interface name Updated the patch as per review comments. --- diff --git a/src/libsystemd/sd-bus/bus-internal.c b/src/libsystemd/sd-bus/bus-internal.c index c66056dcc4c..ced330857ac 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; }