mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
dssync keytab: add prefix parameter to add_to_keytab_entries() for flexibility.
This will allow to construct principals of the form PREFIX/name@domain Michael (This used to be commit 7dd32b56a65574db95f4a0e136f54bd73862c59f)
This commit is contained in:
parent
c1b9eb278f
commit
764691fdd1
@ -26,13 +26,16 @@ static NTSTATUS add_to_keytab_entries(TALLOC_CTX *mem_ctx,
|
||||
struct libnet_keytab_context *ctx,
|
||||
uint32_t kvno,
|
||||
const char *name,
|
||||
const char *prefix,
|
||||
DATA_BLOB blob)
|
||||
{
|
||||
struct libnet_keytab_entry entry;
|
||||
|
||||
entry.kvno = kvno;
|
||||
entry.name = talloc_strdup(mem_ctx, name);
|
||||
entry.principal = talloc_asprintf(mem_ctx, "%s@%s",
|
||||
entry.principal = talloc_asprintf(mem_ctx, "%s%s%s@%s",
|
||||
prefix ? prefix : "",
|
||||
prefix ? "/" : "",
|
||||
name, ctx->dns_domain_name);
|
||||
entry.password = blob;
|
||||
NT_STATUS_HAVE_NO_MEMORY(entry.name);
|
||||
@ -190,7 +193,7 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
DEBUGADD(1,("\n"));
|
||||
|
||||
status = add_to_keytab_entries(mem_ctx, ctx, kvno, name,
|
||||
status = add_to_keytab_entries(mem_ctx, ctx, kvno, name, NULL,
|
||||
data_blob_talloc(mem_ctx, nt_passwd, 16));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user