]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We need to copy out the script from the config file as it's no longer a constant...
authorRoy Marples <roy@marples.name>
Mon, 30 Jun 2008 14:15:03 +0000 (14:15 +0000)
committerRoy Marples <roy@marples.name>
Mon, 30 Jun 2008 14:15:03 +0000 (14:15 +0000)
dhcpcd.c
dhcpcd.h

index 693d3923d5dd8ec547ea330d15dee6140bfb2781..f844ad36c3c09ae6df30a4278abd305b0a0b3349 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -217,7 +217,7 @@ parse_option(int opt, char *oarg, struct options *options)
 
        switch(opt) {
        case 'c':
-               options->script = oarg;
+               strlcpy(options->script, oarg, sizeof(options->script));
                break;
        case 'h':
                if (!oarg)
@@ -446,7 +446,7 @@ main(int argc, char **argv)
        openlog(PACKAGE, LOG_PID, LOG_LOCAL0);
 
        options = xzalloc(sizeof(*options));
-       options->script = SCRIPT;
+       strlcpy(options->script, SCRIPT, sizeof(options->script));
        options->classid[0] = snprintf(options->classid + 1, CLASSID_MAX_LEN,
                                       "%s %s", PACKAGE, VERSION);
 
index 7b1ee396412cf5399f7e6febb7911ebf8eb221e6..839e9b4eae4e168085054b8dc91d8b9784df81dc 100644 (file)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -86,7 +86,7 @@ struct options {
        struct in_addr request_netmask;
 
        char **environ;
-       const char *script;
+       char script[PATH_MAX];
        char pidfile[PATH_MAX];
 };