diff options
Diffstat (limited to 'source3/lib/util_builtin.c')
-rw-r--r-- | source3/lib/util_builtin.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source3/lib/util_builtin.c b/source3/lib/util_builtin.c index b370a76c69..c87c84927f 100644 --- a/source3/lib/util_builtin.c +++ b/source3/lib/util_builtin.c @@ -52,6 +52,14 @@ static const struct rid_name_map builtin_aliases[] = { "Windows Authorization Access Group" }, { BUILTIN_RID_TS_LICENSE_SERVERS, "Terminal Server License Servers" }, + { BUILTIN_RID_DISTRIBUTED_COM_USERS, + "Distributed COM Users" }, + { BUILTIN_RID_CRYPTO_OPERATORS, + "Cryptographic Operators" }, + { BUILTIN_RID_EVENT_LOG_READERS, + "Event Log Readers" }, + { BUILTIN_RID_CERT_SERV_DCOM_ACCESS, + "Certificate Service DCOM Access" }, { 0, NULL}}; /******************************************************************* @@ -121,3 +129,30 @@ bool sid_check_is_in_builtin(const struct dom_sid *sid) return sid_check_is_builtin(&dom_sid); } + +/******************************************************************** + Check if the SID is one of the well-known builtin SIDs (S-1-5-32-x) +*********************************************************************/ + +bool sid_check_is_wellknown_builtin(const struct dom_sid *sid) +{ + struct dom_sid dom_sid; + const struct rid_name_map *aliases = builtin_aliases; + uint32_t rid; + + sid_copy(&dom_sid, sid); + sid_split_rid(&dom_sid, &rid); + + if (!sid_check_is_builtin(&dom_sid)) { + return false; + } + + while (aliases->name != NULL) { + if (aliases->rid == rid) { + return True; + } + aliases++; + } + + return False; +} |