summaryrefslogtreecommitdiff
path: root/src/nologin.c
diff options
context:
space:
mode:
authorBalint Reczey <balint.reczey@canonical.com>2019-06-23 22:06:37 +0200
committerBalint Reczey <balint.reczey@canonical.com>2019-06-23 22:06:37 +0200
commitb28d45d2bd2462414b9dbbe38e6c7f3d5f7b462b (patch)
tree4b068e3513ef5c60228cddfcda72be0a31d09b14 /src/nologin.c
parentb0729855e8fb744192a0395ea24673557818172c (diff)
downloadshadow-b28d45d2bd2462414b9dbbe38e6c7f3d5f7b462b.tar.gz
New upstream version 4.7upstream/4.7
Diffstat (limited to 'src/nologin.c')
-rw-r--r--src/nologin.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nologin.c b/src/nologin.c
index 7fe8a6a2..98989d26 100644
--- a/src/nologin.c
+++ b/src/nologin.c
@@ -24,7 +24,6 @@
* SUCH DAMAGE.
*/
-#include <config.h>
#ident "$Id$"
@@ -36,6 +35,7 @@
int main (void)
{
const char *user, *tty;
+ uid_t uid;
tty = ttyname (0);
if (NULL == tty) {
@@ -45,8 +45,9 @@ int main (void)
if (NULL == user) {
user = "UNKNOWN";
}
+ uid = getuid (); /* getuid() is always successful */
openlog ("nologin", LOG_CONS, LOG_AUTH);
- syslog (LOG_CRIT, "Attempted login by %s on %s", user, tty);
+ syslog (LOG_CRIT, "Attempted login by %s (UID: %d) on %s", user, uid, tty);
closelog ();
printf ("%s", "This account is currently not available.\n");