diff options
author | jkar8572 <jkar8572> | 2006-07-21 15:14:01 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2006-07-21 15:14:01 +0000 |
commit | ac258971fbd99ac3130ad85879fde9b9e3470856 (patch) | |
tree | 77effbd74ef2ab09ec7c5cb76b6cd5c9f810c426 | |
parent | 203e34e6a4bce09f7aa43f7f3ec64ee622c2e0ba (diff) |
Add user name in error messages in getprivs (Michal Marek, Jan Kara)
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | quotaops.c | 16 |
2 files changed, 11 insertions, 6 deletions
@@ -1,4 +1,5 @@ Changes in quota-tools from 3.13 to 3.14 +* print user/group names in error messages when cannot get quota information (Marian Jancar, Jan Kara) * added option --always-resolve to force resolving even names with digits only (Jan Kara) * minor language corrections in manpages (Jan Kara) * implemented long options parsing for all quota tools (Jan Kara) @@ -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) |