1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

Support imap passwords with strange characters (sf.net #3402448)

conky now sends the password using the length + string format, which should not need any quoting
of special characters. Hopefully, we won't find a server which does not support this encoding.

bug reported by Brent
This commit is contained in:
Pavel Labath 2011-09-16 21:56:05 +02:00
parent 9943ad2700
commit e6088bcfe2

View File

@ -745,11 +745,14 @@ static void *imap_thread(void *arg)
has_idle = 1; has_idle = 1;
} }
strncpy(sendbuf, "a1 login ", MAXDATASIZE); snprintf(sendbuf, sizeof sendbuf, "a1 login %s {%d}\r\n",
strncat(sendbuf, mail->user, MAXDATASIZE - strlen(sendbuf) - 1); mail->user, strlen(mail->pass));
strncat(sendbuf, " ", MAXDATASIZE - strlen(sendbuf) - 1); if (imap_command(sockfd, sendbuf, recvbuf, "+ OK")) {
strncat(sendbuf, mail->pass, MAXDATASIZE - strlen(sendbuf) - 1); fail++;
strncat(sendbuf, "\r\n", MAXDATASIZE - strlen(sendbuf) - 1); break;
}
snprintf(sendbuf, sizeof sendbuf, "%s\r\n", mail->pass);
if (imap_command(sockfd, sendbuf, recvbuf, "a1 OK")) { if (imap_command(sockfd, sendbuf, recvbuf, "a1 OK")) {
fail++; fail++;
break; break;