diff options
-rw-r--r-- | source3/nsswitch/winbindd_rpc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c index 7899d62fea..31ccdc1f73 100644 --- a/source3/nsswitch/winbindd_rpc.c +++ b/source3/nsswitch/winbindd_rpc.c @@ -269,18 +269,20 @@ NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain, struct rpc_pipe_client *cli; POLICY_HND lsa_policy; - if(name == NULL || *name=='\0') { - DEBUG(3,("rpc: name_to_sid name=%s\n", domain_name)); - full_name = talloc_asprintf(mem_ctx, "%s", domain_name); - } else { - DEBUG(3,("rpc: name_to_sid name=%s\\%s\n", domain_name, name)); - full_name = talloc_asprintf(mem_ctx, "%s\\%s", domain_name, name); - } + if (name == NULL || *name=='\0') { + full_name = talloc_asprintf(mem_ctx, "%s", domain_name); + } else if (domain_name == NULL || *domain_name == '\0') { + full_name = talloc_asprintf(mem_ctx, "%s", name); + } else { + full_name = talloc_asprintf(mem_ctx, "%s\\%s", domain_name, name); + } if (!full_name) { DEBUG(0, ("talloc_asprintf failed!\n")); return NT_STATUS_NO_MEMORY; } + DEBUG(3,("rpc: name_to_sid name=%s\n", full_name)); + ws_name_return( full_name, WB_REPLACE_CHAR ); DEBUG(3,("name_to_sid [rpc] %s for domain %s\n", full_name?full_name:"", domain_name )); |