summaryrefslogtreecommitdiff
path: root/sbin/newfs
AgeCommit message (Collapse)Author
2020-06-20With filesystem having many cylinder groups and many inodes per cg theOtto Moerbeek
ncg * ipg calcualtion can overflow if signed types are used. Move to uint32_t for the relevant values. Aligned with FreeBSD changes. Also make sure newfs refuses to create an fs with more that 2^32-1 inodes. ok millert@
2020-05-28Make generation numbers unsigned and fill them using a random numberOtto Moerbeek
from the range [1..UINT_MAX] initially. On inode re-use increment and on wrap refill from the range [1..UINT_MAX-1] to avoid assigning UINT_MAX (the original value). Zero still means uninitialized. ok millert@
2020-05-19Move back to FFS1 by default for MFS as suggested by millert@. OK otto@Stuart Henderson
2020-05-19Copy ownership/permissions from the mountpoint to FFS2 MFS, as already doneStuart Henderson
for FFS1 MFS. Problem reported by Mark Patruck and Andreas Kusalananda Kahari. ok otto@
2020-05-18Make ffs2 the default for newfs; change all calls to create e.g. floppyOtto Moerbeek
filesystems or ramdisks to use explicit -O 1; installer already does that. ok sthen@
2020-01-16Usually, -width Fl (which is 10n) is too wide and hence ugly.Ingo Schwarze
Change several instances, most of them to the usual -width Ds.
2019-07-03snprintf/vsnprintf return < 0 on error, rather than -1.Theo de Raadt
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-04-23missing dots after ".%P pp"; the case of btree(3) wasIngo Schwarze
reported by Fabio Scotoni <fabio at esse dot ch>; also garbage collect one .Tn while here
2018-11-25Remove (unused) FS_BOOT training wheels. If you are allowed to newfs aKenneth R Westerback
partition, you obviously know what you are doing. Even (especially?) if the new file system will be ffs or ext2fs. ok deraadt@ as part of larger diff
2018-03-10Avoid a race when populating an mfs fs by using a tmp dir and splitOtto Moerbeek
out the "wait for mount" code into a function to see more easily what is going on. ok visa@ tedu@
2016-10-11Enable the noperm option for mount_mfs. mfs is ffs in sheeps clothing,Martin Natano
so we basically get this for free. requested by espie ok deraadt
2016-09-01Start writing the size of the cylinder group into the (unused) cpgOtto Moerbeek
field of the disklabel. To be used by fsck_ffs(8) to find alternate superblocks. ok deraadt@ krw@
2016-07-25Revert change to density calculation. David Vasek points out thisKenneth R Westerback
is a more complicated problem than it appears. ok deraadt@
2016-07-23At n2k16 David Vasek pointed out that FFS partitions on 4K disks areKenneth R Westerback
created with far fewer inodes than DEV_BSIZE devices. Scale the default 'density' value by (sector size)/DEV_BSIZE to create the same number of inodes. Obviously a NO-OP on DEV_BSIZE devices. Thanks David! ok deraadt@
2016-05-31permit wxallowed on mfsTheo de Raadt
discussed with naddy a bit, ok millert
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2016-03-17simplify previous; ok bentleyJason McIntyre
2016-03-17Switch (non-curses, non-ksh) programs that use COLUMNS to a single idiom.Anthony J. Bentley
Previously behaviors were all over the map. This changes them to use COLUMNS first, and either terminal width or a hardcoded value (typically 80) as appropriate. ok deraadt@; man bits ok jmc@
2016-03-09We are done providing support for the vax.Theo de Raadt
lots of agreement.
2016-02-18TMPDIR is no longer supported;Jason McIntyre
from rafael neves
2016-01-28malloc(3) returns a pointer, so check against NULL, not 0. (No functional ↵Gleydson Soares
change) OK millert@
2015-12-06Avoid out of boundary access on illegal command line arguments.Tobias Stoeckmann
ok deraadt, mmcc, tedu
2015-11-25We can't make a pledge if we're mount_mfs(8) as we need the ability to callMark Kettenis
mount(2). ok deraadt@
2015-11-23Use pledge "disklabel" as needed. The theory here is these tools become moreTheo de Raadt
resistant against memory correctup, if a corrupt filesystem is given to them. ok krw
2015-11-21remove mlinks for aliases: ntalkd, mfs, updatedbJason McIntyre
ok schwarze
2015-11-10newfs does not need TMPDIR supportTheo de Raadt
2015-10-11Prefer dprintf() over snprintf()+write()Philip Guenther
ok beck@ deraadt@
2015-09-29Delete the final, inscrutable NOSTRICT and VARARGS lint commentsPhilip Guenther
ok millert@
2015-08-20<stdlib.h> is included, so do not need to cast result fromTheo de Raadt
malloc, calloc, realloc* ok krw millert
2015-04-18Convert many atoi() calls to strtonum(), adding range checks and failureTheo de Raadt
handling along the way. Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-02-06Better size_t overflow check for mount_mfs. OK miod@Todd C. Miller
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-18do not require <a.out.h>Theo de Raadt
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-08-29mount_mfs does not require disklabel to be run;Jason McIntyre
diff From: Navan Carson confirmed/ok mikeb
2014-07-20Make sure the correct errno is reported by warn* or err* and notPhilip Guenther
the errno of an intervening cleanup operation like close/unlink/etc. Diff from Doug Hogan (doug (at) acyclic.org)
2014-07-20Mark fatal() as printf-like.Philip Guenther
Don't put a format string that's only used once in a variable.
2014-06-30Use getrlimit(2) instead of assuming MAXDSIZ is available in userland.Otto Moerbeek
ok deraadt@
2014-01-24Don't include <machine/vmparam.h> directly. Instead, get it with its necessaryMiod Vallat
dependencies via <sys/sysctl.h>. Unbreaks ppc userland build.
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-11-05Replace direct references to p_size, p_offset and d_secperunit withKenneth R Westerback
DL_[GET|SET]PSIZE(), DL_[GET|SET]POFFSET(), DL_[GET|SET]DSIZE() in order to get|set correct value that includes the high bits of the value.
2013-11-03Add missing (long long) cast of variable, (long long) castsKenneth R Westerback
for defines fragnum, fsbtodb, cgsblock, and cgdmin.
2013-11-01Sprinkle (long long) casts where %lld is being used to print daddr_tKenneth R Westerback
variables. Some random whitespace/knf repairs encountered on the way. ok miod@ on inspection, feedback & more suggestions from millert@
2013-10-07Say 'fragments' where fragments are meant. Divide by DEV_BSIZEKenneth R Westerback
to convert from bytes to DEV_SIZE. ok otto@ zhuk@ (for his chunk)
2013-10-07Show number of sectors, not the number of 512-byte blocks, whenKenneth R Westerback
saying "n sectors of m bytes". Issue pointed out by David Vasek on misc@. Thanks!
2013-10-07Oops. Too mechanical -- can't use DL_SECTOBLK() to set fssize, sinceKenneth R Westerback
command line sector size overrides disk label sector size. Add a comment to make sure I don't do it again.
2013-10-06daddr_t tweaks. %lld -> %llu, intermediate disk sector calculationKenneth R Westerback
variable, drop pointless casts, vax-only sector variable to u_int64_t. No intentional functional change.
2013-10-06daddr_t comment tweak and whitespace fix.Kenneth R Westerback