]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Log when non-root ksu authorization fails 776/head
authorRobbie Harwood <rharwood@redhat.com>
Mon, 7 May 2018 20:42:59 +0000 (16:42 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 31 May 2018 22:21:09 +0000 (18:21 -0400)
If non-root user attempts to ksu but is denied by policy, log to
syslog at LOG_WARNING in keeping with other failure messages.

ticket: 8270

src/clients/ksu/main.c

index 30f6db771608a9f116d1e020e1745ff6fd3abbbf..6fa74a536abf1f41572a992114f3e610efb187f3 100644 (file)
@@ -414,6 +414,16 @@ main (argc, argv)
     if (hp){
         if (gb_err) fprintf(stderr, "%s", gb_err);
         fprintf(stderr, _("account %s: authorization failed\n"), target_user);
+
+        if (cmd != NULL) {
+            syslog(LOG_WARNING,
+                   "Account %s: authorization for %s for execution of %s failed",
+                   target_user, source_user, cmd);
+        } else {
+            syslog(LOG_WARNING, "Account %s: authorization of %s failed",
+                   target_user, source_user);
+        }
+
         exit(1);
     }