From: Marcelo Cerri <mhcerri@linux.vnet.ibm.com>
To: linux-audit@redhat.com
Cc: gcwilson@us.ibm.com, bryntcor@us.ibm.com
Subject: [PATCH] ausearch: Fix parsing of uid in user space events
Date: Tue, 7 Feb 2012 14:30:19 -0200 [thread overview]
Message-ID: <1328632219-19071-1-git-send-email-mhcerri@linux.vnet.ibm.com> (raw)
The function parse_user aborts when it tries to parse a record which contains
an uuid field (usually a VIRT_* record).
---
src/ausearch-parse.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ausearch-parse.c b/src/ausearch-parse.c
index d38ed56..f83f84b 100644
--- a/src/ausearch-parse.c
+++ b/src/ausearch-parse.c
@@ -719,7 +719,7 @@ static int parse_user(const lnode *n, search_items *s)
str = strstr(term, "auid=");
if (str == NULL) { // Try the older one
str = strstr(term, "loginuid=");
- if (str == NULL)
+ if (str == NULL)
return 7;
ptr = str + 9;
} else
@@ -792,7 +792,7 @@ static int parse_user(const lnode *n, search_items *s)
term = str;
while (*term != ' ' && *term != ':')
term++;
- if (term == str)
+ if (term == str)
return 24;
saved = *term;
*term = 0;
@@ -804,9 +804,9 @@ static int parse_user(const lnode *n, search_items *s)
// USER_LOGIN for example.
str = strstr(term, "uid=");
if (str) {
- if (*(str-1)=='a' || *(str-1)=='s')
+ if (*(str - 1) == 'a' || *(str - 1) == 's' || *(str - 1) == 'u')
goto skip;
- if (!(*(str-1)=='\'' || *(str-1)==' '))
+ if (!(*(str - 1) == '\'' || *(str - 1) == ' '))
return 25;
ptr = str + 4;
term = ptr;
--
1.7.1
next reply other threads:[~2012-02-07 16:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-07 16:30 Marcelo Cerri [this message]
2012-02-07 22:11 ` [PATCH] ausearch: Fix parsing of uid in user space events 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=1328632219-19071-1-git-send-email-mhcerri@linux.vnet.ibm.com \
--to=mhcerri@linux.vnet.ibm.com \
--cc=bryntcor@us.ibm.com \
--cc=gcwilson@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox