cli: support escaping delimiters for "connection.seconaries"

It's obviously a change in behavior. Now accept backslash for escaping
the whitespace+comma separators when setting "connection.secondaries".

Before:

  $ nmcli --offline connection add type ethernet con-name x connection.secondaries 'a b'
  Error: failed to modify connection.secondaries: the value 'a' is not a valid UUID.
  $ nmcli --offline connection add type ethernet con-name x connection.secondaries 'a\ b'
  Error: failed to modify connection.secondaries: the value 'a\' is not a valid UUID.

After:

  $ nmcli --offline connection add type ethernet con-name x connection.secondaries 'a\ b'
  Error: failed to modify connection.secondaries: the value 'a b' is not a valid UUID.

https://bugzilla.redhat.com/show_bug.cgi?id=2177209
This commit is contained in:
Thomas Haller 2023-05-22 09:18:28 +02:00
parent 30a6742d96
commit 16e2c9f155
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -5606,7 +5606,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
.remove_by_idx_fcn_u32 = MULTILIST_REMOVE_BY_IDX_FCN_U32 (NMSettingConnection, nm_setting_connection_remove_secondary),
.remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingConnection, nm_setting_connection_remove_secondary_by_value),
.validate2_fcn = _multilist_validate2_fcn_uuid,
.strsplit_plain = TRUE,
.strsplit_with_spaces = TRUE,
),
),
),