diff --git a/ChangeLog b/ChangeLog index dd5bdcbe..a14a516f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-13 Nicolas François + + * 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 * src/pwck.c: Use a %lu format and cast group and user IDs to diff --git a/src/groupadd.c b/src/groupadd.c index 5f2fcdd1..beb3cf97 100644 --- a/src/groupadd.c +++ b/src/groupadd.c @@ -205,8 +205,9 @@ static void grp_update (void) } #endif /* SHADOWGRP */ #ifdef WITH_AUDIT - audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", group_name, - group_id, 1); + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding group", + group_name, (unsigned int) group_id, 1); #endif SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", group_name, (unsigned int) group_id)); @@ -269,16 +270,18 @@ static void open_files (void) if (gr_lock () == 0) { fprintf (stderr, _("%s: unable to lock group file\n"), Prog); #ifdef WITH_AUDIT - audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "locking group file", - group_name, -1, 0); + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "locking group file", + group_name, AUDIT_NO_ID, 0); #endif exit (E_GRP_UPDATE); } if (gr_open (O_RDWR) == 0) { fprintf (stderr, _("%s: unable to open group file\n"), Prog); #ifdef WITH_AUDIT - audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "opening group file", - group_name, -1, 0); + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "opening group file", + group_name, AUDIT_NO_ID, 0); #endif fail_exit (E_GRP_UPDATE); } @@ -310,8 +313,9 @@ static void fail_exit (int code) #ifdef WITH_AUDIT if (code != E_SUCCESS) { - audit_logger (AUDIT_USER_CHAUTHTOK, Prog, "adding group", - group_name, -1, 0); + audit_logger (AUDIT_USER_CHAUTHTOK, Prog, + "adding group", + group_name, AUDIT_NO_ID, 0); } #endif @@ -340,7 +344,7 @@ static gid_t get_gid (const char *gidstr) Prog, gidstr); exit (E_BAD_ARG); } - return val; + return (gid_t) val; } /*