From 764691fdd141c5f362594dfcf54034f37e727fea Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 16 Jul 2008 23:12:31 +0200 Subject: 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) --- source3/libnet/libnet_dssync_keytab.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/libnet') diff --git a/source3/libnet/libnet_dssync_keytab.c b/source3/libnet/libnet_dssync_keytab.c index a2ce8ddcaa..eb3a936bcd 100644 --- a/source3/libnet/libnet_dssync_keytab.c +++ b/source3/libnet/libnet_dssync_keytab.c @@ -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)) { -- cgit