summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 85038314ba..7fa27e8a91 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -259,7 +259,11 @@ static int samldb_check_primaryGroupID(struct samldb_ctx *ac)
rid = samdb_result_uint(ac->msg, "primaryGroupID", (uint32_t) -1);
if (rid == (uint32_t) -1) {
- rid = DOMAIN_RID_USERS;
+ uint32_t uac = samdb_result_uint(ac->msg, "userAccountControl",
+ 0);
+
+ rid = ds_uf2prim_group_rid(uac);
+
ret = samdb_msg_add_uint(ldb, ac->msg, ac->msg,
"primaryGroupID", rid);
if (ret != LDB_SUCCESS) {