summaryrefslogtreecommitdiff
path: root/clients/cli/settings.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-08-26 19:36:22 +0200
committerThomas Haller <thaller@redhat.com>2019-08-27 11:56:32 +0200
commit199ba58bed17bfdf8a7cc68874add6d522687408 (patch)
tree375474acf62a318e027144afe8b0648a54d9a9bf /clients/cli/settings.c
parent68e8fe9419fa6358d862e0a5e8ff58c11deb4f3e (diff)
downloadNetworkManager-lr/gsm-default-apn-part2.tar.gz
cli: allow deleting the gsm.apnlr/gsm-default-apn-part2
Use "nmcli c modify -gsm.apn ''" to remove the APN.
Diffstat (limited to 'clients/cli/settings.c')
-rw-r--r--clients/cli/settings.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index fec36a89fd..74b642b0ad 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -549,6 +549,18 @@ nmc_setting_set_property (NMClient *client,
if (!property_info->property_type->set_fcn)
goto out_fail_read_only;
+ if (property_info->del_sets_null) {
+ /* Attempting to delete this property sets it to NULL */
+ if (modifier == NM_META_ACCESSOR_MODIFIER_DEL) {
+ modifier = NM_META_ACCESSOR_MODIFIER_SET;
+ value = NULL;
+ }
+ } else if (!value && value[0] == '\0') {
+ /* Empty string will reset the value to default */
+ value = NULL;
+ }
+
+
if ( modifier == NM_META_ACCESSOR_MODIFIER_DEL
&& !property_info->property_type->set_supports_remove) {
/* The property is a plain property. It does not support '-'.