Fix LDAP account lookup when user not in group

If a user is not a member of any group and the backing LDAP server
is an Active Directory instance we won't receive a 'memberOf'
attribute in the user's account data.  Instead of crashing with
NPE we should handle the case as though the list was empty.

I cleaned up the LdapQuery.Result code a little while checking the
other uses of data obtained from the directory, as we should always
handle a missing attribute gracefully.

Change-Id: Id2f030815bd597dcba5712f7def5d10818b4eb79
Signed-off-by: Shawn O. Pearce <sop@google.com>
2 files changed