Commit Graph

20 Commits

Author SHA1 Message Date
sef
a652771388 r343881 had an uninitialized error. This fixes that.
PR:             233849
Reported by:    Andre Albsmeier
MFC after:      1 month
Sponsored by:   iXsystems Inc
Differential Revision:  https://reviews.freebsd.org/D18785
2019-02-07 22:10:20 +00:00
sef
839aca8032 r339008 broke repquota for UFS. This rectifies that.
Refactor the function calls and tests so that, on UFS, the proper fields
are filled out.

PR:		233849
Reported by:	Andre Albsmeier
Reviewed by:	mav, delphij
MFC after:	1 month
Sponsored by:	iXsystems Inc
Differential Revision:	https://reviews.freebsd.org/D18785
2019-02-07 21:51:39 +00:00
delphij
1e3059d959 Ensure buffer is nul-terminated.
MFC after:	2 weeks
2018-12-31 03:08:01 +00:00
sef
107a344bbb This exposes ZFS user and group quotas via the normal
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
2018-07-05 22:56:13 +00:00
pfg
260ba0bff1 lib: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using mis-identified 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.
2017-11-26 02:00:33 +00:00
truckman
61eb4d5d8a Use strlcpy() instead of strncpy() to ensure that qf->fsname is NUL
terminated.  Don't bother checking for truncation since the subsequent
stat() call should detect that and fail.

Reported by:	Coverity
CID:		1018189
MFC after:	1 week
2016-05-13 00:26:14 +00:00
jilles
baaacfdc28 libutil: Use O_CLOEXEC for internal file descriptors from open(). 2013-08-28 21:10:37 +00:00
ed
e7e5b53bf1 Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
mckusick
f63b97928b Debugging nits found while testing the new 64-bit quota code. 2010-03-16 06:12:30 +00:00
mckusick
5a28062dc2 Add and document the quota_convert function which converts between the
old 32-bit and the new 64-bit formats.
2009-12-28 22:44:19 +00:00
mckusick
ec26bb0ac6 Minor bugs turned up during conversion of quotacheck. 2009-12-27 06:26:04 +00:00
mckusick
eb9113cb7d Add and document new quoat_on and quota_off functions. 2009-11-16 18:59:04 +00:00
mckusick
964d09e0da Add quota_maxid which returns the maximum user (or group) identifier
in an associated quotafile. Needed by repquota.

Bug fix in quota_read.
2009-10-20 05:37:54 +00:00
des
a45436ee47 Further extend the quotafile API. 2009-09-26 23:16:06 +00:00
des
4764a20762 Style 2009-09-25 23:27:07 +00:00
mckusick
46197420cc Update the quotafile library to manage both active quotas via the
quotactl(2) interface and inactive quotas by accessing the quota
files directly.

Update the edquota program to use this new interface as proof of
concept.
2009-02-14 08:08:08 +00:00
mckusick
987cbdc1c9 Make hasquota thread safe. 2009-02-13 19:56:59 +00:00
mckusick
44bede95eb Move hasquota() function to libutil. 2009-02-13 06:12:15 +00:00
mckusick
69ccea269c Bug fixes found from using these functions in edquota. 2009-02-10 08:11:44 +00:00
des
604db9f61a WIP 2009-01-30 13:54:03 +00:00