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-25 09:12:33 +0100
commit8b0461380febd98cb6b8b867104653325bcddac4 (patch)
treeaf24ac8141818d4adcb27e67a437e8f26ca2d685
parent7dcf368cf04d3ae7da9b61bf7986842f4eb3c465 (diff)
downloadNetworkManager-8b0461380febd98cb6b8b867104653325bcddac4.tar.gz
cli/trivial: add comment about partially modifying settings when failing set_fcn()
-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],