]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:passdb: Zero password in fetch_ldap_pw() callers
authorPavel Filipenský <pfilipensky@samba.org>
Wed, 10 Aug 2022 18:51:46 +0000 (20:51 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 26 Aug 2022 07:59:32 +0000 (07:59 +0000)
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/passdb/pdb_ldap.c
source3/utils/net_sam.c

index c4efffc1c04ec158942b8c587b42c08d41a022d9..548ce3c48741c7141cdce6069cab5d66ab43e670 100644 (file)
@@ -6659,8 +6659,7 @@ static NTSTATUS pdb_init_ldapsam_common(struct pdb_methods **pdb_method, const c
        nt_status = smbldap_init(*pdb_method, pdb_get_tevent_context(),
                                 location, false, bind_dn, bind_secret,
                                 &ldap_state->smbldap_state);
-       memset(bind_secret, '\0', strlen(bind_secret));
-       SAFE_FREE(bind_secret);
+       BURN_FREE_STR(bind_secret);
        SAFE_FREE(bind_dn);
        if ( !NT_STATUS_IS_OK(nt_status) ) {
                return nt_status;
index 17cc47b2ddd1d0ed13324cb837f864e4cf5c2196..5c1e007381e7f2ba2b15c751865d01a0bcff8d57 100644 (file)
@@ -1678,8 +1678,7 @@ static int net_sam_provision(struct net_context *c, int argc, const char **argv)
 
        status = smbldap_init(tc, NULL, ldap_uri, false, bind_dn, bind_secret, &state);
 
-       memset(bind_secret, '\0', strlen(bind_secret));
-       SAFE_FREE(bind_secret);
+       BURN_FREE_STR(bind_secret);
        SAFE_FREE(bind_dn);
 
        if (!NT_STATUS_IS_OK(status)) {