Commit Graph

50 Commits

Author SHA1 Message Date
dholland
d2a6847577 Remove leftover #if 0 code from before the libquota rework. 2014-07-13 01:46:04 +00:00
dholland
853ab96025 Remove traces of -D option, which no longer does anything. 2012-05-12 19:53:21 +00:00
dholland
430a952206 Remove unneeded #include. 2012-02-05 14:14:44 +00:00
dholland
fb3f26c0cf Simplify elaborate calls to quota_check_limit(). 2012-02-01 17:48:10 +00:00
dholland
cae8b79fca Remove unused include. 2012-01-30 16:46:30 +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
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
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
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
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
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
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
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
d6efcbd88e call getuid() once. KNF. ensure a buffer is nul-terminated. 1998-07-12 04:56:06 +00:00
kleink
6e574a3997 Need <time.h> for time() prototype. 1998-04-02 10:45:54 +00:00
mrg
9395f04c8b fix compile warnings on the sparc. 1997-10-20 10:32:06 +00:00
lukem
0d374e0c45 disable WARNS here, fix .Nm usage, deprecate register, s/index/strchr/ 1997-10-19 13:16:33 +00:00
mrg
1663c913e5 merge lite-2; clean up includes. 1997-10-19 04:59:20 +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
mrg
f9db097104 remove dangerous sprintf and strcpy calls. 1997-02-11 09:29:26 +00:00
tls
9d225a1783 RCS ID police 1997-01-09 20:18:21 +00:00
mark
f8fcb56bce Use an integer instead of a char to store the getopt() return value in
order to match the function prototype and to work with compilers that
default to unsigned chars.
Compare the getopt() return value with -1 instead of EOF.
1996-04-01 21:31:33 +00:00
jtc
0366d49b2d Fixed to use ffs instead of ufs; See PR #1790, etc. 1996-02-01 02:33:52 +00:00
cgd
3d113b326b don't assume f_fstypename is larger than MFSNAMELEN or is nul-terminated 1995-06-18 10:58:06 +00:00
mycroft
fda52a9197 Include the egid when displaying the groups and doing security checks. 1995-06-03 03:12:05 +00:00
cgd
f9acc964ad needs stdlib.h 1994-12-24 17:31:23 +00:00
deraadt
c119261953 more NFS quota support from <bouyer@ensta.fr> and myself. 1994-06-28 07:47:23 +00:00
mycroft
e82c4deeb5 Merge local changes. 1994-06-13 21:33:03 +00:00
cgd
86be4d6208 long cast 1994-04-01 03:29:58 +00:00
jtc
abfeba19ee Getgroup's second argument is now a gid_t ptr. 1994-04-01 01:19:08 +00:00
mycroft
e9d867ef50 Add RCS identifiers. 1993-08-01 17:54:45 +00:00
cgd
dab5e017db added, from net/2 (patch 124). 1993-04-09 12:58:42 +00:00