diff options
author | Thomas Haller <thaller@redhat.com> | 2023-07-17 11:23:43 +0200 |
---|---|---|
committer | Fernando Fernandez Mancera <ffmancera@riseup.net> | 2023-07-19 11:50:04 +0200 |
commit | ab69d430a7fa5fe16c9b4c4d2b57b85df8c3011b (patch) | |
tree | 66d85b618828587098f23d47322fb4c5cfc2c44c | |
parent | cffca6f9950f8b07c00e537aafd8105ee0c136c1 (diff) |
glib-aux: fix rejecting '\v' and NBSP in nm_utils_ifname_valid_kernel()
Kernel's dev_valid_name() calls isspace(), which also rejects '\v'
and '\240'.
As this tightens the check, the change can break code that partly worked
before. It surely didn't work to the point, where an interface with such
name could be created in kernel.
# ip link add name $'foo\240bar' type dummy
RTNETLINK answers: Invalid argument
-rw-r--r-- | src/libnm-glib-aux/nm-shared-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libnm-glib-aux/nm-shared-utils.c b/src/libnm-glib-aux/nm-shared-utils.c index a51ff765d7..34a3af2053 100644 --- a/src/libnm-glib-aux/nm-shared-utils.c +++ b/src/libnm-glib-aux/nm-shared-utils.c @@ -5352,7 +5352,7 @@ nm_utils_ifname_valid_kernel(const char *name, GError **error) if (ch == '\0') return TRUE; - if (NM_IN_SET(ch, '/', ':') || g_ascii_isspace(ch)) { + if (NM_IN_SET(ch, '/', ':') || nm_ascii_is_space_kernel(ch)) { g_set_error_literal(error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN, |