diff options
author | Günther Deschner <gd@samba.org> | 2007-07-02 09:46:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:45 -0500 |
commit | 7d6b8ff5b73c89dbd08339a8f8e22dec804a0fe1 (patch) | |
tree | 5ceb640b1c3e9a1dcd1c2f430ea06cd1fd3b3439 /source3/nsswitch/winbindd_rpc.c | |
parent | 2ae9a0b4d83f10af02a75a16673cdef9c4f3873b (diff) | |
download | samba-7d6b8ff5b73c89dbd08339a8f8e22dec804a0fe1.tar.gz samba-7d6b8ff5b73c89dbd08339a8f8e22dec804a0fe1.tar.bz2 samba-7d6b8ff5b73c89dbd08339a8f8e22dec804a0fe1.zip |
r23672: Allow msrpc_name_to_sid() to be called without a domain_name and just a name.
Guenther
(This used to be commit eeed62b6ca86bcb0875de90a5d8c65948fd80215)
Diffstat (limited to 'source3/nsswitch/winbindd_rpc.c')
-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 )); |