mirror of
https://github.com/samba-team/samba.git
synced 2025-08-30 17:49:30 +03:00
dssync keytab: remove old UpToDateNess vectors from keytab before storing new one.
Michael
This commit is contained in:
@ -113,6 +113,7 @@ static NTSTATUS keytab_finish(struct dssync_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
if (new_utdv) {
|
if (new_utdv) {
|
||||||
enum ndr_err_code ndr_err;
|
enum ndr_err_code ndr_err;
|
||||||
DATA_BLOB blob;
|
DATA_BLOB blob;
|
||||||
|
char *principal;
|
||||||
|
|
||||||
if (DEBUGLEVEL >= 10) {
|
if (DEBUGLEVEL >= 10) {
|
||||||
NDR_PRINT_DEBUG(replUpToDateVectorBlob, new_utdv);
|
NDR_PRINT_DEBUG(replUpToDateVectorBlob, new_utdv);
|
||||||
@ -135,6 +136,24 @@ static NTSTATUS keytab_finish(struct dssync_context *ctx, TALLOC_CTX *mem_ctx,
|
|||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
principal = talloc_asprintf(mem_ctx, "UTDV/%s@%s",
|
||||||
|
ctx->nc_dn, ctx->dns_domain_name);
|
||||||
|
if (!principal) {
|
||||||
|
status = NT_STATUS_NO_MEMORY;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = libnet_keytab_remove_entries(keytab_ctx, principal,
|
||||||
|
0, ENCTYPE_ARCFOUR_HMAC);
|
||||||
|
if (ret) {
|
||||||
|
status = krb5_to_nt_status(ret);
|
||||||
|
ctx->error_message = talloc_asprintf(mem_ctx,
|
||||||
|
"Failed to remove old UTDV entries from "
|
||||||
|
"keytab %s: %s", keytab_ctx->keytab_name,
|
||||||
|
error_message(ret));
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = libnet_keytab_add(keytab_ctx);
|
ret = libnet_keytab_add(keytab_ctx);
|
||||||
|
Reference in New Issue
Block a user