diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-03-15 18:12:05 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2010-03-15 18:20:04 -0700 |
commit | af916ebc97a3bd6208f1376e52a4310099b48622 (patch) | |
tree | fa89dfeb1acdb51e22c6a53e490bfbf1e756a4d8 | |
parent | dd9dc06055e16cd72ff34c2caea22a6627803fa5 (diff) |
echo_passwd should key off PAM no-echo state, not prompt position
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | greeter/Login.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/greeter/Login.c b/greeter/Login.c index 60c21e9..86e3d44 100644 --- a/greeter/Login.c +++ b/greeter/Login.c @@ -359,7 +359,7 @@ realizeValue (LoginWidget w, int cursor, int promptNum, GC gc) XDM_ASSERT(promptNum >= 0 && promptNum <= LAST_PROMPT); /* replace all password characters with asterisks */ - if ((promptNum == LOGIN_PROMPT_PASSWORD) && (w->login.echo_passwd == True)) + if ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True)) { Cardinal length = strlen(text); Cardinal i = 0; @@ -404,7 +404,7 @@ realizeValue (LoginWidget w, int cursor, int promptNum, GC gc) width - curoff, height); } } else if ((state == LOGIN_PROMPT_ECHO_ON) || (state == LOGIN_TEXT_INFO) || - ((promptNum == LOGIN_PROMPT_PASSWORD) && (w->login.echo_passwd == True))) + ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True))) { int textwidth; int offset = max(cursor, VALUE_SHOW_START(w, promptNum)); @@ -439,7 +439,7 @@ realizeValue (LoginWidget w, int cursor, int promptNum, GC gc) } } /* free memory */ - if ((promptNum == LOGIN_PROMPT_PASSWORD) && (w->login.echo_passwd == True)) + if ((state == LOGIN_PROMPT_ECHO_OFF) && (w->login.echo_passwd == True)) { XtFree(text); } @@ -491,7 +491,7 @@ realizeCursor (LoginWidget w, GC gc) } break; case LOGIN_PROMPT_ECHO_OFF: - if ((w->login.activePrompt == LOGIN_PROMPT_PASSWORD) && (w->login.echo_passwd == True)) { + if (w->login.echo_passwd == True) { int len = PROMPT_CURSOR(w, w->login.activePrompt) - VALUE_SHOW_START(w, w->login.activePrompt); |