xlockmore/xlockmore-pam.patch

50 lines
1.7 KiB
Diff
Raw Normal View History

This is more a hack than a correct fix.
Instead of hadcoded expecting of "Password" prompt as a first PAM query, just
expect that it asks for password (xlock hardcodes "Password" as a first query in
the GUI).
It will unbreak xlock with non-English locales, but it will still swallow the
first prompt from PAM. In most cases, it is just translated "Password" string,
but in some cases it can be a different question.
To fully fix the problem, GUI needs to be redone. Instead of hardcoded
"Password" prompt in the initial phase of authentication, get all prompts from
PAM.
Index: xlockmore-5.53/xlock/passwd.c
===================================================================
--- xlockmore-5.53.orig/xlock/passwd.c
+++ xlockmore-5.53/xlock/passwd.c
@@ -335,29 +335,19 @@ PAM_conv(int num_msg,
#ifdef DEBUG
(void) printf( " + Message style: PAM_PROMPT_ECHO_OFF\n" );
#endif
- if( strstr( msg[replies]->msg, "Password" ) == NULL ) {
- PAM_putText( msg[replies], &reply[replies], False );
- } else {
- reply[replies].resp = COPY_STRING(PAM_password);
- }
+ reply[replies].resp = COPY_STRING(PAM_password);
/* PAM frees resp */
break;
case PAM_TEXT_INFO:
#ifdef DEBUG
(void) printf( " + Message style: PAM_TEXT_INFO\n" );
#endif
- if( strstr( msg[replies]->msg, "Password" ) == NULL ) {
- PAM_putText( msg[replies], &reply[replies], False );
- }
/* PAM frees resp */
break;
case PAM_ERROR_MSG:
#ifdef DEBUG
(void) printf( " + Message style: PAM_ERROR_MSG\n" );
#endif
- if( strstr( msg[replies]->msg, "Password" ) == NULL ) {
- PAM_putText( msg[replies], &reply[replies], False );
- }
/* PAM frees resp */
break;
default: