]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't attempt to run the script if it's an NULL, an empty string or /dev/null
authorRoy Marples <roy@marples.name>
Mon, 30 Jan 2012 16:59:48 +0000 (16:59 +0000)
committerRoy Marples <roy@marples.name>
Mon, 30 Jan 2012 16:59:48 +0000 (16:59 +0000)
configure.c

index db5b0ec2e2387243b7b056c5974a661f71a97d1c..901853754c373aa48ad379cd15d9b4892d62d3cc 100644 (file)
@@ -329,6 +329,11 @@ run_script(const struct interface *iface)
        const struct fd_list *fd;
        struct iovec iov[2];
 
+       if (iface->state->options->script == NULL ||
+           iface->state->options->script[0] == '\0' ||
+           strcmp(iface->state->options->script, "/dev/null") == 0)
+               return 0;
+
        syslog(LOG_DEBUG, "%s: executing `%s', reason %s",
            iface->name, argv[0], iface->state->reason);