diff options
author | Günther Deschner <gd@samba.org> | 2008-03-04 12:46:15 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-03-04 12:52:37 +0100 |
commit | 33322a7ced16e4b4325a813b4143833954882745 (patch) | |
tree | 6ae95c14218e1ba2e79553821f0669217b0c2c6e /source3 | |
parent | 5a4182012de914116798455793fd1963c2e65d28 (diff) | |
download | samba-33322a7ced16e4b4325a813b4143833954882745.tar.gz samba-33322a7ced16e4b4325a813b4143833954882745.tar.bz2 samba-33322a7ced16e4b4325a813b4143833954882745.zip |
Fix lsa_QueryInfoPolicy: make proper talloc copies of the sids.
Guenther
(This used to be commit b9441232d66d78e66464be6c9748a023681ce6ca)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 15 |
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(); |