All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miloslav Trmac <mitr@redhat.com>
To: linux-audit@redhat.com
Subject: [PATCH] Fix acct quoting in audit_log_acct_message())
Date: Tue, 04 Mar 2008 04:50:08 +0100	[thread overview]
Message-ID: <47CCC6F0.1090005@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

Hello,
audit_log_acct_message() is currently quoting acct differently from all 
other users: it adds quotes to acct if it is represented in hexadecimal, 
not when it is represented as-is.

The attached patch fixes it - but it also changes the format of some of 
the most-often used messages.  It might be better to leave the message 
format alone, and add a special case to libauparse and other 
applications that parse the logs - I have no idea.
	Mirek

[-- Attachment #2: audit_log_acct_message-quotes.patch --]
[-- Type: text/x-patch, Size: 705 bytes --]

diff -up audit-1.6.7/lib/audit_logging.c.quotes audit-1.6.7/lib/audit_logging.c
--- audit-1.6.7/lib/audit_logging.c.quotes	2008-03-04 04:34:38.000000000 +0100
+++ audit-1.6.7/lib/audit_logging.c	2008-03-04 04:35:33.000000000 +0100
@@ -378,10 +378,10 @@ int audit_log_acct_message(int audit_fd,
 		}
 		if (enc)
 			format = 
-	 "op=%s acct=\"%s\" exe=%s (hostname=%s, addr=%s, terminal=%s res=%s)";
+	 "op=%s acct=%s exe=%s (hostname=%s, addr=%s, terminal=%s res=%s)";
 		else
 			format = 
-	     "op=%s acct=%s exe=%s (hostname=%s, addr=%s, terminal=%s res=%s)";
+	     "op=%s acct=\"%s\" exe=%s (hostname=%s, addr=%s, terminal=%s res=%s)";
 
 		snprintf(buf, sizeof(buf), format,
 			op, user, pgname,

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2008-03-04  3:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04  3:50 Miloslav Trmac [this message]
2008-03-04 15:07 ` [PATCH] Fix acct quoting in audit_log_acct_message()) John Dennis
2008-03-04 18:10   ` Tomas Mraz
2008-03-04 18:29     ` John Dennis
2008-03-04 19:05       ` Eric Paris
2008-03-05  4:02         ` Valdis.Kletnieks
2008-03-05 13:15           ` Eric Paris
2008-03-04 18:56     ` Steve Grubb
2008-03-04 19:08       ` Miloslav Trmac
2008-03-04 19:28         ` Steve Grubb
2008-03-04 19:15       ` Eric Paris
2008-03-04 20:41         ` John Dennis
2008-03-04 20:29       ` John Dennis
2008-03-04 20:36         ` Tomas Mraz
2008-03-04 20:57           ` John Dennis
2008-03-04 20:43         ` Eric Paris
2008-03-04 20:52           ` Steve Grubb
2008-03-04 21:21           ` John Dennis
2008-03-04 21:38             ` Steve Grubb
2008-03-04 21:55               ` Eric Paris
2008-03-04 22:03                 ` Eric Paris
2008-03-04 22:18                   ` Steve Grubb
2008-03-04 22:32                   ` John Dennis
2008-03-05 14:11                     ` John Dennis
2008-03-04 22:14                 ` Steve Grubb
2008-03-04 22:21                   ` Eric Paris
2008-03-04 23:00                     ` Steve Grubb
2008-03-09 18:36 ` Steve Grubb
  -- strict thread matches above, loose matches on Subject: below --
2008-03-05 13:55 Miloslav Trmac
2008-03-05 14:11 ` Tomas Mraz
2008-03-05 15:04   ` John Dennis
2008-03-05 15:21     ` Tomas Mraz
2008-03-05 15:29       ` Steve Grubb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CCC6F0.1090005@redhat.com \
    --to=mitr@redhat.com \
    --cc=linux-audit@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.