diff options
author | Gerald Carter <jerry@samba.org> | 2003-07-09 16:44:47 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-07-09 16:44:47 +0000 |
commit | 16ff7b26f6b9d288cbd1d39e075b637e24da13a6 (patch) | |
tree | b20088c7adac8df8823defc6649db0a9607c0c6a /source3/smbd | |
parent | 816724fb39ba1d13f553704b2deaa3e8e716c5ab (diff) | |
download | samba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.tar.gz samba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.tar.bz2 samba-16ff7b26f6b9d288cbd1d39e075b637e24da13a6.zip |
Large set of changes to add UNIX account/group management
to winbindd. See README.idmap-and-winbind-changes for details.
(This used to be commit 1111bc7b0c7165e1cdf8d90eb49f4c368d2eded6)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/uid.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 6ca2aa336d..8d8ce136a9 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -809,17 +809,28 @@ NTSTATUS sid_to_uid(const DOM_SID *psid, uid_t *puid) if (fetch_uid_from_cache(puid, psid)) return NT_STATUS_OK; - /* - * First we must look up the name and decide if this is a user sid. - */ + /* if this is our DIS then go straight to a local lookup */ + + if ( sid_compare_domain(get_global_sam_sid(), psid) == 0 ) { + DEBUG(10,("sid_to_uid: my domain (%s) - trying local.\n", + sid_string_static(psid) )); + + if ( (ret = local_sid_to_uid(puid, psid, &name_type)) == True ) + store_uid_sid_cache(psid, *puid); + + return (ret ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL); + } + + + /* look up the name and decide if this is a user sid */ if ( (!winbind_lookup_sid(psid, dom_name, name, &name_type)) || (name_type != SID_NAME_USER) ) { DEBUG(10,("sid_to_uid: winbind lookup for sid %s failed - trying local.\n", - sid_to_string(sid_str, psid) )); + sid_string_static(psid) )); - ret = local_sid_to_uid(puid, psid, &name_type); - if (ret) + if ( (ret = local_sid_to_uid(puid, psid, &name_type)) == True ) store_uid_sid_cache(psid, *puid); + return (ret ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL); } |