From: nekral-guest Date: Fri, 7 Mar 2008 20:21:15 +0000 (+0000) Subject: * src/newgrp.c: Add missing end of line in message. X-Git-Tag: 4.1.1~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b2618d688d81c083913ec3bea6f47b1af2bf90b;p=shadow * 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. --- diff --git a/ChangeLog b/ChangeLog index 95ec9fd8..5c82ab68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-03-07 Nicolas François + + * 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 * NEWS, src/faillog.c: Only reset the entries of existing users diff --git a/src/newgrp.c b/src/newgrp.c index 7c87af20..bf94d8bd 100644 --- a/src/newgrp.c +++ b/src/newgrp.c @@ -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) {