]> granicus.if.org Git - shadow/commitdiff
* src/groupadd.c: The ID argument of audit_logger is an unsigned
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:19:07 +0000 (21:19 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 13 Jun 2008 21:19:07 +0000 (21:19 +0000)
int. Use AUDIT_NO_ID instead of -1.
* src/groupadd.c: Cast the parsed GID/UID to a gid_t/uid_t.

ChangeLog
src/groupadd.c

index dd5bdcbe91826adeb00c5fa39010c17a6789c335..a14a516fcb0f5ca91341ffe1e88b7f693f01c9ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * src/pwck.c: Use a %lu format and cast group and user IDs to
index 5f2fcdd1f128a9db072dfa741a314d57d4dd0c82..beb3cf97ae093f307dcd342641652a87ea147ec9 100644 (file)
@@ -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;
 }
 
 /*