summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-12 16:39:38 +0200
committerThomas Haller <thaller@redhat.com>2018-08-22 10:49:34 +0200
commit5b5b651bcfd3446c5c4e91b475f707e529e0d966 (patch)
treed481fd3cb30a601f8fa406d5bdc657021e7c8c9a
parentdba19ebd7df9d5e4c65e0fbb2d9f33a28c884523 (diff)
downloadNetworkManager-5b5b651bcfd3446c5c4e91b475f707e529e0d966.tar.gz
dhcp/trivial: add fixme comments to nm_dhcp_dhclient_unescape_duid()
-rw-r--r--src/dhcp/nm-dhcp-dhclient-utils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c
index 16d60c35a2..d8f8dd98d8 100644
--- a/src/dhcp/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp/nm-dhcp-dhclient-utils.c
@@ -530,6 +530,10 @@ nm_dhcp_dhclient_unescape_duid (const char *duid)
guint i, len;
guint8 octal;
+ /* FIXME: it's wrong to have an "unescape-duid" function. dhclient
+ * defines a file format with escaping. So we need a general unescape
+ * function that can handle dhclient syntax. */
+
len = strlen (duid);
unescaped = g_byte_array_sized_new (len);
for (i = 0; i < len; i++) {
@@ -543,6 +547,9 @@ nm_dhcp_dhclient_unescape_duid (const char *duid)
g_byte_array_append (unescaped, &octal, 1);
i += 2;
} else {
+ /* FIXME: don't warn on untrusted data. Either signal an error, or accept
+ * it silently. */
+
/* One of ", ', $, `, \, |, or & */
g_warn_if_fail (p[i] == '"' || p[i] == '\'' || p[i] == '$' ||
p[i] == '`' || p[i] == '\\' || p[i] == '|' ||