summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1997-10-13 15:03:55 +0000
committerjkh <jkh@FreeBSD.org>1997-10-13 15:03:55 +0000
commit4b318a582678d8f68d483f6a6e26bed4605e1bb2 (patch)
tree616a602eaba10b4a9566eeba12230e573af92805
parentf71ea4919aca593ee0fd403a76ddb6b0113b7ba6 (diff)
downloadFreeBSD-src-4b318a582678d8f68d483f6a6e26bed4605e1bb2.zip
FreeBSD-src-4b318a582678d8f68d483f6a6e26bed4605e1bb2.tar.gz
Don't return from cleanup() - if it's removed the playpen then very
bad things will happen if we return to unsuspecting code. Noted to my great dismay by: Tim Vanderhoek <hoek@hwcn.org>
-rw-r--r--usr.sbin/pkg_install/add/perform.c3
-rw-r--r--usr.sbin/pkg_install/create/perform.c5
-rw-r--r--usr.sbin/pkg_install/delete/perform.c3
-rw-r--r--usr.sbin/pkg_install/info/perform.c3
-rw-r--r--usr.sbin/pkg_install/lib/msg.c9
5 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index fba2fff..c921b90 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.42 1997/06/29 10:41:44 jkh Exp $";
+ "$Id: perform.c,v 1.43 1997/10/08 07:45:48 charnier Exp $";
#endif
/*
@@ -475,4 +475,5 @@ cleanup(int signo)
if (!Fake && LogDir[0])
vsystem("%s -rf %s", REMOVE_CMD, LogDir);
leave_playpen(Home);
+ exit(1);
}
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index 2394d8c..830a2b2 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.36 1997/07/04 04:48:02 jkh Exp $";
+ "$Id: perform.c,v 1.37 1997/10/08 07:46:27 charnier Exp $";
#endif
/*
@@ -182,7 +182,7 @@ pkg_perform(char **pkgs)
free(Comment);
free(Desc);
free_plist(&plist);
- cleanup(0);
+ leave_playpen(home);
return TRUE; /* Success */
}
@@ -293,4 +293,5 @@ void
cleanup(int sig)
{
leave_playpen(home);
+ exit(1);
}
diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c
index 1584b60..92ca3cb 100644
--- a/usr.sbin/pkg_install/delete/perform.c
+++ b/usr.sbin/pkg_install/delete/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.13 1997/03/06 10:21:57 jkh Exp $";
+ "$Id: perform.c,v 1.14 1997/10/08 07:46:52 charnier Exp $";
#endif
/*
@@ -162,6 +162,7 @@ void
cleanup(int sig)
{
/* Nothing to do */
+ exit(1);
}
static void
diff --git a/usr.sbin/pkg_install/info/perform.c b/usr.sbin/pkg_install/info/perform.c
index 25d0328..5625f62 100644
--- a/usr.sbin/pkg_install/info/perform.c
+++ b/usr.sbin/pkg_install/info/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.21 1997/02/22 16:09:42 peter Exp $";
+ "$Id: perform.c,v 1.22 1997/10/08 07:47:29 charnier Exp $";
#endif
/*
@@ -202,4 +202,5 @@ void
cleanup(int sig)
{
leave_playpen(Home);
+ exit(1);
}
diff --git a/usr.sbin/pkg_install/lib/msg.c b/usr.sbin/pkg_install/lib/msg.c
index 032320b..3c2d199 100644
--- a/usr.sbin/pkg_install/lib/msg.c
+++ b/usr.sbin/pkg_install/lib/msg.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: msg.c,v 1.8 1997/02/22 16:09:50 peter Exp $";
+ "$Id: msg.c,v 1.9 1997/10/08 07:48:09 charnier Exp $";
#endif
/*
@@ -33,7 +33,6 @@ upchuck(const char *err)
{
warn("fatal error during execution: %s", err);
cleanup(0);
- exit(1);
}
/*
@@ -53,8 +52,10 @@ y_or_n(Boolean def, const char *msg, ...)
* collected on stdin
*/
tty = fopen("/dev/tty", "r");
- if (!tty)
- cleanup(0), errx(2, "can't open /dev/tty!");
+ if (!tty) {
+ warnx("can't open /dev/tty!");
+ cleanup(0);
+ }
while (ch != 'Y' && ch != 'N') {
vfprintf(stderr, msg, args);
if (def)
OpenPOWER on IntegriCloud