[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.