diff options
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 } |