[packaging] Branch 'feature-el5-kolab-2.4' - 0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch 0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch 0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch 0004-Proxy-authentication-support-for-IMAP.patch php-pear-Kolab-Server.spec

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed Oct 26 13:02:08 CEST 2011


 0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch |   29 +
 0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch |   26 +
 0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch  |   63 ++++
 0004-Proxy-authentication-support-for-IMAP.patch                |  149 ++++++++++
 php-pear-Kolab-Server.spec                                      |   14 
 5 files changed, 280 insertions(+), 1 deletion(-)

New commits:
commit 720ae1052516b0dbf4a8941bd7f022058dffd338
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Oct 26 11:57:37 2011 +0100

    Patch Kolab_Server

diff --git a/0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch b/0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch
new file mode 100644
index 0000000..03a8493
--- /dev/null
+++ b/0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch
@@ -0,0 +1,29 @@
+From 5d9bf99efb7179666583f98e6739235939f0986f Mon Sep 17 00:00:00 2001
+From: Aleksander Machniak <alec at alec.pl>
+Date: Wed, 19 Oct 2011 08:52:20 +0200
+Subject: [PATCH 1/6] Disable charset conversion from/to UTF8. We operate on
+ UTF7-IMAP (as cclient does)
+ [https://bugzilla.kolabsys.com/show_bug.cgi?id=116]
+
+---
+ Kolab_Server/lib/Horde/Kolab/IMAP/pear.php |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php b/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
+index 7f4c9c8..a8cc28d 100644
+--- a/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
++++ b/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
+@@ -57,6 +57,10 @@ class Horde_Kolab_IMAP_pear extends Horde_Kolab_IMAP {
+         }
+ 
+         $this->_imap = &new Net_IMAP($this->_server, $this->_port);
++
++        // Net_IMAP uses UTF-8 by default, we oparate on UTF7-IMAP
++        $this->_imap->_useUTF_7 = false;
++
+         $result = $this->_imap->login($login, $password, true, false);
+         if (is_a($result, 'PEAR_Error')) {
+             return $result;
+-- 
+1.7.6.4
+
diff --git a/0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch b/0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch
new file mode 100644
index 0000000..68f85e1
--- /dev/null
+++ b/0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch
@@ -0,0 +1,26 @@
+From ca18b245f6d0d93540b74c6140c96c14594cb8cc Mon Sep 17 00:00:00 2001
+From: Aleksander Machniak <alec at alec.pl>
+Date: Mon, 24 Oct 2011 11:20:23 +0200
+Subject: [PATCH 2/6] Fixed obvious bug in setting LDAP's 'search_uid'
+ parameter, even if not used
+
+---
+ Kolab_Server/lib/Horde/Kolab/Server.php |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Kolab_Server/lib/Horde/Kolab/Server.php b/Kolab_Server/lib/Horde/Kolab/Server.php
+index b9f18ea..efb6e51 100644
+--- a/Kolab_Server/lib/Horde/Kolab/Server.php
++++ b/Kolab_Server/lib/Horde/Kolab/Server.php
+@@ -190,7 +190,7 @@ class Horde_Kolab_Server {
+             }
+             if (isset($params['uid'])) {
+                 if (isset($server_params['uid'])) {
+-                    $server_params['search_uid'] = $server_params['pass'];
++                    $server_params['search_uid'] = $server_params['uid'];
+                 }
+                 $server_params['uid'] = $params['uid'];
+             }
+-- 
+1.7.6.4
+
diff --git a/0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch b/0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch
new file mode 100644
index 0000000..c1b29c3
--- /dev/null
+++ b/0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch
@@ -0,0 +1,63 @@
+From 455bd2d4380b91cd9246e84e21d984e32f4e1788 Mon Sep 17 00:00:00 2001
+From: Aleksander Machniak <alec at alec.pl>
+Date: Mon, 24 Oct 2011 14:23:19 +0200
+Subject: [PATCH 3/6] Fixed inconsistency in Free-Busy server URL setting
+
+---
+ .../lib/Horde/Kolab/Server/Object/user.php         |   33 ++++++++++++-------
+ 1 files changed, 21 insertions(+), 12 deletions(-)
+
+diff --git a/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php b/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php
+index f3bcc18..b38c7e8 100644
+--- a/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php
++++ b/Kolab_Server/lib/Horde/Kolab/Server/Object/user.php
+@@ -229,25 +229,34 @@ class Horde_Kolab_Server_Object_user extends Horde_Kolab_Server_Object {
+         switch ($server_type) {
+         case 'freebusy':
+             $server = $this->get(KOLAB_ATTR_FREEBUSYHOST);
+-            if (!is_a($server, 'PEAR_Error') && !empty($server)) {
+-                return $server;
+-            }
+-            $server = $this->getServer('homeserver');
+-            if (is_a($server, 'PEAR_Error')) {
++            if (is_object($server) && is_a($server, 'PEAR_Error')) {
+                 return $server;
+             }
++
+             if (empty($server)) {
+-                $server = $_SERVER['SERVER_NAME'];
++                if (!empty($conf['kolab']['freebusy']['server'])) {
++                    $server = $conf['kolab']['freebusy']['server'];
++                }
++                else if ($server = $this->getServer('homeserver')) {
++                    if (is_object($server) && is_a($server, 'PEAR_Error')) {
++                        return $server;
++                    }
++                }
++                else {
++                    $server = $_SERVER['SERVER_NAME'];
++                }
+             }
+-            if (isset($conf['kolab']['freebusy']['server'])) {
+-                return $conf['kolab']['freebusy']['server'];
++
++            // check if $server contains URL or just a hostname
++            if (strpos($server, '//')) {
++                return $server;
+             }
+-            if (isset($conf['kolab']['server']['freebusy_url_format'])) {
++
++            if (!empty($conf['kolab']['server']['freebusy_url_format'])) {
+                 return sprintf($conf['kolab']['server']['freebusy_url_format'],
+-                               $server);
+-            } else {
+-                return 'https://' . $server . '/freebusy';
++                    $server);
+             }
++            return 'https://' . $server . '/freebusy';
+         case 'imap':
+             $server = $this->get(KOLAB_ATTR_IMAPHOST);
+             if (!is_a($server, 'PEAR_Error') && !empty($server)) {
+-- 
+1.7.6.4
+
diff --git a/0004-Proxy-authentication-support-for-IMAP.patch b/0004-Proxy-authentication-support-for-IMAP.patch
new file mode 100644
index 0000000..fa6236c
--- /dev/null
+++ b/0004-Proxy-authentication-support-for-IMAP.patch
@@ -0,0 +1,149 @@
+From fc9623e0f192d75d71768258bc1b308dc51bc601 Mon Sep 17 00:00:00 2001
+From: Aleksander Machniak <alec at alec.pl>
+Date: Wed, 26 Oct 2011 09:43:08 +0200
+Subject: [PATCH 4/6] Proxy authentication support (for IMAP).
+
+---
+ Kolab_Server/lib/Horde/Kolab/IMAP/cclient.php    |    5 +++-
+ Kolab_Server/lib/Horde/Kolab/IMAP/pear.php       |    6 +++-
+ Kolab_Server/lib/Horde/Kolab/IMAP/test.php       |    2 +-
+ Kolab_Server/lib/Horde/Kolab/Session.php         |   30 +++++++++++++++++++---
+ Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php |   13 ++++++++-
+ 5 files changed, 48 insertions(+), 8 deletions(-)
+
+diff --git a/Kolab_Server/lib/Horde/Kolab/IMAP/cclient.php b/Kolab_Server/lib/Horde/Kolab/IMAP/cclient.php
+index 552946a..d01f0d7 100644
+--- a/Kolab_Server/lib/Horde/Kolab/IMAP/cclient.php
++++ b/Kolab_Server/lib/Horde/Kolab/IMAP/cclient.php
+@@ -67,12 +67,15 @@ class Horde_Kolab_IMAP_cclient extends Horde_Kolab_IMAP {
+      * @return boolean|PEAR_Error  True in case the connection was opened
+      *                             successfully.
+      */
+-    function connect($login, $password, $tls = false)
++    function connect($login, $password, $tls = false, $params = array())
+     {
+         $options = '';
+         if (!$tls) {
+             $options = '/notls';
+         }
++        if (!empty($params['authuser'])) {
++            $options .= '/authuser=' . $params['authuser'];
++        }
+ 
+         $mbox = '{' . $this->_server . ':' . $this->_port
+             . $options . '}';
+diff --git a/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php b/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
+index a8cc28d..92ed47a 100644
+--- a/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
++++ b/Kolab_Server/lib/Horde/Kolab/IMAP/pear.php
+@@ -47,8 +47,12 @@ class Horde_Kolab_IMAP_pear extends Horde_Kolab_IMAP {
+      * @return mixed  True in case the connection was opened successfully, a
+      *                PEAR error otherwise.
+      */
+-    function connect($login, $password, $tls = false)
++    function connect($login, $password, $tls = false, $params = array())
+     {
++        if (!empty($params['authuser'])) {
++            return PEAR::raiseError('"authuser" parameter not supported!');
++        }
++
+         $this->_signature = $this->_server . '|' . $this->_port . "|$login|$password|$tls";
+ 
+         // Reuse existing connection?
+diff --git a/Kolab_Server/lib/Horde/Kolab/IMAP/test.php b/Kolab_Server/lib/Horde/Kolab/IMAP/test.php
+index 471b879..2dfd6bc 100644
+--- a/Kolab_Server/lib/Horde/Kolab/IMAP/test.php
++++ b/Kolab_Server/lib/Horde/Kolab/IMAP/test.php
+@@ -65,7 +65,7 @@ class Horde_Kolab_IMAP_test extends Horde_Kolab_IMAP {
+      * @return mixed  True in case the connection was opened successfully, a
+      *                PEAR error otherwise.
+      */
+-    function connect($login, $password, $tls = false)
++    function connect($login, $password, $tls = false, $params = array())
+     {
+         if (!is_array($GLOBALS['KOLAB_TESTING'])) {
+             /* Simulate an empty IMAP server */
+diff --git a/Kolab_Server/lib/Horde/Kolab/Session.php b/Kolab_Server/lib/Horde/Kolab/Session.php
+index acfcf65..8513eb4 100644
+--- a/Kolab_Server/lib/Horde/Kolab/Session.php
++++ b/Kolab_Server/lib/Horde/Kolab/Session.php
+@@ -211,7 +211,10 @@ class Horde_Kolab_Session {
+             }
+         }
+ 
+-        if (empty($this->user_mail)) {
++        if (isset($conf['kolab']['user_mail'])) {
++            $this->user_mail = $conf['kolab']['user_mail'];
++        }
++        else if (empty($this->user_mail)) {
+             $this->user_mail = $user;
+         }
+ 
+@@ -300,6 +303,8 @@ class Horde_Kolab_Session {
+      */
+     function &getImap()
+     {
++        global $conf;
++
+         if (!isset($this->_imap)) {
+ 
+             $params = $this->getImapParams();
+@@ -316,9 +321,26 @@ class Horde_Kolab_Session {
+                 return $imap;
+             }
+ 
+-            $result = $imap->connect(Auth::getAuth(),
+-                                     Auth::getCredential('password'),
+-                                     !empty($params['secure']));
++            // Support proxy SASL authentication
++            if (!empty($conf['kolab']['imap']['user'])) {
++                $user = $conf['kolab']['imap']['user'];
++            }
++            else {
++                $user = Auth::getAuth();
++            }
++
++            if (!empty($conf['kolab']['imap']['password'])) {
++                $pass = $conf['kolab']['imap']['password'];
++            }
++            else {
++                $pass = Auth::getCredential('password');
++            }
++
++            if (!empty($conf['kolab']['imap']['authuser'])) {
++                $params['authuser'] = $conf['kolab']['imap']['authuser'];
++            }
++
++            $result = $imap->connect($user, $pass, !empty($params['secure']), $params);
+             if (is_a($result, 'PEAR_Error')) {
+                 return $result;
+             }
+diff --git a/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php b/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php
+index dc9b84e..4270e77 100644
+--- a/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php
++++ b/Kolab_Storage/lib/Horde/Kolab/Storage/Folder.php
+@@ -1314,9 +1314,20 @@ class Kolab_Folder {
+             $options = array_merge($options, $conf['http']['proxy']);
+         }
+ 
++        if (!empty($conf['kolab']['imap']['authuser'])) {
++            $user = $conf['kolab']['imap']['authuser'];
++        } else {
++            $user = Auth::getAuth();
++        }
++        if (!empty($conf['kolab']['imap']['password'])) {
++            $password = $conf['kolab']['imap']['password'];
++        } else {
++            $password = Auth::getCredential('password');
++        }
++
+         require_once 'HTTP/Request.php';
+         $http = new HTTP_Request($url, $options);
+-        $http->setBasicAuth(Auth::getAuth(), Auth::getCredential('password'));
++        $http->setBasicAuth($user, $password);
+         @$http->sendRequest();
+         if ($http->getResponseCode() != 200) {
+             return PEAR::raiseError(sprintf(_("Unable to trigger URL %s. Response: %s"),
+-- 
+1.7.6.4
+
diff --git a/php-pear-Kolab-Server.spec b/php-pear-Kolab-Server.spec
index 7016e2a..f3f0295 100644
--- a/php-pear-Kolab-Server.spec
+++ b/php-pear-Kolab-Server.spec
@@ -3,7 +3,7 @@
 
 Name:               php-pear-Kolab-Server
 Version:            0.5.1
-Release:            3%{?dist}
+Release:            4%{?dist}
 Summary:            A package for manipulating the Kolab user database
 License:            LGPL
 Group:              Productivity/Networking/Web/Servers
@@ -31,6 +31,11 @@ Provides:           php-pear(%{pear_name})
 Patch0:             Kolab_Server-0.5.1-imap-novalidate_cert.patch
 Patch1:             Kolab_Server-0.5.1-search-for-alias-values-as-well.patch
 
+Patch100:           0001-Disable-charset-conversion-from-to-UTF8.-We-operate-.patch
+Patch101:           0002-Fixed-obvious-bug-in-setting-LDAP-s-search_uid-param.patch
+Patch102:           0003-Fixed-inconsistency-in-Free-Busy-server-URL-setting.patch
+Patch103:           0004-Proxy-authentication-support-for-IMAP.patch
+
 %description
 This package allows read/write entries in the Kolab user
 database stored in LDAP.
@@ -53,6 +58,10 @@ pushd %{buildroot}/%{pear_phpdir}/
 patch -p2 < %{PATCH0}
 pushd Horde/Kolab/Server/
 patch -p0 < %{PATCH1}
+patch -p5 < %{PATCH100}
+patch -p5 < %{PATCH101}
+patch -p5 < %{PATCH102}
+patch -p5 < %{PATCH103}
 popd
 popd
 
@@ -118,6 +127,9 @@ fi
 %{pear_phpdir}/test/Kolab_Server/Horde/Kolab/Server/testTest.php
 
 %changelog
+* Wed Oct 26 2011 Jeroen van Meeuwen <vanmeeuwen at kolabsys.com> - 0.5.1-4
+- Ship patches for bugs reported
+
 * Sat Jul 16 2011 Jeroen van Meeuwen <vanmeeuwen at kolabsys.com> - 0.5.1-3
 - Search alias values as well, when searching for an object
 




More information about the packaging-commits mailing list