diff options
author | Gerald Carter <jerry@samba.org> | 2005-06-08 22:10:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:08 -0500 |
commit | fed660877c16562265327c6093ea645cf4176b5c (patch) | |
tree | e92ae1356542ba095d806bbe1093fa56fbc8ddcc /source3/passdb | |
parent | 66bb4f03c3466205488f72e4878e8801c5bbb295 (diff) | |
download | samba-fed660877c16562265327c6093ea645cf4176b5c.tar.gz samba-fed660877c16562265327c6093ea645cf4176b5c.tar.bz2 samba-fed660877c16562265327c6093ea645cf4176b5c.zip |
r7415: * big change -- volker's new async winbindd from trunk
(This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/lookup_sid.c | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c index 8a3d35defd..6fcd4582f2 100644 --- a/source3/passdb/lookup_sid.c +++ b/source3/passdb/lookup_sid.c @@ -112,6 +112,44 @@ BOOL lookup_sid(const DOM_SID *sid, fstring dom_name, fstring name, enum SID_NAM return True; } +BOOL sid_to_local_user_name(const DOM_SID *sid, fstring username) +{ + fstring dom_name; + fstring name; + enum SID_NAME_USE type; + + if (!sid_check_is_in_our_domain(sid)) + return False; + + if (!lookup_sid(sid, dom_name, name, &type)) + return False; + + if (type != SID_NAME_USER) + return False; + + fstrcpy(username, name); + return True; +} + +BOOL sid_to_local_dom_grp_name(const DOM_SID *sid, fstring groupname) +{ + fstring dom_name; + fstring name; + enum SID_NAME_USE type; + + if (!sid_check_is_in_our_domain(sid)) + return False; + + if (!lookup_sid(sid, dom_name, name, &type)) + return False; + + if (type != SID_NAME_DOM_GRP) + return False; + + fstrcpy(groupname, name); + return True; +} + /***************************************************************** Id mapping cache. This is to avoid Winbind mappings already @@ -250,8 +288,8 @@ static BOOL fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid) if (sid_compare(&pc->sid, psid) == 0) { fstring sid; *pgid = pc->gid; - DEBUG(3,("fetch uid from cache %u -> %s\n", - (unsigned int)*pgid, sid_to_string(sid, psid))); + DEBUG(3,("fetch gid from cache %u -> %s\n", + (unsigned int)*pgid, sid_to_string(sid, psid))); DLIST_PROMOTE(gid_sid_cache_head, pc); return True; } |