From ddc0716fa88bcef0dfe2396ad4b93a5904629d71 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 6 Apr 2004 22:02:47 +0000 Subject: r91: Fix lsalookupnames. Previously we'd fail if we didn't find the name, but we never checked if it was a domain user and didn't find a local one. (This used to be commit 68022f5ebc55d1f3403dee5198d364cff300baf5) --- source3/lib/util_sid.c | 7 +++++++ source3/rpc_server/srv_lsa_nt.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index 50bbb4c72c..e317f8f84e 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -201,6 +201,13 @@ void split_domain_name(const char *fullname, char *domain, char *name) fstrcpy(domain, full_name); fstrcpy(name, p+1); } else { + if(!lp_domain_logons()) { + fstrcpy(domain, global_myname()); + fstrcpy(name, full_name); + } else { + fstrcpy(domain, lp_workgroup()); + fstrcpy(name, full_name); + } fstrcpy(domain, global_myname()); fstrcpy(name, full_name); } diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 07c024e1ca..9801ce47f8 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -165,6 +165,12 @@ static void init_lsa_rid2s(DOM_R_REF *ref, DOM_RID2 *rid2, status = lookup_name(dom_name, user, &sid, &name_type); + if((name_type == SID_NAME_UNKNOWN) && (lp_server_role() == ROLE_DOMAIN_MEMBER) && (strncmp(dom_name, full_name, strlen(dom_name)) != 0)) { + DEBUG(5, ("init_lsa_rid2s: domain name not provided and local account not found, using member domain\n")); + fstrcpy(dom_name, lp_workgroup()); + status = lookup_name(dom_name, user, &sid, &name_type); + } + DEBUG(5, ("init_lsa_rid2s: %s\n", status ? "found" : "not found")); -- cgit