From: "Miloslav Trmač" <mitr@redhat.com>
To: Yu Zhiguo <yuzg@cn.fujitsu.com>
Cc: audit-list <linux-audit@redhat.com>
Subject: Re: [PATCH] make it match explicitly when use option '-a', '-A' and '-d' to specify "list,action"
Date: Fri, 18 Jul 2008 08:49:13 +0000 [thread overview]
Message-ID: <1216370953.2664.23.camel@amilo> (raw)
In-Reply-To: <48803E3C.4060209@cn.fujitsu.com>
Hello,
Yu Zhiguo píše v Pá 18. 07. 2008 v 14:54 +0800:
> I know "list" and "action" can be changed, this is convenient.
No, it is undocumented. As an author of system-config-audit I'd much
prefer if audit rejected such options, replicating the exact code in
auditctl in order to handle all undocumented behavior the same way as
auditctl is rather impractical.
> diff --git a/src/auditctl.c b/src/auditctl.c
> index 2c136ea..1aba437 100644
> --- a/src/auditctl.c
> +++ b/src/auditctl.c
> @@ -168,27 +168,34 @@ static void usage(void)
> /* Returns 0 ok, 1 deprecated action, 2 error */
> static int audit_rule_setup(const char *opt, int *flags, int *act)
> {
> + char *p;
> + if ((strchr(opt, ',') != strrchr(opt, ',')) || !strchr(opt, ','))
> + return 2;
> +
> + p = strchr(opt, ',');
I think
p = strchr(opt, ',');
if (p == NULL || strchr(p + 1, ',') != NULL)
return 2;
would be simpler.
> - if (strstr(opt, "task"))
> + if (!strncmp(opt, "task,", p - opt + 1) || !strcmp(p, ",task"))
> *flags = AUDIT_FILTER_TASK;
Each string should be recognized only in the documented position IMHO.
The patch also replaces case-sensitive matching by case-insensitive,
which is not described above.
If such changes in the semantics of the parameter are accepted, at
minimum the auditctl.8 man page should be updated as well.
Mirek
next prev parent reply other threads:[~2008-07-18 8:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 6:54 [PATCH] make it match explicitly when use option '-a', '-A' and '-d' to specify "list,action" Yu Zhiguo
2008-07-18 8:49 ` Miloslav Trmač [this message]
2008-07-18 11:52 ` Yu Zhiguo
2008-07-18 11:56 ` Miloslav Trmač
2008-07-30 6:32 ` Yu Zhiguo
2008-07-31 0:57 ` Yu Zhiguo
2008-08-04 19:37 ` Steve Grubb
2008-08-05 2:14 ` [PATCH] the usage of strchr is wrong Yu Zhiguo
2008-08-05 2:43 ` Yu Zhiguo
2008-08-05 12:00 ` 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=1216370953.2664.23.camel@amilo \
--to=mitr@redhat.com \
--cc=linux-audit@redhat.com \
--cc=yuzg@cn.fujitsu.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