Bug 2177209

Summary: nmcli doesn't accept space in connection.secondaries "VPN connection"
Product: Red Hat Enterprise Linux 9 Reporter: David Jaša <djasa>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED MIGRATED QA Contact: Desktop QE <desktop-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 9.2CC: bgalvani, lrintel, rkhan, sfaye, sukulkar, thaller, till
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-17 12:26:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Jaša 2023-03-10 12:10:08 UTC
Description of problem:
nmcli doesn't accept space in connection.secondaries "VPN connection"

Version-Release number of selected component (if applicable):
NetworkManager-1.42.2-1.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1. nmcli c add con-name base_con ifname eth1 type ethernet connection.autoconnect no
2. nmcli c add con-name 'Open VPN' type vpn ifname '*' vpn-type openvpn
3. nmcli c modify base_con connection.secondaries "Open VPN"

Actual results:
Error: failed to modify connection.secondaries: 'Open' is not a name of any existing profile.

Expected results:
secondary profile of "Open VPN" is added and its UUID is visible in base_con's connection.secondaries

Additional info:
Already covered by NMCI scenario nmcli_space_in_secondaries

Comment 1 Thomas Haller 2023-05-23 07:28:26 UTC
ok, !1635 was not enough.

- the check at https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/6069f75e00806de5244fba6e923abf4f30b2f3b0/src/nmcli/settings.c#L612 needs to be dropped (moved).

- `.validate2_fcn = _multilist_validate2_fcn_uuid` needs to be replaced by a _multilist_validate2_fcn_connection_secondaries(). That callback must also get a `const NMMetaEnvironment *environment` and `gpointer environment_user_data` arguments. The `NMMetaEnvironment` needs to learn a new callback, that basically basically does what _set_fcn_precheck_connection_secondaries() currently does. It also needs the ability to return allocated new values (and the caller of `_multilist_do_validate()` needs to handle the ownership transfer.