mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Fix to catch a stupid oversight on my part which allowed this thing
to remove the current directory under certain circumstances. Submitted by: Richard J Kuhns <rjk@watson.grauel.com>
This commit is contained in:
parent
f0d807c7fe
commit
dab396ba99
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13994
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static const char *rcsid = "$Id: pen.c,v 1.13.4.6 1995/10/23 12:33:43 jkh Exp $";
|
||||
static const char *rcsid = "$Id: pen.c,v 1.19 1995/10/25 15:38:35 jkh Exp $";
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -118,7 +118,7 @@ leave_playpen(char *save)
|
||||
oldsig = signal(SIGINT, SIG_IGN);
|
||||
if (Previous[0] && chdir(Previous) == FAIL)
|
||||
barf("Can't chdir back to '%s'.", Previous);
|
||||
else if (Current[0]) {
|
||||
else if (Current[0] && strcmp(Current, Previous)) {
|
||||
if (vsystem("rm -rf %s", Current))
|
||||
whinge("Couldn't remove temporary dir '%s'", Current);
|
||||
strcpy(Current, Previous);
|
||||
|
Loading…
Reference in New Issue
Block a user