1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-14 04:58:28 +03:00

Handle escape characters in interface name

Updated the patch as per review comments.
This commit is contained in:
Gaurav 2020-12-15 12:58:52 +05:30 committed by Zbigniew Jędrzejewski-Szmek
parent 17f8a21fd0
commit 6ef03f7a0d

View 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;
}