[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-710-g9f148da
Günther Deschner
gd at samba.org
Tue Apr 8 21:11:22 GMT 2008
The branch, v3-2-test has been updated
via 9f148daaf2e240002914183655c2b2cc9067759f (commit)
via ad3073749089f7166d9070c232ef02e6ba203215 (commit)
via 7b56a4bcf23f124fc9530fe1401add094f25fb28 (commit)
from 6f474326030b916ca972b68ce36e4d7287192a33 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 9f148daaf2e240002914183655c2b2cc9067759f
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 8 23:09:24 2008 +0200
Fix lsa_QueryTrustedDomainInfo caller.
Guenther
commit ad3073749089f7166d9070c232ef02e6ba203215
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 8 23:04:22 2008 +0200
Re-run make idl.
Guenther
commit 7b56a4bcf23f124fc9530fe1401add094f25fb28
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 8 23:02:48 2008 +0200
Fix IDL for lsa_LookupPrivName.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/librpc/gen_ndr/cli_lsa.c | 6 ++----
source/librpc/gen_ndr/cli_lsa.h | 2 +-
source/librpc/gen_ndr/lsa.h | 2 +-
source/librpc/gen_ndr/ndr_lsa.c | 39 +++++++++++++++++++++++++++------------
source/librpc/gen_ndr/srv_lsa.c | 2 +-
source/librpc/idl/lsa.idl | 4 ++--
source/rpcclient/cmd_lsarpc.c | 4 ++--
7 files changed, 36 insertions(+), 23 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/librpc/gen_ndr/cli_lsa.c b/source/librpc/gen_ndr/cli_lsa.c
index 8df638f..4e81f70 100644
--- a/source/librpc/gen_ndr/cli_lsa.c
+++ b/source/librpc/gen_ndr/cli_lsa.c
@@ -1398,7 +1398,7 @@ NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
struct lsa_LUID *luid /* [in] [ref] */,
- struct lsa_StringLarge *name /* [out] [unique] */)
+ struct lsa_StringLarge **name /* [out] [ref] */)
{
struct lsa_LookupPrivName r;
NTSTATUS status;
@@ -1431,9 +1431,7 @@ NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
}
/* Return variables */
- if (name && r.out.name) {
- *name = *r.out.name;
- }
+ *name = *r.out.name;
/* Return result */
return r.out.result;
diff --git a/source/librpc/gen_ndr/cli_lsa.h b/source/librpc/gen_ndr/cli_lsa.h
index 6befb1d..f3333a0 100644
--- a/source/librpc/gen_ndr/cli_lsa.h
+++ b/source/librpc/gen_ndr/cli_lsa.h
@@ -161,7 +161,7 @@ NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
struct lsa_LUID *luid /* [in] [ref] */,
- struct lsa_StringLarge *name /* [out] [unique] */);
+ struct lsa_StringLarge **name /* [out] [ref] */);
NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
diff --git a/source/librpc/gen_ndr/lsa.h b/source/librpc/gen_ndr/lsa.h
index 044d07b..1e3d316 100644
--- a/source/librpc/gen_ndr/lsa.h
+++ b/source/librpc/gen_ndr/lsa.h
@@ -1049,7 +1049,7 @@ struct lsa_LookupPrivName {
} in;
struct {
- struct lsa_StringLarge *name;/* [unique] */
+ struct lsa_StringLarge **name;/* [ref] */
NTSTATUS result;
} out;
diff --git a/source/librpc/gen_ndr/ndr_lsa.c b/source/librpc/gen_ndr/ndr_lsa.c
index 396791a..c7d428b 100644
--- a/source/librpc/gen_ndr/ndr_lsa.c
+++ b/source/librpc/gen_ndr/ndr_lsa.c
@@ -7674,9 +7674,12 @@ static enum ndr_err_code ndr_push_lsa_LookupPrivName(struct ndr_push *ndr, int f
NDR_CHECK(ndr_push_lsa_LUID(ndr, NDR_SCALARS, r->in.luid));
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.name));
- if (r->out.name) {
- NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
+ if (r->out.name == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.name));
+ if (*r->out.name) {
+ NDR_CHECK(ndr_push_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name));
}
NDR_CHECK(ndr_push_NTSTATUS(ndr, NDR_SCALARS, r->out.result));
}
@@ -7689,6 +7692,7 @@ static enum ndr_err_code ndr_pull_lsa_LookupPrivName(struct ndr_pull *ndr, int f
TALLOC_CTX *_mem_save_handle_0;
TALLOC_CTX *_mem_save_luid_0;
TALLOC_CTX *_mem_save_name_0;
+ TALLOC_CTX *_mem_save_name_1;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -7706,20 +7710,28 @@ static enum ndr_err_code ndr_pull_lsa_LookupPrivName(struct ndr_pull *ndr, int f
NDR_PULL_SET_MEM_CTX(ndr, r->in.luid, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_lsa_LUID(ndr, NDR_SCALARS, r->in.luid));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_luid_0, LIBNDR_FLAG_REF_ALLOC);
+ NDR_PULL_ALLOC(ndr, r->out.name);
+ ZERO_STRUCTP(r->out.name);
}
if (flags & NDR_OUT) {
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.name);
+ }
+ _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.name, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_name));
if (_ptr_name) {
- NDR_PULL_ALLOC(ndr, r->out.name);
+ NDR_PULL_ALLOC(ndr, *r->out.name);
} else {
- r->out.name = NULL;
+ *r->out.name = NULL;
}
- if (r->out.name) {
- _mem_save_name_0 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.name, 0);
- NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.name));
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, 0);
+ if (*r->out.name) {
+ _mem_save_name_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->out.name, 0);
+ NDR_CHECK(ndr_pull_lsa_StringLarge(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.name));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_1, 0);
}
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_NTSTATUS(ndr, NDR_SCALARS, &r->out.result));
}
return NDR_ERR_SUCCESS;
@@ -7750,10 +7762,13 @@ _PUBLIC_ void ndr_print_lsa_LookupPrivName(struct ndr_print *ndr, const char *na
ndr->depth++;
ndr_print_ptr(ndr, "name", r->out.name);
ndr->depth++;
- if (r->out.name) {
- ndr_print_lsa_StringLarge(ndr, "name", r->out.name);
+ ndr_print_ptr(ndr, "name", *r->out.name);
+ ndr->depth++;
+ if (*r->out.name) {
+ ndr_print_lsa_StringLarge(ndr, "name", *r->out.name);
}
ndr->depth--;
+ ndr->depth--;
ndr_print_NTSTATUS(ndr, "result", r->out.result);
ndr->depth--;
}
diff --git a/source/librpc/gen_ndr/srv_lsa.c b/source/librpc/gen_ndr/srv_lsa.c
index e6fca84..249bdc0 100644
--- a/source/librpc/gen_ndr/srv_lsa.c
+++ b/source/librpc/gen_ndr/srv_lsa.c
@@ -2521,7 +2521,7 @@ static bool api_lsa_LookupPrivName(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.name = talloc_zero(r, struct lsa_StringLarge);
+ r->out.name = talloc_zero(r, struct lsa_StringLarge *);
if (r->out.name == NULL) {
talloc_free(r);
return false;
diff --git a/source/librpc/idl/lsa.idl b/source/librpc/idl/lsa.idl
index 994553f..cb16f64 100644
--- a/source/librpc/idl/lsa.idl
+++ b/source/librpc/idl/lsa.idl
@@ -677,8 +677,8 @@ import "security.idl";
/* Function: 0x20 */
NTSTATUS lsa_LookupPrivName (
[in] policy_handle *handle,
- [in] lsa_LUID *luid,
- [out,unique] lsa_StringLarge *name
+ [in,ref] lsa_LUID *luid,
+ [out,ref] lsa_StringLarge **name
);
diff --git a/source/rpcclient/cmd_lsarpc.c b/source/rpcclient/cmd_lsarpc.c
index 245969c..0d530ce 100644
--- a/source/rpcclient/cmd_lsarpc.c
+++ b/source/rpcclient/cmd_lsarpc.c
@@ -1043,7 +1043,7 @@ static NTSTATUS cmd_lsa_query_trustdominfobyname(struct rpc_pipe_client *cli,
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32 access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
- union lsa_TrustedDomainInfo info;
+ union lsa_TrustedDomainInfo *info = NULL;
enum lsa_TrustDomInfoEnum info_class = 1;
struct lsa_String trusted_domain;
@@ -1070,7 +1070,7 @@ static NTSTATUS cmd_lsa_query_trustdominfobyname(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
- display_trust_dom_info(mem_ctx, &info, info_class, cli->pwd.password);
+ display_trust_dom_info(mem_ctx, info, info_class, cli->pwd.password);
done:
rpccli_lsa_Close(cli, mem_ctx, &pol);
--
Samba Shared Repository
More information about the samba-cvs
mailing list