1) The yp_bind/yp_unbind and internal _yp_dobind/_yp_unbind sequences shared
authorderaadt <deraadt@openbsd.org>
Tue, 2 Aug 2022 17:00:15 +0000 (17:00 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 2 Aug 2022 17:00:15 +0000 (17:00 +0000)
commit5126bebe35d659ea3599c987e6350ee5f3b6d2b7
treeba00ea3c6dd60c1d25e8338c6f979c3b8847911a
parent2d62dde8310c0f11b45f14adaba36cf1950be6bf
1) The yp_bind/yp_unbind and internal _yp_dobind/_yp_unbind sequences shared
dom_binding structs between threads, which is unsafe -- example, dom_vers
signalled retry events, and structs+socket would get deallocated in _yp_unbind.
Change all yp_first (and similar) functions to understand that _yp_dobind now
provides a private dom_binding and socket, which must be released using
_yp_unbind.  Use similar methods in the one-step yp_all function.
2) domainname caching in get* is not neccessary now that the domainname cannot
change relative to ypconnect(2)'s decisions.
Many fields in dom_binding struct become unused, so delete them.
ok jmatthew, also tested by miod
lib/libc/gen/getgrent.c
lib/libc/gen/getgrouplist.c
lib/libc/gen/getnetgrent.c
lib/libc/gen/getpwent.c