summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_passdb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-09-03 14:36:43 -0400
committerSimo Sorce <idra@samba.org>2008-09-03 14:36:43 -0400
commit3fa16da8c70af9c54e03ea2a497d18009d2126e9 (patch)
tree2a0c13ba91c9c1701d151ec6b5174abe658be0ee /source3/winbindd/winbindd_passdb.c
parent04691de379fa692b22fc9f0b58c0bd829ce7cc7a (diff)
downloadsamba-3fa16da8c70af9c54e03ea2a497d18009d2126e9.tar.gz
samba-3fa16da8c70af9c54e03ea2a497d18009d2126e9.tar.bz2
samba-3fa16da8c70af9c54e03ea2a497d18009d2126e9.zip
Revert "Split lookup_name() and create a new functiong called"
This reverts commit 8594edf666c29fd4ddf1780da842683dd81483b6. (This used to be commit ad462e2e2d025a7fc23e7dea32b2b442b528970b)
Diffstat (limited to 'source3/winbindd/winbindd_passdb.c')
-rw-r--r--source3/winbindd/winbindd_passdb.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source3/winbindd/winbindd_passdb.c b/source3/winbindd/winbindd_passdb.c
index fbe4a27abf..5677c01be1 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,26 +107,28 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
DEBUG(10,("winbindd_passdb: limiting name_to_sid() to explicit mappings\n"));
break;
}
-
- 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);
+
+ 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;
+ }
} else {
- res = lookup_domain_name(mem_ctx, domain_name, name, flags,
- NULL, NULL, sid, type);
+ fullname = name;
}
- if (!res) {
+ DEBUG(10, ("Finding fullname %s\n", fullname));
+
+ if ( !lookup_name( mem_ctx, fullname, flags, NULL, NULL, sid, type ) ) {
return NT_STATUS_NONE_MAPPED;
}
- DEBUG(10, ("name_to_sid for [%s\\%s] returned %s (%s)\n",
- domain_name?domain_name:"(NULL)", name,
+ DEBUG(10, ("name_to_sid for %s returned %s (%s)\n",
+ fullname,
sid_string_dbg(sid),
sid_type_lookup((uint32)*type)));
-
+
return NT_STATUS_OK;
}