summaryrefslogtreecommitdiff
path: root/sbin/ncheck_ffs
AgeCommit message (Collapse)Author
2016-05-28Don't pledge before opendev() and ioctl DIOCGDINFO were called.Theo Buehler
Avoids a pledge crash with 'ncheck_ffs /dev/tty'. deraadt agrees
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
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-23ncheck_ffs may be invoked more simply as ncheck,Jason McIntyre
so add an entry to NAME and document it; ok schwarze
2015-10-11Pledge that ncheck_ffs only uses "stdio" after opening the device.Doug Hogan
ok deraadt@
2015-02-07When getopt processing flags, many should be flag=1 instead of flag++Theo de Raadt
ok tedu miod
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-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-09fairly obvious reallocarray() conversion, where the size is recalculatedTheo de Raadt
only on success.
2014-07-09Oops. Forgot makefile ...Kenneth R Westerback
Enable specifying the filesystem of interest by the duid. Original diff from halex@ a while ago. ok halex@ jsing@ (with comments for future tweaking)
2014-07-09Enable specifying the filesystem of interest by the duid.Kenneth R Westerback
Original diff from halex@ a while ago. ok halex@ jsing@ (with comments for future tweaking)
2014-05-27Where trying to pread() a single disk sector, the i/o must be for theKenneth R Westerback
actual disk sector size and not DEV_BSIZE. The sector size must be obtained via the disklabel. Larger i/o's must be multiple sectors, so when retrying with a smaller size shrink the attempt by one sector and not DEV_BSIZE. Of course if your d_secsize is DEV_BSIZE, this will all be a no-op. This does not make non-512-byte sectors work, but puts in place the logic to get and use the disklabel info. Which makes the next diffs bite sized and focused. ok guenther@
2014-05-24Nuke last of the illusionary 'dev_bsize' and 'dev_bshift' variables inKenneth R Westerback
favour of DEV_BSIZE. No-op on 512-byte sector devices.
2014-05-22Nuke some trailing whitespace to shrink subsequent diffs.Kenneth R Westerback
2014-05-20As suggested by guenther@ and millert@, replace seek+[read|write] withKenneth R Westerback
p[read|write]. Makes the code much clearer by eliminating extra error checking and verbiage. No intentional functional change. Tweaks by and ok guenther@
2014-05-13Since this is limited to ffs, use ufsinfo_t instead of ino_t.Philip Guenther
Grow the array of cached inodes exponentially instead of arithmetically. Prefer sizeof(*pointer) over sizeof(type) in mallocs. Don't leak memory in searchdir(). Fix multiple bugs in the handling of indirect blocks, including reuse of a static buffer in a recursive function and failure to track the remaining size of the directory blocks to process Tested with a directory *doubly* indirect block! ok krw@
2014-05-11replace realloc(p, N * M) with reallocarray(p, N, M) and remove someAlexander Hall
pointless cleanup if we're obviously going to die anyway ok guenther@
2014-05-11struct direct's d_ino is no longer the same size as an ino_t, so copy itPhilip Guenther
for the call to bsearch() problem report and ok krw@
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-07-16Add missing .Mt macros for AUTHORS email addresses.Ingo Schwarze
From Jan Stary <hans at stare dot cz>. ok jmc@
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-24pretty print bigger off_tTheo de Raadt
ok tedu otto
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
2009-06-02snprintf returns int, not size_t.Ray Lai
OK millert otto deraadt
2007-08-06the ellipsis is not an optional argument; while here, sync the usageIgor Sobrado
and synopsis of commands lots of good ideas by jmc@ ok jmc@
2007-07-09correct a typo in an error message.Thordur I. Bjornsson
use realpath(3) to sanitize the path we're going to work with, prevents silly errors when passing ncheck_ffs paths from the shell with a trailing '/' since that doesnt match the entry in fstab. ok deraadt@,krw@
2007-06-29more daddr64_t changes; checked by ottoTheo de Raadt
2007-06-01ufs1_daddr_t cleanup, okay otto@Pedro Martelletto
2007-06-01convert ufs2_daddr_t -> daddr64_t for greater clarity; ok pedro otto thibTheo de Raadt
2007-05-31convert to new .Dd format;Jason McIntyre
2007-05-21Add ffs2 support; some parts adapted from ffs2 dump changes in FreeBSD.Todd C. Miller
2007-03-19Add FFS2 fields to the superblock, change file system tools to keepPedro Martelletto
accessing FFS1 fields, okay art@, quite some testing by ckuethe@, simon@ and thib@, thanks.
2006-04-02use SEEK_* for lseek()Theo de Raadt
2005-11-12more asprintf; ok dhill@mindcry.orgTheo de Raadt
2005-04-12handle snprintf potential -1 caseTheo de Raadt
2004-08-08spacingTheo de Raadt
2003-11-21- standard SYNOPSISJason McIntyre
- sort OPTIONS - s/Dq/Sq when quoting single characters - sync usage() - simplify macros
2003-09-25realloc fixes; 3rd rev to make markus happierTheo de Raadt
2003-08-25rename struct dinode to ufs1_dinode. clears the namespace and makesTed Unangst
way for some future work. no function changes yet. help testing otto@ and markus@
2003-07-29spacesTheo de Raadt
2003-06-11ansificationTheo de Raadt
2003-06-04term 3 & 4 from tholo after permissionTheo de Raadt
2003-06-03- section reorderJason McIntyre
- some mdoc fixes
2003-03-06Make fsdb(8) a little easier to find with some cross references.Hugh Graham
2003-02-07typos;Jason McIntyre
2003-01-17Add a new option, -f, that allows the user to specify a custom outputTodd C. Miller
format. Currently only supports printing the inode number and path (along with any arbitrary text) but other escapes may be added later. A useful invocation is: ncheck -s -f '\P\0' | xargs -0 ls -ldgT deraadt@ OK
2003-01-17Don't report setugid directories in "ncheck -s" output since thoseTodd C. Miller
bits have no meaning on OpenBSD. deraadt@ OK
2002-08-12Swap args to calloc(3) so they are in the correct order; art@ ok.Aaron Campbell
2002-07-11malloc() failure tests; rimshot@pandora.beTheo de Raadt
2002-07-03ansiTheo de Raadt