diff options
author | Phil Davis <phil.davis@inf.org> | 2017-02-13 08:41:41 +0545 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-02-13 09:16:59 -0200 |
commit | 42a2f7da9d2a8ff91d2c08615474d602267e20ad (patch) | |
tree | 5464ecf97b3ba4051e3cf9246e78911bf9c1ef31 | |
parent | 3129d3e9b8a86b6a360de0b606f121a69478b14e (diff) | |
download | pfsense-42a2f7da9d2a8ff91d2c08615474d602267e20ad.zip pfsense-42a2f7da9d2a8ff91d2c08615474d602267e20ad.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.
(cherry picked from commit 0241b34f1a33c3ae83fdf817c8c374b10775335a)
-rw-r--r-- | src/etc/inc/auth.inc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index 3688659..4835a00 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -1156,7 +1156,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); @@ -1185,7 +1185,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 */ |