summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/lsa.idl2
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c17
-rw-r--r--source4/torture/rpc/lsa.c2
3 files changed, 13 insertions, 8 deletions
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 9af5fcffd4..52701211f6 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -974,7 +974,7 @@ import "misc.idl", "security.idl";
NTSTATUS lsa_QueryDomainInformationPolicy(
[in] policy_handle *handle,
[in] uint16 level,
- [out,unique,switch_is(level)] lsa_DomainInformationPolicy *info
+ [out,ref,switch_is(level)] lsa_DomainInformationPolicy **info
);
/* Function 0x36 */
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 99afdea654..01c0b03295 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -2962,19 +2962,21 @@ static NTSTATUS dcesrv_lsa_QueryDomainInformationPolicy(struct dcesrv_call_state
TALLOC_CTX *mem_ctx,
struct lsa_QueryDomainInformationPolicy *r)
{
- r->out.info = talloc(mem_ctx, union lsa_DomainInformationPolicy);
- if (!r->out.info) {
+ union lsa_DomainInformationPolicy *info;
+
+ info = talloc(r->out.info, union lsa_DomainInformationPolicy);
+ if (!info) {
return NT_STATUS_NO_MEMORY;
}
switch (r->in.level) {
case LSA_DOMAIN_INFO_POLICY_EFS:
- talloc_free(r->out.info);
- r->out.info = NULL;
+ talloc_free(info);
+ *r->out.info = NULL;
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
case LSA_DOMAIN_INFO_POLICY_KERBEROS:
{
- struct lsa_DomainInfoKerberos *k = &r->out.info->kerberos_info;
+ struct lsa_DomainInfoKerberos *k = &info->kerberos_info;
struct smb_krb5_context *smb_krb5_context;
int ret = smb_krb5_init_context(mem_ctx,
dce_call->event_ctx,
@@ -2991,11 +2993,12 @@ static NTSTATUS dcesrv_lsa_QueryDomainInformationPolicy(struct dcesrv_call_state
k->user_tkt_renewaltime = 0; /* Need to find somewhere to store this, and query in KDC too */
k->clock_skew = krb5_get_max_time_skew(smb_krb5_context->krb5_context);
talloc_free(smb_krb5_context);
+ *r->out.info = info;
return NT_STATUS_OK;
}
default:
- talloc_free(r->out.info);
- r->out.info = NULL;
+ talloc_free(info);
+ *r->out.info = NULL;
return NT_STATUS_INVALID_INFO_CLASS;
}
}
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 56faab0476..a5f7f73959 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -2294,6 +2294,7 @@ static bool test_QueryDomainInfoPolicy(struct dcerpc_pipe *p,
struct policy_handle *handle)
{
struct lsa_QueryDomainInformationPolicy r;
+ union lsa_DomainInformationPolicy *info = NULL;
NTSTATUS status;
int i;
bool ret = true;
@@ -2303,6 +2304,7 @@ static bool test_QueryDomainInfoPolicy(struct dcerpc_pipe *p,
for (i=2;i<4;i++) {
r.in.handle = handle;
r.in.level = i;
+ r.out.info = &info;
printf("\nTrying QueryDomainInformationPolicy level %d\n", i);