mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r23672: Allow msrpc_name_to_sid() to be called without a domain_name and just a name.
Guenther
This commit is contained in:
parent
25f3bfdb1f
commit
eeed62b6ca
@ -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 ));
|
||||
|
Loading…
Reference in New Issue
Block a user