diff options
author | Günther Deschner <gd@samba.org> | 2008-10-21 13:03:49 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-10-27 19:33:23 +0100 |
commit | 8e622f57e705e92095d0f1079618366fd82f80f8 (patch) | |
tree | 940a1e32086f72808fc67d2104c1d63aa0c9b0a6 | |
parent | ea886864190e7d3bb9f58260ec854489c4642c86 (diff) | |
download | samba-8e622f57e705e92095d0f1079618366fd82f80f8.tar.gz samba-8e622f57e705e92095d0f1079618366fd82f80f8.tar.bz2 samba-8e622f57e705e92095d0f1079618366fd82f80f8.zip |
s4-lsa: merge lsa_QueryDomainInformationPolicy from s3 lsa idl.
Guenther
-rw-r--r-- | source4/librpc/idl/lsa.idl | 2 | ||||
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 17 | ||||
-rw-r--r-- | source4/torture/rpc/lsa.c | 2 |
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); |