aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/quot
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* quot: Use getopt(3) and show usage() if no argumentsRicardo Branco2024-02-032-31/+36
| | | | | | | | Also update the man page and usage to be a little more accurate with the -a flag. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/983
* usr.sbin: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* Add a flags parameter to the ffs_sbget() function that reads UFS superblocks.Kirk McKusick2022-07-311-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than trying to shoehorn flags into the requested superblock address, create a separate flags parameter to the ffs_sbget() function in sys/ufs/ffs/ffs_subr.c. The ffs_sbget() function is used both in the kernel and in user-level utilities through export to the sbget() function in the libufs(3) library (see sbget(3) for details). The kernel uses ffs_sbget() when mounting UFS filesystems, in the glabel(8) and gjournal(8) GEOM utilities, and in the standalone library used when booting the system from a UFS root filesystem. The ffs_sbget() function reads the superblock located at the byte offset specified by its sblockloc parameter. The value UFS_STDSB may be specified for sblockloc to request that the standard location for the superblock be read. The two existing options are now flags: UFS_NOHASHFAIL will note if the check hash is wrong but will still return the superblock. This is used by the bootstrap code to give the system a chance to come up so that fsck can be run to correct the problem. UFS_NOMSG indicates that superblock inconsistency error messages should not be printed. It is used by programs like fsck that want to print their own error message and programs like glabel(8) that just want to know if a UFS filesystem exists on a partition. One additional flag is added: UFS_NOCSUM causes only the superblock itself to be returned, but does not read in any auxiliary data structures like the cylinder group summary information. It is used by clients like glabel(8) that just want to check for possible filesystem types. Using UFS_NOCSUM skips the superblock checks for csum data which allows superblocks that have corrupted csum data to be read and used. The validate_sblock() function checks that the superblock has not been corrupted in a way that can crash or hang the system. Unless the UFS_NOMSG flag is specified, it will print out any errors that it finds. Prior to this commit, validate_sblock() returned as soon as it found an inconsistency so would print at most one message. It now does all its checks so when UFS_NOMSG has not been specified will print out everything that it finds inconsistent. Sponsored by: The FreeBSD Foundation
* Move the pointers stored in the superblock into a separateKirk McKusick2020-06-191-0/+3
| | | | | | | | | | | | | | | | | fs_summary_info structure. This change was originally done by the CheriBSD project as they need larger pointers that do not fit in the existing superblock. This cleanup of the superblock eases the task of the commit that immediately follows this one. Suggested by: brooks Reviewed by: kib PR: 246983 Sponsored by: Netflix Notes: svn path=/head/; revision=362358
* Normally when an attempt is made to mount a UFS/FFS filesystem whoseKirk McKusick2018-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | superblock has a check-hash error, an error message noting the superblock check-hash failure is printed and the mount fails. The administrator then runs fsck to repair the filesystem and when successful, the filesystem can once again be mounted. This approach fails if the filesystem in question is a root filesystem from which you are trying to boot. Here, the loader fails when trying to access the filesystem to get the kernel to boot. So it is necessary to allow the loader to ignore the superblock check-hash error and make a best effort to read the kernel. The filesystem may be suffiently corrupted that the read attempt fails, but there is no harm in trying since the loader makes no attempt to write to the filesystem. Once the kernel is loaded and starts to run, it attempts to mount its root filesystem. Once again, failure means that it breaks to its prompt to ask where to get its root filesystem. Unless you have an alternate root filesystem, you are stuck. Since the root filesystem is initially mounted read-only, it is safe to make an attempt to mount the root filesystem with the failed superblock check-hash. Thus, when asked to mount a root filesystem with a failed superblock check-hash, the kernel prints a warning message that the root filesystem superblock check-hash needs repair, but notes that it is ignoring the error and proceeding. It does mark the filesystem as needing an fsck which prevents it from being enabled for writing until fsck has been run on it. The net effect is that the reboot fails to single user, but at least at that point the administrator has the tools at hand to fix the problem. Reported by: Rick Macklem (rmacklem@) Discussed with: Warner Losh (imp@) Sponsored by: Netflix Notes: svn path=/head/; revision=341608
* Revert r313780 (UFS_ prefix)Ed Maste2018-03-171-14/+13
| | | | Notes: svn path=/head/; revision=331095
* Prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2018-03-171-13/+14
| | | | | | | | | | | | | Followup to r313780. Also prefix ext2's and nandfs's versions with EXT2_ and NANDFS_. Reported by: kib Reviewed by: kib, mckusick Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9623 Notes: svn path=/head/; revision=331083
* Refactoring of reading and writing of the UFS/FFS superblock.Kirk McKusick2018-01-262-26/+12
| | | | | | | | | | | | | | | Specifically reading is done if ffs_sbget() and writing is done in ffs_sbput(). These functions are exported to libufs via the sbget() and sbput() functions which then used in the various filesystem utilities. This work is in preparation for adding subperblock check hashes. No functional change intended. Reviewed by: kib Notes: svn path=/head/; revision=328426
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* prefix UFS symbols with UFS_ to reduce namespace pollutionEd Maste2017-02-151-3/+3
| | | | | | | | | | | | | | | | | | | | | Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Also prefix ext2's and nandfs's NDADDR and NIADDR with EXT2_ and NANDFS_ Reviewed by: kib, mckusick Obtained from: NetBSD MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D9536 Notes: svn path=/head/; revision=313780
* quot: make use of our rounddown() macro when <sys/param.h> is available.Pedro F. Giffuni2016-05-021-2/+2
| | | | | | | No functional change. Notes: svn path=/head/; revision=298913
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * Sync from headSimon J. Gerraty2012-11-041-3/+3
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=242545
| * Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Fix usr.bin/ and usr.sbin/ build with a 64-bit ino_t.Matthew D Fleming2012-09-271-3/+3
|/ | | | | | | Original code by: Gleb Kurtsou Notes: svn path=/head/; revision=241015
* The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilitiesKirk McKusick2011-01-241-1/+1
| | | | | | | | | | | | | | | | | include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This commit replaces sys/time.h where necessary with time.h. The commit also includes some minor style(9) header fixup in newfs. This commit is part of a larger effort by Garrett Cooper started in //depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more POSIX compliant. Submitted by: Garrett Cooper yanegomi at gmail dot com Notes: svn path=/head/; revision=217769
* Make `quot -a' work when we've got slashes in the device name.Ed Schouten2008-09-141-10/+2
| | | | | | | | | | | | | | | | A very long time ago we had raw device nodes. quot(8) was supposed to use these when running `quot -a'. For some reason the code got once changed to strip the device name until it reaches the last slash. This is not reliable, because this means /dev/mirror/foo will be stripped to /dev/foo. This bug also exists on RELENG_7 and RELENG_6, but I think I'll just merge them back somewhere after the upcoming releases. There's no rush. MFC after: 2 months Notes: svn path=/head/; revision=183018
* Drag this code kicking and screaming into the twenty-first century.Dag-Erling Smørgrav2008-07-021-75/+51
| | | | Notes: svn path=/head/; revision=180187
* o Check we have a non-NULL pointer to a super block before dereference it.Maxim Konovalov2006-09-301-1/+1
| | | | | | | | | PR: misc/103822 Submitted by: Dmitry Stefankov MFC after: 2 weeks Notes: svn path=/head/; revision=162831
* The quot command expected all inodes contents to be valid, howeverDavid Malone2006-02-251-3/+31
| | | | | | | | | | | | | | | | | | | | on UFS2 inodes are initialised as they are needed, rather than at newfs time. When quot encountered these inodes it could produce crazy results. Now, on UFS2 filesystems, quot's get_inode function will bzero unallicated inodes before passing them back to a caller. This is how UFS2 initialises new inodes, so this should work OK. Also, while I'm here, make quot exit with an error if it finds inodes of an unknown type. This should help catch future problems of this type. Reviewed by: iedowse MFC after: 1 week Notes: svn path=/head/; revision=156015
* Remove unused variables.Stefan Farfeleder2005-04-091-3/+1
| | | | Notes: svn path=/head/; revision=144841
* Sort sections.Ruslan Ermilov2005-01-181-7/+7
| | | | Notes: svn path=/head/; revision=140442
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-1/+2
| | | | Notes: svn path=/head/; revision=131500
* Use __FBSDID over rcsid[]. Protect copyright[] where needed.David E. O'Brien2003-05-031-4/+2
| | | | Notes: svn path=/head/; revision=114601
* Repair the UFS2 superblock location consistency check so that it succeedsTim J. Robbins2003-04-251-1/+1
| | | | | | | | | | on valid superblocks instead of issuing the error "not a BSD filesystem". fs_sblockloc is a byte offset, not a fragment number. This change makes quot work properly on UFS2 filesystems, which is important now that UFS2 is the default. Notes: svn path=/head/; revision=114009
* style.Makefile(5)David E. O'Brien2003-04-041-1/+2
| | | | Notes: svn path=/head/; revision=113091
* Remove contractions.Tom Rhodes2003-02-181-3/+3
| | | | | | | Use `Force' in place of `Cause' which sounds better. Notes: svn path=/head/; revision=111067
* Back out rev 1.19; getbsize(3)'s original interface has been restored.Mike Barcroft2002-12-301-1/+1
| | | | Notes: svn path=/head/; revision=108458
* Uniformly refer to a file system as "file system".Ruslan Ermilov2002-12-121-1/+1
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107788
* another int * to size_t * change for getbsize() to make it compileAndrew Gallatin2002-10-241-1/+1
| | | | | | | on LP64 hosts Notes: svn path=/head/; revision=105883
* Use POSIX-style sort syntax in exampleAndrey A. Chernov2002-09-241-1/+1
| | | | Notes: svn path=/head/; revision=103912
* The .Nm utilityPhilippe Charnier2002-07-141-1/+3
| | | | Notes: svn path=/head/; revision=99968
* This commit adds basic support for the UFS2 filesystem. The UFS2Kirk McKusick2002-06-211-53/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org> Notes: svn path=/head/; revision=98542
* Unbreak Alpha build.Dag-Erling Smørgrav2002-05-151-2/+4
| | | | Notes: svn path=/head/; revision=96638
* Sigh... Yet a BBSIZE breakage.Poul-Henning Kamp2002-05-121-0/+1
| | | | Notes: svn path=/head/; revision=96479
* Reorder WARNS line for style.Mike Heffner2001-12-101-2/+1
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=87629
* WARNS=2 cleanup.Mike Heffner2001-12-092-15/+41
| | | | | | | | PR: bin/32567 MFC after: 2 weeks Notes: svn path=/head/; revision=87554
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79537
* mdoc(7) police: cosmetics.Ruslan Ermilov2001-07-051-1/+3
| | | | Notes: svn path=/head/; revision=79303