Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=bmf.git;a=commitdiff;h=ac376c11e36461eb0d14809321a6ebd2708be99b

commit ac376c11e36461eb0d14809321a6ebd2708be99b
Author: crazy <[email protected]>
Date:   Tue Dec 29 23:37:20 2015 +0100

cyrus-sasl-2.1.26-1-x86_64
* Version bump
* removed old patch
* added another round of fixes:
one big patch to fix the build system and compile errors
one follow up patch for the build system
an CVE fix
* depends()/makedepends()/subdepends() fixes
* some minor build() changes

diff --git a/source/network/cyrus-sasl/FrugalBuild 
b/source/network/cyrus-sasl/FrugalBuild
index f37961e..b42fec9 100644
--- a/source/network/cyrus-sasl/FrugalBuild
+++ b/source/network/cyrus-sasl/FrugalBuild
@@ -3,34 +3,43 @@
# Contributorr: Karoly CZOVEK <[email protected]>

pkgname=cyrus-sasl
-pkgver=2.1.25
-pkgrel=8
+pkgver=2.1.26
+pkgrel=1
pkgdesc="SASL Authentication mechanism"
url="https://cyrusimap.org/";
-depends=('openssl>=1.0.0' 'gdbm>=1.10' 'pam' 'systemd')
+depends=('openssl>=1.0.2-3' 'gdbm>=1.11-3' 'e2fsprogs>=1.42.13-4' 
'libkrb5>=1.14')
+makedepends=('postgresql>=9.4.5' 'krb5>=1.14' 'mysql>=5.5.47')
groups=('network' 'chroot-core')
archs=('i686' 'x86_64' 'arm')
source=(ftp://ftp.cyrusimap.org/$pkgname/$pkgname-$pkgver.tar.gz \
-       psql.patch saslauthd.service saslauthd \
-       README.Frugalware)
+       saslauthd.service saslauthd README.Frugalware \
+       cyrus-sasl-2.1.26-big-fix.patch \
+       cyrus-sasl-2.1.26-fix-2.patch \
+       cyrus-sasl-2.1.26-CVE-2013-4122.patch)
up2date="Flasttar ftp://ftp.cyrusimap.org/$pkgname/";
-sha1sums=('b6c34426012d9b5d448d5646cbecd818a5eeacbf' \
-          'b4eeaf03a4b672f3153e0b5ef2eec59802d0214d' \
+sha1sums=('d6669fb91434192529bd13ee95737a8a5040241c' \
'8867cae952e6b31d9bb2f4c2976a6f6bae4301e3' \
'5fa8a4fd427eafd732eb9f539e7a7eeab44f234f' \
-          'c0399d630d345237c7811b9fe6f5666c0ef818cf')
+          'c0399d630d345237c7811b9fe6f5666c0ef818cf' \
+          '8955e2d5617655be209b3681ff98baef22a93cc9' \
+          'ba3cc7b67a5911e271b907a5eba00bbb7d4741e9' \
+          '4a4ae789b93a822a78ec282264ac99e997256e2b')
+
+
+

subpkgs=("$pkgname-sql" "$pkgname-gssapiv2" "saslauthd")
subdescs=("$pkgname mysql, postgresql and sqlite plugin." "$pkgname gssapiv2 
plugin." \
"sasl authentication server")
-subdepends=('libmysqlclient libpq>=8.2 libstdc++' 'libkrb5' 'libkrb5')
+subdepends=('libmysqlclient>=5.5.47 libpq>=9.4.5 e2fsprogs>=1.42.13-4' 
'libkrb5>=1.14' 'libkrb5>=1.14 pam>=1.1.8-3')
subrodepends=("$pkgname=$pkgver" "$pkgname=$pkgver" "$pkgname=$pkgver")
-makedepends=('krb5' 'mysql>=5.1.45-2')
subgroups=('network' 'network' 'network')
subarchs=('i686 x86_64 arm' 'i686 x86_64 arm' 'i686 x86_64 arm')
subbackup=('' '' 'etc/sysconfig/saslauthd')
subinstall=('' '' 'saslauthd.install')

+
+
Fconfopts+="    --enable-login \
--enable-sql \
--enable-plain \
@@ -38,12 +47,23 @@ Fconfopts+="        --enable-login \
--with-saslauthd=/var/run/courier \
--with-pam \
--with-dblib=gdbm \
-                --with-gdbm=/usr"
+                --with-gdbm=/usr \
+               --with-pgsql=/usr/include"
+
+_F_conf_notry="disable-static"

build()
{
-       unset MAKEFLAGS
-       Fbuild
+       ## strange strange!
+       CFLAGS+=" -fno-strict-aliasing"
+       export MAKEFLAGS="-j1"
+
+       Fcd
+       Fpatchall
+       Fautoreconf
+       Fconf
+       make || Fdie
+       Fmakeinstall

Frm /usr/share/man/cat8

diff --git a/source/network/cyrus-sasl/cyrus-sasl-2.1.26-CVE-2013-4122.patch 
b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-CVE-2013-4122.patch
new file mode 100644
index 0000000..09c9ce8
--- /dev/null
+++ b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-CVE-2013-4122.patch
@@ -0,0 +1,116 @@
+From dedad73e5e7a75d01a5f3d5a6702ab8ccd2ff40d Mon Sep 17 00:00:00 2001
+From: mancha <[email protected]>
+Date: Thu, 11 Jul 2013 09:08:07 +0000
+Subject: Handle NULL returns from glibc 2.17+ crypt()
+
+Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL
+(w/ NULL return) if the salt violates specifications. Additionally,
+on FIPS-140 enabled Linux systems, DES/MD5-encrypted passwords
+passed to crypt() fail with EPERM (w/ NULL return).
+
+When using glibc's crypt(), check return value to avoid a possible
+NULL pointer dereference.
+
+Patch by [email protected].
+---
+diff --git a/pwcheck/pwcheck_getpwnam.c b/pwcheck/pwcheck_getpwnam.c
+index 4b34222..400289c 100644
+--- a/pwcheck/pwcheck_getpwnam.c
++++ b/pwcheck/pwcheck_getpwnam.c
+@@ -32,6 +32,7 @@ char *userid;
+ char *password;
+ {
+     char* r;
++    char* crpt_passwd;
+     struct passwd *pwd;
+
+     pwd = getpwnam(userid);
+@@ -41,7 +42,7 @@ char *password;
+     else if (pwd->pw_passwd[0] == '*') {
+       r = "Account disabled";
+     }
+-    else if (strcmp(pwd->pw_passwd, crypt(password, pwd->pw_passwd)) != 0) {
++    else if (!(crpt_passwd = crypt(password, pwd->pw_passwd)) || 
strcmp(pwd->pw_passwd, (const char *)crpt_passwd) != 0) {
+       r = "Incorrect password";
+     }
+     else {
+diff --git a/pwcheck/pwcheck_getspnam.c b/pwcheck/pwcheck_getspnam.c
+index 2b11286..6d607bb 100644
+--- a/pwcheck/pwcheck_getspnam.c
++++ b/pwcheck/pwcheck_getspnam.c
+@@ -32,13 +32,15 @@ char *userid;
+ char *password;
+ {
+     struct spwd *pwd;
++    char *crpt_passwd;
+
+     pwd = getspnam(userid);
+     if (!pwd) {
+       return "Userid not found";
+     }
+
+-    if (strcmp(pwd->sp_pwdp, crypt(password, pwd->sp_pwdp)) != 0) {
++    crpt_passwd = crypt(password, pwd->sp_pwdp);
++    if (!crpt_passwd || strcmp(pwd->sp_pwdp, (const char *)crpt_passwd) != 0) 
{
+       return "Incorrect password";
+     }
+     else {
+diff --git a/saslauthd/auth_getpwent.c b/saslauthd/auth_getpwent.c
+index fc8029d..d4ebe54 100644
+--- a/saslauthd/auth_getpwent.c
++++ b/saslauthd/auth_getpwent.c
+@@ -77,6 +77,7 @@ auth_getpwent (
+ {
+     /* VARIABLES */
+     struct passwd *pw;                        /* pointer to passwd file entry 
*/
++    char *crpt_passwd;                        /* encrypted password */
+     int errnum;
+     /* END VARIABLES */
+
+@@ -105,7 +106,8 @@ auth_getpwent (
+       }
+     }
+
+-    if (strcmp(pw->pw_passwd, (const char *)crypt(password, pw->pw_passwd))) {
++    crpt_passwd = crypt(password, pw->pw_passwd);
++    if (!crpt_passwd || strcmp(pw->pw_passwd, (const char *)crpt_passwd)) {
+       if (flags & VERBOSE) {
+           syslog(LOG_DEBUG, "DEBUG: auth_getpwent: %s: invalid password", 
login);
+       }
+diff --git a/saslauthd/auth_shadow.c b/saslauthd/auth_shadow.c
+index 677131b..1988afd 100644
+--- a/saslauthd/auth_shadow.c
++++ b/saslauthd/auth_shadow.c
+@@ -210,8 +210,8 @@ auth_shadow (
+       RETURN("NO Insufficient permission to access NIS authentication 
database (saslauthd)");
+     }
+
+-    cpw = strdup((const char *)crypt(password, sp->sp_pwdp));
+-    if (strcmp(sp->sp_pwdp, cpw)) {
++    cpw = crypt(password, sp->sp_pwdp);
++    if (!cpw || strcmp(sp->sp_pwdp, (const char *)cpw)) {
+       if (flags & VERBOSE) {
+           /*
+            * This _should_ reveal the SHADOW_PW_LOCKED prefix to an
+@@ -221,10 +221,8 @@ auth_shadow (
+           syslog(LOG_DEBUG, "DEBUG: auth_shadow: pw mismatch: '%s' != '%s'",
+                  sp->sp_pwdp, cpw);
+       }
+-      free(cpw);
+       RETURN("NO Incorrect password");
+     }
+-    free(cpw);
+
+     /*
+      * The following fields will be set to -1 if:
+@@ -286,7 +284,7 @@ auth_shadow (
+       RETURN("NO Invalid username");
+     }
+
+-    if (strcmp(upw->upw_passwd, crypt(password, upw->upw_passwd)) != 0) {
++    if (!(cpw = crypt(password, upw->upw_passwd)) || (strcmp(upw->upw_passwd, 
(const char *)cpw) != 0)) {
+       if (flags & VERBOSE) {
+           syslog(LOG_DEBUG, "auth_shadow: pw mismatch: %s != %s",
+                  password, upw->upw_passwd);
+--
+cgit v0.9.0.2
diff --git a/source/network/cyrus-sasl/cyrus-sasl-2.1.26-big-fix.patch 
b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-big-fix.patch
new file mode 100644
index 0000000..dbd45fc
--- /dev/null
+++ b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-big-fix.patch
@@ -0,0 +1,418 @@
+diff -Naur cyrus-sasl-2.1.26/cmulocal/sasl2.m4 
cyrus-sasl-2.1.26-patch/cmulocal/sasl2.m4
+--- cyrus-sasl-2.1.26/cmulocal/sasl2.m4        2012-11-06 20:14:29.000000000 
+0100
++++ cyrus-sasl-2.1.26-patch/cmulocal/sasl2.m4  2015-12-29 19:56:50.002238221 
+0100
+@@ -219,7 +219,11 @@
+                  [AC_WARN([Cybersafe define not found])])
+
+   elif test "$ac_cv_header_gssapi_h" = "yes"; then
+-    AC_EGREP_HEADER(GSS_C_NT_HOSTBASED_SERVICE, gssapi.h,
++    AC_EGREP_CPP(hostbased_service_gss_nt_yes, gssapi.h,
++                 [#include <gssapi.h>
++                  #ifdef GSS_C_NT_HOSTBASED_SERVICE
++                    hostbased_service_gss_nt_yes
++                  #endif],
+                     [AC_DEFINE(HAVE_GSS_C_NT_HOSTBASED_SERVICE,,
+                                [Define if your GSSAPI implementation defines 
GSS_C_NT_HOSTBASED_SERVICE])])
+   elif test "$ac_cv_header_gssapi_gssapi_h"; then
+@@ -268,7 +272,11 @@
+
+   cmu_save_LIBS="$LIBS"
+   LIBS="$LIBS $GSSAPIBASE_LIBS"
+-  AC_CHECK_FUNCS(gsskrb5_register_acceptor_identity)
++  AC_CHECK_FUNCS([gsskrb5_register_acceptor_identity], [],
++    [AC_CHECK_FUNCS([krb5_gss_register_acceptor_identity],
++      [AC_CHECK_HEADERS([gssapi/gssapi_krb5.h],
++         [AC_DEFINE([HAVE_GSSKRB5_REGISTER_ACCEPTOR_IDENTITY], [1])]
++  )])])
+   AC_CHECK_FUNCS(gss_decapsulate_token)
+   AC_CHECK_FUNCS(gss_encapsulate_token)
+   AC_CHECK_FUNCS(gss_oid_equal)
+diff -Naur cyrus-sasl-2.1.26/config/kerberos_v4.m4 
cyrus-sasl-2.1.26-patch/config/kerberos_v4.m4
+--- cyrus-sasl-2.1.26/config/kerberos_v4.m4    2012-01-28 00:31:36.000000000 
+0100
++++ cyrus-sasl-2.1.26-patch/config/kerberos_v4.m4      2015-12-29 
19:45:44.892957707 +0100
+@@ -89,18 +89,18 @@
+     dnl if we were ambitious, we would look more aggressively for the
+     dnl krb4 install
+     if test -d ${krb4}; then
+-       AC_CACHE_CHECK(for Kerberos includes, cyrus_krbinclude, [
++       AC_CACHE_CHECK(for Kerberos includes, cyrus_cv_krbinclude, [
+          for krbhloc in include/kerberosIV include/kerberos include
+          do
+            if test -f ${krb4}/${krbhloc}/krb.h ; then
+-             cyrus_krbinclude=${krb4}/${krbhloc}
++             cyrus_cv_krbinclude=${krb4}/${krbhloc}
+              break
+            fi
+          done
+          ])
+
+-       if test -n "${cyrus_krbinclude}"; then
+-         CPPFLAGS="$CPPFLAGS -I${cyrus_krbinclude}"
++       if test -n "${cyrus_cv_krbinclude}"; then
++         CPPFLAGS="$CPPFLAGS -I${cyrus_cv_krbinclude}"
+        fi
+        LDFLAGS="$LDFLAGS -L$krb4/lib"
+     fi
+diff -Naur cyrus-sasl-2.1.26/configure.in cyrus-sasl-2.1.26-patch/configure.in
+--- cyrus-sasl-2.1.26/configure.in     2012-10-12 16:05:48.000000000 +0200
++++ cyrus-sasl-2.1.26-patch/configure.in       2015-12-29 19:45:44.891957678 
+0100
+@@ -44,6 +44,8 @@
+ AC_INIT(lib/saslint.h)
+ AC_PREREQ([2.54])
+
++AC_CONFIG_MACRO_DIRS([cmulocal] [config])
++
+ dnl use ./config.cache as the default cache file.
+ dnl we require a cache file to successfully configure our build.
+ if test $cache_file = "/dev/null"; then
+diff -Naur cyrus-sasl-2.1.26/include/sasl.h 
cyrus-sasl-2.1.26-patch/include/sasl.h
+--- cyrus-sasl-2.1.26/include/sasl.h   2012-10-12 16:05:48.000000000 +0200
++++ cyrus-sasl-2.1.26-patch/include/sasl.h     2015-12-29 19:58:10.738353076 
+0100
+@@ -121,6 +121,9 @@
+ #ifndef SASL_H
+ #define SASL_H 1
+
++/* stddef.h to get size_t defined */
++#include <stddef.h>
++
+ /* Keep in sync with win32/common.mak */
+ #define SASL_VERSION_MAJOR 2
+ #define SASL_VERSION_MINOR 1
+diff -Naur cyrus-sasl-2.1.26/lib/auxprop.c 
cyrus-sasl-2.1.26-patch/lib/auxprop.c
+--- cyrus-sasl-2.1.26/lib/auxprop.c    2012-01-28 00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/lib/auxprop.c      2015-12-29 19:50:01.373343194 
+0100
+@@ -970,6 +970,10 @@
+     }
+
+     if(!found) {
++      /* compatibility with <= 2.1.23, ignore the lack of auxrop plugin */
++      if (!plist)
++          result = SASL_OK;
++      else
+       _sasl_log(sparams->utils->conn, SASL_LOG_DEBUG,
+                 "could not find auxprop plugin, was searching for '%s'",
+                 plist ? plist : "[all]");
+diff -Naur cyrus-sasl-2.1.26/lib/checkpw.c 
cyrus-sasl-2.1.26-patch/lib/checkpw.c
+--- cyrus-sasl-2.1.26/lib/checkpw.c    2012-01-28 00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/lib/checkpw.c      2015-12-29 20:36:01.387503983 
+0100
+@@ -587,16 +587,14 @@
+           /* Timeout. */
+           errno = ETIMEDOUT;
+           return -1;
+-      case +1:
+-          if (FD_ISSET(fd, &rfds)) {
+-              /* Success, file descriptor is readable. */
+-              return 0;
+-          }
+-          return -1;
+       case -1:
+           if (errno == EINTR || errno == EAGAIN)
+               continue;
+       default:
++            if (FD_ISSET(fd, &rfds)) {
++                /* Success, file descriptor is readable. */
++                return 0;
++            }
+           /* Error catch-all. */
+           return -1;
+       }
+diff -Naur cyrus-sasl-2.1.26/lib/Makefile.am 
cyrus-sasl-2.1.26-patch/lib/Makefile.am
+--- cyrus-sasl-2.1.26/lib/Makefile.am  2012-10-12 16:05:48.000000000 +0200
++++ cyrus-sasl-2.1.26-patch/lib/Makefile.am    2015-12-29 19:40:35.680046259 
+0100
+@@ -80,7 +80,7 @@
+
+ libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
+       @echo adding static plugins and dependencies
+-      $(AR) cru .libs/$@ $(SASL_STATIC_OBJS)
++      $(AR) cru $@ $(SASL_STATIC_OBJS)
+       @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \
+       if test ! -f $$i; then continue; fi; . $$i; \
+       for j in $$dependency_libs foo; do \
+diff -Naur cyrus-sasl-2.1.26/Makefile.am cyrus-sasl-2.1.26-patch/Makefile.am
+--- cyrus-sasl-2.1.26/Makefile.am      2012-10-12 16:05:48.000000000 +0200
++++ cyrus-sasl-2.1.26-patch/Makefile.am        2015-12-29 19:45:44.891957678 
+0100
+@@ -43,6 +43,8 @@
+ #
+ ################################################################
+
++ACLOCAL_AMFLAGS = -I cmulocal -I config
++
+ if SASLAUTHD
+ SAD = saslauthd
+ else
+diff -Naur cyrus-sasl-2.1.26/plugins/gssapi.c 
cyrus-sasl-2.1.26-patch/plugins/gssapi.c
+--- cyrus-sasl-2.1.26/plugins/gssapi.c 2012-01-28 00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/plugins/gssapi.c   2015-12-29 19:56:50.002238221 
+0100
+@@ -50,6 +50,9 @@
+ #else
+ #include <gssapi/gssapi.h>
+ #endif
++#if defined (KRB5_HEIMDAL) || defined (HAVE_GSSAPI_GSSAPI_KRB5_H)
++#include <gssapi/gssapi_krb5.h>
++#endif
+
+ #ifdef WIN32
+ #  include <winsock2.h>
+diff -Naur cyrus-sasl-2.1.26/plugins/ldapdb.c 
cyrus-sasl-2.1.26-patch/plugins/ldapdb.c
+--- cyrus-sasl-2.1.26/plugins/ldapdb.c 2012-01-28 00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/plugins/ldapdb.c   2015-12-29 20:34:25.821118022 
+0100
+@@ -404,6 +404,7 @@
+       if ( len > out_max )
+           len = out_max;
+       memcpy(out, bvals[0]->bv_val, len);
++    out[len] = '\0';
+       *out_ulen = len;
+       ber_bvecfree(bvals);
+     }
+diff -Naur cyrus-sasl-2.1.26/pwcheck/pwcheck_getspnam.c 
cyrus-sasl-2.1.26-patch/pwcheck/pwcheck_getspnam.c
+--- cyrus-sasl-2.1.26/pwcheck/pwcheck_getspnam.c       2012-01-28 
00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/pwcheck/pwcheck_getspnam.c 2015-12-29 
19:47:19.473681843 +0100
+@@ -24,6 +24,7 @@
+ ******************************************************************/
+
+ #include <shadow.h>
++#include <string.h>
+
+ extern char *crypt();
+
+diff -Naur cyrus-sasl-2.1.26/sample/server.c 
cyrus-sasl-2.1.26-patch/sample/server.c
+--- cyrus-sasl-2.1.26/sample/server.c  2012-01-28 00:31:36.000000000 +0100
++++ cyrus-sasl-2.1.26-patch/sample/server.c    2015-12-29 19:48:17.314347416 
+0100
+@@ -85,8 +85,10 @@
+
+ #ifdef HAVE_GSS_GET_NAME_ATTRIBUTE
+ #include <gssapi/gssapi.h>
++#ifndef KRB5_HEIMDAL
+ #include <gssapi/gssapi_ext.h>
+ #endif
++#endif
+
+ #include "common.h"
+
+diff -Naur cyrus-sasl-2.1.26/saslauthd/auth_rimap.c 
cyrus-sasl-2.1.26-patch/saslauthd/auth_rimap.c
+--- cyrus-sasl-2.1.26/saslauthd/auth_rimap.c   2012-10-12 16:05:48.000000000 
+0200
++++ cyrus-sasl-2.1.26-patch/saslauthd/auth_rimap.c     2015-12-29 
20:36:01.386503958 +0100
+@@ -90,6 +90,7 @@
+                                          service we connect to.        */
+ #define TAG "saslauthd"                       /* IMAP command tag */
+ #define LOGIN_CMD (TAG " LOGIN ")     /* IMAP login command (with tag) */
++#define LOGOUT_CMD (TAG " LOGOUT ")   /* IMAP logout command (with tag)*/
+ #define NETWORK_IO_TIMEOUT 30         /* network I/O timeout (seconds) */
+ #define RESP_LEN 1000                 /* size of read response buffer  */
+
+@@ -307,10 +308,12 @@
+     int       s=-1;                           /* socket to remote auth host   
*/
+     struct addrinfo *r;                       /* remote socket address info   
*/
+     struct iovec iov[5];              /* for sending LOGIN command    */
++    struct iovec iov2[2];               /* for sending LOGOUT command   */
+     char *qlogin;                     /* pointer to "quoted" login    */
+     char *qpass;                      /* pointer to "quoted" password */
+     char *c;                          /* scratch pointer              */
+     int rc;                           /* return code scratch area     */
++    int rcl;                          /* return code scratch area     */
+     char rbuf[RESP_LEN];              /* response read buffer         */
+     char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV];
+     int saved_errno;
+@@ -371,7 +374,7 @@
+     if ( rc>0 ) {
+         /* check if there is more to read */
+         fd_set         perm;
+-        int            fds, ret;
++        int            fds, ret, loopc;
+         struct timeval timeout;
+
+         FD_ZERO(&perm);
+@@ -380,6 +383,7 @@
+
+         timeout.tv_sec  = 1;
+         timeout.tv_usec = 0;
++        loopc = 0;
+         while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
+            if ( FD_ISSET(s, &perm) ) {
+               ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
+@@ -387,6 +391,14 @@
+                  rc = ret;
+                  break;
+               } else {
++                 if (ret == 0) {
++                   loopc += 1;
++                 } else {
++                   loopc = 0;
++                 }
++                 if (loopc > sizeof(rbuf)) { // arbitrary chosen value
++                   break;
++                 }
+                  rc += ret;
+               }
+            }
+@@ -484,7 +496,7 @@
+     if ( rc>0 ) {
+         /* check if there is more to read */
+         fd_set         perm;
+-        int            fds, ret;
++        int            fds, ret, loopc;
+         struct timeval timeout;
+
+         FD_ZERO(&perm);
+@@ -493,6 +505,7 @@
+
+         timeout.tv_sec  = 1;
+         timeout.tv_usec = 0;
++        loopc = 0;
+         while( select (fds, &perm, NULL, NULL, &timeout ) >0 ) {
+            if ( FD_ISSET(s, &perm) ) {
+               ret = read(s, rbuf+rc, sizeof(rbuf)-rc);
+@@ -500,11 +513,37 @@
+                  rc = ret;
+                  break;
+               } else {
++                 if (ret == 0) {
++                   loopc += 1;
++                 } else {
++                   loopc = 0;
++                 }
++                 if (loopc > sizeof(rbuf)) { // arbitrary chosen value
++                   break;
++                 }
+                  rc += ret;
+               }
+            }
+         }
+     }
++
++    /* close remote imap */
++    iov2[0].iov_base = LOGOUT_CMD;
++    iov2[0].iov_len  = sizeof(LOGOUT_CMD) - 1;
++    iov2[1].iov_base = "\r\n";
++    iov2[1].iov_len  = sizeof("\r\n") - 1;
++
++    if (flags & VERBOSE) {
++        syslog(LOG_DEBUG, "auth_rimap: sending %s%s %s",
++               LOGOUT_CMD, qlogin, qpass);
++    }
++    alarm(NETWORK_IO_TIMEOUT);
++    rcl = retry_writev(s, iov2, 2);
++    alarm(0);
++    if (rcl == -1) {
++        syslog(LOG_WARNING, "auth_rimap: writev logout: %m");
++    }
++
+     (void) close(s);                  /* we're done with the remote */
+     if (rc == -1) {
+       syslog(LOG_WARNING, "auth_rimap: read (response): %m");
+diff -Naur cyrus-sasl-2.1.26/saslauthd/configure.in 
cyrus-sasl-2.1.26-patch/saslauthd/configure.in
+--- cyrus-sasl-2.1.26/saslauthd/configure.in   2012-10-12 16:05:48.000000000 
+0200
++++ cyrus-sasl-2.1.26-patch/saslauthd/configure.in     2015-12-29 
19:45:44.891957678 +0100
+@@ -1,7 +1,8 @@
+ AC_INIT(mechanisms.h)
+ AC_PREREQ([2.54])
+
+-AC_CONFIG_AUX_DIR(config)
++AC_CONFIG_MACRO_DIRS([../cmulocal] [../config])
++AC_CONFIG_AUX_DIR([config])
+ AC_CANONICAL_HOST
+
+ dnl Should we enable SASLAUTHd at all?
+@@ -25,6 +26,7 @@
+ AC_PROG_MAKE_SET
+ AC_PROG_LN_S
+ AC_PROG_INSTALL
++AC_PROG_LIBTOOL
+
+ dnl Checks for build foo
+ CMU_C___ATTRIBUTE__
+@@ -77,7 +79,7 @@
+   AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support])
+   SASL_DB_PATH_CHECK()
+   SASL_DB_CHECK()
+-  SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al"
++  SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a"
+ fi
+
+ AC_ARG_ENABLE(httpform, [  --enable-httpform       enable HTTP form 
authentication [[no]] ],
+@@ -163,30 +165,30 @@
+
+ dnl Checks for which function macros exist
+ AC_MSG_CHECKING(whether $CC implements __func__)
+-AC_CACHE_VAL(have_func,
++AC_CACHE_VAL(_cv_have_func,
+ [AC_TRY_LINK([#include <stdio.h>],[printf("%s", __func__);],
+-have_func=yes,
+-have_func=no)])
+-AC_MSG_RESULT($have_func)
+-if test "$have_func" = yes; then
++_cv_have_func=yes,
++_cv_have_func=no)])
++AC_MSG_RESULT($_cv_have_func)
++if test "$_cv_have_func" = yes; then
+        AC_DEFINE(HAVE_FUNC,[],[Does the compiler understand __func__])
+ else
+        AC_MSG_CHECKING(whether $CC implements __PRETTY_FUNCTION__)
+-       AC_CACHE_VAL(have_pretty_function,
++       AC_CACHE_VAL(_cv_have_pretty_function,
+        [AC_TRY_LINK([#include <stdio.h>],[printf("%s", __PRETTY_FUNCTION__);],
+-       have_pretty_function=yes,
+-       have_pretty_function=no)])
+-       AC_MSG_RESULT($have_pretty_function)
+-       if test "$have_pretty_function" = yes; then
++       _cv_have_pretty_function=yes,
++       _cv_have_pretty_function=no)])
++       AC_MSG_RESULT($_cv_have_pretty_function)
++       if test "$_cv_have_pretty_function" = yes; then
+                AC_DEFINE(HAVE_PRETTY_FUNCTION,[],[Does compiler understand 
__PRETTY_FUNCTION__])
+        else
+                AC_MSG_CHECKING(whether $CC implements __FUNCTION__)
+-               AC_CACHE_VAL(have_function,
++               AC_CACHE_VAL(_cv_have_function,
+                [AC_TRY_LINK([#include <stdio.h>],[printf("%s", 
__FUNCTION__);],
+-               have_function=yes,
+-               have_function=no)])
+-               AC_MSG_RESULT($have_function)
+-               if test "$have_function" = yes; then
++               _cv_have_function=yes,
++               _cv_have_function=no)])
++               AC_MSG_RESULT($_cv_have_function)
++               if test "$_cv_have_function" = yes; then
+                        AC_DEFINE(HAVE_FUNCTION,[],[Does compiler understand 
__FUNCTION__])
+                fi
+        fi
+diff -Naur cyrus-sasl-2.1.26/saslauthd/Makefile.am 
cyrus-sasl-2.1.26-patch/saslauthd/Makefile.am
+--- cyrus-sasl-2.1.26/saslauthd/Makefile.am    2012-01-28 00:31:36.000000000 
+0100
++++ cyrus-sasl-2.1.26-patch/saslauthd/Makefile.am      2015-12-29 
19:46:26.940168853 +0100
+@@ -1,4 +1,6 @@
+ AUTOMAKE_OPTIONS = 1.7
++ACLOCAL_AMFLAGS = -I ../cmulocal -I ../config
++
+ sbin_PROGRAMS = saslauthd testsaslauthd
+ EXTRA_PROGRAMS  = saslcache
+
+@@ -16,7 +18,7 @@
+ saslauthd_DEPENDENCIES = saslauthd-main.o @LTLIBOBJS@
+ saslauthd_LDADD       = @SASL_KRB_LIB@ \
+                 @GSSAPIBASE_LIBS@ @GSSAPI_LIBS@ @LIB_CRYPT@ @LIB_SIA@ \
+-                @LIB_SOCKET@ @SASL_DB_LIB@ @LIB_PAM@ @LDAP_LIBS@ @LTLIBOBJS@
++                @LIB_SOCKET@ ../sasldb/libsasldb.la @LIB_PAM@ @LDAP_LIBS@ 
@LTLIBOBJS@
+
+ testsaslauthd_SOURCES = testsaslauthd.c utils.c
+ testsaslauthd_LDADD = @LIB_SOCKET@
+diff -Naur cyrus-sasl-2.1.26/sasldb/Makefile.am 
cyrus-sasl-2.1.26-patch/sasldb/Makefile.am
+--- cyrus-sasl-2.1.26/sasldb/Makefile.am       2012-01-28 00:31:36.000000000 
+0100
++++ cyrus-sasl-2.1.26-patch/sasldb/Makefile.am 2015-12-29 19:46:26.941168882 
+0100
+@@ -55,14 +55,14 @@
+
+ libsasldb_la_SOURCES = allockey.c sasldb.h
+ EXTRA_libsasldb_la_SOURCES = $(extra_common_sources)
+-libsasldb_la_DEPENDENCIES = $(SASL_DB_BACKEND)
+-libsasldb_la_LIBADD = $(SASL_DB_BACKEND)
++libsasldb_la_DEPENDENCIES = $(SASL_DB_BACKEND) $(SASL_DB_LIB)
++libsasldb_la_LIBADD = $(SASL_DB_BACKEND) $(SASL_DB_LIB)
+
+ # Prevent make dist stupidity
+ libsasldb_a_SOURCES =
+ EXTRA_libsasldb_a_SOURCES =
+
+ libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC)
+-      $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC)
++      $(AR) cru $@ $(SASL_DB_BACKEND_STATIC)
+
+
diff --git a/source/network/cyrus-sasl/cyrus-sasl-2.1.26-fix-2.patch 
b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-fix-2.patch
new file mode 100644
index 0000000..9ca4007
--- /dev/null
+++ b/source/network/cyrus-sasl/cyrus-sasl-2.1.26-fix-2.patch
@@ -0,0 +1,36 @@
+diff -Naur cyrus-sasl-2.1.26/configure.in cyrus-sasl-2.1.26-patch1/configure.in
+--- cyrus-sasl-2.1.26/configure.in     2012-10-12 16:05:48.000000000 +0200
++++ cyrus-sasl-2.1.26-patch1/configure.in      2015-12-29 20:40:13.369799398 
+0100
+@@ -861,9 +861,9 @@
+     notfound) AC_WARN([SQLite Library not found]); true;;
+     *)
+      if test -d ${with_sqlite}/lib; then
+-         LIB_SQLITE="-L${with_sqlite}/lib -R${with_sqlite}/lib"
++         LIB_SQLITE="-L${with_sqlite}/lib"
+      else
+-         LIB_SQLITE="-L${with_sqlite} -R${with_sqlite}"
++         LIB_SQLITE="-L${with_sqlite}"
+      fi
+
+      LIB_SQLITE_DIR=$LIB_SQLITE
+@@ -913,9 +913,9 @@
+     notfound) AC_WARN([SQLite3 Library not found]); true;;
+     *)
+      if test -d ${with_sqlite3}/lib; then
+-         LIB_SQLITE3="-L${with_sqlite3}/lib -R${with_sqlite3}/lib"
++         LIB_SQLITE3="-L${with_sqlite3}/lib"
+      else
+-         LIB_SQLITE3="-L${with_sqlite3} -R${with_sqlite3}"
++         LIB_SQLITE3="-L${with_sqlite3}"
+      fi
+
+      LIB_SQLITE3_DIR=$LIB_SQLITE3
+@@ -1412,7 +1412,7 @@
+ #endif /* CONFIG_H */
+ ])
+
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ AC_OUTPUT(Makefile
+ libsasl2.pc
diff --git a/source/network/cyrus-sasl/psql.patch 
b/source/network/cyrus-sasl/psql.patch
deleted file mode 100644
index c126b7f..0000000
--- a/source/network/cyrus-sasl/psql.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- cyrus-sasl-2.1.22/plugins/Makefile.in      2006-06-11 15:56:22.000000000 
+0200
-+++ cyrus-sasl-2.1.22/plugins/Makefile.in.new  2006-06-11 15:55:47.000000000 
+0200
-@@ -97,7 +97,7 @@
- CPP = @CPP@
- CPPFLAGS = @CPPFLAGS@
- CYGPATH_W = @CYGPATH_W@
--DEFS = @DEFS@
-+DEFS = @DEFS@ -DHAVE_PGSQL
- DEPDIR = @DEPDIR@
- DIRS = @DIRS@
- DMALLOC_LIBS = @DMALLOC_LIBS@
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to