nm-shared-utils: relax ovs ifname check to accept any (non-space) ASCII printable char
quoting 'man ovs-vswitchd.conf.db':
"The name must be alphanumeric and must not contain forward or backward
slashes."
OVS actually accepts a wider range of chars (all printable UTF-8 chars),
NetworkManager restricts this to ASCII char as it's a safer option for
now since OVS is not well documented on this matter.
https://bugzilla.redhat.com/show_bug.cgi?id=1788432
Fixes: e7d72a14f6
('libnm-core: use different ifname validation function for OVS bridges, ports and interfaces')
This commit is contained in:
@@ -4097,11 +4097,14 @@ _nm_utils_ifname_valid_ovs (const char* name, GError **error)
|
||||
{
|
||||
const char *ch;
|
||||
|
||||
/* OVS actually accepts a wider range of chars (all printable UTF-8 chars),
|
||||
NetworkManager restricts this to ASCII char as it's a safer option for
|
||||
now since OVS is not well documented on this matter.
|
||||
*/
|
||||
for (ch = name; *ch; ++ch) {
|
||||
if ( *ch == '\\'
|
||||
|| *ch == '/'
|
||||
|| g_ascii_isspace (*ch)
|
||||
|| !g_ascii_isalnum (*ch)) {
|
||||
|| !g_ascii_isgraph (*ch)) {
|
||||
g_set_error_literal (error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN,
|
||||
_("interface name must be alphanumerical with "
|
||||
"no forward or backward slashes"));
|
||||
|
Reference in New Issue
Block a user