summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/lookup_sid.c7
-rw-r--r--source3/passdb/passdb.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index e40a71c145..4df497461a 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -76,6 +76,13 @@ BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAM
/* Check if this is our own sid. This should perhaps be done by
winbind? For the moment handle it here. */
+ if (sid->num_auths == 4 && sid_equal(get_global_sam_sid(), sid)) {
+ DOM_SID tmp_sid;
+ sid_copy(&tmp_sid, sid);
+ return map_domain_sid_to_name(&tmp_sid, dom_name) &&
+ local_lookup_sid(sid, name, name_type);
+ }
+
if (sid->num_auths == 5) {
DOM_SID tmp_sid;
uint32 rid;
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 74ac8fa865..35317b9816 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -742,6 +742,14 @@ BOOL local_lookup_sid(const DOM_SID *sid, char *name, enum SID_NAME_USE *psid_na
GROUP_MAP map;
BOOL ret;
+ if (sid_equal(get_global_sam_sid(), sid)) {
+ *psid_name_use = SID_NAME_DOMAIN;
+ fstrcpy(name, "");
+ DEBUG(5,("local_lookup_sid: SID is our own domain-sid: %s.\n",
+ sid_string_static(sid)));
+ return True;
+ }
+
if (!sid_peek_check_rid(get_global_sam_sid(), sid, &rid)){
DEBUG(0,("local_lookup_sid: sid_peek_check_rid return False! SID: %s\n",
sid_string_static(&map.sid)));