* src/groupadd.c: The ID argument of audit_logger is an unsigned

int. Use AUDIT_NO_ID instead of -1.
	* src/groupadd.c: Cast the parsed GID/UID to a gid_t/uid_t.
This commit is contained in:
nekral-guest 2008-06-13 21:19:07 +00:00
parent a70898fc28
commit 42a4604461
2 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
* src/groupadd.c: The ID argument of audit_logger is an unsigned
int. Use AUDIT_NO_ID instead of -1.
* src/groupadd.c: Cast the parsed GID/UID to a gid_t/uid_t.
2008-06-13 Nicolas François <nicolas.francois@centraliens.net> 2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
* src/pwck.c: Use a %lu format and cast group and user IDs to * src/pwck.c: Use a %lu format and cast group and user IDs to

View File

@ -205,8 +205,9 @@ static void grp_update (void)
} }
#endif /* SHADOWGRP */ #endif /* SHADOWGRP */
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", group_name, audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
group_id, 1); "adding group",
group_name, (unsigned int) group_id, 1);
#endif #endif
SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u",
group_name, (unsigned int) group_id)); group_name, (unsigned int) group_id));
@ -269,16 +270,18 @@ static void open_files (void)
if (gr_lock () == 0) { if (gr_lock () == 0) {
fprintf (stderr, _("%s: unable to lock group file\n"), Prog); fprintf (stderr, _("%s: unable to lock group file\n"), Prog);
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "locking group file", audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
group_name, -1, 0); "locking group file",
group_name, AUDIT_NO_ID, 0);
#endif #endif
exit (E_GRP_UPDATE); exit (E_GRP_UPDATE);
} }
if (gr_open (O_RDWR) == 0) { if (gr_open (O_RDWR) == 0) {
fprintf (stderr, _("%s: unable to open group file\n"), Prog); fprintf (stderr, _("%s: unable to open group file\n"), Prog);
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "opening group file", audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
group_name, -1, 0); "opening group file",
group_name, AUDIT_NO_ID, 0);
#endif #endif
fail_exit (E_GRP_UPDATE); fail_exit (E_GRP_UPDATE);
} }
@ -310,8 +313,9 @@ static void fail_exit (int code)
#ifdef WITH_AUDIT #ifdef WITH_AUDIT
if (code != E_SUCCESS) { if (code != E_SUCCESS) {
audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", audit_logger (AUDIT_USER_CHAUTHTOK, Prog,
group_name, -1, 0); "adding group",
group_name, AUDIT_NO_ID, 0);
} }
#endif #endif
@ -340,7 +344,7 @@ static gid_t get_gid (const char *gidstr)
Prog, gidstr); Prog, gidstr);
exit (E_BAD_ARG); exit (E_BAD_ARG);
} }
return val; return (gid_t) val;
} }
/* /*