Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > d700348dff5d2eede97121acef6e202d > files > 4

usermode-1.85-7mdv2007.1.src.rpm

Temporary fix. PAM is i18nized now, so the msg[count]->msg content can't be
compared with the fixed string "password". We could use a i18nized compare
string (fix all translations) or set locale to C for just the PAM call, if
that's possible at all.
--- usermode-1.85/userhelper.c.orig	2007-03-20 18:12:47.000000000 -0300
+++ usermode-1.85/userhelper.c	2007-03-20 18:16:58.000000000 -0300
@@ -588,18 +588,9 @@
 				expected_responses++;
 				break;
 			case PAM_PROMPT_ECHO_OFF:
-				/* If the prompt is for the user's password,
-				 * indicate the user's name if we can.
-				 * Otherwise, just output the prompt as-is. */
-				if ((strncasecmp(msg[count]->msg,
-						 "password",
-						 8) == 0)) {
-					noecho_message =
+				noecho_message =
 						g_strdup_printf(_("Password for %s"),
 								user);
-				} else {
-					noecho_message = g_strdup(msg[count]->msg);
-				}
 #ifdef DEBUG_USERHELPER
 				g_print("userhelper: sending prompt (no echo) ="
 					" \"%s\".\n", noecho_message);
@@ -850,13 +850,9 @@
 		messages[i] = g_malloc(sizeof(struct pam_message));
 		*(messages[i]) = *(msg[i]);
 		if (msg[i]->msg != NULL) {
-			if ((strncasecmp(msg[i]->msg, "password", 8) == 0)) {
-				messages[i]->msg =
-					g_strdup_printf(_("Password for %s: "),
-							user);
-			} else {
-				messages[i]->msg = g_strdup(_(msg[i]->msg));
-			}
+			messages[i]->msg =
+				g_strdup_printf(_("Password for %s: "),
+						user);
 		}
 	}