Projects
Kolab:16:Enterprise
kolab-syncroton
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
kolab-syncroton.spec
Changed
@@ -37,7 +37,7 @@ Name: kolab-syncroton Version: 2.3.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: ActiveSync for Kolab Groupware Group: Applications/Internet @@ -47,6 +47,9 @@ Source0: kolab-syncroton-2.3.4.tar.gz Source1: kolab-syncroton.logrotate +Patch0001: 0001-Nicely-handle-errors-on-FolderCreate-T2223.patch +Patch0002: 0002-Only-call-kolab_auth-ldap_close-if-the-method-actual.patch + BuildArch: noarch # Use this build requirement to make sure we are using @@ -92,6 +95,9 @@ %prep %setup -q -n %{name}-%{version} +%patch0001 -p1 +%patch0002 -p1 + rm -rf \ lib/ext/Auth/ \ lib/ext/MDB2/ \ @@ -109,7 +115,9 @@ %install mkdir -p \ %{buildroot}/%{_datadir}/%{name} \ +%if 0%{?plesk} < 1 %{buildroot}/%{_ap_sysconfdir}/conf.d/ \ +%endif %{buildroot}/%{_sysconfdir}/%{name} \ %{buildroot}/%{_var}/log/%{name} @@ -162,7 +170,9 @@ ln -s ../../../../../..%{_sysconfdir}/roundcubemail/libkolab.inc.php config.inc.php popd +%if 0%{?plesk} < 1 cp -a docs/kolab-syncroton.conf %{buildroot}/%{_ap_sysconfdir}/conf.d/ +%endif find %{buildroot}/%{_datadir}/%{name}/ -type f -name "*.orig" -delete @@ -218,12 +228,17 @@ %dir %{_ap_sysconfdir}/ %dir %{_ap_sysconfdir}/conf.d/ %endif +%if 0%{?plesk} < 1 %config(noreplace) %{_ap_sysconfdir}/conf.d/kolab-syncroton.conf +%endif %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} %{_datadir}/%{name} %attr(0770,%{httpd_user},%{httpd_group}) %{_var}/log/%{name} %changelog +* Fri Feb 24 2017 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.4-2 +- Only call kolab_auth::ldap_close() if the method actually exists + * Wed Jan 25 2017 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 2.3.4-1 - Release of version 2.3.4
View file
0001-Nicely-handle-errors-on-FolderCreate-T2223.patch
Added
@@ -0,0 +1,189 @@ +From 1d7e1237f2dd2cc3882ed0b5491ef401eddcf1d2 Mon Sep 17 00:00:00 2001 +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Fri, 10 Feb 2017 11:03:18 +0100 +Subject: PATCH 1/2 Nicely handle errors on FolderCreate (T2223) + +--- + lib/ext/Syncroton/Command/FolderCreate.php | 75 +++++++++++++++++++----------- + lib/kolab_sync_backend.php | 8 ++++ + lib/kolab_sync_data.php | 16 ++++++- + 3 files changed, 72 insertions(+), 27 deletions(-) + +diff --git a/lib/ext/Syncroton/Command/FolderCreate.php b/lib/ext/Syncroton/Command/FolderCreate.php +index 1654b34..222c556 100644 +--- a/lib/ext/Syncroton/Command/FolderCreate.php ++++ b/lib/ext/Syncroton/Command/FolderCreate.php +@@ -10,7 +10,7 @@ + */ + + /** +- * class to handle ActiveSync FolderSync command ++ * class to handle ActiveSync FolderCreate command + * + * @package Syncroton + * @subpackage Command +@@ -21,14 +21,17 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml + protected $_documentElement = 'FolderCreate'; + + /** +- * + * @var Syncroton_Model_Folder + */ + protected $_folder; ++ ++ /** ++ * @var int ++ */ ++ protected $_status; + + /** + * parse FolderCreate request +- * + */ + public function handle() + { +@@ -39,14 +42,23 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml + if ($this->_logger instanceof Zend_Log) + $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " synckey is $syncKey"); + +- if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) { +- return; +- } ++ if (!($this->_syncState = $this->_syncStateBackend->validate($this->_device, 'FolderSync', $syncKey)) instanceof Syncroton_Model_SyncState) { ++ if ($this->_logger instanceof Zend_Log) ++ $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed."); ++ ++ $this->_status = Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY; ++ return; ++ } + +- $folder = new Syncroton_Model_Folder($xml); ++ $folder = new Syncroton_Model_Folder($xml); + +- if ($this->_logger instanceof Zend_Log) +- $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " parentId: {$folder->parentId} displayName: {$folder->displayName}"); ++ if ($this->_logger instanceof Zend_Log) ++ $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " parentId: {$folder->parentId} displayName: {$folder->displayName}"); ++ ++ if (!strlen($folder->displayName)) { ++ $this->_status = Syncroton_Command_FolderSync::STATUS_MISFORMATTED; ++ return; ++ } + + switch($folder->type) { + case Syncroton_Command_FolderSync::FOLDERTYPE_CALENDAR_USER_CREATED: +@@ -73,15 +85,32 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml + // unsupported type + return; + } +- +- $dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp); +- +- $this->_folder = $dataController->createFolder($folder); +- $this->_folder->class = $folder->class; +- $this->_folder->deviceId = $this->_device; +- $this->_folder->creationTime = $this->_syncTimeStamp; +- +- $this->_folderBackend->create($this->_folder); ++ ++ try { ++ $dataController = Syncroton_Data_Factory::factory($folder->class, $this->_device, $this->_syncTimeStamp); ++ ++ $this->_folder = $dataController->createFolder($folder); ++ ++ if (!$this->_folder) { ++ $this->_status = Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR; ++ } else { ++ $this->_folder->class = $folder->class; ++ $this->_folder->deviceId = $this->_device; ++ $this->_folder->creationTime = $this->_syncTimeStamp; ++ ++ $this->_folderBackend->create($this->_folder); ++ } ++ } catch (Syncroton_Exception_Status $e) { ++ if ($this->_logger instanceof Zend_Log) ++ $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); ++ ++ $this->_status = $e->getCode(); ++ } catch (Exception $e) { ++ if ($this->_logger instanceof Zend_Log) ++ $this->_logger->debug(__METHOD__ . '::' . __LINE__ . " " . $e->getMessage()); ++ ++ $this->_status = Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR; ++ } + } + + /** +@@ -91,14 +120,8 @@ class Syncroton_Command_FolderCreate extends Syncroton_Command_Wbxml + { + $folderCreate = $this->_outputDom->documentElement; + +- if (!$this->_syncState instanceof Syncroton_Model_SyncState) { +- if ($this->_logger instanceof Zend_Log) +- $this->_logger->info(__METHOD__ . '::' . __LINE__ . " invalid synckey provided. FolderSync 0 needed."); +- $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_INVALID_SYNC_KEY)); +- +- } else if (!$this->_folder instanceof Syncroton_Model_Folder) { +- $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', Syncroton_Command_FolderSync::STATUS_UNKNOWN_ERROR)); +- ++ if ($this->_status) { ++ $folderCreate->appendChild($this->_outputDom->createElementNS('uri:FolderHierarchy', 'Status', $this->_status)); + } else { + $this->_syncState->counter++; + $this->_syncState->lastsync = $this->_syncTimeStamp; +diff --git a/lib/kolab_sync_backend.php b/lib/kolab_sync_backend.php +index 8d2c9eb..315a803 100644 +--- a/lib/kolab_sync_backend.php ++++ b/lib/kolab_sync_backend.php +@@ -993,6 +993,14 @@ class kolab_sync_backend + } + + /** ++ * Return last storage error ++ */ ++ public static function last_error() ++ { ++ return kolab_storage::$last_error; ++ } ++ ++ /** + * Compares two arrays + * + * @param array $array1 +diff --git a/lib/kolab_sync_data.php b/lib/kolab_sync_data.php +index ce0353a..500ab78 100644 +--- a/lib/kolab_sync_data.php ++++ b/lib/kolab_sync_data.php +@@ -305,6 +305,10 @@ abstract class kolab_sync_data implements Syncroton_Data_IData + + if ($parentid) { + $parent = $this->backend->folder_id2name($parentid, $this->device->deviceid); ++ ++ if ($parent === null) { ++ throw new Syncroton_Exception_Status_FolderCreate(Syncroton_Exception_Status_FolderCreate::PARENT_NOT_FOUND); ++ } + } + + $name = rcube_charset::convert($display_name, kolab_sync::CHARSET, 'UTF7-IMAP'); +@@ -324,7 +328,17 @@ abstract class kolab_sync_data implements Syncroton_Data_IData + return $folder; + } + +- // @TODO: throw exception ++ $errno = Syncroton_Exception_Status_FolderCreate::UNKNOWN_ERROR; ++ ++ // Special case when client tries to create a subfolder of INBOX ++ // which is not possible on Cyrus-IMAP (T2223) ++ if ($parent == 'INBOX' && stripos($this->backend->last_error(), 'invalid') !== false) { ++ $errno = Syncroton_Exception_Status_FolderCreate::SPECIAL_FOLDER; ++ } ++ ++ // Note: Looks like Outlook 2013 ignores any errors on FolderCreate command ++ ++ throw new Syncroton_Exception_Status_FolderCreate($errno); + } + + /** +-- +2.9.3 +
View file
0002-Only-call-kolab_auth-ldap_close-if-the-method-actual.patch
Added
@@ -0,0 +1,28 @@ +From 661badaa42b1a83cc2430d959d09bf8db4716ee1 Mon Sep 17 00:00:00 2001 +From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> +Date: Fri, 24 Feb 2017 09:34:50 +0100 +Subject: PATCH 2/2 Only call kolab_auth::ldap_close() if the method actually + exists + +--- + lib/kolab_sync.php | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/lib/kolab_sync.php b/lib/kolab_sync.php +index 01bb0c7..150f8ec 100644 +--- a/lib/kolab_sync.php ++++ b/lib/kolab_sync.php +@@ -207,7 +207,9 @@ class kolab_sync extends rcube + + // Close LDAP connection from kolab_auth plugin + if (class_exists('kolab_auth', false)) { +- kolab_auth::ldap_close(); ++ if (method_exists('kolab_auth', 'ldap_close')) { ++ kolab_auth::ldap_close(); ++ } + } + } + else { +-- +2.9.3 +
View file
debian.changelog
Changed
@@ -1,3 +1,15 @@ +kolab-syncroton (2.3.4-0~kolab2) unstable; urgency=low + + * Only call kolab_auth::ldap_close() if the method actually exists + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Fri, 24 Feb 2017 15:13:40 +0200 + +kolab-syncroton (2.3.4-0~kolab1.1) unstable; urgency=low + + * Enhance packaging + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Tue, 7 Feb 2017 15:13:40 +0200 + kolab-syncroton (2.3.4-0~kolab1) unstable; urgency=low * Release of version 2.3.4 @@ -21,13 +33,13 @@ kolab-syncroton (2.3.1-0~kolab3) unstable; urgency=low * Revert workaround for #2050 - + -- Christoph Wickert <wickert@kolabsys.com> Thu, 12 Feb 2015 12:22:47 +0100 kolab-syncroton (2.3.1-0~kolab2) unstable; urgency=low * Do a full apache restart to work around #2050 - + -- Christoph Wickert <wickert@kolabsys.com> Mon, 09 Feb 2015 16:29:23 +0100 kolab-syncroton (2.3.1-0~kolab1) unstable; urgency=low @@ -67,7 +79,7 @@ kolab-syncroton (2.3-0~kolab3) unstable; urgency=low * renamed apache config from sitename to sitename.conf - + -- Daniel Hoffend <dh@dotlan.net> Sun, 14 Sep 2014 00:54:02 +0100 kolab-syncroton (2.3-0~kolab2) unstable; urgency=low
View file
debian.control
Changed
@@ -16,7 +16,9 @@ php-net-socket, php5-cli, php5-mysql, - roundcubemail-plugins-kolab (>= 3.1.12), + roundcubemail-core, + roundcubemail-plugin-libcalendaring (>= 3.1.12), + roundcubemail-plugin-libkolab (>= 3.1.12), zendframework | zend-framework, ${misc:Depends} Description: ActiveSync for Kolab Groupware
View file
debian.series
Changed
@@ -0,0 +1,2 @@ +0001-Nicely-handle-errors-on-FolderCreate-T2223.patch -p1 +0002-Only-call-kolab_auth-ldap_close-if-the-method-actual.patch -p1
View file
debian.tar.gz/postinst
Changed
@@ -6,7 +6,9 @@ #DEBHELPER# fixperms() { - chown -R www-data:adm \ + group=$(getent group roundcube_sysgroup >/dev/null 2>&1 && echo "roundcube_sysgroup" || echo "adm") + user=$(getent passwd roundcube_sysuser >/dev/null 2>&1 && echo "roundcube_sysuser" || echo "www-data") + chown -R ${user}:${group} \ /var/lib/kolab-syncroton \ /var/log/kolab-syncroton chmod 750 \ @@ -36,6 +38,11 @@ fixperms update_database a2enmod rewrite >/dev/null 2>&1 || true + + if -f "/etc/plesk-release" ; then + exit 0 + fi + if -e "/etc/apache2/sites-available/kolab-syncroton.conf" -a ! -e "/etc/apache2/sites-enabled/kolab-syncroton.conf" ; then a2ensite kolab-syncroton.conf fi
View file
kolab-syncroton.dsc
Changed
@@ -2,7 +2,7 @@ Source: kolab-syncroton Binary: kolab-syncroton Architecture: all -Version: 2.3.4-0~kolab1 +Version: 2.3.4-0~kolab2 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.