Skip to contentSkip to conversation

Error message is not appropriate when try to set gid to negative

PATCH In review Cai Xianchao 2 participants 2 messages Aug 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Error message is not appropriate when try to set gid to negative

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

---

deprecated.c +0 -0
index e05e826..2d32ad3 100644
@@ -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;
                                }
                        }
libaudit.c +0 -0
index 4bedfaf..37e96e5 100644
@@ -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;
                                }
                        }
#1 lore raw
Quoted 3 lines · On Friday 08 August 2008 00:03:24 Cai Xianchao wrote:

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.

OK, I tried to apply the patch and got:

patching file deprecated.c
patch: **** malformed patch at line 6: const char *pair, int flags)

I eventually did the edits by hand since they were simple. Watch the word wrapping. :)

Thanks for the patch !

-Steve