From 9eecb45924b2eb5c6631043f33ccd338cbf376d2 Mon Sep 17 00:00:00 2001 From: Vlastimil Holer Date: Mon, 27 Nov 2017 09:43:30 +0100 Subject: [PATCH] B #1489: Fix LDAP group membership checks with custom 'user_group_field' --- src/authm_mad/remotes/ldap/ldap_auth.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/authm_mad/remotes/ldap/ldap_auth.rb b/src/authm_mad/remotes/ldap/ldap_auth.rb index 9a7ac5220c..091e91b3fb 100644 --- a/src/authm_mad/remotes/ldap/ldap_auth.rb +++ b/src/authm_mad/remotes/ldap/ldap_auth.rb @@ -66,6 +66,11 @@ class OpenNebula::LdapAuth @options[:attributes] << @options[:user_field] end + # fetch the user group field only if we need that + if @options[:group] or !@options[:rfc2307bis] + @options[:attributes] << @options[:user_group_field] + end + ops[:host]=@options[:host] if @options[:host] ops[:port]=@options[:port].to_i if @options[:port] ops[:encryption]=@options[:encryption] if @options[:encryption]