summaryrefslogtreecommitdiff
path: root/sbin/disklabel/editor.c
AgeCommit message (Collapse)Author
2015-01-20Adjust <sys/param.h> comments regarding use of use of MAXFRAG, orTheo de Raadt
delete <sys/param.h> if now possible ok guenther
2015-01-16Constify the driver name to disk type table, and remove rz and ccd from thatMiod Vallat
list. ok krw@ millert@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers whereTheo de Raadt
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
2014-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-07-10Forward declarations for mpcopy & mpfree.Florian Obser
OK miod@, deraadt@
2014-05-02remove unused variableCharles Longeau
ok otto@ krw@
2014-05-02'for (part == 0; ...)' is not the same as 'for(part = 0; ...)'.Kenneth R Westerback
Should fix mysterious crashes when twiddling mount points. Too much Marrakesh sun. Pointed out by Owain G. Ainsworth. Thanks!
2014-04-21Don't leak mountpoint info. Now with replacement for silly realloc() danceKenneth R Westerback
that appears to fix mysterious crashes seen with previous version that tried to sneak in to 5.5. ok otto@
2014-04-03Proper validation and computation of bsize in expert mode; ok krw@ millert@Otto Moerbeek
2014-02-22Revert mountpoints tweaking. Needs much more serious surgery than timeKenneth R Westerback
permits before release, and is pointless without other following diffs to justify it that will not make release. Should fix segfault's during install reported by Rod Whitworth on tech@
2014-02-16Further tweak to mpfree(). Don't bother setting about-to-be-freedKenneth R Westerback
memory to NULL.
2014-02-15Don't risk dereferencing NULL pointer to mountpoints arrayKenneth R Westerback
when calling mpfree() with the array.
2014-02-15Stop leaking mount point strings in temporary copies of theKenneth R Westerback
mountpoints array.
2013-11-22Whole bunch of (unsigned char) casts carefully added for ctype calls.Theo de Raadt
Careful second audit by millert
2013-11-12add a variety of missing prototypesTheo de Raadt
2013-10-21improve on last commit: take 10% for swap, with a max of physmem plus a bitOtto Moerbeek
2013-10-18allow more space for swap with big disks, useful for hibernation;Otto Moerbeek
requested by deraadt@
2013-10-15The disklabel variables aflag and dflag are boolean, use logicalAlexander Bluhm
instead of binary operators for comparison. OK krw@
2013-10-03Print u_int64_t variables with %llu.Kenneth R Westerback
2013-09-10The rule is: daddr_t variables hold counts of 512-byte blocks, a.k.a.Kenneth R Westerback
DEV_BSIZE blocks. Counts of possibly other-sized blocks (e.g. disk sector addresses) are u_int64_t. The values stored in disklabels are counts of possibly other-sized blocks and hence should be handled with u_int64_t variables. Start enforcing this rule. No intended functional change. Rule strongly suggested by deraadt@
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others
2013-04-19make sure the fs blocksize doesn't get too big; ok krw@Otto Moerbeek
2012-07-13Replace a '512' with DEV_BSIZE. Calculate physmem size in blocks andKenneth R Westerback
not sectors, since the values being tested/manipulated in the auto_alloc tables are blocks at that point. Use MEG(256) instead of hand expanding it when testing physmem.
2012-03-18getuint() -> getuint64() to make it crystal clear. No functionalKenneth R Westerback
change.
2012-03-18Wrap some long lines I keep fixing, shrinking various diffs. NoKenneth R Westerback
change to executable.
2012-01-30fix format stringCharles Longeau
ok krw@ otto@
2012-01-19Even 'X'perts should not be able to use the built in editor toKenneth R Westerback
create ffs partitions with invalid fsize and bsize values newfs will croak on. However, they should be able to set them to whatever consistent values they want, not just make them smaller. Also tweak some verbiage.
2012-01-17No need for saying out loud what we're thinking during auto-allocation.Kenneth R Westerback
i.e. when rounding off various values. ok deraadt@ sthen@
2012-01-17Avoid ffs fragsize < sector-size when 'a'dding a partition via theKenneth R Westerback
editor. Use logic from calculating fragsize for an auto-allocated partition. Noted when trying to add a small ffs partition to a 4K sector device.
2012-01-02Change last "#if (NUMBOOT == 1)" to "#if NUMBOOT > 0".Kenneth R Westerback
2011-12-25miod@ reported problems reproducing a 'pre-4K fix' disklabel. So in theKenneth R Westerback
interest of rope sales allow the 'X'pert to suppress the rounding of partition locations to bsize boundaries. Also mention that such rounding is being done, so as to not surprise the user. ok otto@ a while ago
2011-12-01Fix negating of unsigned d_secsize. FIRST, cast to signed type,Kenneth R Westerback
THEN negate. Fixes issues with 'b' and 'k' size suffixes. Make error message more clear while here. Found, and fix provided, by David Imhoff via bugs@. Thanks!
2011-10-06mark ccd(4) deprecated in a few more placesTheo de Raadt
2011-07-05Add DIOCGPDINFO to rxioctl(), as a synonym for DIOCGDINFO, the lastKenneth R Westerback
place it was missing. Delete now redundant calls to DIOCGDINFO when getting physical disk info in disklabel(8) and fdisk(8). Reminded by a fdisk discussion with Andres Perera on tech@. ok deraadt@
2011-07-05More non-512-byte sector groundwork. Don't let disklabel hint thatKenneth R Westerback
a ffs frag size can be less than the d_secsize of the disk. Make sure amd64 writedisklabel() puts the disklabel where readdoslabel() will read it. Tweak i386/amd64 installboot/biosboot so sectors are indeed used where sectors are claimed. Lets me fdisk, newfs, mount and installboot onto 2048 and 4096 byte sector devices. Other filesystem utilites will still hold surprises. Note that actually booting from such devices will await BIOSen that acknowledge such devices as bootable. ok guenther@
2011-05-24Allow for more room for /usr/obj on static linking only archs; ok krw@ deraadt@Otto Moerbeek
2011-05-23Make /usr/obj a bit bigger, on small disks it ends up just a littleOtto Moerbeek
bit too small. ok krw@
2011-05-22Apply proper rounding for the R command (changing of auto-allocatedOtto Moerbeek
partitions); ok krw@
2011-05-22In addition to relative resizing, allow absolute resizing of partitionsOtto Moerbeek
in auto-allocated labels. ok krw@ sthen@
2011-04-16Add swap partition entries to -F and -f output. man pageKenneth R Westerback
updates to follow. This will simplify install script fstab creation. ok deraadt@
2011-04-16Add '-F'. Same as '-f' but uses DUIDs when writing the mount pointKenneth R Westerback
information to the specified file. After every label write, read the label to get current UID info. Some internal code cleanup with no intended functional change. ok deraadt@
2011-03-05If an auto-allocation scheme fails because there are not enoughKenneth R Westerback
available partitions (e.g. many spoofed logical partitions) try the next scheme rather than giving up. "sane" deraadt@ ok matthew@
2011-03-02Every time the user updates the bounds of the OpenBSD area of the disk, ↵Kenneth R Westerback
either explicitly or implicitly, update the start and end sector of the OpenBSD area in the disklabel with DL_SEBEND/DL_SETBSTART. Otherwise the new bounds would not be saved to disk. ok miod@ deraadt@
2011-02-19If the user screws up adding a partition, don't keep partial bitsKenneth R Westerback
of the partition info around to confuse disklabel, newfs, fsck, etc. From Pedro Martelletto. ok miod@
2010-12-13stray tabs and spacesMarco Peereboom
2010-11-24When dealing with disklabel UIDs (DUIDs) be specific and consistent withJoel Sing
naming. ok krw@
2010-09-23Print disklabel UIDs using printf/fprintf instead of using the hand rolledJoel Sing
uid_print() function. ok krw@
2010-08-12fix a few warnings. ok jsingTed Unangst
2010-08-10Add support for t/T == terabyte units to -E. Prodded by deraadt@.Kenneth R Westerback
Semantically equivalent version ok beck@ millert@ and tested ckeuthe@. "just commit" deraadt@
2010-08-09Improve the editor prompt for the 'R' (resize) commandTheo de Raadt
from otto