2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 14:25:41 +00:00

By default, do not leave scripts lying around in /tmp

This commit is contained in:
Ted Lemon
1997-10-20 21:35:34 +00:00
parent 40f04e6f62
commit 126965a98f

View File

@@ -56,7 +56,7 @@
#ifndef lint #ifndef lint
static char copyright[] = 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 */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -91,6 +91,7 @@ u_int16_t local_port;
u_int16_t remote_port; u_int16_t remote_port;
int log_priority; int log_priority;
int no_daemon; int no_daemon;
int save_scripts;
static void usage PROTO ((void)); static void usage PROTO ((void));
@@ -123,6 +124,8 @@ int main (argc, argv, envp)
ntohs (local_port)); ntohs (local_port));
} else if (!strcmp (argv [i], "-d")) { } else if (!strcmp (argv [i], "-d")) {
no_daemon = 1; no_daemon = 1;
} else if (!strcmp (argv [i], "-D")) {
save_scripts = 1;
} else if (argv [i][0] == '-') { } else if (argv [i][0] == '-') {
usage (); usage ();
} else { } else {
@@ -1936,7 +1939,8 @@ int script_go (ip)
fclose (scriptFile); fclose (scriptFile);
chmod (scriptName, 0700); chmod (scriptName, 0700);
rval = system (scriptName); rval = system (scriptName);
/* unlink (scriptName); */ if (!save_scripts)
unlink (scriptName);
return rval; return rval;
} }