diff options
author | Günther Deschner <gd@samba.org> | 2008-06-27 00:46:38 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-06-27 01:59:26 +0200 |
commit | 92df9ae39329a2c442c55d20ba9015fe23b071e3 (patch) | |
tree | f3a1a2633e9cd147f29b450ccf53f88c3c12844c | |
parent | 8b52e2bc63904824022bcd9c51e52209a905b914 (diff) | |
download | samba-92df9ae39329a2c442c55d20ba9015fe23b071e3.tar.gz samba-92df9ae39329a2c442c55d20ba9015fe23b071e3.tar.bz2 samba-92df9ae39329a2c442c55d20ba9015fe23b071e3.zip |
net_vampire: use bool for last_query information in samsync.
Guenther
(This used to be commit fa1976e23a33bd3fab17c3f6ab5573ee1fdf9e31)
-rw-r--r-- | source3/libnet/libnet_samsync.c | 3 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync.h | 10 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_display.c | 7 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_keytab.c | 19 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_ldif.c | 4 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_passdb.c | 2 |
6 files changed, 26 insertions, 19 deletions
diff --git a/source3/libnet/libnet_samsync.c b/source3/libnet/libnet_samsync.c index dcf5f9c39f..4f2a8f9222 100644 --- a/source3/libnet/libnet_samsync.c +++ b/source3/libnet/libnet_samsync.c @@ -336,7 +336,8 @@ NTSTATUS libnet_samsync(enum netr_SamDatabaseID database_id, /* Process results */ callback_status = ctx->delta_fn(mem_ctx, database_id, - delta_enum_array, result, ctx); + delta_enum_array, + NT_STATUS_IS_OK(result), ctx); if (!NT_STATUS_IS_OK(callback_status)) { result = callback_status; goto out; diff --git a/source3/libnet/libnet_samsync.h b/source3/libnet/libnet_samsync.h index 8559043f5a..1f10d2c1c0 100644 --- a/source3/libnet/libnet_samsync.h +++ b/source3/libnet/libnet_samsync.h @@ -30,7 +30,7 @@ struct samsync_context; typedef NTSTATUS (*samsync_delta_fn_t)(TALLOC_CTX *, enum netr_SamDatabaseID, struct netr_DELTA_ENUM_ARRAY *, - NTSTATUS, + bool, struct samsync_context *); struct samsync_context { @@ -54,20 +54,20 @@ struct samsync_context { NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS result, + bool last_query, struct samsync_context *ctx); NTSTATUS fetch_sam_entries(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx); NTSTATUS display_sam_entries(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx); NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx); diff --git a/source3/libnet/libnet_samsync_display.c b/source3/libnet/libnet_samsync_display.c index 6e9a6924b4..6f7ae4e7aa 100644 --- a/source3/libnet/libnet_samsync_display.c +++ b/source3/libnet/libnet_samsync_display.c @@ -164,7 +164,7 @@ static void display_rename_alias(uint32_t rid, struct netr_DELTA_RENAME *r) static NTSTATUS display_sam_entry(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx) { union netr_DELTA_UNION u = r->delta_union; @@ -289,13 +289,14 @@ static NTSTATUS display_sam_entry(TALLOC_CTX *mem_ctx, NTSTATUS display_sam_entries(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx) { int i; for (i = 0; i < r->num_deltas; i++) { - display_sam_entry(mem_ctx, database_id, &r->delta_enum[i], status, ctx); + display_sam_entry(mem_ctx, database_id, &r->delta_enum[i], + last_query, ctx); } return NT_STATUS_OK; diff --git a/source3/libnet/libnet_samsync_keytab.c b/source3/libnet/libnet_samsync_keytab.c index 49d7ac27e2..d10bfd5e9d 100644 --- a/source3/libnet/libnet_samsync_keytab.c +++ b/source3/libnet/libnet_samsync_keytab.c @@ -75,7 +75,7 @@ static NTSTATUS fetch_sam_entry_keytab(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, uint32_t rid, struct netr_DELTA_USER *r, - NTSTATUS status, + bool last_query, struct libnet_keytab_context *ctx) { uchar nt_passwd[16]; @@ -111,7 +111,7 @@ static NTSTATUS fetch_sam_entry_keytab(TALLOC_CTX *mem_ctx, NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS result, + bool last_query, struct samsync_context *ctx) { NTSTATUS status = NT_STATUS_OK; @@ -143,7 +143,7 @@ NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, status = fetch_sam_entry_keytab(mem_ctx, database_id, r->delta_enum[i].delta_id_union.rid, r->delta_enum[i].delta_union.user, - result, + last_query, keytab_ctx); if (!NT_STATUS_IS_OK(status)) { goto out; @@ -159,10 +159,15 @@ NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, goto out; } - ctx->result_message = talloc_asprintf(mem_ctx, - "vampired %d accounts to keytab %s", - keytab_ctx->count, - keytab_ctx->keytab_name); + if (last_query) { + ctx->result_message = talloc_asprintf(mem_ctx, + "Vampired %d accounts to keytab %s", + keytab_ctx->count, + keytab_ctx->keytab_name); + TALLOC_FREE(keytab_ctx); + } + + return NT_STATUS_OK; out: TALLOC_FREE(keytab_ctx); diff --git a/source3/libnet/libnet_samsync_ldif.c b/source3/libnet/libnet_samsync_ldif.c index 64eb9a58da..c89fedc2a3 100644 --- a/source3/libnet/libnet_samsync_ldif.c +++ b/source3/libnet/libnet_samsync_ldif.c @@ -1158,7 +1158,7 @@ static NTSTATUS ldif_realloc_maps(TALLOC_CTX *mem_ctx, NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS result, + bool last_query, struct samsync_context *ctx) { NTSTATUS status; @@ -1193,7 +1193,7 @@ NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, } /* This was the last query */ - if (NT_STATUS_IS_OK(result)) { + if (last_query) { ldif_write_output(database_id, ldif_ctx); if (ldif_ctx->ldif_file != stdout) { ctx->result_message = talloc_asprintf(mem_ctx, diff --git a/source3/libnet/libnet_samsync_passdb.c b/source3/libnet/libnet_samsync_passdb.c index a049d1b9c3..7d07bcb791 100644 --- a/source3/libnet/libnet_samsync_passdb.c +++ b/source3/libnet/libnet_samsync_passdb.c @@ -776,7 +776,7 @@ static NTSTATUS fetch_sam_entry(TALLOC_CTX *mem_ctx, NTSTATUS fetch_sam_entries(TALLOC_CTX *mem_ctx, enum netr_SamDatabaseID database_id, struct netr_DELTA_ENUM_ARRAY *r, - NTSTATUS status, + bool last_query, struct samsync_context *ctx) { int i; |