From 97990135f150237eb7d529894fb0149d9faa5f0f Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Feb 2013 14:49:25 +0100 Subject: [PATCH] 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. --- src/dhcp-manager/nm-dhcp-dhclient-utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dhcp-manager/nm-dhcp-dhclient-utils.c b/src/dhcp-manager/nm-dhcp-dhclient-utils.c index 8dc7902f40..d311d5028d 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;