]> granicus.if.org Git - shadow/commitdiff
* src/newgrp.c: Add missing end of line in message.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 7 Mar 2008 20:21:15 +0000 (20:21 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 7 Mar 2008 20:21:15 +0000 (20:21 +0000)
* src/newgrp.c: Add audit events for the authentication
  (AUDIT_GRP_AUTH). Thansk to Peter Vrabec.

ChangeLog
src/newgrp.c

index 95ec9fd891739e8817bab62f8efede687768248b..5c82ab6890ed8ad3504ea16591f3cee07a6be327 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-07  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/newgrp.c: Add missing end of line in message.
+       * src/newgrp.c: Add audit events for the authentication
+       (AUDIT_GRP_AUTH). Thansk to Peter Vrabec.
+
 2008-03-05  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, src/faillog.c: Only reset the entries of existing users
index 7c87af20394c8c29161937007d6388fde7db02ad..bf94d8bdeed5d97de85412e0dd1cb7f4aaa4db5f 100644 (file)
@@ -165,6 +165,12 @@ static void check_perms (const struct group *grp,
 
                if (grp->gr_passwd[0] == '\0' ||
                    strcmp (cpasswd, grp->gr_passwd) != 0) {
+#ifdef WITH_AUDIT
+                       snprintf (audit_buf, sizeof(audit_buf),
+                                 "authentication new-gid=%d", grp->gr_gid);
+                       audit_logger (AUDIT_GRP_AUTH, Prog,
+                                     audit_buf, NULL, getuid (), 0);
+#endif
                        SYSLOG ((LOG_INFO,
                                 "Invalid password for group `%s' from `%s'",
                                 groupname, pwd->pw_name));
@@ -172,6 +178,12 @@ static void check_perms (const struct group *grp,
                        fputs (_("Invalid password.\n"), stderr);
                        goto failure;
                }
+#ifdef WITH_AUDIT
+               snprintf (audit_buf, sizeof(audit_buf),
+                         "authentication new-gid=%d", grp->gr_gid);
+               audit_logger (AUDIT_GRP_AUTH, Prog,
+                             audit_buf, NULL, getuid (), 1);
+#endif
        }
 
        return;
@@ -250,7 +262,7 @@ static void syslog_sg (const char *name, const char *group)
                child = fork ();
                if (child < 0) {
                        /* error in fork() */
-                       fprintf (stderr, _("%s: failure forking: %s"),
+                       fprintf (stderr, _("%s: failure forking: %s\n"),
                                 is_newgrp ? "newgrp" : "sg", strerror (errno));
 #ifdef WITH_AUDIT
                        if (group) {