Commit b5fb83e5 authored by Ray Strode's avatar Ray Strode

manager: don't record wtmp entries when user unknown

Right now we end up writing wtmp entries for the login screen
user into /var/log/wtmp, but with a funky username of "(unknown)".

The login screen session shouldn't get a wtmp entry, and we
shouldn't ever add wtmp entries for sessions we don't know the username
for.

This commit fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=788784
parent 22f1e3c6
......@@ -677,6 +677,11 @@ add_session_record (GdmManager *manager,
display_device = NULL;
username = gdm_session_get_username (session);
if (username == NULL) {
goto out;
}
g_object_get (G_OBJECT (session),
"display-name", &display_name,
"display-hostname", &hostname,
......
......@@ -61,21 +61,8 @@
static void
record_set_username (UTMP *u,
const char *user_name)
const char *username)
{
const char *username;
/*
* It is possible that PAM failed before it mapped the user
* input into a valid username, so we fallback to try using
* "(unknown)"
*/
if (user_name != NULL) {
username = user_name;
} else {
username = "(unknown)";
}
#if defined(HAVE_UT_UT_USER)
strncpy (u->ut_user,
username,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment