mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00
tftpd: allow initgroups() to rescue setgroups() failure
If setgroups() fails, but initgroups() succeeds (somehow) then allow the process to continue, as initgroups() ought to have set the group list properly. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
416046e2ad
commit
99112f0206
1 changed files with 3 additions and 1 deletions
|
@ -990,7 +990,9 @@ int main(int argc, char **argv)
|
|||
#endif
|
||||
#ifdef HAVE_INITGROUPS
|
||||
setrv = initgroups(user, pw->pw_gid);
|
||||
if (setrv && errno != EPERM) {
|
||||
if (!setrv) {
|
||||
die = 0;
|
||||
} else if (errno != EPERM) {
|
||||
syslog(LOG_ERR, "cannot set groups for user %s", user);
|
||||
die = EX_OSERR;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue