1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/source3/librpc/idl
Stefan Metzmacher ca859e55d2 s3:libads: avoid changing ADS->server.workgroup
ads_find_dc() uses c_domain = ads->server.workgroup and
don't expect it to get out of scope deep in resolve_and_ping_dns().

The result are corrupted domain values in the debug output.

Valgrind shows this:

 Invalid read of size 1
    at 0x483EF46: strlen (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x608BE94: __vfprintf_internal (vfprintf-internal.c:1688)
    by 0x609ED49: __vasprintf_internal (vasprintf.c:57)
    by 0x5D2EC0F: __dbgtext_va (debug.c:1860)
    by 0x5D2ED3F: dbgtext (debug.c:1881)
    by 0x4BFFB50: ads_find_dc (ldap.c:570)
    by 0x4C001F4: ads_connect (ldap.c:704)
    by 0x4C1DC12: ads_dc_name (namequery_dc.c:84)
  Address 0xb69f6f0 is 0 bytes inside a block of size 11 free'd
    at 0x483CA3F: free (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x4BFF0AF: ads_try_connect (ldap.c:299)
    by 0x4BFF40E: cldap_ping_list (ldap.c:367)
    by 0x4BFF75F: resolve_and_ping_dns (ldap.c:468)
    by 0x4BFFA91: ads_find_dc (ldap.c:556)
    by 0x4C001F4: ads_connect (ldap.c:704)
    by 0x4C1DC12: ads_dc_name (namequery_dc.c:84)
  Block was alloc'd at
    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
    by 0x60B250E: strdup (strdup.c:42)
    by 0x4FF1492: smb_xstrdup (util.c:743)
    by 0x4C10E62: ads_init (ads_struct.c:148)
    by 0x4C1DB68: ads_dc_name (namequery_dc.c:73)

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-05 12:24:42 +00:00
..
ads.idl s3:libads: avoid changing ADS->server.workgroup 2024-04-05 12:24:42 +00:00
IDL_LICENSE.txt
leases_db.idl smbd: Make "current_state" show up first in the blob 2019-09-17 22:49:36 +00:00
libnet_join.idl s3-librpc: add ads.idl and convert ads_struct to talloc. 2022-12-16 20:38:32 +00:00
libnetapi.idl s3:libnetapi: Add NetComposeOfflineDomainJoin() to IDL 2023-09-05 21:18:32 +00:00
open_files.idl s3:locking: introduce share_mode_data->not_stored 2022-09-20 00:34:35 +00:00
perfcount.idl idl: Fix a typo 2014-10-07 17:03:42 +02:00
rpc_host.idl s3:rpc_server: distribute clients based on available association group slots 2023-10-17 19:20:38 +00:00
rpcd_witness.idl s3:rpcd_witness.idl: add rpcd_witness_registration_updateB message definitions 2024-01-26 17:00:33 +00:00
secrets.idl idl: secrets_domain_info1_change is not a recursive structure 2021-06-29 03:07:17 +00:00
smbXsrv.idl smbd: Fix a typo 2024-03-12 13:31:31 +00:00
wscript_build s3-librpc: merge two PIDL lists 2024-03-20 23:42:34 +00:00