From: Roy Marples Date: Mon, 30 Jun 2008 14:15:03 +0000 (+0000) Subject: We need to copy out the script from the config file as it's no longer a constant... X-Git-Tag: v4.0.2~263 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=944bb80ec50e1264b4c1b3df1508176ce73e5418;p=thirdparty%2Fdhcpcd.git We need to copy out the script from the config file as it's no longer a constant var. --- diff --git a/dhcpcd.c b/dhcpcd.c index 693d3923..f844ad36 100644 --- 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); diff --git a/dhcpcd.h b/dhcpcd.h index 7b1ee396..839e9b4e 100644 --- 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]; };