]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib:audit_logging JSON remove leading spaces
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 22 Jan 2026 20:33:10 +0000 (09:33 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 28 Jan 2026 23:29:39 +0000 (23:29 +0000)
Remove the leading spaces in JSON audit lines.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15898

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/audit_logging/audit_logging.c

index e2fe4b0edb765350a493e5ac532ab2087ae454ec..58f32df1a2531ef0ce57f53435ec640160d5c11d 100644 (file)
@@ -132,14 +132,10 @@ void audit_log_json(struct json_object* message,
                return;
        }
        /*
-        * This is very strange, but we call this routine to get a log
-        * output without the header.  JSON logs all have timestamps
-        * so this only makes parsing harder.
-        *
-        * We push out the raw JSON blob without a prefix, consumers
-        * can find such lines by the leading {
+        * Output a single line to the logs, with no prefix
+        * or time stamps, any embedded '\n' chars will be removed
         */
-       DEBUGADDC(debug_class, debug_level, ("%s\n", s));
+       DEBUGJSONC(debug_class, debug_level, (s));
        TALLOC_FREE(frame);
 }