summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-02-27 14:49:25 +0100
committerThomas Haller <thaller@redhat.com>2014-02-05 00:17:07 +0100
commitb34c397a4fd712fa440c791155ccadbca5d28962 (patch)
treee4183f942db7842db19033aceaeb8977ab132818
parentf39f26234746d89d51be860db8f6e106b9b00658 (diff)
downloadNetworkManager-b34c397a4fd712fa440c791155ccadbca5d28962.tar.gz
dhcp: ensure any dhclient script from dhclient.conf is ignored
The config file can specify a dhclient script, which gets used instead of what NM passes on the command-line. Make sure that script gets ignored in the final dhclient config, because the script NM passes is the script that needs to be used to pass data back to NM. People may have old dhclient.conf files lying around that get picked up and we don't want any script specified there to interfere. (cherry picked from commit 97990135f150237eb7d529894fb0149d9faa5f0f)
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient-utils.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
index 89fa51ee45..db4bf7e8b6 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient-utils.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient-utils.c
@@ -168,6 +168,10 @@ nm_dhcp_dhclient_create_config (const char *interface,
continue;
}
+ /* Ignore 'script' since we pass our own */
+ if (g_str_has_prefix (p, "script "))
+ continue;
+
/* Check for "also require" */
if (!strncmp (p, ALSOREQ_TAG, strlen (ALSOREQ_TAG))) {
in_alsoreq = TRUE;