summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-03-22 13:45:44 +0100
committerThomas Haller <thaller@redhat.com>2019-03-24 09:21:55 +0100
commitb3fb492dbadcb7262e68ba505899944650c7494f (patch)
treeb223df991196a7fad16fe246188f780eb1609cf2
parent9c91609c33ee1ebe8feea9f920faae88b37e5c0e (diff)
downloadNetworkManager-th/nmcli-list-options.tar.gz
cli/trivial: add comment about partially modifying settings when failing set_fcn()th/nmcli-list-options
-rw-r--r--clients/common/nm-meta-setting-desc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index 20126693d6..0529420118 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -3248,6 +3248,17 @@ _set_fcn_objlist (ARGS_SET_FCN)
}
for (i = 0; i < nstrv; i++) {
+ /* FIXME: there is the problem here that set_fcn() might succed on the first item
+ * (modifying it), and fail to parse the second one.
+ *
+ * Optimally, we would first parse all input strings before starting the
+ * modify the setting. The setting should only be modified if (and only if)
+ * the entire operation succeeds to set all items.
+ *
+ * Currently, in interactive mode this leads to odd behavior.
+ *
+ * This does not only affect objlist.set_fcn() or _pt_objlist properties.
+ * E.g. we also call _gobject_property_reset() before validating the input. */
if (!property_info->property_typ_data->subtype.objlist.set_fcn (setting,
!_SET_FCN_DO_REMOVE (modifier, value),
strv[i],