Projects
Kolab:16
php-kolab-net-ldap3
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
php-kolab-net-ldap3.spec
Changed
@@ -24,8 +24,8 @@ %else Name: php-kolab-net-ldap3 %endif -Version: 1.0.4 -Release: 2%{?dist} +Version: 1.0.6 +Release: 1%{?dist} Summary: Object oriented interface for searching and manipulating LDAP-entries Group: Development/Libraries License: GPLv3+ @@ -33,7 +33,9 @@ Source0: pear-Net-LDAP3-%{version}.tar.gz -Patch0001: 0001-Ensure-that-multi-valued-attributes-have-sequential-.patch +Patch0001: 0001-Improve-setup-of-the-schema-cache-location.patch +Patch0002: 0002-Fix-regression-in-setting-LDAP-cache-file-path.patch +Patch0003: 0003-Fix-bug-where-ldapsearch-command-was-failing-when-co.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -51,6 +53,8 @@ %setup -q -n pear-Net-LDAP3-%{version} %patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 %build @@ -74,6 +78,10 @@ %{_datadir}/%{php}/Net/LDAP3/Result.php %changelog +* Wed May 02 2018 Christoph Erhardt <kolab@sicherha.de> - 1.0.6-1 +- New upstream release 1.0.6 +- Add upstream patches + * Thu Oct 22 2015 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 1.0.4-2 - Ensure multi-valued attributes have sequential indexes
View file
0001-Ensure-that-multi-valued-attributes-have-sequential-.patch
Deleted
@@ -1,26 +0,0 @@ -From e049b764a5adbf14bd14df081e4ecd08d06bc678 Mon Sep 17 00:00:00 2001 -From: "Jeroen van Meeuwen (Kolab Systems)" <vanmeeuwen@kolabsys.com> -Date: Thu, 22 Oct 2015 11:20:19 +0200 -Subject: [PATCH] Ensure that multi-valued attributes have sequential indexes - in the array - ---- - lib/Net/LDAP3.php | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php -index a3e9f79..5ecce1e 100644 ---- a/lib/Net/LDAP3.php -+++ b/lib/Net/LDAP3.php -@@ -199,6 +199,8 @@ class Net_LDAP3 - foreach ($attributes as $attr_name => $attr_value) { - if (empty($attr_value)) { - unset($attributes[$attr_name]); -+ } else if (is_array($attr_value)) { -+ $attributes[$attr_name] = array_values($attr_value); - } - } - --- -2.4.3 -
View file
0001-Improve-setup-of-the-schema-cache-location.patch
Added
@@ -0,0 +1,30 @@ +From d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837 Mon Sep 17 00:00:00 2001 +Message-Id: <d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837.1525290244.git.christoph@terra.fritz.box> +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Fri, 24 Nov 2017 11:59:50 +0100 +Subject: [PATCH 1/3] Improve setup of the schema cache location + +1. Prevent from errors when the host is configured e.g. with ldap:// prefix +2. Use sys_get_temp_dir() to get the system tmp directory +--- + lib/Net/LDAP3.php | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php +index 8872e47..b5dcae3 100644 +--- a/lib/Net/LDAP3.php ++++ b/lib/Net/LDAP3.php +@@ -2149,8 +2149,9 @@ class Net_LDAP3 + ); + + $_ldap_schema_cache_cfg = array( +- 'path' => "/tmp/" . $host . ":" . ($port ? $port : '389') . "-Net_LDAP2_Schema.cache", + 'max_age' => 86400, ++ 'path' => sprintf('%s/%s:%d-Net_LDAP2_Schema.cache', ++ (sys_get_temp_dir() ?: '/tmp'), str_replace('://', ':', $host) . (strpos($host, ":$port") ? '' : ":$port")), + ); + + $_ldap = Net_LDAP2::connect($_ldap_cfg); +-- +2.14.1 +
View file
0002-Fix-regression-in-setting-LDAP-cache-file-path.patch
Added
@@ -0,0 +1,30 @@ +From 858fd6076366626b6ff45e8bdf57dedeb210ce34 Mon Sep 17 00:00:00 2001 +Message-Id: <858fd6076366626b6ff45e8bdf57dedeb210ce34.1525290244.git.christoph@terra.fritz.box> +In-Reply-To: <d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837.1525290244.git.christoph@terra.fritz.box> +References: <d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837.1525290244.git.christoph@terra.fritz.box> +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Tue, 26 Dec 2017 08:10:41 +0000 +Subject: [PATCH 2/3] Fix regression in setting LDAP cache file path + +--- + lib/Net/LDAP3.php | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php +index b5dcae3..937c785 100644 +--- a/lib/Net/LDAP3.php ++++ b/lib/Net/LDAP3.php +@@ -2150,8 +2150,8 @@ class Net_LDAP3 + + $_ldap_schema_cache_cfg = array( + 'max_age' => 86400, +- 'path' => sprintf('%s/%s:%d-Net_LDAP2_Schema.cache', +- (sys_get_temp_dir() ?: '/tmp'), str_replace('://', ':', $host) . (strpos($host, ":$port") ? '' : ":$port")), ++ 'path' => sprintf('%s/%s-Net_LDAP2_Schema.cache', ++ sys_get_temp_dir() ?: '/tmp', str_replace('://', ':', $host) . (strpos($host, ":$port") ? '' : ":$port")), + ); + + $_ldap = Net_LDAP2::connect($_ldap_cfg); +-- +2.14.1 +
View file
0003-Fix-bug-where-ldapsearch-command-was-failing-when-co.patch
Added
@@ -0,0 +1,29 @@ +From 56210fdaec70bc1f8f7455a75a6cd34e3a2f7e6d Mon Sep 17 00:00:00 2001 +Message-Id: <56210fdaec70bc1f8f7455a75a6cd34e3a2f7e6d.1525290244.git.christoph@terra.fritz.box> +In-Reply-To: <d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837.1525290244.git.christoph@terra.fritz.box> +References: <d2d74d6aaa43af3dd1735d5afdc51ccd2f78e837.1525290244.git.christoph@terra.fritz.box> +From: Aleksander Machniak <machniak@kolabsys.com> +Date: Tue, 26 Dec 2017 08:13:24 +0000 +Subject: [PATCH 3/3] Fix bug where ldapsearch command was failing when + configured host contained protocol schema prefix + +--- + lib/Net/LDAP3.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php +index 937c785..b12185f 100644 +--- a/lib/Net/LDAP3.php ++++ b/lib/Net/LDAP3.php +@@ -738,7 +738,7 @@ class Net_LDAP3 + $moz_ldapsearch, + '-x', + '-h', +- $this->_current_host, ++ preg_replace('|^[a-z]+://|i', '', $this->_current_host), + '-p', + $this->config_get('port', 389), + '-b', +-- +2.14.1 +
View file
debian.changelog
Changed
@@ -1,3 +1,10 @@ +php-net-ldap3 (1.0.6-1~kolab1) unstable; urgency=low + + * Release version 1.0.6 + * Add upstream patches + + -- Christoph Erhardt <kolab@sicherha.de> Wed, 02 May 2018 21:53:23 +0200 + php-net-ldap3 (1.0.4-0~kolab2) unstable; urgency=low * Adjust dependencies for future Debian/Ubuntu releases
View file
debian.series
Changed
@@ -1,1 +1,3 @@ -0001-Ensure-that-multi-valued-attributes-have-sequential-.patch -p1 +0001-Improve-setup-of-the-schema-cache-location.patch -p1 +0002-Fix-regression-in-setting-LDAP-cache-file-path.patch -p1 +0003-Fix-bug-where-ldapsearch-command-was-failing-when-co.patch -p1
View file
pear-Net-LDAP3-1.0.6.tar.gz/.arcconfig
Added
@@ -0,0 +1,3 @@ +{ + "phabricator.uri": "https://git.kolab.org" +}
View file
pear-Net-LDAP3-1.0.4.tar.gz/composer.json -> pear-Net-LDAP3-1.0.6.tar.gz/composer.json
Changed
@@ -1,8 +1,8 @@ { - "name": "kolab/Net_LDAP3", + "name": "kolab/net_ldap3", "description": "A successor of the PEAR:Net_LDAP2 module providing advanced functionality for accessing LDAP directories", "type": "library", - "version": "1.0.4", + "version": "1.0.6", "keywords": ["pear", "ldap", "vlv"], "homepage": "http://git.kolab.org/pear/Net_LDAP3/", "license": "GPL-3.0+", @@ -23,15 +23,9 @@ "role": "Developer" } ], - "repositories": [ - { - "type": "pear", - "url": "http://pear.php.net/" - } - ], "require": { "php": ">=5.3.3", - "pear-pear/Net_LDAP2": ">=2.0.12" + "pear/net_ldap2": ">=2.0.12" }, "autoload": { "classmap": ["lib/"]
View file
pear-Net-LDAP3-1.0.4.tar.gz/lib/Net/LDAP3.php -> pear-Net-LDAP3-1.0.6.tar.gz/lib/Net/LDAP3.php
Changed
@@ -70,6 +70,7 @@ * 'use_tls' => false, * 'ldap_version' => 3, // using LDAPv3 * 'auth_method' => '', // SASL authentication method (for proxy auth), e.g. DIGEST-MD5 + * 'gssapi_cn' => null // Kerberos cache name (KRB5CCNAME) for SASL GSSAPI authentication * 'numsub_filter' => '(objectClass=organizationalUnit)', // with VLV, we also use numSubOrdinates to query the total number of records. Set this filter to get all numSubOrdinates attributes for counting * 'referrals' => false, // Sets the LDAP_OPT_REFERRALS option. Mostly used in multi-domain Active Directory setups * 'network_timeout' => 10, // The timeout (in seconds) for connect + bind arrempts. This is only supported in PHP >= 5.3.0 with OpenLDAP 2.x @@ -199,12 +200,14 @@ foreach ($attributes as $attr_name => $attr_value) { if (empty($attr_value)) { unset($attributes[$attr_name]); + } else if (is_array($attr_value)) { + $attributes[$attr_name] = array_values($attr_value); } } $this->_debug("C: Add $entry_dn: " . json_encode($attributes)); - if (($add_result = @ldap_add($this->conn, $entry_dn, $attributes)) == false) { + if (!ldap_add($this->conn, $entry_dn, $attributes)) { $this->_debug("S: " . ldap_error($this->conn)); $this->_warning("LDAP: Adding entry $entry_dn failed. " . ldap_error($this->conn)); @@ -1511,7 +1514,7 @@ * * @return boolean True on success, False on error */ - public function sasl_bind($authc, $pass, $authz=null) + public function sasl_bind($authc = '', $pass = '', $authz = null) { if (!$this->conn) { return false; @@ -1526,12 +1529,18 @@ $authz = 'u:' . $authz; } + $gssapi = $this->config_get('gssapi_cn'); $method = $this->config_get('auth_method'); + if (empty($method)) { $method = 'DIGEST-MD5'; } - $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz]"); + if ($gssapi && strcasecmp($method, 'GSSAPI') == 0) { + putenv("KRB5CCNAME=$gssapi"); + } + + $this->_debug("C: Bind [mech: $method, authc: $authc, authz: $authz, gssapi: $gssapi]"); if (ldap_sasl_bind($this->conn, null, $pass, $method, null, $authc, $authz)) { $this->_debug("S: OK"); @@ -1922,9 +1931,7 @@ private function config_set_debug($value) { $this->config['debug'] = (bool) $value; - if ((int)($value) > 0) { - ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, (int)($value)); - } + ldap_set_option(null, LDAP_OPT_DEBUG_LEVEL, (int) $value); } /**
View file
pear-Net-LDAP3-1.0.4.tar.gz/lib/Net/LDAP3/Result.php -> pear-Net-LDAP3-1.0.6.tar.gz/lib/Net/LDAP3/Result.php
Changed
@@ -65,15 +65,25 @@ $this->result = $result; } + /** + * Property value getter + * + * @param string $property Property name + * @param mixed $default Return value if proprty is not set + * + * @return mixed Property value + */ public function get($property, $default = null) { - if (isset($this->$property)) { - return $this->$property; - } else { - return $default; - } + return isset($this->$property) ? $this->$property : $default; } + /** + * Property value setter + * + * @param string $property Property name + * @param mixed $value Property value + */ public function set($property, $value) { $this->$property = $value; @@ -81,14 +91,22 @@ /** * Wrapper for ldap_sort() + * + * @param string $attr The attribute to use as a key in the sort + * + * @return bool True on success, False on failure */ public function sort($attr) { - return ldap_sort($this->conn, $this->result, $attr); + // @TODO: Don't use ldap_sort() it's deprecated since PHP7 + // and will be removed in future + return @ldap_sort($this->conn, $this->result, $attr); } /** * Get entries count + * + * @return int Number of entries in the result */ public function count() { @@ -157,5 +175,4 @@ { return (bool)$this->current; } - }
View file
php-net-ldap3.dsc
Changed
@@ -2,7 +2,7 @@ Source: php-net-ldap3 Binary: php-net-ldap3 Architecture: all -Version: 1.0.4-0~kolab2 +Version: 1.0.6-1~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Christoph Wickert <wickert@kolabsys.com> Homepage: http://kolab.org @@ -12,5 +12,5 @@ Package-List: php-net-ldap3 deb php optional Files: - 00000000000000000000000000000000 0 pear-Net-LDAP3-1.0.4.tar.gz + 00000000000000000000000000000000 0 pear-Net-LDAP3-1.0.6.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
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
.