summaryrefslogtreecommitdiffstats
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-06 10:15:50 +0100
committerVolker Lendecke <vl@samba.org>2011-02-06 16:44:56 +0100
commit8c367162f09c7772091a80d8426de6bead0c030d (patch)
tree67e52953bf0e46da6a47ca2165baa6c2aa7b00ba /source3/passdb
parent08f2a8562f67982f69f4bbf5b1034a42529ab226 (diff)
downloadsamba-8c367162f09c7772091a80d8426de6bead0c030d.tar.gz
samba-8c367162f09c7772091a80d8426de6bead0c030d.tar.xz
samba-8c367162f09c7772091a80d8426de6bead0c030d.zip
s3: In pdb_ads, cope with artificial samu structs
Diffstat (limited to 'source3/passdb')
-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,