summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-04 12:46:15 +0100
committerKarolin Seeger <kseeger@samba.org>2008-03-04 13:58:13 +0100
commit295734191fc0165a2ea17561a0fd39bffb9625d6 (patch)
treee693c6bc1d1717851e0c933e71c749c13b68d3b4
parent59e745ea67c8dfe1168ca08eec59cb29c333c403 (diff)
downloadsamba-295734191fc0165a2ea17561a0fd39bffb9625d6.tar.gz
samba-295734191fc0165a2ea17561a0fd39bffb9625d6.tar.bz2
samba-295734191fc0165a2ea17561a0fd39bffb9625d6.zip
Fix lsa_QueryInfoPolicy: make proper talloc copies of the sids.
Guenther (cherry picked from commit b9441232d66d78e66464be6c9748a023681ce6ca) (This used to be commit 1081da4d83dbfb6d87c3267c5e00e668b2151294)
-rw-r--r--source3/rpc_server/srv_lsa_nt.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index c2502141e5..c03630d6f9 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -603,15 +603,22 @@ NTSTATUS _lsa_QueryInfoPolicy(pipes_struct *p,
case ROLE_DOMAIN_PDC:
case ROLE_DOMAIN_BDC:
name = get_global_sam_name();
- sid = get_global_sam_sid();
+ sid = sid_dup_talloc(p->mem_ctx, get_global_sam_sid());
+ if (!sid) {
+ return NT_STATUS_NO_MEMORY;
+ }
break;
case ROLE_DOMAIN_MEMBER:
name = lp_workgroup();
/* We need to return the Domain SID here. */
- if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid))
- sid = &domain_sid;
- else
+ if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
+ sid = sid_dup_talloc(p->mem_ctx, &domain_sid);
+ if (!sid) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ } else {
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
+ }
break;
case ROLE_STANDALONE:
name = lp_workgroup();