summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Chard <flup@users.sf.net>2017-08-31 12:12:34 +0200
committerJan Kara <jack@suse.cz>2017-08-31 12:17:59 +0200
commit05e8677a45a3b613586a4b5efeb3a33c1e8f7b1f (patch)
tree6a48f0bfa468a6c5f41bcae8b41eed03acc7404b
parent251c3931fedc9275bd57bc75c2153674a540bbce (diff)
downloadquota-tools-05e8677a45a3b613586a4b5efeb3a33c1e8f7b1f.tar.gz
quota: Return non-zero exit code when getting quota fails
Make sure we return with non-zero exit code when getting quotas for some user fails. Signed-off-by: Ian Chard <flup@users.sf.net> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--quota.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/quota.c b/quota.c
index c8cc9b5..84c03a9 100644
--- a/quota.c
+++ b/quota.c
@@ -193,6 +193,10 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
| ((flags & FL_LOCALONLY) ? MS_LOCALONLY : 0)
| ((flags & FL_NFSALL) ? MS_NFS_ALL : 0));
qlist = getprivs(id, handles, !!(flags & FL_QUIETREFUSE));
+ if (!qlist) {
+ over = 1;
+ goto out_handles;
+ }
over = 0;
for (q = qlist; q; q = q->dq_next) {
bover = iover = 0;
@@ -292,6 +296,7 @@ static int showquotas(int type, qid_t id, int mntcnt, char **mnt)
if (!(flags & FL_QUIET) && !lines && qlist)
heading(type, id, name, _("none"));
freeprivs(qlist);
+out_handles:
dispose_handle_list(handles);
return over > 0 ? 1 : 0;
}