From e56990e43bdd97a3b36a158fc719072324d702c7 Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Fri, 9 Aug 2002 00:53:00 +0000 Subject: [PATCH] Add a new flag (-l) that suppresses quota checks on NFS filesystems. PR: bin/12939 Submitted by: Neil Blakey-Milner --- usr.bin/quota/quota.1 | 19 ++++++++++++++++--- usr.bin/quota/quota.c | 14 ++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/usr.bin/quota/quota.1 b/usr.bin/quota/quota.1 index 314c083fc7b8..3974c1b4b98f 100644 --- a/usr.bin/quota/quota.1 +++ b/usr.bin/quota/quota.1 @@ -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 diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c index be83e645e64d..6ce25bf307dc 100644 --- a/usr.bin/quota/quota.c +++ b/usr.bin/quota/quota.c @@ -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;