Module Name: src Committed By: bouyer Date: Mon Feb 14 20:55:36 UTC 2011
Modified Files: src/usr.sbin/repquota [bouyer-quota2]: repquota.8 repquota.c Log Message: When reading quota1 entries, initialize default quota to unlimited, for POLA when using -x. When displaying quotas, do not skip users which have a 0 usage but are overquota. When -v is used display all existing quota entries, including those with a 0 usage. To generate a diff of this commit: cvs rdiff -u -r1.9.50.2 -r1.9.50.3 src/usr.sbin/repquota/repquota.8 cvs rdiff -u -r1.25.2.7 -r1.25.2.8 src/usr.sbin/repquota/repquota.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/repquota/repquota.8 diff -u src/usr.sbin/repquota/repquota.8:1.9.50.2 src/usr.sbin/repquota/repquota.8:1.9.50.3 --- src/usr.sbin/repquota/repquota.8:1.9.50.2 Thu Feb 10 17:11:35 2011 +++ src/usr.sbin/repquota/repquota.8 Mon Feb 14 20:55:36 2011 @@ -29,7 +29,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)repquota.8 8.1 (Berkeley) 6/6/93 -.\" $NetBSD: repquota.8,v 1.9.50.2 2011/02/10 17:11:35 bouyer Exp $ +.\" $NetBSD: repquota.8,v 1.9.50.3 2011/02/14 20:55:36 bouyer Exp $ .\" .Dd February 10, 2011 .Dt REPQUOTA 8 @@ -75,6 +75,7 @@ group and user quotas if they exist). .It Fl v Print a header line before printing each filesystem quotas. +Print all exiting quotas, including those whose current usage is 0. .It Fl D Debug: print plist sent to and received from kernel. .It Fl h Index: src/usr.sbin/repquota/repquota.c diff -u src/usr.sbin/repquota/repquota.c:1.25.2.7 src/usr.sbin/repquota/repquota.c:1.25.2.8 --- src/usr.sbin/repquota/repquota.c:1.25.2.7 Thu Feb 10 17:11:35 2011 +++ src/usr.sbin/repquota/repquota.c Mon Feb 14 20:55:36 2011 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)repquota.c 8.2 (Berkeley) 11/22/94"; #else -__RCSID("$NetBSD: repquota.c,v 1.25.2.7 2011/02/10 17:11:35 bouyer Exp $"); +__RCSID("$NetBSD: repquota.c,v 1.25.2.8 2011/02/14 20:55:36 bouyer Exp $"); #endif #endif /* not lint */ @@ -378,7 +378,9 @@ if (dqbuf.dqb_itime > 0) igrace = dqbuf.dqb_itime; } - if (dqbuf.dqb_curinodes == 0 && dqbuf.dqb_curblocks == 0) + if (dqbuf.dqb_curinodes == 0 && dqbuf.dqb_curblocks == 0 && + dqbuf.dqb_bsoftlimit == 0 && dqbuf.dqb_bhardlimit == 0 && + dqbuf.dqb_isoftlimit == 0 && dqbuf.dqb_ihardlimit == 0) continue; if ((fup = lookup(id, type)) == 0) fup = addid(id, type, (char *)0); @@ -388,6 +390,10 @@ } defaultq2e[type].q2e_val[QL_BLOCK].q2v_grace = bgrace; defaultq2e[type].q2e_val[QL_FILE].q2v_grace = igrace; + defaultq2e[type].q2e_val[QL_BLOCK].q2v_softlimit = + defaultq2e[type].q2e_val[QL_BLOCK].q2v_hardlimit = + defaultq2e[type].q2e_val[QL_FILE].q2v_softlimit = + defaultq2e[type].q2e_val[QL_FILE].q2v_hardlimit = UQUAD_MAX; fclose(qf); valid[type] = 1; if (xflag == 0) @@ -423,13 +429,6 @@ fup = lookup(id, type); if (fup == 0) continue; - if (fup->fu_q2e.q2e_val[QL_BLOCK].q2v_cur == 0 && - fup->fu_q2e.q2e_val[QL_FILE].q2v_cur == 0) - continue; - if (strlen(fup->fu_name) > 9) - printf("%s ", fup->fu_name); - else - printf("%-10s", fup->fu_name); for (i = 0; i < N_QL; i++) { switch (QL_STATUS(quota2_check_limit( &fup->fu_q2e.q2e_val[i], 1, now))) { @@ -450,6 +449,14 @@ } } + if (fup->fu_q2e.q2e_val[QL_BLOCK].q2v_cur == 0 && + fup->fu_q2e.q2e_val[QL_FILE].q2v_cur == 0 && vflag == 0 && + overchar[QL_BLOCK] == '-' && overchar[QL_FILE] == '-') + continue; + if (strlen(fup->fu_name) > 9) + printf("%s ", fup->fu_name); + else + printf("%-10s", fup->fu_name); printf("%c%c%9s%9s%9s%7s", overchar[QL_BLOCK], overchar[QL_FILE], intprt(fup->fu_q2e.q2e_val[QL_BLOCK].q2v_cur,