1) The yp_bind/yp_unbind and internal _yp_dobind/_yp_unbind sequences shared
authorderaadt <deraadt@openbsd.org>
Tue, 2 Aug 2022 16:59:29 +0000 (16:59 +0000)
committerderaadt <deraadt@openbsd.org>
Tue, 2 Aug 2022 16:59:29 +0000 (16:59 +0000)
commit2d62dde8310c0f11b45f14adaba36cf1950be6bf
tree5d6f82264e4a760afd69f568b71bf05ad3b21b22
parentea07427c1c47448089326aa51e9dae339e010a7b
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/yp/yp_all.c
lib/libc/yp/yp_bind.c
lib/libc/yp/yp_first.c
lib/libc/yp/yp_get_default_domain.c
lib/libc/yp/yp_maplist.c
lib/libc/yp/yp_master.c
lib/libc/yp/yp_order.c
lib/libc/yp/ypinternal.h
lib/libc/yp/ypmatch_cache.c