diff options
author | George Lebl <jirka@5z.com> | 2004-05-06 22:18:39 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2004-05-06 22:18:39 +0000 |
commit | 57d112f7acd4a71efb778e2b44672f7657c74788 (patch) | |
tree | 593e61f073a58b0c14b387d228946dc1319e8931 | |
parent | 636909afe52850e6866d4b42aa136322196eb777 (diff) | |
download | gdm-57d112f7acd4a71efb778e2b44672f7657c74788.tar.gz |
attempt to fix #126984 and possibly others where pam asks for the username
Thu May 06 15:18:07 2004 George Lebl <jirka@5z.com>
* daemon/verify-pam.c: attempt to fix #126984 and possibly others
where pam asks for the username AGAIN even though we gave it
a username. PAM is on crack. Just attempt to detect it and
give it the username without asking the user for it.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | daemon/verify-pam.c | 28 |
2 files changed, 25 insertions, 10 deletions
@@ -1,3 +1,10 @@ +Thu May 06 15:18:07 2004 George Lebl <jirka@5z.com> + + * daemon/verify-pam.c: attempt to fix #126984 and possibly others + where pam asks for the username AGAIN even though we gave it + a username. PAM is on crack. Just attempt to detect it and + give it the username without asking the user for it. + Thu May 06 09:59:48 2004 George Lebl <jirka@5z.com> * gui/misc.[ch], gui/gdmlogin.c, gui/gdmsetup.c, diff --git a/daemon/verify-pam.c b/daemon/verify-pam.c index e2937f98..7c21d1fa 100644 --- a/daemon/verify-pam.c +++ b/daemon/verify-pam.c @@ -168,16 +168,24 @@ gdm_verify_pam_conv (int num_msg, const struct pam_message **msg, /* PAM requested textual input with echo on */ case PAM_PROMPT_ECHO_ON: if (strcmp(m, _("Username:")) == 0) { - /* this is an evil hack, but really there is no way we'll - know this is a username prompt. However we SHOULD NOT - rely on this working. The pam modules can set their - prompt to whatever they wish to */ - gdm_slave_greeter_ctl_no_ret - (GDM_MSG, _("Please enter your username")); - s = gdm_slave_greeter_ctl (GDM_PROMPT, m); - /* this will clear the message */ - gdm_slave_greeter_ctl_no_ret (GDM_MSG, ""); - islogin = TRUE; + if ( ! ve_string_empty (selected_user)) { + /* Sometimes we are just completely on crack, + and pam asks for the username even if we + already gave it. PAM is on better crack, + then I can afford. */ + s = g_strdup (selected_user); + } else { + /* this is an evil hack, but really there is no way we'll + know this is a username prompt. However we SHOULD NOT + rely on this working. The pam modules can set their + prompt to whatever they wish to */ + gdm_slave_greeter_ctl_no_ret + (GDM_MSG, _("Please enter your username")); + s = gdm_slave_greeter_ctl (GDM_PROMPT, m); + /* this will clear the message */ + gdm_slave_greeter_ctl_no_ret (GDM_MSG, ""); + islogin = TRUE; + } } else { s = gdm_slave_greeter_ctl (GDM_PROMPT, m); } |