Commit Graph

1 Commits

Author SHA1 Message Date
Ian Kent
511169a715 libnss_sss: threads stuck at sss_nss_lock from initgroups
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2087535

In threaded programs it's required to not call functions that are
not async-thread safe between fork(2) and exec(3).

Unfortunately initgroups(3) is not async-thread safe but is called
between these two functions and it leads to automount(8) hanging.

But getgroups(2) and setgroups(2) can be used for this and even though
setgroups(2) is not listed as async-thread safe it is in fact safe to
call here.

This MR changes automount(8) to use getgroups(2)/setgroups(2) instead
if initgroups(3) and testing shows that this resolves the hang problem.

Resolves: rhbz#2087535

Signed-off-by: Ian Kent ikent@redhat.com
2022-05-30 10:28:50 +08:00