All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cai Xianchao <caixianchao@cn.fujitsu.com>
To: sgrubb@redhat.com, Linux Audit <linux-audit@redhat.com>
Subject: [PATCH] Error message is not appropriate when try to set gid to negative
Date: Fri, 08 Aug 2008 12:03:24 +0800	[thread overview]
Message-ID: <489BC58C.2060208@cn.fujitsu.com> (raw)

Hello Steve,

The error message is not appropriate when I try to set gid to
negative. the value of "Unknown group:" should be the gid rather
than "gid". There is the same problem in uids.

I did as fallows:
#auditctl -a exit,always -F gid=-1
Unknown group: gid
-F unknown field: gid=-1

Signed-off-by: Cai Xianchao <caixianchao@cn.fujistu.com>
---
diff --git a/deprecated.c b/deprecated.c
index e05e826..2d32ad3 100644
--- a/deprecated.c
+++ b/deprecated.c
@@ -259,7 +259,7 @@ int audit_rule_fieldpair(struct audit_rule *rule,
const char *pair, int flags)
                                if (name_to_uid(v,
                                        &rule->values[rule->field_count])) {
                                        audit_msg(LOG_ERR, "Unknown
user: %s",
-                                               pair);
+                                               v);
                                        return -2;
                                }
                        }
@@ -275,7 +275,7 @@ int audit_rule_fieldpair(struct audit_rule *rule,
const char *pair, int flags)
                                if (name_to_gid(v,
                                        &rule->values[rule->field_count])) {
                                        audit_msg(LOG_ERR, "Unknown
group: %s",
-                                               pair);
+                                               v);
                                        return -2;
                                }
                        }
diff --git a/libaudit.c b/libaudit.c
index 4bedfaf..37e96e5 100644
--- a/libaudit.c
+++ b/libaudit.c
@@ -851,7 +851,7 @@ int audit_rule_fieldpair_data(struct audit_rule_data
**rulep, const char *pair,
                                if (audit_name_to_uid(v,
                                        &rule->values[rule->field_count])) {
                                        audit_msg(LOG_ERR, "Unknown
user: %s",
-                                               pair);
+                                               v);
                                        return -2;
                                }
                        }
@@ -867,7 +867,7 @@ int audit_rule_fieldpair_data(struct audit_rule_data
**rulep, const char *pair,
                                if (audit_name_to_gid(v,
                                        &rule->values[rule->field_count])) {
                                        audit_msg(LOG_ERR, "Unknown
group: %s",
-                                               pair);
+                                               v);
                                        return -2;
                                }
                        }

             reply	other threads:[~2008-08-08  4:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  4:03 Cai Xianchao [this message]
2008-08-08 13:42 ` [PATCH] Error message is not appropriate when try to set gid to negative 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=489BC58C.2060208@cn.fujitsu.com \
    --to=caixianchao@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.