summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-02-03 13:09:59 +0100
committerGünther Deschner <gd@samba.org>2009-02-04 21:11:52 +0100
commit1b71fa5c59f3af4f096a640839c7d48b20b2266a (patch)
tree7acd099eb61e1d2fecf1c502a65dd819a01698c7
parent0126dba7efb6d8fea2565f21cffa1e85569da81e (diff)
downloadsamba-1b71fa5c59f3af4f096a640839c7d48b20b2266a.tar.gz
samba-1b71fa5c59f3af4f096a640839c7d48b20b2266a.tar.bz2
samba-1b71fa5c59f3af4f096a640839c7d48b20b2266a.zip
s3-eventlog: add evlog_pull_record function.
Guenther
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/rpc_server/srv_eventlog_lib.c33
2 files changed, 36 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 3ae2448e4b..0f9779f2f8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -6271,6 +6271,9 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx,
TDB_CONTEXT *tdb,
struct eventlog_Record_tdb *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 fdd3db9191..1cd306c5f2 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