From: zhangxiliang <zhangxiliang@cn.fujitsu.com>
To: Steve Grubb <sgrubb@redhat.com>, Linux Audit <linux-audit@redhat.com>
Subject: [PATCH 3/4] Add the checking of exclude filter list for the field which is not AUDIT_MSGTYPE
Date: Sat, 02 Aug 2008 18:13:11 +0800 [thread overview]
Message-ID: <48943337.9090806@cn.fujitsu.com> (raw)
Hello Steve,
When field is not AUDIT_MSGTYPE, it is invalid for exclude filter list.
I think the fields shoud be check before sending to kernel.
I add checking and error message "-18" to realize it.
Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
lib/deprecated.c | 3 +++
lib/libaudit.c | 3 +++
src/auditctl.c | 5 +++++
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/deprecated.c b/lib/deprecated.c
index 695e5d6..e7047df 100644
--- a/lib/deprecated.c
+++ b/lib/deprecated.c
@@ -440,6 +440,9 @@ int audit_rule_fieldpair(struct audit_rule *rule, const char *pair, int flags)
if (field == AUDIT_PPID && (flags != AUDIT_FILTER_EXIT
|| flags != AUDIT_FILTER_ENTRY))
return -17;
+
+ if (flags == AUDIT_FILTER_EXCLUDE)
+ return -18;
rule->values[rule->field_count] = strtol(v, NULL, 0);
break;
diff --git a/lib/libaudit.c b/lib/libaudit.c
index 5b276f1..4d20261 100644
--- a/lib/libaudit.c
+++ b/lib/libaudit.c
@@ -1085,6 +1085,9 @@ int audit_rule_fieldpair_data(struct audit_rule_data **rulep, const char *pair,
if (field == AUDIT_PPID && (flags != AUDIT_FILTER_EXIT
|| flags != AUDIT_FILTER_ENTRY))
return -17;
+
+ if (flags == AUDIT_FILTER_EXCLUDE)
+ return -18;
rule->values[rule->field_count] = strtol(v, NULL, 0);
break;
diff --git a/src/auditctl.c b/src/auditctl.c
index 2e64d28..0d38ac1 100644
--- a/src/auditctl.c
+++ b/src/auditctl.c
@@ -794,6 +794,11 @@ static int setopt(int count, char *vars[])
"Field %s can only be used with exit and entry filter list\n", optarg);
retval = -1;
break;
+ case -18:
+ fprintf(stderr,
+ "Field %s can not be used with exclude filter list\n", optarg);
+ retval = -1;
+ break;
default:
retval = -1;
break;
--
Regards
Zhang Xiliang
next reply other threads:[~2008-08-02 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 10:13 zhangxiliang [this message]
2008-08-05 0:03 ` [PATCH 3/4] Add the checking of exclude filter list for the field which is not AUDIT_MSGTYPE 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=48943337.9090806@cn.fujitsu.com \
--to=zhangxiliang@cn.fujitsu.com \
--cc=linux-audit@redhat.com \
--cc=sgrubb@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