Add a new flag (-l) that suppresses quota checks on NFS filesystems.

PR:		bin/12939
Submitted by:	Neil Blakey-Milner <nbm@rucus.ru.ac.za>
This commit is contained in:
Ian Dowse 2002-08-09 00:53:00 +00:00
parent e608ec61bd
commit e56990e43b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=101545
2 changed files with 26 additions and 7 deletions

View File

@ -35,7 +35,7 @@
.\" from: @(#)quota.1 8.1 (Berkeley) 6/6/93
.\" $FreeBSD$
.\"
.Dd June 6, 1993
.Dd August 8, 2002
.Dt QUOTA 1
.Os
.Sh NAME
@ -43,14 +43,15 @@
.Nd display disk usage and limits
.Sh SYNOPSIS
.Nm
.Op Fl gu
.Op Fl glu
.Op Fl v | Fl q
.Nm
.Op Fl u
.Op Fl lu
.Op Fl v | Fl q
.Ar user ...
.Nm
.Fl g
.Op Fl l
.Op Fl v | Fl q
.Ar group ...
.Sh DESCRIPTION
@ -64,6 +65,10 @@ The following options are available:
.It Fl g
Print group quotas for the group
of which the user is a member.
.It Fl l
Do not report quotas on
.Tn NFS
filesystems.
.It Fl q
Print a more terse message,
containing only information
@ -120,6 +125,14 @@ If
.Nm
exits with a non-zero status, one or more filesystems
are over quota.
.Pp
If the
.Fl l
flag is specified,
.Nm
will not check
.Tn NFS
filesystems.
.Sh FILES
.Bl -tag -width quota.group -compact
.It Pa quota.user

View File

@ -105,6 +105,7 @@ static int callaurpc(char *host, int prognum, int versnum, int procnum,
xdrproc_t inproc, char *in, xdrproc_t outproc, char *out);
static int alldigits(char *s);
int lflag;
int qflag;
int vflag;
@ -116,11 +117,14 @@ main(int argc, char *argv[])
int i, gflag = 0, uflag = 0;
char ch;
while ((ch = getopt(argc, argv, "gquv")) != -1) {
while ((ch = getopt(argc, argv, "glquv")) != -1) {
switch(ch) {
case 'g':
gflag++;
break;
case 'l':
lflag++;
break;
case 'q':
qflag++;
break;
@ -180,9 +184,9 @@ usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n",
"usage: quota [-gu] [-v | -q]",
" quota [-u] [-v | -q] user ...",
" quota -g [-v | -q] group ...");
"usage: quota [-glu] [-v | -q]",
" quota [-lu] [-v | -q] user ...",
" quota -g [-l] [-v | -q] group ...");
exit(1);
}
@ -461,6 +465,8 @@ getprivs(long id, int quotatype)
errx(2, "out of memory");
}
if (strcmp(fst[i].f_fstypename, "nfs") == 0) {
if (lflag)
continue;
if (getnfsquota(&fst[i], qup, id, quotatype)
== 0)
continue;