summaryrefslogtreecommitdiff
path: root/source3/passdb/lookup_sid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-11-26 21:02:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:35 -0500
commitd36eb68cb5be37423a98eb1a122c14f45d4fdaa0 (patch)
treeda6109033c6ed239beb07d4db1e78b9a01162c26 /source3/passdb/lookup_sid.c
parentadd1493a86d62c298f4a9e0686e8e81deab70c57 (diff)
downloadsamba-d36eb68cb5be37423a98eb1a122c14f45d4fdaa0.tar.gz
samba-d36eb68cb5be37423a98eb1a122c14f45d4fdaa0.tar.bz2
samba-d36eb68cb5be37423a98eb1a122c14f45d4fdaa0.zip
r11920: Rename local_lookup_rid to lookup_global_sam_rid, add lookup_builtin_rid.
Volker (This used to be commit bc8836d5d7361041ce935f65bf2d172e1eb43299)
Diffstat (limited to 'source3/passdb/lookup_sid.c')
-rw-r--r--source3/passdb/lookup_sid.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index 5c0bf0aef8..b397e084c3 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -66,7 +66,8 @@ BOOL lookup_name(const char *domain, const char *name, DOM_SID *psid, enum SID_N
Tries local lookup first - for local sids, then tries winbind.
*****************************************************************/
-BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAME_USE *name_type)
+BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name,
+ enum SID_NAME_USE *name_type)
{
if (!name_type)
return False;
@@ -83,6 +84,15 @@ BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAM
return True;
}
+ if (sid_check_is_in_our_domain(sid)) {
+ uint32 rid;
+ SMB_ASSERT(sid_peek_rid(sid, &rid));
+
+ /* For our own domain passdb is responsible */
+ fstrcpy(dom_name, get_global_sam_name());
+ return lookup_global_sam_rid(rid, name, name_type);
+ }
+
if (sid_check_is_builtin(sid)) {
/* Got through map_domain_sid_to_name here so that the mapping
@@ -97,13 +107,21 @@ BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAM
return True;
}
- if (sid_check_is_in_our_domain(sid)) {
+ if (sid_check_is_in_builtin(sid)) {
uint32 rid;
+
SMB_ASSERT(sid_peek_rid(sid, &rid));
- /* For our own domain passdb is responsible */
- fstrcpy(dom_name, get_global_sam_name());
- return local_lookup_rid(rid, name, name_type);
+ /* Got through map_domain_sid_to_name here so that the mapping
+ * of S-1-5-32 to the name "BUILTIN" in as few places as
+ * possible. We might add i18n... */
+ SMB_ASSERT(map_domain_sid_to_name(&global_sid_Builtin,
+ dom_name));
+
+ /* There's only aliases in S-1-5-32 */
+ *name_type = SID_NAME_ALIAS;
+
+ return lookup_builtin_rid(rid, name);
}
if (winbind_lookup_sid(sid, dom_name, name, name_type)) {