summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-11-20 17:07:21 +0000
committerbde <bde@FreeBSD.org>1997-11-20 17:07:21 +0000
commitdbdea37b8422a75dd03baeb05d688bb75fceff8e (patch)
treecee92a7a84044870c866f8ce190f077d38e0ea5f /sys
parent2001000d902e54e9a7a11e6d1af3fd9a2ba8391b (diff)
downloadFreeBSD-src-dbdea37b8422a75dd03baeb05d688bb75fceff8e.zip
FreeBSD-src-dbdea37b8422a75dd03baeb05d688bb75fceff8e.tar.gz
Don't allow setting the dump device to any partition except the
one traditionally reserved for swap devices. The restrictions should now be the same as the ones for dumpsys(). The restriction on the partition should be removed someday, and dumpsys() shouldn't repeat all the checks.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/autoconf.c9
-rw-r--r--sys/i386/i386/autoconf.c9
2 files changed, 16 insertions, 2 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c
index 0728769..c12c723 100644
--- a/sys/amd64/amd64/autoconf.c
+++ b/sys/amd64/amd64/autoconf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.77 1997/09/23 17:14:37 bde Exp $
+ * $Id: autoconf.c,v 1.78 1997/10/26 04:36:11 nate Exp $
*/
/*
@@ -396,6 +396,13 @@ setdumpdev(dev)
psize = bdevsw[maj]->d_psize(dev);
if (psize == -1)
return (ENXIO); /* XXX should be ENODEV ? */
+ /*
+ * XXX should clean up checking in dumpsys() to be more like this,
+ * and nuke dodump sysctl (too many knobs), and move this to
+ * kern_shutdown.c...
+ */
+ if (dkpart(dev) != SWAP_PART)
+ return (ENODEV);
newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE;
if (newdumplo < 0)
return (ENOSPC);
diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c
index 0728769..c12c723 100644
--- a/sys/i386/i386/autoconf.c
+++ b/sys/i386/i386/autoconf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.77 1997/09/23 17:14:37 bde Exp $
+ * $Id: autoconf.c,v 1.78 1997/10/26 04:36:11 nate Exp $
*/
/*
@@ -396,6 +396,13 @@ setdumpdev(dev)
psize = bdevsw[maj]->d_psize(dev);
if (psize == -1)
return (ENXIO); /* XXX should be ENODEV ? */
+ /*
+ * XXX should clean up checking in dumpsys() to be more like this,
+ * and nuke dodump sysctl (too many knobs), and move this to
+ * kern_shutdown.c...
+ */
+ if (dkpart(dev) != SWAP_PART)
+ return (ENODEV);
newdumplo = psize - Maxmem * PAGE_SIZE / DEV_BSIZE;
if (newdumplo < 0)
return (ENOSPC);
OpenPOWER on IntegriCloud