aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/main.c b/main.c
index 05964a2d..3680e3f4 100644
--- a/main.c
+++ b/main.c
@@ -1372,17 +1372,20 @@ init_groupset()
*/
ngroups = getgroups(0, NULL);
#endif
- if (ngroups == -1)
- fatal(_("could not find groups: %s"), strerror(errno));
- else if (ngroups == 0)
+ /* If an error or no groups, just give up and get on with life. */
+ if (ngroups <= 0)
return;
/* fill in groups */
emalloc(groupset, GETGROUPS_T *, ngroups * sizeof(GETGROUPS_T), "init_groupset");
ngroups = getgroups(ngroups, groupset);
- if (ngroups == -1)
- fatal(_("could not find groups: %s"), strerror(errno));
+ /* same thing here, give up but keep going */
+ if (ngroups == -1) {
+ efree(groupset);
+ ngroups = 0;
+ groupset = NULL;
+ }
#endif
}