diff options
author | jkh <jkh@FreeBSD.org> | 1999-04-07 03:06:44 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1999-04-07 03:06:44 +0000 |
commit | 315a10a3c0014dae651799d01366330f5d307619 (patch) | |
tree | ea47e7f286b784e509bba3c4f095d2f266356d77 | |
parent | 4d32515975526424cd816a37d232e4589ab08176 (diff) | |
download | FreeBSD-src-315a10a3c0014dae651799d01366330f5d307619.zip FreeBSD-src-315a10a3c0014dae651799d01366330f5d307619.tar.gz |
Don't allow upgrade to touch /usr/src; only evil can result from
that kind of overlay smashing.
-rw-r--r-- | release/sysinstall/installUpgrade.c | 13 | ||||
-rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 13 |
2 files changed, 24 insertions, 2 deletions
diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index 4a4ae75..b153e02 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.64 1999/02/15 02:22:47 jkh Exp $ + * $Id: installUpgrade.c,v 1.65 1999/03/19 08:22:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -248,6 +248,17 @@ installUpgrade(dialogMenuItem *self) } saved_etc[0] = '\0'; + + /* Don't allow sources to be upgraded unless if we have src already */ + if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) { + Dists &= ~DIST_SRC; + msgConfirm("Warning: /usr/src exists and sources were selected as upgrade\n" + "targets. Unfortunately, this is not the way to upgrade your\n" + "sources - please use CTM or CVSup or some other method which\n" + "handles ``deletion events'', unlike this particular feature.\n\n" + "Your existing /usr/src will not be affected by this upgrade.\n"); + } + if (extractingBin) { while (!*saved_etc) { char *cp = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index 4a4ae75..b153e02 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.64 1999/02/15 02:22:47 jkh Exp $ + * $Id: installUpgrade.c,v 1.65 1999/03/19 08:22:31 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -248,6 +248,17 @@ installUpgrade(dialogMenuItem *self) } saved_etc[0] = '\0'; + + /* Don't allow sources to be upgraded unless if we have src already */ + if (directory_exists("/usr/src/") && (Dists & DIST_SRC)) { + Dists &= ~DIST_SRC; + msgConfirm("Warning: /usr/src exists and sources were selected as upgrade\n" + "targets. Unfortunately, this is not the way to upgrade your\n" + "sources - please use CTM or CVSup or some other method which\n" + "handles ``deletion events'', unlike this particular feature.\n\n" + "Your existing /usr/src will not be affected by this upgrade.\n"); + } + if (extractingBin) { while (!*saved_etc) { char *cp = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); |