1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/source3/libads
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_ldap_protos.h
ads_proto.h s3-librpc: add ads.idl and convert ads_struct to talloc. 2022-12-16 20:38:32 +00:00
ads_status.c krb5_wrap: move source3/libads/krb5_errs.c to lib/krb5_wrap/krb5_errs.c 2020-02-10 16:32:37 +00:00
ads_status.h
ads_struct.c s3: libads: Fix coverity false positive. 2022-07-04 16:42:28 +00:00
authdata.c libsmb: Make libsmb/clispnego.c static to libads/ 2023-09-25 19:01:34 +00:00
cldap.c s3-libads: Also handle the DS_WEB_SERVICE_REQUIRED flag in check_cldap_reply_required_flags() 2023-05-31 04:02:36 +00:00
cldap.h
disp_sec.c s3:libads: Allocate ads->config.config_path under ADS_STRUCT talloc context 2022-06-27 15:50:30 +00:00
kerberos_keytab.c lib/krb5_wrap: Pull already_hashed case out of smb_krb5_kt_add_entry() 2024-03-14 22:06:39 +00:00
kerberos_proto.h s3:libads: Return canonical principal and realm from kerberos_return_pac() 2022-02-23 15:20:32 +00:00
kerberos_util.c s3:libads: let kerberos_kinit_password_ext() return the canonicalized principal/realm 2019-09-24 18:30:37 +00:00
kerberos.c s3:libads: Fix code spelling 2023-10-25 22:23:37 +00:00
krb5_setpw.c s3:libads: Add missing newlines to logging messages 2023-08-08 04:39:38 +00:00
ldap_printer.c
ldap_schema_oids.h
ldap_schema.c libads: Save intermediate NULL checks with talloc_asprintf_addbuf() 2022-12-14 05:29:51 +00:00
ldap_schema.h
ldap_user.c
ldap_utils.c s3:libads: Allocate ADS_STRUCT under a talloc context 2022-06-27 15:50:30 +00:00
ldap.c s3:libads: avoid changing ADS->server.workgroup 2024-04-05 12:24:42 +00:00
net_ads_setspn.c
sasl_wrapping.c s3-librpc: add ads.idl and convert ads_struct to talloc. 2022-12-16 20:38:32 +00:00
sasl.c libsmb: Make libsmb/clispnego.c static to libads/ 2023-09-25 19:01:34 +00:00
sitename_cache.c s3:libads: Fix code spelling 2023-07-13 05:41:36 +00:00
sitename_cache.h
util.c s3:libads: Zero memory in ads_change_trust_account_password() 2022-08-26 07:59:32 +00:00