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.
This commit is contained in:
Bruce Evans 1997-11-20 17:07:21 +00:00
parent ff0618391a
commit e6af3c69e8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31316
2 changed files with 16 additions and 2 deletions

View File

@ -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);

View File

@ -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);