summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2017-02-13 08:41:41 +0545
committerGitHub <noreply@github.com>2017-02-13 08:41:41 +0545
commit0241b34f1a33c3ae83fdf817c8c374b10775335a (patch)
tree512c4b2588d1ba4644bc2d6bc859d8dd559300ce
parente8813e5183d9bfc6fea29c0f67d6d9131a466c7a (diff)
downloadpfsense-0241b34f1a33c3ae83fdf817c8c374b10775335a.zip
pfsense-0241b34f1a33c3ae83fdf817c8c374b10775335a.tar.gz
Fix ldap_get_groups return value when down
In some places ldap_get_groups has: ``` return memberof; ``` It should have the "$" in front, so it will return the $memberof array (that is empty when this happens). This causes issues for callers that expect to have a return value that is either false, an empty array, or an array of the groups.
-rw-r--r--src/etc/inc/auth.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc
index c940705..49572eb 100644
--- a/src/etc/inc/auth.inc
+++ b/src/etc/inc/auth.inc
@@ -1132,7 +1132,7 @@ function ldap_get_groups($username, $authcfg) {
if ($error == true) {
log_error(sprintf(gettext("ERROR! ldap_get_groups() Could not connect to server %s."), $ldapname));
- return memberof;
+ return $memberof;
}
ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0);
@@ -1161,7 +1161,7 @@ function ldap_get_groups($username, $authcfg) {
} else if (!($res = @ldap_bind($ldap, $ldapbindun, $ldapbindpw))) {
log_error(sprintf(gettext("ERROR! ldap_get_groups() could not bind to server %s."), $ldapname));
@ldap_close($ldap);
- return memberof;
+ return $memberof;
}
/* get groups from DN found */
OpenPOWER on IntegriCloud