summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-16 23:12:31 +0200
committerMichael Adam <obnox@samba.org>2008-08-01 16:04:40 +0200
commit764691fdd141c5f362594dfcf54034f37e727fea (patch)
tree0b0fc56a04ab1610ed7a9c7e68fc26bdff7197ef
parentc1b9eb278fcc37cc9d286c830236af4532a5bf76 (diff)
downloadsamba-764691fdd141c5f362594dfcf54034f37e727fea.tar.gz
samba-764691fdd141c5f362594dfcf54034f37e727fea.tar.bz2
samba-764691fdd141c5f362594dfcf54034f37e727fea.zip
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)
-rw-r--r--source3/libnet/libnet_dssync_keytab.c7
1 files changed, 5 insertions, 2 deletions
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)) {