From b08894ba7727f9bce8d0e41d76ad5d2ae4a3b7e3 Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@owncloud.com>
Date: Tue, 5 Mar 2013 13:47:03 +0100
Subject: [PATCH] LDAP: error codes can be negative, too

---
 apps/user_ldap/lib/access.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 05249b8f16..d409591283 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -650,7 +650,7 @@ abstract class Access {
 		$linkResources = array_pad(array(), count($base), $link_resource);
 		$sr = ldap_search($linkResources, $base, $filter, $attr);
 		$error = ldap_errno($link_resource);
-		if(!is_array($sr) || $error > 0) {
+		if(!is_array($sr) || $error != 0) {
 			\OCP\Util::writeLog('user_ldap',
 				'Error when searching: '.ldap_error($link_resource).' code '.ldap_errno($link_resource),
 				\OCP\Util::ERROR);
-- 
GitLab