1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/source3/utils
Stefan Metzmacher 4257e3b8fe 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>
(cherry picked from commit ca859e55d2)
2024-05-30 09:47:15 +00:00
..
async-tracker.c s3/async-tracker: don't ignore unknown options 2021-09-10 15:10:30 +00:00
clirap2.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
clirap2.h
conn_tdb.c s3:utils: let connections_forall_read() report if the session was authenticated 2024-05-30 09:47:15 +00:00
conn_tdb.h s3:utils: let connections_forall_read() report if the session was authenticated 2024-05-30 09:47:15 +00:00
dbwrap_tool.c s3:utils: Use lpcfg_set_cmdline() in dbwrap_tool 2023-08-23 08:27:30 +00:00
dbwrap_torture.c s3:utils: Use lpcfg_set_cmdline() in dbwrap_torture 2023-08-23 08:27:30 +00:00
destroy_netlogon_creds_cli.c CVE-2022-38023 libcli/auth: pass lp_ctx to netlogon_creds_cli_set_global_db() 2022-12-13 13:07:29 +00:00
eventlogadm.c
interact.c
interact.h
log2pcaphex.c s3:utils: Remove unused variable 2023-02-06 22:51:32 +00:00
mdsearch.c s3:utils: Use lpcfg_set_cmdline() in mdsearch 2023-08-23 08:27:30 +00:00
mvxattr.c mvxattr: don't ignore unknown options 2021-09-10 15:10:30 +00:00
net_ads_gpo.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_ads_join_dns.c net: add new --dns-ttl option to specify the ttl of dns records 2023-03-03 11:58:34 +00:00
net_ads.c s3:libads: avoid changing ADS->server.workgroup 2024-05-30 09:47:15 +00:00
net_afs.c s3:afs: Zero memory for afs_keyfile 2022-08-26 07:59:32 +00:00
net_afs.h
net_cache.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_conf_util.c
net_conf_util.h
net_conf.c
net_dns.c net: add new --dns-ttl option to specify the ttl of dns records 2023-03-03 11:58:34 +00:00
net_dns.h net: add new --dns-ttl option to specify the ttl of dns records 2023-03-03 11:58:34 +00:00
net_dom.c netapi: Pass net's cmdline credentials to libnetapi_net_init() 2023-09-11 02:42:41 +00:00
net_eventlog.c
net_file.c
net_g_lock.c s3:g_lock: add callback function to g_lock_lock() 2022-09-20 00:34:35 +00:00
net_group.c
net_groupmap.c s3-utils: Fix typo in error message in net groupmap 2022-10-21 03:57:33 +00:00
net_help_common.c lib/cmdline: restore s3 option name --max-protocol for MAXPROTOCOL from 4.14 2021-09-10 15:10:30 +00:00
net_help_common.h
net_help.c
net_idmap_check.c
net_idmap_check.h
net_idmap.c
net_join.c CVE-2022-38023 s3:net: add and use net_warn_member_options() helper 2022-12-13 13:07:29 +00:00
net_lookup.c
net_notify.c
net_offlinejoin.c s3:net: Check return value of data_blob_talloc() 2023-09-14 21:35:29 +00:00
net_printing.c s3:utils: Use lpcfg_set_cmdline() in net 2023-08-23 08:27:30 +00:00
net_proto.h s3:utils: add 'net witness list' command 2024-01-26 17:00:33 +00:00
net_rap.c s3:utils: Check return value of cli_RNetServiceEnum() (CID 1273313) 2023-10-13 02:18:31 +00:00
net_registry_check.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_registry_check.h
net_registry_util.c
net_registry_util.h
net_registry.c s3:g_lock: add callback function to g_lock_lock() 2022-09-20 00:34:35 +00:00
net_rpc_audit.c
net_rpc_conf.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
net_rpc_printer.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_rpc_registry.c
net_rpc_rights.c s3:utils: Use any_nt_status_not_ok() in rpc_rights_grant_internal() 2023-11-21 11:16:37 +00:00
net_rpc_samsync.c
net_rpc_service.c
net_rpc_sh_acct.c
net_rpc_shell.c netapi: Pass net's cmdline credentials to libnetapi_net_init() 2023-09-11 02:42:41 +00:00
net_rpc_trust.c net: create creds for other domain 2024-01-20 13:20:37 +00:00
net_rpc.c net: fix credentials in trustdom establish 2024-01-20 13:20:37 +00:00
net_sam.c s3:passdb: Zero password in fetch_ldap_pw() callers 2022-08-26 07:59:32 +00:00
net_serverid.c s3:utils: Avoid integer overflow (CID 1035488) 2023-10-13 02:18:31 +00:00
net_share.c
net_status.c conn_tdb: change type of connections_data.start to NTTIME 2022-08-08 12:56:28 +00:00
net_tdb.c
net_time.c libsmb: Pass neg contexts through sync smbXcli_negprot_recv() 2023-09-25 19:59:17 +00:00
net_user.c
net_usershare.c s3:net_usershare: Correctly escape newline in error message 2023-04-12 13:52:32 +00:00
net_util.c CVE-2022-38023 s3:net: add and use net_warn_member_options() helper 2022-12-13 13:07:29 +00:00
net_vfs.c s3:utils: Use lpcfg_set_cmdline() in net 2023-08-23 08:27:30 +00:00
net_witness.c s3:utils: fix help string for 'net witness force-response' 2024-02-19 14:31:13 +00:00
net.c s3:utils: add 'net witness force-response' 2024-01-26 17:00:33 +00:00
net.h s3:utils: add 'net witness force-response' 2024-01-26 17:00:33 +00:00
netlookup.c
nmblookup.c s3:utils: Initialize flags (CID 1499396) 2023-11-02 03:08:37 +00:00
ntlm_auth_diagnostics.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
ntlm_auth_proto.h ntlm_auth: Adapt --diagnostics mode to expect that the DC does not support LANMAN by default 2022-03-17 01:57:38 +00:00
ntlm_auth.c s3:utils: Call gfree_all() before exit in ntlm_auth 2023-10-25 22:23:37 +00:00
ntlm_auth.h
passwd_proto.h
passwd_util.c
pdbedit.c s3:utils: Call gfree_all() before exit in pdbedit 2023-10-25 22:23:37 +00:00
profiles.c profiles: don't ignore unknown options 2021-09-10 15:10:30 +00:00
py_net.c Use python.h from libreplace 2023-11-20 15:37:33 +00:00
py_net.h s3: Add s3 net python bindings 2021-04-21 20:51:31 +00:00
regedit_dialog.c
regedit_dialog.h
regedit_hexedit.c s3:utils: Fix format error 2021-10-04 10:43:37 +00:00
regedit_hexedit.h
regedit_list.c
regedit_list.h
regedit_samba3.c
regedit_treeview.c
regedit_treeview.h
regedit_valuelist.c
regedit_valuelist.h
regedit_wrap.c
regedit.c s3:utils: Call gfree_all() before exit in regedit 2023-10-25 22:23:37 +00:00
regedit.h
sharesec.c s3:utils: Call gfree_all() before exit in sharesec 2023-10-25 22:23:37 +00:00
smbcacls.c s3:utils: Fix Inherit-Only flag being automatically propagated to children 2024-05-07 08:52:48 +00:00
smbcontrol.c s3:utils: Call gfree_all() before exit in smbcontrol 2023-10-25 22:23:37 +00:00
smbcquotas.c s3:utils: Call gfree_all() before exit in smbcquotas 2023-10-25 22:23:37 +00:00
smbfilter.c s3:utils: Fix code spelling 2023-10-25 22:23:37 +00:00
smbget.c s3:utils: Fix the auth function to print correct values to the user 2024-01-04 11:26:52 +00:00
smbpasswd.c s3:utils: Initialize the memcache for smbpasswd 2023-10-27 06:51:48 +00:00
smbtree.c s3:utils: Call gfree_all() before exit in smbtree 2023-10-25 22:23:37 +00:00
status_json_dummy.c smbstatus: add a method to add profile items to json 2022-08-08 12:56:29 +00:00
status_json.c s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-30 09:47:15 +00:00
status_json.h smbstatus: add a method to add profile items to json 2022-08-08 12:56:29 +00:00
status_profile_dummy.c smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status_profile.c smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status_profile.h smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status.c s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-30 09:47:15 +00:00
status.h s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-30 09:47:15 +00:00
testparm.c testparm: Allow idmap ranges overlap for idmap_nss 2023-09-26 19:28:08 +00:00
wscript_build s3:utils: add 'net witness list' command 2024-01-26 17:00:33 +00:00
wspsearch.c s3/utils: use full 64 bit address for getrows (with 64bit offsets) 2024-02-26 09:34:15 +00:00