The branch, master has been updated via 63a992168db48568c91fe622e81141ca00c9bc45 (commit) via 1b71fa5c59f3af4f096a640839c7d48b20b2266a (commit) from 0126dba7efb6d8fea2565f21cffa1e85569da81e (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 63a992168db48568c91fe622e81141ca00c9bc45 Author: Günther Deschner <g...@samba.org> Date: Tue Feb 3 13:08:44 2009 +0100 s3-eventlog: add evlog_push_record function. Guenther commit 1b71fa5c59f3af4f096a640839c7d48b20b2266a Author: Günther Deschner <g...@samba.org> Date: Tue Feb 3 13:09:59 2009 +0100 s3-eventlog: add evlog_pull_record function. Guenther ----------------------------------------------------------------------- Summary of changes: source3/include/proto.h | 7 ++++ source3/rpc_server/srv_eventlog_lib.c | 61 +++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 3ae2448..68c4c8b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6271,6 +6271,13 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, struct eventlog_Record_tdb *r, uint32_t *record_number); +NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + struct EVENTLOGRECORD *r, + uint32_t *record_number); +struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + uint32_t record_number); NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx, const struct EVENTLOGRECORD *e, struct eventlog_Record_tdb *t); diff --git a/source3/rpc_server/srv_eventlog_lib.c b/source3/rpc_server/srv_eventlog_lib.c index fdd3db9..2c70141 100644 --- a/source3/rpc_server/srv_eventlog_lib.c +++ b/source3/rpc_server/srv_eventlog_lib.c @@ -832,6 +832,39 @@ struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, } /******************************************************************** + ********************************************************************/ + +struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + uint32_t record_number) +{ + struct eventlog_Record_tdb *t; + struct EVENTLOGRECORD *r; + NTSTATUS status; + + r = talloc_zero(mem_ctx, struct EVENTLOGRECORD); + if (!r) { + return NULL; + } + + t = evlog_pull_record_tdb(r, tdb, record_number); + if (!t) { + talloc_free(r); + return NULL; + } + + status = evlog_tdb_entry_to_evt_entry(r, t, r); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(r); + return NULL; + } + + r->Length = r->Length2 = ndr_size_EVENTLOGRECORD(r, NULL, 0); + + return r; +} + +/******************************************************************** write an eventlog entry. Note that we have to lock, read next eventlog, increment, write, write the record, unlock @@ -908,6 +941,34 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, /******************************************************************** ********************************************************************/ +NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + struct EVENTLOGRECORD *r, + uint32_t *record_number) +{ + struct eventlog_Record_tdb *t; + NTSTATUS status; + + t = talloc_zero(mem_ctx, struct eventlog_Record_tdb); + if (!t) { + return NT_STATUS_NO_MEMORY; + } + + status = evlog_evt_entry_to_tdb_entry(t, r, t); + if (!NT_STATUS_IS_OK(status)) { + talloc_free(t); + return status; + } + + status = evlog_push_record_tdb(mem_ctx, tdb, t, record_number); + talloc_free(t); + + return status; +} + +/******************************************************************** + ********************************************************************/ + NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx, const struct EVENTLOGRECORD *e, struct eventlog_Record_tdb *t) -- Samba Shared Repository