Commit Graph

71 Commits

Author SHA1 Message Date
dholland 524e377411 Passes WARNS=5; don't set WARNS=4. 2013-08-11 06:09:29 +00:00
wiz 06b206851a Bump date for previous. 2012-05-12 21:42:38 +00:00
dholland 853ab96025 Remove traces of -D option, which no longer does anything. 2012-05-12 19:53:21 +00:00
dholland 7da608ca9c Update dangling references to quotactl(2), mostly now libquota(3), and to
quotactl(8), mostly now quotarestore(8). ok riz@
2012-02-13 19:53:24 +00:00
dholland 430a952206 Remove unneeded #include. 2012-02-05 14:14:44 +00:00
dholland a577f74f5b libquota no longer requires libprop. Also remove some other no-longer-used
.PATH'd-in bits from repquota.
2012-02-01 17:53:01 +00:00
dholland fb3f26c0cf Simplify elaborate calls to quota_check_limit(). 2012-02-01 17:48:10 +00:00
dholland bdf1946e25 Remove this material, which is no longer used. 2012-01-30 19:21:37 +00:00
dholland cae8b79fca Remove unused include. 2012-01-30 16:46:30 +00:00
dholland 3db227b343 Remove stray p in identifier name. This has (as far as I can tell)
prevented quotacheck and other old-style quota bits from working since
last March. Use a correct declaration in the header file, so that if
something similar happens again affected programs will fail to link
instead of failing to work.

This kind of nonsense is why I like -Wl,-warn-common.
2012-01-30 06:14:43 +00:00
dholland e4f0c6844a Don't strlcpy from a string buffer to itself; the behavior is not
defined.
2012-01-30 06:02:12 +00:00
dholland e5e6acbd31 Remove an old, no longer necessary hack from libquota and handle the
relevant case properly in usr.bin/quota.
2012-01-30 06:00:49 +00:00
dholland 2d709bd6e8 Remove unnecessary include. 2012-01-25 01:24:07 +00:00
dholland c64bfb1c4d Clean up usr.bin/quota to use the new libquota API.
(with one relatively minor exception remaining)
2012-01-09 15:35:44 +00:00
dholland d1d45012e0 Adjust the quota-fetching code to allow more than two object types.
(as far as we can so far, at least)

Note that quota won't actually work fully with multiple object types
as it is, but this and the last change are a good start and do fold
together a lot of duplicated code.
2011-11-30 16:12:32 +00:00
dholland ebec1aced8 Clean up the printout code to support more than the old fixed two
object types.
2011-11-30 16:09:29 +00:00
dholland 0cde282c93 Move a big chunk of code out of a loop into its own function. 2011-11-30 16:07:28 +00:00
dholland 4a00a690f3 Use __dead, not attribute noreturn. 2011-11-27 13:24:32 +00:00
dholland dc46435fc4 The proper type for a variable that can be either a uid or gid is id_t,
not uint32_t.
2011-11-27 13:23:50 +00:00
dholland 51d1d7e7c4 Rename struct ufs_quota_entry -> struct quotaval. 2011-11-25 16:55:05 +00:00
jym afca4e3b49 Fix an implementation inconsistency with the prop_*_send_syscall() and
prop_*_recv_syscall() functions from proplib(3). They now share the
same logic as the one from prop_*_send_ioctl() functions:
- returns an int
- 0 indicates "no error", otherwise returns the error number (and
set errno)

Many consumers of the prop_*_{ioctl, syscall} expect errno to be set
on error and use err() to display the error message. As such, ensures that
errno gets set before returning from these functions.

prop_*_send_syscall() functions returned a boolean, and now return an int.
Fix all call sites to use the new paradigm (only quota2 is affected in src).

As the prop_*_{send,recv}_syscall() API appeared in -current and is only
used by the recent quota2 code, I am not bumping the lib. The API change
only affects the prop_*_send_syscall() function (recv_syscall()s were
already used correctly), so ensure you are not mixing "old" -current
quota binaries with a new proplib(3) (or the other way around). This
change will be announced via a HEADS-UP and UPDATING.

