Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/dhcp/client Pull up rev. 1.30:



details:   https://anonhg.NetBSD.org/src/rev/0d35435b4d7e
branches:  netbsd-1-5
changeset: 488677:0d35435b4d7e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jul 23 05:38:53 2000 +0000

description:
Pull up rev. 1.30:
Set the PATH environment variable properly.  Now this actually
works again.

diffstat:

 usr.sbin/dhcp/client/dhclient.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 70a2ae01935f -r 0d35435b4d7e usr.sbin/dhcp/client/dhclient.c
--- a/usr.sbin/dhcp/client/dhclient.c   Sun Jul 23 05:37:44 2000 +0000
+++ b/usr.sbin/dhcp/client/dhclient.c   Sun Jul 23 05:38:53 2000 +0000
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static char ocopyright[] =
-"$Id: dhclient.c,v 1.26.2.2 2000/07/22 05:00:19 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium.  All rights reserved.\n";
+"$Id: dhclient.c,v 1.26.2.3 2000/07/23 05:38:53 thorpej Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2269,17 +2269,27 @@
 int script_go (client)
        struct client_state *client;
 {
+       static char *client_path;
        int rval;
        char *scriptName;
        char *argv [2];
        char **envp;
        char *epp [3];
        char reason [] = "REASON=NBI";
-       static char client_path [] = CLIENT_PATH;
        int i;
        struct string_list *sp, *next;
        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) {
                scriptName = client -> config -> script_name;
                envp = dmalloc ((client -> envc + 2) * sizeof (char *),



Home | Main Index | Thread Index | Old Index