summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/samldb.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-09-12 18:26:06 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-09-12 19:23:06 +0200
commit7f424155e62d04d23bb1c825ecd546eed18725e0 (patch)
tree4f645127c6f120b68e984b6a67cfcea2ffccd24a /source4/dsdb/samdb/ldb_modules/samldb.c
parent1e52e72e409a3a5b52e4f75b985122ac94d8aa4a (diff)
downloadsamba-7f424155e62d04d23bb1c825ecd546eed18725e0.tar.gz
samba-7f424155e62d04d23bb1c825ecd546eed18725e0.tar.bz2
samba-7f424155e62d04d23bb1c825ecd546eed18725e0.zip
s4:samldb LDB module - "samldb_check_primaryGroupID" - support RID derivation from "userAccountControl"
Specified in MS-SAMR 3.1.1.8.1 and probably fixes also bug #7441.
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/samldb.c')
-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) {