* [PATCH] Fix the bug that use option "--session Login-Session-ID" cannot search out all matched logs
@ 2010-11-25 8:06 Peng Haitao
2010-12-06 16:41 ` Steve Grubb
0 siblings, 1 reply; 2+ messages in thread
From: Peng Haitao @ 2010-11-25 8:06 UTC (permalink / raw)
To: Steve Grubb; +Cc: linux-audit
Hello Steve,
Use option '--session Login-Session-ID' cannot search out the log which
contains the given Login Session ID and message type is MAC_POLICY_LOAD.
For example:
# echo "type=MAC_POLICY_LOAD msg=audit(1290670949.711:413341): policy loaded auid=0 ses=218" | ausearch --session 218
<no matches>
Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
---
src/ausearch-parse.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/ausearch-parse.c b/src/ausearch-parse.c
index 30a96a2..0ffea14 100755
--- a/src/ausearch-parse.c
+++ b/src/ausearch-parse.c
@@ -1551,14 +1551,14 @@ static int parse_simple_message(const lnode *n, search_items *s)
if (str) {
ptr = str + 4;
term = strchr(ptr, ' ');
- if (term == NULL)
- return 3;
- *term = 0;
+ if (term)
+ *term = 0;
errno = 0;
s->session_id = strtoul(ptr, NULL, 10);
if (errno)
- return 4;
- *term = ' ';
+ return 3;
+ if (term)
+ *term = ' ';
}
}
@@ -1582,7 +1582,7 @@ static int parse_simple_message(const lnode *n, search_items *s)
else // Set it back to something sane
term = str;
} else
- return 5;
+ return 4;
}
}
@@ -1593,7 +1593,7 @@ static int parse_simple_message(const lnode *n, search_items *s)
//create
s->key = malloc(sizeof(slist));
if (s->key == NULL)
- return 6;
+ return 5;
slist_create(s->key);
}
ptr = str + 4;
@@ -1612,7 +1612,7 @@ static int parse_simple_message(const lnode *n, search_items *s)
}
*term = '"';
} else
- return 7;
+ return 6;
} else {
if (s->key) {
char *saved=NULL;
@@ -1652,7 +1652,7 @@ static int parse_simple_message(const lnode *n, search_items *s)
errno = 0;
s->success = strtoul(ptr, NULL, 10);
if (errno)
- return 8;
+ return 7;
if (term)
*term = ' ';
}
--
1.7.0.1
--
Best Regards,
Peng Haitao
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix the bug that use option "--session Login-Session-ID" cannot search out all matched logs
2010-11-25 8:06 [PATCH] Fix the bug that use option "--session Login-Session-ID" cannot search out all matched logs Peng Haitao
@ 2010-12-06 16:41 ` Steve Grubb
0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2010-12-06 16:41 UTC (permalink / raw)
To: Peng Haitao; +Cc: linux-audit
On Thursday, November 25, 2010 03:06:16 am Peng Haitao wrote:
> Use option '--session Login-Session-ID' cannot search out the log which
> contains the given Login Session ID and message type is MAC_POLICY_LOAD.
>
> For example:
> # echo "type=MAC_POLICY_LOAD msg=audit(1290670949.711:413341): policy
> loaded auid=0 ses=218" | ausearch --session 218 <no matches>
>
> Signed-off-by: Peng Haitao <penght@cn.fujitsu.com>
Applied.
Thanks,
-Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-06 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25 8:06 [PATCH] Fix the bug that use option "--session Login-Session-ID" cannot search out all matched logs Peng Haitao
2010-12-06 16:41 ` Steve Grubb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox