diff --git a/Fix-abort_if_no_fqdn-behavior.patch b/Fix-abort_if_no_fqdn-behavior.patch new file mode 100644 index 0000000..812ca43 --- /dev/null +++ b/Fix-abort_if_no_fqdn-behavior.patch @@ -0,0 +1,74 @@ +commit 8fc14fd702897e652a38384af2f55e51752e8c15 +Author: Alexey Melnikov +Date: Tue May 29 16:00:47 2012 +0100 + + get_fqhostname() function has broken logic when abort_if_no_fqdn is 0 + + When abort_if_no_fqdn is 0, a getaddrinfo failure should be ignored, + as long as gethostname() succeeded. + + Cyrus SASL Bug # 3589 + + Patch by baggins@pld-linux.org + +diff --git a/lib/saslutil.c b/lib/saslutil.c +index fc5b774..6174124 100644 +--- a/lib/saslutil.c ++++ b/lib/saslutil.c +@@ -557,32 +557,44 @@ int get_fqhostname( + 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; ++ } + } + + diff --git a/cyrus-sasl-saslauthd.changes b/cyrus-sasl-saslauthd.changes index 50f701e..b4c6edc 100644 --- a/cyrus-sasl-saslauthd.changes +++ b/cyrus-sasl-saslauthd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 13 07:55:11 UTC 2012 - rhafer@suse.de + +- Include fix for Cyrus SASL Bug#3589: When abort_if_no_fqdn is 0, + a getaddrinfo failure should be ignored, as long as gethostname() + succeeded. (bnc#771983) + ------------------------------------------------------------------- Wed May 9 21:47:48 UTC 2012 - crrodriguez@opensuse.org diff --git a/cyrus-sasl-saslauthd.spec b/cyrus-sasl-saslauthd.spec index 3bd361d..7851de9 100644 --- a/cyrus-sasl-saslauthd.spec +++ b/cyrus-sasl-saslauthd.spec @@ -42,6 +42,7 @@ Patch3: cyrus-sasl-gs2-not-overwrite-minor-error-code.dif Patch4: gssapi-null-deref.dif Patch5: cyrus-sasl-no_rpath.patch Patch6: cyrus-sasl-lfs.patch +Patch7: Fix-abort_if_no_fqdn-behavior.patch PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -75,6 +76,7 @@ The SQL auxprop plugin supports PostgreSQL and MySQL %patch4 -p1 %patch5 -p1 %patch6 +%patch7 -p1 %build find . -name \*.cvsignore -print0 | xargs -0 rm -vf autoreconf -f -i diff --git a/cyrus-sasl.changes b/cyrus-sasl.changes index 50f701e..b4c6edc 100644 --- a/cyrus-sasl.changes +++ b/cyrus-sasl.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 13 07:55:11 UTC 2012 - rhafer@suse.de + +- Include fix for Cyrus SASL Bug#3589: When abort_if_no_fqdn is 0, + a getaddrinfo failure should be ignored, as long as gethostname() + succeeded. (bnc#771983) + ------------------------------------------------------------------- Wed May 9 21:47:48 UTC 2012 - crrodriguez@opensuse.org diff --git a/cyrus-sasl.spec b/cyrus-sasl.spec index 1262b43..8eb2727 100644 --- a/cyrus-sasl.spec +++ b/cyrus-sasl.spec @@ -45,6 +45,7 @@ Patch3: cyrus-sasl-gs2-not-overwrite-minor-error-code.dif Patch4: gssapi-null-deref.dif Patch5: cyrus-sasl-no_rpath.patch Patch6: cyrus-sasl-lfs.patch +Patch7: Fix-abort_if_no_fqdn-behavior.patch PreReq: %insserv_prereq %fillup_prereq BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -160,6 +161,7 @@ fi %patch4 -p1 %patch5 -p1 %patch6 +%patch7 -p1 %build find . -name \*.cvsignore -print0 | xargs -0 rm -fv autoreconf -f -i