summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--source3/passdb/pdb_ads.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index 7a299e58547..68ce2b469ca 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -974,8 +974,7 @@ static NTSTATUS pdb_ads_enum_group_memberships(struct pdb_methods *m,
{
struct pdb_ads_state *state = talloc_get_type_abort(
m->private_data, struct pdb_ads_state);
- struct pdb_ads_samu_private *priv = pdb_ads_get_samu_private(
- m, user);
+ struct pdb_ads_samu_private *priv;
const char *attrs[1] = { "objectSid" };
struct tldap_message **groups;
int i, rc, count;
@@ -983,6 +982,15 @@ static NTSTATUS pdb_ads_enum_group_memberships(struct pdb_methods *m,
struct dom_sid *group_sids;
gid_t *gids;
+ priv = pdb_ads_get_samu_private(m, user);
+ if (priv == NULL) {
+ DEBUG(10, ("Could not get pdb_ads_samu_private\n"));
+ *pp_sids = NULL;
+ *pp_gids = NULL;
+ *p_num_groups = 0;
+ return NT_STATUS_OK;
+ }
+
rc = pdb_ads_search_fmt(
state, state->domaindn, TLDAP_SCOPE_SUB,
attrs, ARRAY_SIZE(attrs), 0, talloc_tos(), &groups,