summaryrefslogtreecommitdiff
path: root/quotaops.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2006-07-21 15:14:01 +0000
committerjkar8572 <jkar8572>2006-07-21 15:14:01 +0000
commitac258971fbd99ac3130ad85879fde9b9e3470856 (patch)
tree77effbd74ef2ab09ec7c5cb76b6cd5c9f810c426 /quotaops.c
parent203e34e6a4bce09f7aa43f7f3ec64ee622c2e0ba (diff)
Add user name in error messages in getprivs (Michal Marek, Jan Kara)
Diffstat (limited to 'quotaops.c')
-rw-r--r--quotaops.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/quotaops.c b/quotaops.c
index 83cf377..7ff2182 100644
--- a/quotaops.c
+++ b/quotaops.c
@@ -34,7 +34,7 @@
#ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $"
#ident "$Copyright: All rights reserved. $"
-#ident "$Id: quotaops.c,v 1.19 2006/05/13 01:05:24 jkar8572 Exp $"
+#ident "$Id: quotaops.c,v 1.20 2006/07/21 15:14:01 jkar8572 Exp $"
#include <rpc/rpc.h>
#include <sys/types.h>
@@ -118,7 +118,8 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet)
if (ngroups > NGROUPS) {
gidsetp = malloc(ngroups * sizeof(gid_t));
if (!gidsetp) {
- errstr(_("gid set allocation (%d): %s\n"), ngroups, strerror(errno));
+ gid2group(id, name);
+ errstr(_("%s (gid %d): gid set allocation (%d): %s\n"), name, id, ngroups, strerror(errno));
return (struct dquot *)NULL;
}
}
@@ -128,7 +129,8 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet)
if (ngroups < 0) {
if (gidsetp != gidset)
free(gidsetp);
- errstr(_("error while trying getgroups(): %s\n"), strerror(errno));
+ gid2group(id, name);
+ errstr(_("%s (gid %d): error while trying getgroups(): %s\n"), name, id, strerror(errno));
return (struct dquot *)NULL;
}
@@ -151,9 +153,11 @@ struct dquot *getprivs(qid_t id, struct quota_handle **handles, int quiet)
if (!(q = handles[i]->qh_ops->read_dquot(handles[i], id))) {
/* If rpc.rquotad is not running filesystem might be just without quotas... */
- if (errno != ENOENT && (errno != ECONNREFUSED || !quiet))
- errstr(_("error while getting quota from %s for %u: %s\n"),
- handles[i]->qh_quotadev, id, strerror(errno));
+ if (errno != ENOENT && (errno != ECONNREFUSED || !quiet)) {
+ id2name(id, handles[i]->qh_type, name);
+ errstr(_("error while getting quota from %s for %s (id %u): %s\n"),
+ handles[i]->qh_quotadev, name, id, strerror(errno));
+ }
continue;
}
if (qhead == NULL)