WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] CA-34424: rbac audit-log should echo to syslog only

To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-API] [PATCH] CA-34424: rbac audit-log should echo to syslog only
From: Marcus Granado <marcus.granado@xxxxxxxxxx>
Date: Mon, 30 Nov 2009 18:22:47 +0000
Delivery-date: Mon, 30 Nov 2009 10:23:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
2 files changed, 7 insertions(+), 6 deletions(-)
ocaml/xapi/audit_log.ml |   12 +++++++-----
scripts/log.conf        |    1 -


# HG changeset patch
# User Marcus Granado <marcus.granado@xxxxxxxxxx>
# Date 1259599634 0
# Node ID e6185002376e4dc22148b85b4e6c32d498fe67fd
# Parent  e628313d4c047d5f8a3ac3578162689fae07b1ec
CA-34424: rbac audit-log should echo to syslog only

Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>

diff -r e628313d4c04 -r e6185002376e ocaml/xapi/audit_log.ml
--- a/ocaml/xapi/audit_log.ml   Fri Nov 27 17:25:33 2009 +0000
+++ b/ocaml/xapi/audit_log.ml   Mon Nov 30 16:47:14 2009 +0000
@@ -21,14 +21,17 @@
 let audit_log_whitelist_prefix = "/var/log/audit.log"
 
 let line_timestamp_length = 21 (* the timestamp length at the debug line *)
-let line_before_timestamp_length = 1 (* [ at the beginning of the line *)
+
+(* location of [ at the beginning of the line timestamp *)
+let timestamp_index line = 
+       try ((String.index line '[') + 1) with Not_found -> 0
 
 let write_line line fd since =
        if String.length line >
-               (line_timestamp_length + line_before_timestamp_length)
+               (line_timestamp_length + (timestamp_index line))
        then
        let line_timestamp =
-               String.sub line line_before_timestamp_length 
line_timestamp_length
+               String.sub line (timestamp_index line) line_timestamp_length
        in
        if since="" or ((String.compare line_timestamp since) >= 0)
        then
@@ -100,8 +103,7 @@
 
 (* map the ISO8601 timestamp format into the one in our logs *)
 let log_timestamp_of_iso8601 iso8601_timestamp =
-       let step0 = iso8601_timestamp in
-       let step1 = Stringext.String.replace "T" " " step0 in
+       let step1 = iso8601_timestamp in
        let step2 = Stringext.String.replace "-" "" step1 in
        let step3 = Stringext.String.replace "Z" "" step2 in
        step3
diff -r e628313d4c04 -r e6185002376e scripts/log.conf
--- a/scripts/log.conf  Fri Nov 27 17:25:33 2009 +0000
+++ b/scripts/log.conf  Mon Nov 30 16:47:14 2009 +0000
@@ -33,4 +33,3 @@
 info;;file:/var/log/xensource.log
 warn;;file:/var/log/xensource.log
 error;;file:/var/log/xensource.log
-info;audit;file:/var/log/audit.log

Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] CA-34424: rbac audit-log should echo to syslog only, Marcus Granado <=