Module Name:    src
Committed By:   bouyer
Date:           Sun Mar 27 17:15:17 UTC 2011

Modified Files:
        src/usr.sbin/repquota: repquota.c

Log Message:
Make sure to not report quotas for a class if we didn't get valid datas
from kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.c
diff -u src/usr.sbin/repquota/repquota.c:1.30 src/usr.sbin/repquota/repquota.c:1.31
--- src/usr.sbin/repquota/repquota.c:1.30	Thu Mar 24 17:05:47 2011
+++ src/usr.sbin/repquota/repquota.c	Sun Mar 27 17:15:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $	*/
+/*	$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)repquota.c	8.2 (Berkeley) 11/22/94";
 #else
-__RCSID("$NetBSD: repquota.c,v 1.30 2011/03/24 17:05:47 bouyer Exp $");
+__RCSID("$NetBSD: repquota.c,v 1.31 2011/03/27 17:15:17 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -284,8 +284,9 @@
 		if (dataiter == NULL)
 			err(1, "prop_array_iterator");
 
-		valid[class] = 1;
+		valid[class] = 0;
 		while ((data = prop_object_iterator_next(dataiter)) != NULL) {
+			valid[class] = 1;
 			strid = NULL;
 			if (!prop_dictionary_get_uint32(data, "id", &id)) {
 				if (!prop_dictionary_get_cstring_nocopy(data,
@@ -317,7 +318,7 @@
 	}
 	prop_object_iterator_release(cmditer);
 	prop_object_release(dict);
-	if (xflag == 0)
+	if (xflag == 0 && valid[class])
 		printquotas(class, vfs, version);
 	return 0;
 }

Reply via email to