public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Yu Zhiguo <yuzg@cn.fujitsu.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: audit-list <linux-audit@redhat.com>
Subject: Re: [PATCH] the usage of strchr is wrong
Date: Tue, 05 Aug 2008 10:43:25 +0800	[thread overview]
Message-ID: <4897BE4D.4060506@cn.fujitsu.com> (raw)
In-Reply-To: <4897B777.5070900@cn.fujitsu.com>

Hello Steve,

Yu Zhiguo wrote:
> Ok, but I tested this commit a moment ago. I think this is a bug about 
> usage
> of strchr().

We'd better correct this bug ASAP. Otherwise no rule can be added/deleted
and the error message reported is very strange, e.g.

# ./auditctl -a entry,always
Append rule - bad keyword Wntry,always
# ./auditctl -d never,exit
Delete rule - bad keyword Yever,exit


> 
> strchr returns a pointer, this pointer should be given to 'p' directly.
> 
> Signed-off-by: Yu Zhiguo<yuzg@cn.fujitsu.com>
> ---
>  src/auditctl.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/auditctl.c b/src/auditctl.c
> index 1053638..868f770 100644
> --- a/src/auditctl.c
> +++ b/src/auditctl.c
> @@ -209,7 +209,7 @@ static int audit_rule_setup(char *opt, int *filter, 
> int *act)
>      if (++multiple != 1)
>          return 3;
> 
> -    *p = strchr(opt, ',');
> +    p = strchr(opt, ',');
>      if (p == NULL || strchr(p+1, ','))
>          return 2;
>      *p = 0;

  reply	other threads:[~2008-08-05  2:43 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č
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 [this message]
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=4897BE4D.4060506@cn.fujitsu.com \
    --to=yuzg@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