summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2010-01-12 14:38:33 +0000
committerAlan Coopersmith <alan.coopersmith@sun.com>2010-01-12 13:28:30 -0800
commit504bb1aee60d570d8676a61acbe32c66d6069c45 (patch)
treea76b508638b384de90632358087723fce655db32
parent7d8b4c16d9307f9fa984da7ac5cc00cb945cac09 (diff)
greeter: fix logging of failed login attempts
When PAM rejects a login attempt, the "username" variable remains uninitialized, which results to garbage being syslogged instead of login name. Explicit initialization helps to avoid this issue. Fixes FreeDesktop Bug #26015 <https://bugs.freedesktop.org/show_bug.cgi?id=26015> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--greeter/greet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/greeter/greet.c b/greeter/greet.c
index 61c7a52..f4c972b 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -500,7 +500,7 @@ greet_user_rtn GreetUser(
struct myconv_data pcd = { d, greet, NULL };
struct pam_conv pc = { pamconv, &pcd };
const char * pam_fname;
- char * username;
+ char * username = NULL;
const char * login_prompt;