Commit Graph

38 Commits

Author SHA1 Message Date
dholland
78108b8ccc Split up excessively large main().
Fix -d behavior to match documentation.
2011-11-13 15:42:35 +00:00
dholland
26b9d6b1f1 Cleanup for edquota.
Factor out common malloc and linked list code. Distinguish lists of
quota info from single records.
2011-11-13 15:41:34 +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
dholland
2a4f285a6d Minor cosmetic fixes, no semantic changes. (object file diffs have been
checked)
2011-07-10 07:54:49 +00:00
dholland
edda69b9c3 tsort contents of file. 2011-07-10 07:31:48 +00:00
dholland
a958ceefc8 use __dead 2011-07-10 07:19:24 +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
christos
3f339fb13b - KNF
- merge code
- fix error printing
- don't use static buffers
2011-03-06 22:33:55 +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
9c1945664c Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 13:36:57 +00:00
xtraeme
b2bb69490d WARNS=4 love. 2008-05-02 19:59:19 +00:00
jnemeth
62381dbddf Coverity CID 3785: calling fclose() twice on same file pointer
Coverity CID 3780: dereference of NULL pointer
Approved by: christos@
2006-05-26 13:21:47 +00:00
christos
ae76bda7d7 Coverity CID 3227, 3226: Don't leak fd's 2006-05-23 01:23:49 +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
agc
326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
jonb
e2fdabc65c Fix the way $EDITOR is started so the variable can have flags in addition
to the name of the binary to run.
2002-12-05 22:54:45 +00:00
bouyer
fecc966e36 Add new command-line flags, which ease edquota use in bach scripts:
- -f, which allows to restrict edquota to only one quota-enabled filesystem
- -s and -h, which allows to set soft and hard limits respectively, without
  the need to edit a file.
2002-12-04 21:01:13 +00:00
simonb
fd4ede242b Don't declare 'extern opt*' getopt variables. 2000-04-14 06:26:52 +00:00
mycroft
f5d7100e26 Nuke `extern int errno;' in code we compile with -Wstrict-prototypes. We get
the correct definition from errno.h.
2000-01-21 17:08:33 +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
simonb
299578ebd5 Spell "privilege" correctly (correct spelling from Jonathan Stone). 1999-08-16 02:59:22 +00:00
mrg
eae61447e8 remove unused extern. 1998-03-30 03:33:05 +00:00
mrg
6b8ca7ecc6 fix compile warning on the sparc (erik fair). 1997-10-21 06:40:40 +00:00
lukem
699d25a64e WARNSify, deprecate bcmp/perror et al in favour of memcmp/err* et al 1997-10-17 02:25:02 +00:00
kleink
66105c37fc Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
1997-08-25 19:31:43 +00:00
mikel
3190ec8ac6 prototype internal functions so this will build 1997-03-08 21:39:06 +00:00
mikel
ba2d9f692b merge lite-2 changes.
also RCSid police, and add return types to all of the functions.
1997-03-08 08:01:26 +00:00
mark
1fe734c654 Use an integer instead of a char to store the getopt() return value in
order to work with compilers that default to unsigned chars.
Compare the getopt() return value with -1 instead of EOF.
1996-03-30 23:42:33 +00:00
jtc
21908ddbd5 merge in changes from 1.1 release branch 1995-11-28 19:43:04 +00:00
cgd
af6ef0d828 need stdlib.h 1995-04-21 04:41:21 +00:00
cgd
f24d9135d1 <sys/queue.h> is no longer needed. 1995-01-03 02:06:24 +00:00
cgd
ab628a707e add headers for prototypes. 1994-12-23 16:39:28 +00:00
mycroft
10e2d61588 Fix lseek() calls. 1994-06-13 21:58:54 +00:00
mycroft
bd699d7d8c Merge local changes. 1994-06-13 21:55:00 +00:00
cgd
578ea19478 update for new fs includes 1994-06-13 20:49:42 +00:00
cgd
7a6e889600 kill bad casts 1994-03-30 02:28:43 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd
cf98284671 added accton, edquota, flcopy, gettable, htable, iostat, quotaon,
repquota, trpt, and trsp, per (currently alpha) patch 125.
1993-04-09 12:15:37 +00:00