1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

Fix broken get_fqhostname() logic. Without that fix mail/mutt-devel

compiled with WITH_MUTT_CYRUS_SASL2 option is not able to
connect to IMAPS mailbox.

PR:		161890
Submitted by:	novel (myself)
Approved by:	maintainer timeout (more than 4 months)
Obtained from:	https://bugzilla.cyrusimap.org/show_bug.cgi?id=3589
Feature safe:	yes
This commit is contained in:
Roman Bogorodskiy 2012-03-19 17:08:16 +00:00
parent b0dbf98576
commit f2a5ffc75c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=293573
2 changed files with 60 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= cyrus-sasl
PORTVERSION= 2.1.25
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security ipv6
MASTER_SITES= ftp://ftp.cyrusimap.org/cyrus-sasl/

View File

@ -0,0 +1,59 @@
--- lib/saslutil.c.orig 2011-10-21 13:59:59.354462366 +0200
+++ lib/saslutil.c 2011-10-21 14:10:55.849675881 +0200
@@ -555,32 +555,44 @@
NULL, /* don't care abour service/port */
&hints,
&result) != 0) {
- /* errno on Unix, WSASetLastError on Windows are already done by the function */
- return (-1);
+ if (abort_if_no_fqdn) {
+ /* errno on Unix, WSASetLastError on Windows are already done by the function */
+ return (-1);
+ } else {
+ goto LOWERCASE;
+ }
}
- if (abort_if_no_fqdn && (result == NULL || result->ai_canonname == NULL)) {
+ if (result == NULL || result->ai_canonname == NULL) {
freeaddrinfo (result);
+ if (abort_if_no_fqdn) {
#ifdef WIN32
- WSASetLastError (WSANO_DATA);
+ WSASetLastError (WSANO_DATA);
#elif defined(ENODATA)
- errno = ENODATA;
+ errno = ENODATA;
#elif defined(EADDRNOTAVAIL)
- errno = EADDRNOTAVAIL;
+ errno = EADDRNOTAVAIL;
#endif
- return (-1);
+ return (-1);
+ } else {
+ goto LOWERCASE;
+ }
}
- if (abort_if_no_fqdn && strchr (result->ai_canonname, '.') == NULL) {
+ if (strchr (result->ai_canonname, '.') == NULL) {
freeaddrinfo (result);
+ if (abort_if_no_fqdn) {
#ifdef WIN32
- WSASetLastError (WSANO_DATA);
+ WSASetLastError (WSANO_DATA);
#elif defined(ENODATA)
- errno = ENODATA;
+ errno = ENODATA;
#elif defined(EADDRNOTAVAIL)
- errno = EADDRNOTAVAIL;
+ errno = EADDRNOTAVAIL;
#endif
- return (-1);
+ return (-1);
+ } else {
+ goto LOWERCASE;
+ }
}