From: Ted Lemon Date: Mon, 20 Oct 1997 21:35:34 +0000 (+0000) Subject: By default, do not leave scripts lying around in /tmp X-Git-Tag: NetBSD_1_3_Alpha~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=126965a98f574ba27def23c77c57f3fce043f283;p=thirdparty%2Fdhcp.git By default, do not leave scripts lying around in /tmp --- diff --git a/client/dhclient.c b/client/dhclient.c index a64dc3034..7941b6b1a 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -56,7 +56,7 @@ #ifndef lint static char copyright[] = -"$Id: dhclient.c,v 1.40 1997/09/16 18:09:41 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.41 1997/10/20 21:35:34 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -91,6 +91,7 @@ u_int16_t local_port; u_int16_t remote_port; int log_priority; int no_daemon; +int save_scripts; static void usage PROTO ((void)); @@ -123,6 +124,8 @@ int main (argc, argv, envp) ntohs (local_port)); } else if (!strcmp (argv [i], "-d")) { no_daemon = 1; + } else if (!strcmp (argv [i], "-D")) { + save_scripts = 1; } else if (argv [i][0] == '-') { usage (); } else { @@ -1936,7 +1939,8 @@ int script_go (ip) fclose (scriptFile); chmod (scriptName, 0700); rval = system (scriptName); - /* unlink (scriptName); */ + if (!save_scripts) + unlink (scriptName); return rval; }