Back out previons revision in favour of a simpler solution.

This commit is contained in:
mellon 2000-07-23 07:13:57 +00:00
parent 32ceb997a8
commit 2749a115e8
1 changed files with 2 additions and 12 deletions

View File

@ -41,7 +41,7 @@
#ifndef lint #ifndef lint
static char ocopyright[] = static char ocopyright[] =
"$Id: dhclient.c,v 1.30 2000/07/23 05:34:53 thorpej Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; "$Id: dhclient.c,v 1.31 2000/07/23 07:13:57 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@ -2269,27 +2269,17 @@ void script_write_params (client, prefix, lease)
int script_go (client) int script_go (client)
struct client_state *client; struct client_state *client;
{ {
static char *client_path;
int rval; int rval;
char *scriptName; char *scriptName;
char *argv [2]; char *argv [2];
char **envp; char **envp;
char *epp [3]; char *epp [3];
char reason [] = "REASON=NBI"; char reason [] = "REASON=NBI";
static char client_path [] = CLIENT_PATH;
int i; int i;
struct string_list *sp, *next; struct string_list *sp, *next;
int pid, wpid, wstatus; int pid, wpid, wstatus;
if (client_path == NULL) {
client_path = dmalloc (strlen(CLIENT_PATH) +
strlen("PATH=") + 1, MDL);
if (!client_path) {
log_error ("No memory for PATH environment variable.");
return 0;
}
sprintf (client_path, "PATH=%s", CLIENT_PATH);
}
if (client) { if (client) {
scriptName = client -> config -> script_name; scriptName = client -> config -> script_name;
envp = dmalloc ((client -> envc + 2) * sizeof (char *), envp = dmalloc ((client -> envc + 2) * sizeof (char *),