]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Handle escape characters in interface name
authorGaurav <g.gupta@samsung.com>
Tue, 15 Dec 2020 07:28:52 +0000 (12:58 +0530)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 15 Dec 2020 16:47:03 +0000 (17:47 +0100)
Updated the patch as per review comments.

src/libsystemd/sd-bus/bus-internal.c

index c66056dcc4cd0cb063d58293104ff246d3be85c5..ced330857ac8727b25c4888f50b2e8749cbb4e93 100644 (file)
@@ -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;
                         }