Does not affect the kernel part of proplib.

Document the correct API in prop_array(3) and prop_dictionary(3).

Thanks to Francois Tigeot for noticing the API inconsistency and
reporting it on tech-kern@.

ok bouyer@.
2011-09-30 22:08:18 +00:00
bouyer a3a7248ce7 Fix bad cut'n'paste in copyright. Pointed out by dyoung@ 2011-06-07 14:56:12 +00:00
bouyer d9210c2405 Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
2011-03-24 17:05:39 +00:00
bouyer 46d2eadf0e Don't include quotautil.h here, it's not used. 2011-03-12 12:28:47 +00:00
bouyer 726315aa0b Properly evaluate the space needed to print "unlimited" in an human-readable
way.
2011-03-07 11:46:55 +00:00
christos 1c901e8c26 merge one more triplicated function 2011-03-06 23:26:05 +00:00
christos e0e65cb1e2 - merge more code.
- simplify struct access.
2011-03-06 22:36:07 +00:00
christos 1f0f7c923b - WARNS=4
- KNF
- don't cast malloc
- don't use static buffers
- fix types
- remove extra \n's from errors
- fix prototypes
2011-03-06 20:47:59 +00:00
wiz f1f9830b96 Sort options. Split "file system" like usual. Bump date. 2011-03-06 17:25:32 +00:00
bouyer 063f96f3c2 merge the bouyer-quota2 branch. This adds a new on-disk format
to store disk quota usage and limits, integrated with ffs
metadata. Usage is checked by fsck_ffs (no more quotacheck)
and is covered by the WAPBL journal. Enabled with kernel
option QUOTA2 (added where QUOTA was enabled in kernel config files),
turned on with tunefs(8) on a per-filesystem
basis. mount_mfs(8) can also turn quotas on.

See http://mail-index.netbsd.org/tech-kern/2011/02/19/msg010025.html
for details.
2011-03-06 17:08:10 +00:00
lukem b9f234dd35 Fix -Wcast-qual and -Wshadow issues 2009-04-13 04:16:38 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
christos 6660b4f3b5 eliminate MFSTYPENAME 2007-07-17 21:36:18 +00:00
jrf 190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
jmmv b635f565e7 Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
2004-01-05 23:23:32 +00:00
bouyer ebd3b31bf7 Check the right error code to fallback to rquota v1 RPC.
Problem found and fix tested by Jan Schaumann.
2003-09-21 17:01:43 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
bouyer a39a98c45d Implement rquota RPC version 2, compatible with the linux implementation,
as proposed on tech-userlevel on Dec 06 2002. This allows to retrieve
group quota informations from NFS servers.
2003-02-14 14:55:58 +00:00
wiz 5e442fbbdd specified, not specifed. 2003-01-06 12:38:47 +00:00
wiz cb9405b1ab Sort sections. 2001-12-08 19:10:54 +00:00
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
cgd c5fdfac22d Fix order of arithmetic operations so that NFS file system quotas over
4GB are displayed properly.
2001-03-29 21:54:01 +00:00
bouyer 7616130d51 Explicitely cast to (u_quad_t) calls to btodb() and dbtob() to avoid
int overflow. It's now possible to add/display quotas of more than
4G.
XXX I'm sure there is a PR open on this but I couln't find it with the
usual search engines. If someone knows it's number ...
1999-12-16 17:29:52 +00:00
garbled 9e44e9b578 More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:16:34 +00:00
ross f670fa10c5 Add { and } to shut up egcs. Reformat the more questionable code. 1998-08-25 20:59:36 +00:00
mycroft cc06efc9db const poisoning. 1998-07-26 22:15:38 +00:00
mrg 55a09b0837 quota does not need to be setuid root. 1998-07-12 04:56:22 +00:00
mrg d6efcbd88e call getuid() once. KNF. ensure a buffer is nul-terminated. 1998-07-12 04:56:06 +00:00