summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2004-05-06 22:18:39 +0000
committerGeorge Lebl <jirka@src.gnome.org>2004-05-06 22:18:39 +0000
commit57d112f7acd4a71efb778e2b44672f7657c74788 (patch)
tree593e61f073a58b0c14b387d228946dc1319e8931 /daemon
parent636909afe52850e6866d4b42aa136322196eb777 (diff)
downloadgdm-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.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/verify-pam.c28
1 files changed, 18 insertions, 10 deletions
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);
}