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
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2084108
autofs can take 5 seconds or more to automount file systems in some
cases. This is caused by the server probe logic attempting to connect
to a server when it isn't available.
Attempting to fix this problem introduced a regression where rpcbind
was being consulted in a case where it shouldn't have been.
This MR resolves these problems.
Note that for NFSv4 mounts, if rpcbind is to be avoided then fallback
to NFSv3 must be disabled. This has historically been done by using
the "fstype=nfs4" automount option to requiest a specific nfs version.
Resolves: rhbz#2084108
Signed-off-by: Ian Kent ikent@redhat.com
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2056321
There is a case where a multi-mount tree can be be umounted when it's
still in use.
This MR resolves one (hopefully the only remaining one) of those cases.
Resolves: rhbz#2056321
Signed-off-by: Ian Kent ikent@redhat.com
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2056320
Changes to resolve internal hosts map problem:
- fix root offset error handling.
- fix nonstrict fail handling of last offset mount.
- dont fail on duplicate offset entry tree add.
- fix loop under run in cache_get_offset_parent().
- simplify cache_add() a little.
- fix use after free in tree_mapent_delete_offset_tree().
- fix memory leak in xdr_exports().
- avoid calling pthread_getspecific() with NULL key_thread_attempt_id.
- fix sysconf(3) return handling.
- remove rpcgen dependedncy, it hasn't been needed since rev 10.
Resolves: rhbz#2056320
Signed-off-by: Ian Kent ikent@redhat.com