Add some extra checks to dhclient callout script
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 28 Jul 2010 19:12:31 +0000 (12:12 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 28 Jul 2010 19:12:31 +0000 (12:12 -0700)
scripts/dhclient-script.c

index 841cde3..35ede29 100644 (file)
@@ -66,10 +66,16 @@ int main(int argc, char *argv[])
        busintf = getenv("BUSINTF");
        buspath = getenv("BUSPATH");
 
+       if (busname == NULL || busintf == NULL || buspath == NULL)
+               return 0;
+
        pid = atoi(getenv("pid"));
        reason = getenv("reason");
        interface = getenv("interface");
 
+       if (pid == 0 || reason == NULL)
+               return 0;
+
        dbus_error_init(&error);
 
        conn = dbus_bus_get(DBUS_BUS_SYSTEM, &error);