1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/nsswitch
Stefan Metzmacher 4af3faace4 nsswitch/wb_common.c: fix socket fd and memory leaks of global state
When we are called in wb_atfork_child() or winbind_destructor(),
wb_thread_ctx_destructor() is not called for the global state
of the current nor any other thread, which means we would
leak the related memory and socket fds.

Now we maintain a global list protected by a global mutex.
We traverse the list and close all socket fds, which are no
longer used (winbind_destructor) or no longer valid in the
current process (wb_atfork_child), in addition we 'autofree'
the ones, which are only visible internally as global (per thread)
context.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15464

Tested-by: Krzysztof Piotr Oledzki <ole@ans.pl>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Sep 14 18:53:07 UTC 2023 on atb-devel-224
2023-09-14 18:53:07 +00:00
..
krb5_plugin nsswitch: explicitly mark magic krb5 plugin symbols as _PUBLIC_ 2021-11-30 15:53:34 +00:00
libwbclient nsswitch:libwbclient: Fix memory leak 2023-08-08 04:39:37 +00:00
tests tests: Fix idmap.rid.getgrnam for ad_member_idmap_rid with 'winbind expand groups = 10' 2023-06-13 12:15:32 +00:00
b15464-testcase.c nsswitch: add test for pthread_key_delete missuse (bug 15464) 2023-09-14 17:56:30 +00:00
nsstest.c CVE-2020-25717: nsswitch/nsstest.c: Lower 'non existent uid' to make room for new accounts 2021-11-15 18:10:28 +00:00
nsstest.h nsswitch: Fix checking for config.h #define in nsstest.h 2018-12-16 21:04:10 +01:00
pam_winbind.c nsswitch: Fix getting data out of pam_get_data() 2023-02-06 22:51:31 +00:00
pam_winbind.h pam_winbind: add new pwd_change_prompt option (defaults to off). 2021-12-16 03:05:30 +00:00
stress-nss-libwbclient.c nsswitch: Fix CID 1518966 Resource leaks (RESOURCE_LEAK) 2023-03-03 01:07:36 +00:00
wb_common.c nsswitch/wb_common.c: fix socket fd and memory leaks of global state 2023-09-14 18:53:07 +00:00
wb_reqtrans.c
wb_reqtrans.h
wbinfo.c spelling fixes for 4.18 (errror implemenation proces Controler) 2023-01-26 20:46:11 +00:00
winbind_client.h nsswitch: move winbindd_free_response() as inline function to winbind_struct_protocol.h 2021-11-30 15:53:34 +00:00
winbind_nss_aix.c nsswitch: Fix code spelling 2023-06-23 13:44:31 +00:00
winbind_nss_config.h
winbind_nss_freebsd.c nsswitch: explicitly mark nss_module_register() _PUBLIC_ on FreeBSD 2021-11-30 15:53:34 +00:00
winbind_nss_hpux.h
winbind_nss_linux.c nsswitch: Fix code spelling 2023-06-23 13:44:31 +00:00
winbind_nss_linux.h nsswitch: explicitly mark NSS_STATUS _nss_winbind_* symbols as _PUBLIC_ on Linux 2021-11-30 15:53:34 +00:00
winbind_nss_netbsd.c winbind_nss_netbsd: use WBFLAG_FROM_NSS 2018-12-22 03:11:14 +01:00
winbind_nss_netbsd.h
winbind_nss_solaris.c nsswitch: Fix code spelling 2023-06-23 13:44:31 +00:00
winbind_nss_solaris.h nsswitch: maintain prototypes for the linux based functions only once 2018-04-03 16:41:09 +02:00
winbind_nss.h nsswitch: Fix checking for config.h #define in winbind_nss.h 2018-12-16 21:04:10 +01:00
winbind_struct_protocol.h s3:winbind: Convert InitConnection from struct based to NDR based 2022-05-19 17:51:33 +00:00
wins_freebsd.c nsswitch: explicitly mark nss_module_register() _PUBLIC_ on FreeBSD 2021-11-30 15:53:34 +00:00
wins.c nsswitch/wins: Define NETDB_* for other libc's 2022-08-08 06:33:38 +00:00
wscript_build nsswitch: add test for pthread_key_delete missuse (bug 15464) 2023-09-14 17:56:30 +00:00
wscript_configure nss/waf: check for secmethod_table.method_{attrlist,version} for aix >= 5.2 2018-12-22 06:22:22 +01:00