aboutsummaryrefslogtreecommitdiffstats
path: root/guts/getgrent_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'guts/getgrent_r.c')
-rw-r--r--guts/getgrent_r.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/guts/getgrent_r.c b/guts/getgrent_r.c
index a080f14..b02466a 100644
--- a/guts/getgrent_r.c
+++ b/guts/getgrent_r.c
@@ -10,12 +10,16 @@
/* note that we don't wrap fgetgrent_r, since there's no path
* references in it.
*/
+ if (!pseudo_grp) {
+ errno = ENOENT;
+ return -1;
+ }
rc = fgetgrent_r(pseudo_grp, gbuf, buf, buflen, gbufp);
if (rc == 0 && *gbufp) {
if (*gbufp == gbuf) {
- pseudo_debug(1, "found group: %d/%s\n", gbuf->gr_gid, gbuf->gr_name);
+ pseudo_debug(3, "found group: %d/%s\n", gbuf->gr_gid, gbuf->gr_name);
} else {
- pseudo_debug(1, "found group, but it's wrong?");
+ pseudo_debug(1, "found group (%d), but it's wrong?", gbuf->gr_gid);
}
}