Merge pull request #2755 from alarcher/libxfont2
[unleashed-userland.git] / components / gftp / patches / 06-g11n-ssh-login.patch
blob74753710ed6a21f492f7638d35914fb421f59d80
1 --- gftp-2.0.19/lib/sshv2.c.orig 2008-01-25 08:28:32.000000000 +0900
2 +++ gftp-2.0.19/lib/sshv2.c 2008-12-09 14:32:52.172140155 +0900
3 @@ -379,6 +379,7 @@ sshv2_start_login_sequence (gftp_request
4 N_("Enter passphrase for key '"),
5 N_("Password"),
6 N_("password"),
7 + N_("Password: "),
8 NULL};
9 char *tempstr, *temp1str, *pwstr, *yesstr = "yes\n", *securid_pass;
10 int wrotepw, ok, maxfd, ret, clear_tempstr, pwidx;
11 @@ -463,15 +464,26 @@ sshv2_start_login_sequence (gftp_request
12 continue;
14 tempstr[diff + rd] = '\0';
15 - request->logging_function (gftp_logging_recv, request, "%s", tempstr + diff);
16 + temp1str = g_locale_to_utf8 (tempstr + diff, -1, NULL, NULL, NULL);
17 + if (temp1str == NULL)
18 + temp1str = g_strdup (tempstr);
19 + request->logging_function (gftp_logging_recv, request, "%s", temp1str);
20 + g_free (temp1str);
21 rem -= rd;
22 diff += rd;
24 + temp1str = g_locale_to_utf8 (tempstr, -1, NULL, NULL, NULL);
25 + if (temp1str == NULL)
26 + temp1str = g_strdup (tempstr);
28 /* See if we are at the enter password prompt... */
29 for (pwidx = 0; pwstrs[pwidx] != NULL; pwidx++)
31 - if (strstr (tempstr, pwstrs[pwidx]) != NULL ||
32 - strstr (tempstr, _(pwstrs[pwidx])) != NULL)
33 + if (strstr (temp1str, pwstrs[pwidx]) != NULL ||
34 +#ifdef __sun
35 + strstr (tempstr, dgettext ("SUNW_OST_SYSOSPAM", pwstrs[pwidx])) != NULL ||
36 +#endif
37 + strstr (temp1str, _(pwstrs[pwidx])) != NULL)
38 break;
41 @@ -482,6 +494,7 @@ sshv2_start_login_sequence (gftp_request
42 if (wrotepw)
44 ok = SSH_ERROR_BADPASS;
45 + g_free (temp1str);
46 break;
49 @@ -489,6 +502,7 @@ sshv2_start_login_sequence (gftp_request
50 if (gftp_fd_write (request, pwstr, strlen (pwstr), ptymfd) < 0)
52 ok = 0;
53 + g_free (temp1str);
54 break;
57 @@ -496,13 +510,15 @@ sshv2_start_login_sequence (gftp_request
58 strstr (tempstr, _("(yes/no)?")) != NULL)
60 clear_tempstr = 1;
61 - if (!gftpui_protocol_ask_yes_no (request, request->hostname, tempstr))
62 + if (!gftpui_protocol_ask_yes_no (request, request->hostname, temp1str))
64 ok = SSH_ERROR_QUESTION;
65 + g_free (temp1str);
66 break;
68 else
70 + g_free (temp1str);
71 if (gftp_fd_write (request, yesstr, strlen (yesstr), ptymfd) < 0)
73 ok = 0;
74 @@ -521,9 +537,11 @@ sshv2_start_login_sequence (gftp_request
75 if (securid_pass == NULL || *securid_pass == '\0')
77 ok = SSH_ERROR_BADPASS;
78 + g_free (temp1str);
79 break;
82 + g_free (temp1str);
83 temp1str = g_strconcat (securid_pass, "\n", NULL);
85 ret = gftp_fd_write (request, temp1str, strlen (temp1str), ptymfd);
86 @@ -543,6 +561,7 @@ sshv2_start_login_sequence (gftp_request
88 len += SSH_LOGIN_BUFSIZE;
89 rem += SSH_LOGIN_BUFSIZE;
90 + g_free (temp1str);
91 tempstr = g_realloc (tempstr, len);
92 continue;