summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-24 00:30:07 +0200
committerMichael Adam <obnox@samba.org>2008-08-01 16:04:40 +0200
commit7bd3ea0b6f53ff90af4483d5a27bb4986e8e1209 (patch)
tree46f18217ddba8862432b6375a48383de9a090974
parent764691fdd141c5f362594dfcf54034f37e727fea (diff)
downloadsamba-7bd3ea0b6f53ff90af4483d5a27bb4986e8e1209.tar.gz
samba-7bd3ea0b6f53ff90af4483d5a27bb4986e8e1209.tar.bz2
samba-7bd3ea0b6f53ff90af4483d5a27bb4986e8e1209.zip
dssync keytab: use add_to_keytab_entries() for pwd history in parse_object().
Michael (This used to be commit 61f071de92a7011c70f72dc31fef4430ffb1515a)
-rw-r--r--source3/libnet/libnet_dssync_keytab.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source3/libnet/libnet_dssync_keytab.c b/source3/libnet/libnet_dssync_keytab.c
index eb3a936bcd..b1f0a35d8b 100644
--- a/source3/libnet/libnet_dssync_keytab.c
+++ b/source3/libnet/libnet_dssync_keytab.c
@@ -100,7 +100,6 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
{
NTSTATUS status = NT_STATUS_OK;
uchar nt_passwd[16];
- struct libnet_keytab_entry entry;
DATA_BLOB *blob;
int i = 0;
struct drsuapi_DsReplicaAttribute *attr;
@@ -215,18 +214,11 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
}
for (; i<pwd_history_len; i++) {
-
- entry.kvno = kvno--;
- entry.name = talloc_strdup(mem_ctx, name);
- entry.principal = talloc_asprintf(mem_ctx, "%s@%s",
- name, ctx->dns_domain_name);
- entry.password = data_blob_talloc(mem_ctx, &pwd_history[i*16], 16);
- NT_STATUS_HAVE_NO_MEMORY(entry.name);
- NT_STATUS_HAVE_NO_MEMORY(entry.principal);
- NT_STATUS_HAVE_NO_MEMORY(entry.password.data);
-
- ADD_TO_ARRAY(mem_ctx, struct libnet_keytab_entry, entry,
- &ctx->entries, &ctx->count);
+ status = add_to_keytab_entries(mem_ctx, ctx, kvno--, name, NULL,
+ data_blob_talloc(mem_ctx, &pwd_history[i*16], 16));
+ if (!NT_STATUS_IS_OK(status)) {
+ break;
+ }
}
return status;