summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-08-17 19:54:41 -0400
committerSimo Sorce <idra@samba.org>2008-08-17 19:54:41 -0400
commit5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4 (patch)
treefea9e40e62f5ce034b3f346dad1d9ed2c9cdd743 /source3/winbindd
parentee6c02f7c8bc92190b9f5474057f5885f29c2f8a (diff)
downloadsamba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.tar.gz
samba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.tar.bz2
samba-5e7655fa27f7b2c9c54edfc25f86974dbdb23ea4.zip
Split lookup_name() and create a new functiong called
lookup_domain_name(). This new function accept separated strings for domain and name. (This used to be commit 8594edf666c29fd4ddf1780da842683dd81483b6)
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_passdb.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c
index 5677c01be1..fbe4a27abf 100644
--- a/source3/winbindd/winbindd_passdb.c
+++ b/source3/winbindd/winbindd_passdb.c
@@ -94,8 +94,8 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
DOM_SID *sid,
enum lsa_SidType *type)
{
- const char *fullname;
uint32 flags = LOOKUP_NAME_ALL;
+ bool res;
switch ( original_cmd ) {
case WINBINDD_LOOKUPNAME:
@@ -107,28 +107,26 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
DEBUG(10,("winbindd_passdb: limiting name_to_sid() to explicit mappings\n"));
break;
}
-
- if (domain_name && domain_name[0] && strchr_m(name, '\\') == NULL) {
- fullname = talloc_asprintf(mem_ctx, "%s\\%s",
- domain_name, name);
- if (fullname == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+
+ DEBUG(10, ("looking up name [%s\\%s] (domain\\name) \n",
+ domain_name?domain_name:"(NULL)", name));
+
+ if (strchr_m(name, '\\')) {
+ res = lookup_name(mem_ctx, name, flags, NULL, NULL, sid, type);
} else {
- fullname = name;
+ res = lookup_domain_name(mem_ctx, domain_name, name, flags,
+ NULL, NULL, sid, type);
}
- DEBUG(10, ("Finding fullname %s\n", fullname));
-
- if ( !lookup_name( mem_ctx, fullname, flags, NULL, NULL, sid, type ) ) {
+ if (!res) {
return NT_STATUS_NONE_MAPPED;
}
- DEBUG(10, ("name_to_sid for %s returned %s (%s)\n",
- fullname,
+ DEBUG(10, ("name_to_sid for [%s\\%s] returned %s (%s)\n",
+ domain_name?domain_name:"(NULL)", name,
sid_string_dbg(sid),
sid_type_lookup((uint32)*type)));
-
+
return NT_STATUS_OK;
}