aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/quota
Commit message (Collapse)AuthorAgeFilesLines
* Add a workaround for servers which respond RPC_PROGNOTREGISTEREDHiroki Sato2019-09-211-1/+1
| | | | | | | | | | | | | | | | | to a clnt_create() call even when it is actually a program version mismatch. Normally the server is supposed to return RPC_PROGVERSMISMATCH when it supports the specified program but not support the specified version. Some filers return RPC_PROGNOTREGISTERED to RQUOTA v2 calls and FreeBSD does not retry with the old v1 calls. This change fixes this failure scenario. Submitted by: Jian-Bo Liao PR: 236179 Notes: svn path=/head/; revision=352567
* This exposes ZFS user and group quotas via the normalSean Eric Fagan2018-07-051-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | quatactl(2) mechanism. (Read-only at this point, however.) In particular, this is to allow rpc.rquotad query quotas for NFS mounts, allowing users to see their quotas on the hosts using the datasets. The changes specifically: * Add new RPC entry points for querying quotas. * Changes the library routines to allow non-UFS quotas. * Changes rquotad to check for quotas on mounted filesystems, rather than being limited to entries in /etc/fstab * Lastly, adds a VFS entry-point for ZFS to query quotas. Note that this makes one unavoidable behavioural change: if quotas are enabled, then they can be queried, as opposed to the current method of checking for quotas being specified in fstab. (With ZFS, if there are user or group quotas, they're used, always.) Reviewed by: delphij, mav Approved by: mav Sponsored by: iXsystems Inc Differential Revision: https://reviews.freebsd.org/D15886 Notes: svn path=/head/; revision=336017
* quota(1): Fix calculation overflow and underflowConrad Meyer2018-04-161-6/+6
| | | | | | | | | | | | | | | For very large quotas, do the multiplication as a 64 bit value to avoid overflow. For very small block sizes (smaller than DEV_BSIZE), multiple first before dividing by block size to avoid underflow. PR: 227496 Submitted by: Per Andersson <pa AT chalmers.se> Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=332632
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. 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. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Renumber copyright clause 4Warner Losh2017-02-282-2/+2
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Use MIN() macro from sys/param.h.Marcelo Araujo2016-04-271-2/+2
| | | | | | | MFC after: 2 weeks. Notes: svn path=/head/; revision=298682
* - Add IPv6 support in quota(1). While rpc.rquotad has supported PF_INET6Hiroki Sato2015-07-071-31/+17
| | | | | | | | | | | | | for a long time, quota(1) utility supported only PF_INET. - Clean up confusing changes in f_mntfromname. - Add an entry for rquotad with rpc/udp6 to inetd.conf. PR: 194084 Notes: svn path=/head/; revision=285253
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Merge sync of headSimon J. Gerraty2015-05-271-2/+1
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * 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 FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+23
| | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | Convert to usr.bin/ to LIBADDBaptiste Daroussin2014-11-251-2/+1
|/ | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275042
* Add missing static keywords to quota(1)Ed Schouten2011-11-061-8/+7
| | | | Notes: svn path=/head/; revision=227176
* Fix quota(1) output.Sergey Kandaurov2011-06-301-5/+11
| | | | | | | | | | | | | | - Fix calculation of 1024-byte sized blocks from disk blocks shown when -h option isn't specified. It was broken with quota64 integration. - In prthumanval(): limit the size of a buffer passed to humanize_number() to a width of 5 bytes but allow a shorter length if requested. That's what users expect. PR: bin/150151 Reviewed by: Kirk McKusick Notes: svn path=/head/; revision=223690
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-112-8/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Debugging nits found while testing the new 64-bit quota code.Kirk McKusick2010-03-161-0/+1
| | | | Notes: svn path=/projects/quota64/; revision=205207
* Fix warnings + minor style issuesDag-Erling Smørgrav2010-03-041-33/+30
| | | | Notes: svn path=/projects/quota64/; revision=204702
* Update to work with quotafile functions in -libutil.Kirk McKusick2009-10-211-149/+82
| | | | Notes: svn path=/projects/quota64/; revision=198312
* In preparation for raising NGROUPS and NGROUPS_MAX, change baseBrooks Davis2009-06-191-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. MFC after: 2 weeks Notes: svn path=/head/; revision=194494
* Make quota(1) to compile with WARNS=6:Xin LI2008-08-041-5/+2
| | | | | | | | | - ANSI'fy showrawquotas(). - Shut up GCC by initializing bgrace and igrace. The situation that caused the GCC warning can never happen though. Notes: svn path=/head/; revision=181267
* ctime() expects a time_t, but qup->dqblk.dqb_btime is an int32_t, so forOlivier Houchard2008-08-031-6/+9
| | | | | | | | | | | | big endian platforms where time_t is 64bits (ie armeb and sparc64), it will be a problem. Use a temporary time_t to work around this. Submitted by: Matthew Luckie <mjl AT luckie DOT org dot nz> MFC after: 3 days Notes: svn path=/head/; revision=181262
* Make the human readable numbers printed with the -h option a bitMike Pritchard2008-02-181-4/+6
| | | | | | | | | | | more human readable by telling the human print routines to use a smaller buffer to format the value. This makes it so a value that was previously being printed as 600000K will now print as 586M. Notes: svn path=/head/; revision=176378
* Use [u]intmax_t to printf unknown integer types.David Malone2007-05-071-36/+31
| | | | | | | | Make timeprt always allocate memory, to make things a little simpler. Remove an unused variable. Notes: svn path=/head/; revision=169345
* Insert explicit space between the output fields to prevent themYaroslav Tykhiy2007-04-231-3/+3
| | | | | | | | | from running together when a field overflows. MFC after: 1 week Notes: svn path=/head/; revision=168971
* Fix some spelling / markup / grammar.Mike Pritchard2007-02-111-5/+5
| | | | | | | Pointed out by: ru Notes: svn path=/head/; revision=166651
* Add two new options to quota:Mike Pritchard2007-02-112-24/+94
| | | | | | | | | | | | -f path Only print quota information for the file system that path resides on. -r Display the quota information in a raw format. Reviewed by: freebsd-hackers Notes: svn path=/head/; revision=166646
* If a user is over both the soft block limit and soft i-nodeMike Pritchard2007-02-041-13/+29
| | | | | | | | | | | | | | | limit, quota will report one of the grace times incorrectly. This is due to it storing the result in a static buffer, and the routine being called like: printf("....", ..., timeprnt(btime), timeprnt(itime), ...) The problem becomes very obvious if you change one of the default grace periods to be much larger than the other one. Changed timeprnt to dynamically allocate the string to be displayed. Notes: svn path=/head/; revision=166495
* If two files systems, /a and /b are marked as having quotas enabledMike Pritchard2007-02-041-7/+21
| | | | | | | | | | | | | | | | in fstab and they are normally mounted as /a/b, if /b is not mounted, the various quota utilities will incorrectly operate with the quotas on /a (silently) when operations are attemted on /b. Sync up all the hasquota() routines between all the different quota utilities and change it to detect if the file system we are attempting to perform quota operations on is not currently mounted and warn the user accordingly. PR: bin/38918 Notes: svn path=/head/; revision=166485
* Make quota exit with a non-zero status if one more more fileMike Pritchard2007-02-011-30/+37
| | | | | | | | | systems are over quota, as documented in the man page. PR: bin/77918 Notes: svn path=/head/; revision=166388
* - Document the default disk block usage unit.Ruslan Ermilov2006-10-213-21/+48
| | | | | | | | | - Add option -h, human-readable output. PR: docs/53732 Notes: svn path=/head/; revision=163599
* Remove an unused #define. md5's with and without this commit match.Ceri Davies2005-03-131-1/+0
| | | | | | | Approved by: murray (mentor) Notes: svn path=/head/; revision=143524
* Sort sections.Ruslan Ermilov2005-01-181-5/+5
| | | | Notes: svn path=/head/; revision=140420
* Assign the result of getopt() to an int rather than to a char.Stefan Farfeleder2004-08-071-2/+1
| | | | Notes: svn path=/head/; revision=133258
* Remove redundant declarations.David Schultz2003-08-051-2/+0
| | | | Notes: svn path=/head/; revision=118465
* Don't overflow the block quota calculations for NFS mounts.David Schultz2003-08-051-3/+3
| | | | | | | | PR: 47607 Submitted by: Eric van Gyzen <vangyzen@stat.duke.edu> Notes: svn path=/head/; revision=118464
* Now that the kernel access control for quotactl(2) appears to workRobert Watson2003-06-151-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | properly, clean up quota(1). quota(1) has the ability to query quotas either directly from the kernel, or if that fails, by reading the quota.user or quota.group files specified for the file system in /etc/fstab. The setuid bit existed solely (apparently) to let non-operator users query their quotas and consumption when quotas weren't enabled for the file system. o Remove the setuid bit from quota(1). o Remove the logic used by quota(1) when running setuid to prevent users from querying the quotas of other users or groups. Note that this papered over previously broken kernel access control; if you queried directly using the system call, you could access some of the data "restricted" by quota(1). In the new world order, the ability to inspect the (live) quotas of other uids and gids via the kernel is controlled by the privilege requirement sysctl. The ability to query via the file is controlled by the file permissions on the quota database backing files (root:operator, group readable by default). Notes: svn path=/head/; revision=116386
* Now that the kernel access control for quotactl(2) appears to workRobert Watson2003-06-152-18/+0
| | | | | | | | | | | | | | | | | | properly, clean up quota(1). quota(1) has the ability to query quotas either directly from the kernel, or if that fails, by reading the quota.user or quota.group files specified for the file system in /etc/fstab. The setuid bit existed solely (apparently) to let non-operator users query their quotas and consumption when quotas weren't enabled for the file system. o Remove the setuid bit from quota(1). o Remove the logic used by quota(1) when running setuid to prevent users from querying the quotas of other users or groups. Note that this papered over previously broken kernel access control. Notes: svn path=/head/; revision=116385
* Uniformly refer to a file system as "file system".Ruslan Ermilov2002-12-121-11/+11
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107788
* Add a new flag (-l) that suppresses quota checks on NFS filesystems.Ian Dowse2002-08-092-7/+26
| | | | | | | | PR: bin/12939 Submitted by: Neil Blakey-Milner <nbm@rucus.ru.ac.za> Notes: svn path=/head/; revision=101545
* Fix a few compiler warnings, sort options and make the usage()Ian Dowse2002-08-092-27/+29
| | | | | | | output match the synopsis. Notes: svn path=/head/; revision=101544
* Call getmntinfo with MNT_NOWAIT to avoid hanging if any NFS serversIan Dowse2002-06-031-1/+8
| | | | | | | | | | | are down. Avoid trying to send RPCs to the pidXXX@machine names used in the special amd(8) mounts. PR: bin/6183 Submitted by: Petr Lampa <lampa@fee.vutbr.cz> Notes: svn path=/head/; revision=97764
* Fix some low-hanging fruit in the warnings department; ANSIfy functions,Mark Murray2002-04-281-88/+59
| | | | | | | sort out some const issues. Notes: svn path=/head/; revision=95624
* Use `The .Nm utility'Philippe Charnier2002-04-201-6/+7
| | | | Notes: svn path=/head/; revision=95124
* remove __PWarner Losh2002-03-221-2/+2
| | | | Notes: svn path=/head/; revision=92921
* Set BINOWN=root explicitly for setuid root binaries.Ruslan Ermilov2001-09-131-0/+2
| | | | | | | | | This is not "useless", as one may have non-default setting for BINOWN in make.conf, and we still want these to be installed setuid root in this case. Notes: svn path=/head/; revision=83391