]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-eventlog: implement _eventlog_GetLogInformation().
authorGünther Deschner <gd@samba.org>
Wed, 8 Apr 2009 16:31:32 +0000 (18:31 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 10 Apr 2009 11:15:24 +0000 (13:15 +0200)
Guenther

source3/rpc_server/srv_eventlog_nt.c

index cf07d97fec0ba3ca7e4857c1e5880a751b3ff455..49a96d8bf12605ece3a857a49822ccc9bd54dfec 100644 (file)
@@ -616,6 +616,50 @@ NTSTATUS _eventlog_BackupEventLogW(pipes_struct *p, struct eventlog_BackupEventL
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
+/********************************************************************
+_eventlog_GetLogInformation
+ ********************************************************************/
+
+NTSTATUS _eventlog_GetLogInformation(pipes_struct *p,
+                                    struct eventlog_GetLogInformation *r)
+{
+       EVENTLOG_INFO *info = find_eventlog_info_by_hnd(p, r->in.handle);
+       struct EVENTLOG_FULL_INFORMATION f;
+       enum ndr_err_code ndr_err;
+       DATA_BLOB blob;
+
+       if (!info) {
+               return NT_STATUS_INVALID_HANDLE;
+       }
+
+       if (r->in.level != 0) {
+               return NT_STATUS_INVALID_LEVEL;
+       }
+
+       *r->out.bytes_needed = 4;
+
+       if (r->in.buf_size < 4) {
+               return NT_STATUS_BUFFER_TOO_SMALL;
+       }
+
+       /* FIXME: this should be retrieved from the handle */
+       f.full = false;
+
+       ndr_err = ndr_push_struct_blob(&blob, p->mem_ctx, NULL, &f,
+                     (ndr_push_flags_fn_t)ndr_push_EVENTLOG_FULL_INFORMATION);
+       if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+               return ndr_map_error2ntstatus(ndr_err);
+       }
+
+       if (DEBUGLEVEL >= 10) {
+               NDR_PRINT_DEBUG(EVENTLOG_FULL_INFORMATION, &f);
+       }
+
+       memcpy(r->out.buffer, blob.data, 4);
+
+       return NT_STATUS_OK;
+}
+
 NTSTATUS _eventlog_DeregisterEventSource(pipes_struct *p, struct eventlog_DeregisterEventSource *r)
 {
        p->rng_fault_state = True;
@@ -706,12 +750,6 @@ NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClus
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-NTSTATUS _eventlog_GetLogInformation(pipes_struct *p, struct eventlog_GetLogInformation *r)
-{
-       p->rng_fault_state = True;
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
 NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r)
 {
        p->rng_fault_state = True;