diff options
| author | Michael Biebl <biebl@debian.org> | 2018-09-23 10:10:27 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2018-09-23 10:10:27 +0200 |
| commit | e126f3e804c35480c4f075777430419d6ece23da (patch) | |
| tree | 5d5821ebcda8cd6ac34d2483bb3354910e508930 /src/dhcp/nm-dhcp-dhclient-utils.c | |
| parent | c240974325c552cad177c457d6ff04e381fd77a3 (diff) | |
New upstream version 1.12.4 upstream/1.12.4
Diffstat (limited to 'src/dhcp/nm-dhcp-dhclient-utils.c')
| -rw-r--r-- | src/dhcp/nm-dhcp-dhclient-utils.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/dhcp/nm-dhcp-dhclient-utils.c b/src/dhcp/nm-dhcp-dhclient-utils.c index d8f8dd98..3290dd65 100644 --- a/src/dhcp/nm-dhcp-dhclient-utils.c +++ b/src/dhcp/nm-dhcp-dhclient-utils.c @@ -316,7 +316,6 @@ nm_dhcp_dhclient_create_config (const char *interface, if (orig_contents) { char **lines, **line; - int nest = 0; gboolean in_alsoreq = FALSE; gboolean in_req = FALSE; char intf[IFNAMSIZ]; @@ -331,23 +330,17 @@ nm_dhcp_dhclient_create_config (const char *interface, if (!strlen (g_strstrip (p))) continue; - if (in_req) { - /* pass */ - } else if (strchr (p, '{')) { - nest++; - if ( !intf[0] - && g_str_has_prefix (p, "interface")) - if (read_interface (p, intf, sizeof (intf))) - continue; - } else if (strchr (p, '}')) { - if (nest) - nest--; - intf[0] = '\0'; - continue; + if ( !intf[0] + && g_str_has_prefix (p, "interface") + && !in_req) { + if (read_interface (p, intf, sizeof (intf))) + continue; } - if (nest && !intf[0]) + if (intf[0] && strchr (p, '}')) { + intf[0] = '\0'; continue; + } if (intf[0] && !nm_streq (intf, interface)) continue; @@ -530,10 +523,6 @@ 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++) { @@ -547,9 +536,6 @@ 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] == '|' || |