dhcp: make sure disabled DHCP clients aren't used (gentoo #330319)

If the client was disabled with --with-dhclient=no or
--with-dhcpcd=no, then it's corresponding _PATH will be an empty
string.  In that case we want to ignore that client completely
since it was disabled at build time.
This commit is contained in:
Dan Williams 2010-08-05 15:25:42 -05:00
parent 91e90d9d54
commit c050e036c3

View file

@ -265,8 +265,13 @@ get_client_type (const char *client, GError **error)
const char *dhclient_path = NULL;
const char *dhcpcd_path = NULL;
dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH);
dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH);
/* If a client was disabled at build-time, its *_PATH define will be
* an empty string.
*/
if (DHCLIENT_PATH && strlen (DHCLIENT_PATH))
dhclient_path = nm_dhcp_dhclient_get_path (DHCLIENT_PATH);
if (DHCPCD_PATH && strlen (DHCPCD_PATH))
dhcpcd_path = nm_dhcp_dhcpcd_get_path (DHCPCD_PATH);
if (!client) {
if (dhclient_path)