From: Eric Paris <eparis@redhat.com>
To: Cai Xianchao <caixianchao@cn.fujitsu.com>
Cc: 'LESS' <graphics@cn.fujitsu.com>, Linux Audit <linux-audit@redhat.com>
Subject: Re: [PATCH] Uids should not be allowed to set to negative
Date: Fri, 08 Aug 2008 09:25:09 -0400 [thread overview]
Message-ID: <1218201909.5837.226.camel@localhost.localdomain> (raw)
In-Reply-To: <489C1B77.5030508@cn.fujitsu.com>
On Fri, 2008-08-08 at 18:09 +0800, Cai Xianchao wrote:
> Hello Steve,
>
> When I tried to set uid to negative, no error message was outputed and
> the return value was 0. In the rule list, the value of uid was also
> negative. Negative uid does not exist and the negative user can't be
> added. So, I think uids can't be set to negative.
>
> It is also strange that gid can't be set to negative, while uid can.
Its not the same code that matches uid and auid is it? auid can
reasonably be negative for anything that wasn't done from a login shell.
just want to make sure you don't lose that ability.
-Eric
>
> I did as follows:
> #auditctl -a exit,always -F uid=-1
> #auditctl -l
> LIST_RULES: exit,always uid=-1 (0xffffffff) syscall=all
>
> Signed-off-by: Cai Xianchao <caixianchao@cn.fujistu.com>
> ---
> diff --git a/deprecated.c b/deprecated.c
> index 6bf42dd..94954a5 100644
> --- a/deprecated.c
> +++ b/deprecated.c
> @@ -257,10 +257,6 @@ int audit_rule_fieldpair(struct audit_rule *rule, const char *pair, int flags)
> if (isdigit((char)*(v)))
> rule->values[rule->field_count] =
> strtol(v, NULL, 0);
> - else if (vlen >= 2 && *(v)=='-' &&
> - (isdigit((char)*(v+1))))
> - rule->values[rule->field_count] =
> - strtol(v, NULL, 0);
> else {
> if (name_to_uid(v,
> &rule->values[rule->field_count])) {
> diff --git a/libaudit.c b/libaudit.c
> index 7d48d78..85adbc5 100644
> --- a/libaudit.c
> +++ b/libaudit.c
> @@ -850,10 +850,6 @@ int audit_rule_fieldpair_data(struct audit_rule_data **rulep, const char *pair,
> if (isdigit((char)*(v)))
> rule->values[rule->field_count] =
> strtol(v, NULL, 0);
> - else if (vlen >= 2 && *(v)=='-' &&
> - (isdigit((char)*(v+1))))
> - rule->values[rule->field_count] =
> - strtol(v, NULL, 0);
> else {
> if (audit_name_to_uid(v,
> &rule->values[rule->field_count])) {
>
> --
> Linux-audit mailing list
> Linux-audit@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-audit
next prev parent reply other threads:[~2008-08-08 13:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-08 10:09 [PATCH] Uids should not be allowed to set to negative Cai Xianchao
2008-08-08 13:25 ` Eric Paris [this message]
2008-08-08 13:53 ` Steve Grubb
2008-08-08 13:45 ` Steve Grubb
2008-08-12 19:36 ` 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=1218201909.5837.226.camel@localhost.localdomain \
--to=eparis@redhat.com \
--cc=caixianchao@cn.fujitsu.com \
--cc=graphics@cn.fujitsu.com \
--cc=linux-audit@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