summaryrefslogtreecommitdiffstats
path: root/source3/libnet/libnet_dssync_keytab.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-31 22:53:41 +0200
committerMichael Adam <obnox@samba.org>2008-08-01 16:07:58 +0200
commitefd89b46d6a66e4a4d17e7cdc400e9e3890b7970 (patch)
tree8894224750bfeda83683766db61d2f9e8cf13d43 /source3/libnet/libnet_dssync_keytab.c
parent982759357f8bd9b4c261f342108f106ead2d5a25 (diff)
downloadsamba-efd89b46d6a66e4a4d17e7cdc400e9e3890b7970.tar.gz
samba-efd89b46d6a66e4a4d17e7cdc400e9e3890b7970.tar.xz
samba-efd89b46d6a66e4a4d17e7cdc400e9e3890b7970.zip
dssync keytab: when not in single object replication mode, use object dn list as write filter.
I.e. only the passwords and keys of those objects whose dns are provided are written to the keytab file. Others are skippded. Michael (This used to be commit a013f926ae5aadf64e02ef9254306e32aea79e80)
Diffstat (limited to 'source3/libnet/libnet_dssync_keytab.c')
-rw-r--r--source3/libnet/libnet_dssync_keytab.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/libnet/libnet_dssync_keytab.c b/source3/libnet/libnet_dssync_keytab.c
index d74ee3dbdb0..2558e1d8019 100644
--- a/source3/libnet/libnet_dssync_keytab.c
+++ b/source3/libnet/libnet_dssync_keytab.c
@@ -554,6 +554,24 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
return status;
}
+static bool dn_is_in_object_list(struct dssync_context *ctx,
+ const char *dn)
+{
+ uint32_t count;
+
+ if (ctx->object_count == 0) {
+ return true;
+ }
+
+ for (count = 0; count < ctx->object_count; count++) {
+ if (strequal(ctx->object_dns[count], dn)) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
/****************************************************************
****************************************************************/
@@ -567,6 +585,16 @@ static NTSTATUS keytab_process_objects(struct dssync_context *ctx,
(struct libnet_keytab_context *)ctx->private_data;
for (; cur; cur = cur->next_object) {
+ /*
+ * When not in single object replication mode,
+ * the object_dn list is used as a positive write filter.
+ */
+ if (!ctx->single_object_replication &&
+ !dn_is_in_object_list(ctx, cur->object.identifier->dn))
+ {
+ continue;
+ }
+
status = parse_object(mem_ctx, keytab_ctx, cur);
if (!NT_STATUS_IS_OK(status)) {
goto out;