s4:samr RPC server - "dcesrv_samr_info_DomGeneralInformation" - count always all...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 25 Oct 2010 18:48:18 +0000 (20:48 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 25 Oct 2010 19:37:27 +0000 (19:37 +0000)
One pair are universal an global groups (on the SAMR pipe called "groups") and
the other one are the domain and builtin local groups (on the SAMR pipe called
"aliases").

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Oct 25 19:37:27 UTC 2010 on sn-devel-104

source4/rpc_server/samr/dcesrv_samr.c

index be96883fc61071b6079375fe12d92f4f0b0877be..e419485cdcdeb428266d631e6df64fa046fffd59 100644 (file)
@@ -524,11 +524,13 @@ static NTSTATUS dcesrv_samr_info_DomGeneralInformation(struct samr_domain_state
                                             "(objectClass=user)");
        info->num_groups = samdb_search_count(state->sam_ctx, mem_ctx,
                                              state->domain_dn,
-                                             "(&(objectClass=group)(groupType=%u))",
+                                             "(&(objectClass=group)(|(groupType=%u)(groupType=%u)))",
+                                             GTYPE_SECURITY_UNIVERSAL_GROUP,
                                              GTYPE_SECURITY_GLOBAL_GROUP);
        info->num_aliases = samdb_search_count(state->sam_ctx, mem_ctx,
                                               state->domain_dn,
-                                              "(&(objectClass=group)(groupType=%u))",
+                                              "(&(objectClass=group)(|(groupType=%u)(groupType=%u)))",
+                                              GTYPE_SECURITY_BUILTIN_LOCAL_GROUP,
                                               GTYPE_SECURITY_DOMAIN_LOCAL_GROUP);
 
        return NT_STATUS_OK;
@@ -3570,8 +3572,8 @@ static NTSTATUS dcesrv_samr_GetGroupsForUser(struct dcesrv_call_state *dce_call,
                                    attrs, d_state->domain_sid,
                                    "(&(member=%s)(|(grouptype=%d)(grouptype=%d))(objectclass=group))",
                                    ldb_dn_get_linearized(a_state->account_dn),
-                                   GTYPE_SECURITY_GLOBAL_GROUP,
-                                   GTYPE_SECURITY_UNIVERSAL_GROUP);
+                                   GTYPE_SECURITY_UNIVERSAL_GROUP,
+                                   GTYPE_SECURITY_GLOBAL_GROUP);
        if (count < 0)
                return NT_STATUS_INTERNAL_DB_CORRUPTION;