Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-08-18 12:31:47 +0300
committerGitHub <noreply@github.com>2016-08-18 12:31:47 +0300
commit24224020b1d25bdc326f051ab04f71ca2ececadd (patch)
tree0be22d54fae93751540458f297a3b8d5e6de1764
parent57fd46184978f36a9e217aea1705cf9b0bef9519 (diff)
parent81d0273cb4b69b5e8e9bababab89d96ea4ff318b (diff)
Merge pull request #25393 from owncloud/stable8.1-fdb0d4ad528425b934d9b039c9f09c132b86d0f4
[stable8.1] check if renamed user is still valid by reapplying the ld…
-rw-r--r--apps/user_ldap/lib/access.php2
-rw-r--r--apps/user_ldap/user_ldap.php7
2 files changed, 7 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 9fb14d20545..91ce0102642 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -176,7 +176,7 @@ class Access extends LDAPUtility implements user\IUserTools {
//in case an error occurs , e.g. object does not exist
return false;
}
- if (empty($attr)) {
+ if (empty($attr) && ($filter === 'objectclass=*' || $this->ldap->countEntries($cr, $rr) === 1)) {
\OCP\Util::writeLog('user_ldap', 'readAttribute: '.$dn.' found', \OCP\Util::DEBUG);
return array();
}
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 096d3686afe..499ef77e06c 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -190,7 +190,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
$dn = $user->getDN();
//check if user really still exists by reading its entry
- if(!is_array($this->access->readAttribute($dn, ''))) {
+ if(!is_array($this->access->readAttribute($dn, '', $this->access->connection->ldapUserFilter))) {
$lcr = $this->access->connection->getConnectionResource();
if(is_null($lcr)) {
throw new \Exception('No LDAP Connection to server ' . $this->access->connection->ldapHost);
@@ -202,6 +202,11 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
return false;
}
$newDn = $this->access->getUserDnByUuid($uuid);
+ //check if renamed user is still valid by reapplying the ldap filter
+ if(!is_array($this->access->readAttribute($newDn, '', $this->access->connection->ldapUserFilter))) {
+ return false;
+ }
+
$this->access->getUserMapper()->setDNbyUUID($newDn, $uuid);
return true;
} catch (\Exception $e) {