diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-03-16 11:23:30 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-03-16 11:23:58 -0700 |
commit | afc752d1c483e77de9aa3cb9532a67d95fd27dd9 (patch) | |
tree | ef716d1771969f26e101102b67a43451b0250774 | |
parent | 0f18bdfa7fcfe100e487f4c9f91ae37a125ef0f0 (diff) |
Make sure username is not NULL when calling syslog from FailedLogin()
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | greeter/greet.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/greeter/greet.c b/greeter/greet.c index 7f235ef..1afe2f1 100644 --- a/greeter/greet.c +++ b/greeter/greet.c @@ -410,9 +410,14 @@ static void FailedLogin (struct display *d, struct greet_info *greet) { #ifdef USE_SYSLOG + const char *username = greet->name; + + if (username == NULL) + username = "username unavailable"; + syslog(LOG_AUTHPRIV|LOG_NOTICE, "LOGIN FAILURE ON %s, %s", - d->name, greet->name); + d->name, username); #endif DrawFail (login); #ifndef USE_PAM |