summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_rpc.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-01-26 11:48:42 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-01-26 11:48:42 +0000
commitba8c1c6e459aef204aa93e9cf7e717209335a06b (patch)
tree598da297115b7b43274c4a6980b0f2d0eecd6b06 /source3/nsswitch/winbindd_rpc.c
parent670f46fd4c6ef8eb338284c820f8560bcece095a (diff)
downloadsamba-ba8c1c6e459aef204aa93e9cf7e717209335a06b.tar.gz
samba-ba8c1c6e459aef204aa93e9cf7e717209335a06b.tar.bz2
samba-ba8c1c6e459aef204aa93e9cf7e717209335a06b.zip
Back out some of the less well thought out ideas from last weeks work on
winbind default domains, particulary now I understand whats going on a lot better. This ensures that the RPC client code does as little 'magic' as possible - this is up to the application/user. (Where - for to name->sid code - it was all along). This leaves the change that allows the sid->name code to return domains and usernames in seperate paramaters. Andrew Bartlett (This used to be commit 5dfba2cf536f761b0aee314ed9e30dc53900b691)
Diffstat (limited to 'source3/nsswitch/winbindd_rpc.c')
-rw-r--r--source3/nsswitch/winbindd_rpc.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c
index 7d9a26f906..67fcd5de66 100644
--- a/source3/nsswitch/winbindd_rpc.c
+++ b/source3/nsswitch/winbindd_rpc.c
@@ -177,17 +177,28 @@ static NTSTATUS name_to_sid(struct winbindd_domain *domain,
DOM_SID *sids = NULL;
uint32 *types = NULL;
int num_sids;
- const char *domain_name = domain->name;
+ const char *full_name;
- if (!(mem_ctx = talloc_init_named("name_to_sid[rpc]")))
+ if (!(mem_ctx = talloc_init_named("name_to_sid[rpc] for [%s]\\[%s]", domain->name, name))) {
+ DEBUG(0, ("talloc_init failed!\n"));
return NT_STATUS_NO_MEMORY;
+ }
- if (!(hnd = cm_get_lsa_handle(domain->name)))
+ if (!(hnd = cm_get_lsa_handle(domain->name))) {
+ talloc_destroy(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
+ }
+ full_name = talloc_asprintf(mem_ctx, "%s\\%s", domain->name, name);
+
+ if (!full_name) {
+ DEBUG(0, ("talloc_asprintf failed!\n"));
+ talloc_destroy(mem_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+
status = cli_lsa_lookup_names(hnd->cli, mem_ctx, &hnd->pol, 1,
- &domain_name, &name,
- &sids, &types, &num_sids);
+ &full_name, &sids, &types, &num_sids);
/* Return rid and type if lookup successful */
if (NT_STATUS_IS_OK(status)) {