summaryrefslogtreecommitdiffstats
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-11-07 16:55:53 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-11-07 18:58:44 +0100
commit27ca838c082f080f53b6c8da153509f4f33b0ff6 (patch)
tree29213fc6d5f8247ba2b35d53d17b733b591e55e7 /source4/rpc_server
parent8ef055bad502f59ee1243303637a5a5fe6dc0d5b (diff)
downloadsamba-27ca838c082f080f53b6c8da153509f4f33b0ff6.tar.gz
samba-27ca838c082f080f53b6c8da153509f4f33b0ff6.tar.xz
samba-27ca838c082f080f53b6c8da153509f4f33b0ff6.zip
s4-lsa: Make sure we also duplicate the domain_name.
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 7 18:58:44 CET 2013 on sn-devel-104
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/lsa/lsa_lookup.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c
index daf571987c9..c9c07cffb25 100644
--- a/source4/rpc_server/lsa/lsa_lookup.c
+++ b/source4/rpc_server/lsa/lsa_lookup.c
@@ -313,7 +313,11 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx,
return NT_STATUS_OK;
}
if (strcasecmp_m(username, state->domain_dns) == 0) {
- *authority_name = state->domain_name;
+ *authority_name = talloc_strdup(mem_ctx,
+ state->domain_name);
+ if (*authority_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
*sid = dom_sid_dup(mem_ctx, state->domain_sid);
if (*sid == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -323,7 +327,11 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx,
return NT_STATUS_OK;
}
if (strcasecmp_m(username, state->domain_name) == 0) {
- *authority_name = state->domain_name;
+ *authority_name = talloc_strdup(mem_ctx,
+ state->domain_name);
+ if (*authority_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
*sid = dom_sid_dup(mem_ctx, state->domain_sid);
if (*sid == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -387,10 +395,18 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx,
*authority_name = NAME_BUILTIN;
domain_dn = state->builtin_dn;
} else if (strcasecmp_m(domain, state->domain_dns) == 0) {
- *authority_name = state->domain_name;
+ *authority_name = talloc_strdup(mem_ctx,
+ state->domain_name);
+ if (*authority_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
domain_dn = state->domain_dn;
} else if (strcasecmp_m(domain, state->domain_name) == 0) {
- *authority_name = state->domain_name;
+ *authority_name = talloc_strdup(mem_ctx,
+ state->domain_name);
+ if (*authority_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
domain_dn = state->domain_dn;
} else {
/* Not local, need to ask winbind in future */