aboutsummaryrefslogtreecommitdiffstats
path: root/libds
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-09-12 18:00:21 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-09-12 19:23:06 +0200
commit1e52e72e409a3a5b52e4f75b985122ac94d8aa4a (patch)
tree9d97372fd8cec0033f12c8537a5016ee421adf2b /libds
parent2fb111f7313ddd3bf5f4eee0a54284b201100605 (diff)
downloadsamba-1e52e72e409a3a5b52e4f75b985122ac94d8aa4a.tar.gz
samba-1e52e72e409a3a5b52e4f75b985122ac94d8aa4a.tar.xz
samba-1e52e72e409a3a5b52e4f75b985122ac94d8aa4a.zip
libds:flag_mapping.c - introduce a call which maps the "userAccountControl" to the default primary group RID
Diffstat (limited to 'libds')
-rw-r--r--libds/common/flag_mapping.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libds/common/flag_mapping.c b/libds/common/flag_mapping.c
index d95780ed544..dfe619971f8 100644
--- a/libds/common/flag_mapping.c
+++ b/libds/common/flag_mapping.c
@@ -4,6 +4,7 @@
Copyright (C) Stefan (metze) Metzmacher 2002
Copyright (C) Andrew Tridgell 2004
+ Copyright (C) Matthias Dieter Wallnöfer 2010
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -145,3 +146,15 @@ enum lsa_SidType ds_atype_map(uint32_t atype)
}
return SID_NAME_UNKNOWN;
}
+
+/* get the default primary group RID for a given userAccountControl
+ * (informations according to MS-SAMR 3.1.1.8.1) */
+uint32_t ds_uf2prim_group_rid(uint32_t uf)
+{
+ uint32_t prim_group_rid = DOMAIN_RID_USERS;
+
+ if (uf & UF_SERVER_TRUST_ACCOUNT) prim_group_rid = DOMAIN_RID_DCS;
+ else if (uf & UF_WORKSTATION_TRUST_ACCOUNT) prim_group_rid = DOMAIN_RID_DOMAIN_MEMBERS;
+
+ return prim_group_rid;
+}