summaryrefslogtreecommitdiffstats
path: root/plugins/imjournal
diff options
context:
space:
mode:
authorMilan Bartos <mbartos@redhat.com>2013-04-02 10:54:33 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2013-04-17 11:13:01 +0200
commit52f02ae1e73233cf0fdb6700d4c60f2e6f097509 (patch)
tree6c09965191fe1b10626c2c5d265ab7f9299d0978 /plugins/imjournal
parent56e8bd4df78c3848c73f42d125995f027cba418f (diff)
downloadrsyslog-52f02ae1e73233cf0fdb6700d4c60f2e6f097509.tar.gz
rsyslog-52f02ae1e73233cf0fdb6700d4c60f2e6f097509.tar.bz2
rsyslog-52f02ae1e73233cf0fdb6700d4c60f2e6f097509.zip
Fix journal trusted fields translation.
modified: plugins/imjournal/imjournal.c
Diffstat (limited to 'plugins/imjournal')
-rw-r--r--plugins/imjournal/imjournal.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c
index 88b71c54..f524e831 100644
--- a/plugins/imjournal/imjournal.c
+++ b/plugins/imjournal/imjournal.c
@@ -143,7 +143,7 @@ readjournal() {
char *sys_iden_help;
const void *get;
- uchar *parse;
+ char *parse;
char *get2;
size_t length;
@@ -232,26 +232,50 @@ readjournal() {
prefixlen = ((char *)equal_sign - (char *)get);
/* translate name fields to lumberjack names */
- parse = (uchar *)get;
+ parse = (char *)get;
switch (*parse)
{
case '_':
++parse;
if (*parse == 'P') {
- name = strdup("pid");
+ if (!strncmp(parse, "PID=", 4)) {
+ name = strdup("pid");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else if (*parse == 'G') {
- name = strdup("gid");
+ if (!strncmp(parse, "GID=", 4)) {
+ name = strdup("gid");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else if (*parse == 'U') {
- name = strdup("uid");
+ if (!strncmp(parse, "UID=", 4)) {
+ name = strdup("uid");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else if (*parse == 'E') {
- name = strdup("exe");
+ if (!strncmp(parse, "EXE=", 4)) {
+ name = strdup("exe");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else if (*parse == 'C') {
parse++;
if (*parse == 'O') {
- name = strdup("appname");
+ if (!strncmp(parse, "OMM=", 4)) {
+ name = strdup("appname");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else if (*parse == 'M') {
- name = strdup("cmd");
+ if (!strncmp(parse, "MDLINE=", 7)) {
+ name = strdup("cmd");
+ } else {
+ name = strndup(get, prefixlen);
+ }
} else {
name = strndup(get, prefixlen);
}