1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3:secrets: let secrets_store_machine_pw_sync() delete the des_salt_key when there's no value

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2017-05-22 12:27:45 +02:00
parent c5ded11237
commit 45eea321a6

View File

@ -537,9 +537,16 @@ bool secrets_store_machine_pw_sync(const char *pass, const char *oldpass, const
return ret; return ret;
} }
if (realm && salting_principal) { if (realm != NULL) {
char *key = des_salt_key(realm); char *key = des_salt_key(realm);
ret = secrets_store(key, salting_principal, strlen(salting_principal)+1 );
if (salting_principal != NULL) {
ret = secrets_store(key,
salting_principal,
strlen(salting_principal)+1);
} else {
ret = secrets_delete(key);
}
} }
TALLOC_FREE(frame); TALLOC_FREE(frame);