From 9fa519c9838fce8cf2d1e7d8f022d6c74a7273d1 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sat, 20 Sep 2008 13:20:31 +0000 Subject: [PATCH] * src/login.c: Use failent_user to log to audit. username is the caller, not the user login tries to authenticate. * src/login.c: Use pwd->pw_name instead of pwd->pw_uid. This might be more precise (name must be unique, uid might not be). --- ChangeLog | 7 +++++++ src/login.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0614f0d3..15223d9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-20 Nicolas François + + * src/login.c: Use failent_user to log to audit. username is the + caller, not the user login tries to authenticate. + * src/login.c: Use pwd->pw_name instead of pwd->pw_uid. This might + be more precise (name must be unique, uid might not be). + 2008-09-20 Nicolas François * man/passwd.1.xml: passwd cannot change the full name of the diff --git a/src/login.c b/src/login.c index 73f6e066..e82ead10 100644 --- a/src/login.c +++ b/src/login.c @@ -752,8 +752,7 @@ int main (int argc, char **argv) AUDIT_USER_LOGIN, NULL, /* Prog. name */ "login", - (NULL!=username)?username - :"(unknown)", + failent_user, AUDIT_NO_ID, hostname, NULL, /* addr */ @@ -1045,8 +1044,8 @@ int main (int argc, char **argv) AUDIT_USER_LOGIN, NULL, /* Prog. name */ "login", - NULL, /* user's name => use uid */ - (unsigned int) pwd->pw_uid, + pwd->pw_name, + AUDIT_NO_ID, hostname, NULL, /* addr */ tty,