[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1677-g95e0fb4

Günther Deschner gd at samba.org
Fri Jan 25 16:24:24 GMT 2008


The branch, v3-2-test has been updated
       via  95e0fb452bda4c81b26e3dec4953bbba37940467 (commit)
       via  a52066e6083ff4b0d21b57ba43a812c02c0cbd78 (commit)
       via  cb44c901c1bc66da9f3636020401238ce0005105 (commit)
       via  5db4310d4c9149dc9d68f7684dc961926f94544a (commit)
       via  527aae96a6c2da822a21996ba4e6f7df1941fdbc (commit)
       via  4bdcf07bcc3aaf7c3f7245cfdda06433bcf4ae60 (commit)
       via  6bf75652ef07f5a534cef5034b7aad4fdcbcd265 (commit)
      from  dcd42a1e0642c69348adfaeecef7f7f2f074ac30 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 95e0fb452bda4c81b26e3dec4953bbba37940467
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 16:57:55 2008 +0100

    Remove more unused LSA marshalling functions.
    
    Guenther

commit a52066e6083ff4b0d21b57ba43a812c02c0cbd78
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 16:40:51 2008 +0100

    Remove some unused structures from rpc_lsa.h.
    
    Guenther

commit cb44c901c1bc66da9f3636020401238ce0005105
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 16:35:09 2008 +0100

    Add cmd_netlogon_dsr_enumtrustdom() to rpcclient.
    
    Guenther

commit 5db4310d4c9149dc9d68f7684dc961926f94544a
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 16:33:36 2008 +0100

    run "make idl".
    
    Guenther

commit 527aae96a6c2da822a21996ba4e6f7df1941fdbc
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 16:20:47 2008 +0100

    Fix netr_DsrEnumerateDomainTrusts IDL.
    
    Guenther

commit 4bdcf07bcc3aaf7c3f7245cfdda06433bcf4ae60
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 15:46:11 2008 +0100

    Add LIBNETAPI_LOCAL_SERVER() macro.
    
    Guenther

commit 6bf75652ef07f5a534cef5034b7aad4fdcbcd265
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jan 25 15:45:38 2008 +0100

    No need to close registry on libnetapi_free() anymore.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source/include/rpc_lsa.h             |  122 ----------
 source/lib/netapi/netapi.c           |    1 -
 source/lib/netapi/netapi.h           |    5 +
 source/librpc/gen_ndr/cli_netlogon.c |    2 +-
 source/librpc/gen_ndr/cli_netlogon.h |    2 +-
 source/librpc/gen_ndr/ndr_netlogon.c |   22 +--
 source/librpc/gen_ndr/netlogon.h     |    2 +-
 source/librpc/gen_ndr/srv_netlogon.c |    2 +-
 source/librpc/idl/netlogon.idl       |    2 +-
 source/rpc_parse/parse_lsa.c         |  406 ----------------------------------
 source/rpcclient/cmd_netlogon.c      |   48 ++++
 11 files changed, 61 insertions(+), 553 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index 72aabc3..371c3eb 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -927,45 +927,6 @@ typedef struct lsa_r_removeprivs
 } LSA_R_REMOVEPRIVS;
 
 /*******************************************************/
-#if 0 /* jerry, I think this not correct - gd */
-typedef struct {
-	POLICY_HND	handle;
-	uint32		count;	/* ??? this is what ethereal calls it */
-	DOM_SID		sid;
-} LSA_Q_OPEN_TRUSTED_DOMAIN;
-#endif
-
-/* LSA_Q_OPEN_TRUSTED_DOMAIN - LSA Query Open Trusted Domain */
-typedef struct lsa_q_open_trusted_domain
-{
-	POLICY_HND 	pol; 	/* policy handle */
-	DOM_SID2 	sid;	/* domain sid */
-	uint32 	access_mask;	/* access mask */
-	
-} LSA_Q_OPEN_TRUSTED_DOMAIN;
-
-/* LSA_R_OPEN_TRUSTED_DOMAIN - response to LSA Query Open Trusted Domain */
-typedef struct {
-	POLICY_HND	handle;	/* trustdom policy handle */
-	NTSTATUS	status; /* return code */
-} LSA_R_OPEN_TRUSTED_DOMAIN;
-
-
-/*******************************************************/
-
-typedef struct {
-	POLICY_HND	handle;	
-	UNISTR4		secretname;
-	uint32		access;
-} LSA_Q_OPEN_SECRET;
-
-typedef struct {
-	POLICY_HND	handle;
-	NTSTATUS	status;
-} LSA_R_OPEN_SECRET;
-
-
-/*******************************************************/
 
 typedef struct {
 	POLICY_HND	handle;
@@ -975,87 +936,4 @@ typedef struct {
 	NTSTATUS 	status;
 } LSA_R_DELETE_OBJECT;
 
-
-/*******************************************************/
-
-typedef struct {
-	POLICY_HND      handle;
-	UNISTR4         secretname;
-	uint32          access;
-} LSA_Q_CREATE_SECRET;
-
-typedef struct {
-	POLICY_HND      handle;
-	NTSTATUS        status;
-} LSA_R_CREATE_SECRET;
-
-
-/*******************************************************/
-
-typedef struct {
-	POLICY_HND	handle;	
-	UNISTR4		secretname;
-	uint32		access;
-} LSA_Q_CREATE_TRUSTED_DOMAIN;
-
-typedef struct {
-	POLICY_HND	handle;
-	NTSTATUS	status;
-} LSA_R_CREATE_TRUSTED_DOMAIN;
-
-
-/*******************************************************/
-
-typedef struct {
-	uint32	size;	/* size is written on the wire twice so I 
-			   can only assume that one is supposed to 
-			   be a max length and one is a size */
-	UNISTR2	*data;	/* not really a UNICODE string but the parsing 
-			   is the same */
-} LSA_DATA_BLOB;
-
-typedef struct {
-	POLICY_HND	handle;	
-	LSA_DATA_BLOB   *old_value;
-	LSA_DATA_BLOB	*new_value;
-} LSA_Q_SET_SECRET;
-
-typedef struct {
-	NTSTATUS	status;
-} LSA_R_SET_SECRET;
-
-typedef struct dom_info_kerberos {
-	uint32 enforce_restrictions;
-	NTTIME service_tkt_lifetime;
-	NTTIME user_tkt_lifetime;
-	NTTIME user_tkt_renewaltime;
-	NTTIME clock_skew;
-	NTTIME unknown6;
-} LSA_DOM_INFO_POLICY_KERBEROS;
-
-typedef struct dom_info_efs {
-	uint32 blob_len;
-	UNISTR2 efs_blob;
-} LSA_DOM_INFO_POLICY_EFS;
-
-typedef struct lsa_dom_info_union {
-	uint16 info_class;
-	LSA_DOM_INFO_POLICY_EFS efs_policy;
-	LSA_DOM_INFO_POLICY_KERBEROS krb_policy;
-} LSA_DOM_INFO_UNION;
-
-/* LSA_Q_QUERY_DOM_INFO_POLICY - LSA query info */
-typedef struct lsa_q_query_dom_info_policy
-{
-	POLICY_HND pol;    /* policy handle */
-	uint16 info_class; /* info class */
-} LSA_Q_QUERY_DOM_INFO_POLICY;
-
-typedef struct lsa_r_query_dom_info_policy
-{
-	LSA_DOM_INFO_UNION *info;
-	NTSTATUS status;
-} LSA_R_QUERY_DOM_INFO_POLICY;
-
-
 #endif /* _RPC_LSA_H */
diff --git a/source/lib/netapi/netapi.c b/source/lib/netapi/netapi.c
index 5c3f7ec..47b3ba9 100644
--- a/source/lib/netapi/netapi.c
+++ b/source/lib/netapi/netapi.c
@@ -119,7 +119,6 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
 
 	gencache_shutdown();
 	secrets_shutdown();
-	regdb_close();
 
 	TALLOC_FREE(ctx);
 	TALLOC_FREE(frame);
diff --git a/source/lib/netapi/netapi.h b/source/lib/netapi/netapi.h
index c2f1b48..002fc37 100644
--- a/source/lib/netapi/netapi.h
+++ b/source/lib/netapi/netapi.h
@@ -36,6 +36,11 @@
 /****************************************************************
 ****************************************************************/
 
+#define LIBNETAPI_LOCAL_SERVER(x) (!x || is_myname_or_ipaddr(x))
+
+/****************************************************************
+****************************************************************/
+
 struct libnetapi_ctx {
 	char *debuglevel;
 	char *error_string;
diff --git a/source/librpc/gen_ndr/cli_netlogon.c b/source/librpc/gen_ndr/cli_netlogon.c
index d6739c5..4c9d976 100644
--- a/source/librpc/gen_ndr/cli_netlogon.c
+++ b/source/librpc/gen_ndr/cli_netlogon.c
@@ -2019,7 +2019,7 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
 					      TALLOC_CTX *mem_ctx,
 					      const char *server_name,
 					      uint32_t trust_flags,
-					      struct netr_DomainTrustList **trusts,
+					      struct netr_DomainTrustList *trusts,
 					      WERROR *werror)
 {
 	struct netr_DsrEnumerateDomainTrusts r;
diff --git a/source/librpc/gen_ndr/cli_netlogon.h b/source/librpc/gen_ndr/cli_netlogon.h
index 9716f40..5e58986 100644
--- a/source/librpc/gen_ndr/cli_netlogon.h
+++ b/source/librpc/gen_ndr/cli_netlogon.h
@@ -303,7 +303,7 @@ NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts(struct rpc_pipe_client *cli,
 					      TALLOC_CTX *mem_ctx,
 					      const char *server_name,
 					      uint32_t trust_flags,
-					      struct netr_DomainTrustList **trusts,
+					      struct netr_DomainTrustList *trusts,
 					      WERROR *werror);
 NTSTATUS rpccli_netr_DSRDEREGISTERDNSHOSTRECORDS(struct rpc_pipe_client *cli,
 						 TALLOC_CTX *mem_ctx,
diff --git a/source/librpc/gen_ndr/ndr_netlogon.c b/source/librpc/gen_ndr/ndr_netlogon.c
index 7bc8593..67a54fb 100644
--- a/source/librpc/gen_ndr/ndr_netlogon.c
+++ b/source/librpc/gen_ndr/ndr_netlogon.c
@@ -13350,11 +13350,7 @@ static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push
 		if (r->out.trusts == NULL) {
 			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
 		}
-		if (*r->out.trusts == NULL) {
-			return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
-		}
-		NDR_CHECK(ndr_push_ref_ptr(ndr));
-		NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trusts));
+		NDR_CHECK(ndr_push_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
 		NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result));
 	}
 	return NDR_ERR_SUCCESS;
@@ -13363,10 +13359,8 @@ static enum ndr_err_code ndr_push_netr_DsrEnumerateDomainTrusts(struct ndr_push
 static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull *ndr, int flags, struct netr_DsrEnumerateDomainTrusts *r)
 {
 	uint32_t _ptr_server_name;
-	uint32_t _ptr_trusts;
 	TALLOC_CTX *_mem_save_server_name_0;
 	TALLOC_CTX *_mem_save_trusts_0;
-	TALLOC_CTX *_mem_save_trusts_1;
 	if (flags & NDR_IN) {
 		ZERO_STRUCT(r->out);
 
@@ -13398,14 +13392,7 @@ static enum ndr_err_code ndr_pull_netr_DsrEnumerateDomainTrusts(struct ndr_pull
 		}
 		_mem_save_trusts_0 = NDR_PULL_GET_MEM_CTX(ndr);
 		NDR_PULL_SET_MEM_CTX(ndr, r->out.trusts, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_trusts));
-		if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
-			NDR_PULL_ALLOC(ndr, *r->out.trusts);
-		}
-		_mem_save_trusts_1 = NDR_PULL_GET_MEM_CTX(ndr);
-		NDR_PULL_SET_MEM_CTX(ndr, *r->out.trusts, LIBNDR_FLAG_REF_ALLOC);
-		NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, *r->out.trusts));
-		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_1, LIBNDR_FLAG_REF_ALLOC);
+		NDR_CHECK(ndr_pull_netr_DomainTrustList(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.trusts));
 		NDR_PULL_SET_MEM_CTX(ndr, _mem_save_trusts_0, LIBNDR_FLAG_REF_ALLOC);
 		NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
 	}
@@ -13436,10 +13423,7 @@ _PUBLIC_ void ndr_print_netr_DsrEnumerateDomainTrusts(struct ndr_print *ndr, con
 		ndr->depth++;
 		ndr_print_ptr(ndr, "trusts", r->out.trusts);
 		ndr->depth++;
-		ndr_print_ptr(ndr, "trusts", *r->out.trusts);
-		ndr->depth++;
-		ndr_print_netr_DomainTrustList(ndr, "trusts", *r->out.trusts);
-		ndr->depth--;
+		ndr_print_netr_DomainTrustList(ndr, "trusts", r->out.trusts);
 		ndr->depth--;
 		ndr_print_WERROR(ndr, "result", r->out.result);
 		ndr->depth--;
diff --git a/source/librpc/gen_ndr/netlogon.h b/source/librpc/gen_ndr/netlogon.h
index 64a70ca..d1c00b1 100644
--- a/source/librpc/gen_ndr/netlogon.h
+++ b/source/librpc/gen_ndr/netlogon.h
@@ -1453,7 +1453,7 @@ struct netr_DsrEnumerateDomainTrusts {
 	} in;
 
 	struct {
-		struct netr_DomainTrustList **trusts;/* [ref] */
+		struct netr_DomainTrustList *trusts;/* [ref] */
 		WERROR result;
 	} out;
 
diff --git a/source/librpc/gen_ndr/srv_netlogon.c b/source/librpc/gen_ndr/srv_netlogon.c
index 3f88d7f..692d952 100644
--- a/source/librpc/gen_ndr/srv_netlogon.c
+++ b/source/librpc/gen_ndr/srv_netlogon.c
@@ -3253,7 +3253,7 @@ static bool api_netr_DsrEnumerateDomainTrusts(pipes_struct *p)
 	}
 
 	ZERO_STRUCT(r->out);
-	r->out.trusts = talloc_zero(r, struct netr_DomainTrustList *);
+	r->out.trusts = talloc_zero(r, struct netr_DomainTrustList);
 	if (r->out.trusts == NULL) {
 		talloc_free(r);
 		return false;
diff --git a/source/librpc/idl/netlogon.idl b/source/librpc/idl/netlogon.idl
index fe4cd13..527c690 100644
--- a/source/librpc/idl/netlogon.idl
+++ b/source/librpc/idl/netlogon.idl
@@ -1264,7 +1264,7 @@ interface netlogon
 	WERROR netr_DsrEnumerateDomainTrusts(
 		[in]                 [string,charset(UTF16)] uint16           *server_name,
 		[in]                 netr_TrustFlags  trust_flags,
-		[out,ref]           netr_DomainTrustList **trusts
+		[out,ref]            netr_DomainTrustList *trusts
 		);
 
 
diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c
index 98c4283..1bddfba 100644
--- a/source/rpc_parse/parse_lsa.c
+++ b/source/rpc_parse/parse_lsa.c
@@ -2082,53 +2082,6 @@ bool lsa_io_r_lookup_names4(const char *desc, LSA_R_LOOKUP_NAMES4 *out, prs_stru
 }
 
 /*******************************************************************
- Reads or writes an LSA_Q_OPEN_SECRET structure.
-********************************************************************/
-
-bool lsa_io_q_open_secret(const char *desc, LSA_Q_OPEN_SECRET *in, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_open_secret");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!smb_io_pol_hnd("", &in->handle, ps, depth))
-		return False;
-
-	if(!prs_unistr4 ("secretname", ps, depth, &in->secretname))
-		return False;
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("access", ps, depth, &in->access))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_R_OPEN_SECRET structure.
-********************************************************************/
-
-bool lsa_io_r_open_secret(const char *desc, LSA_R_OPEN_SECRET *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_open_secret");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-   
-	if(!smb_io_pol_hnd("", &out->handle, ps, depth))
-		return False;
-
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
  Inits an LSA_Q_ENUM_PRIVS structure.
 ********************************************************************/
 
@@ -3315,239 +3268,6 @@ bool lsa_io_r_remove_acct_rights(const char *desc, LSA_R_REMOVE_ACCT_RIGHTS *out
 }
 
 /*******************************************************************
- Inits an LSA_Q_OPEN_TRUSTED_DOMAIN structure.
-********************************************************************/
-
-void init_lsa_q_open_trusted_domain(LSA_Q_OPEN_TRUSTED_DOMAIN *q, POLICY_HND *hnd, DOM_SID *sid, uint32 desired_access)
-{
-	memcpy(&q->pol, hnd, sizeof(q->pol));
-
-	init_dom_sid2(&q->sid, sid);
-	q->access_mask = desired_access;
-}
-
-/*******************************************************************
-********************************************************************/
-
-#if 0 /* jerry, I think this not correct - gd */
-bool lsa_io_q_open_trusted_domain(const char *desc, LSA_Q_OPEN_TRUSTED_DOMAIN *in, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_open_trusted_domain");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if (!smb_io_pol_hnd("", &in->handle, ps, depth))
-		return False;
-
-	if(!prs_uint32("count", ps, depth, &in->count))
-		return False;
-
-	if(!smb_io_dom_sid("sid", &in->sid, ps, depth))
-		return False;
-
-	return True;
-}
-#endif
-
-
-/*******************************************************************
-********************************************************************/
-
-bool lsa_io_q_open_trusted_domain(const char *desc, LSA_Q_OPEN_TRUSTED_DOMAIN *q_o, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_open_trusted_domain");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!smb_io_pol_hnd("pol", &q_o->pol, ps, depth))
-		return False;
-
-	if(!smb_io_dom_sid2("sid", &q_o->sid, ps, depth))
-		return False;
-
- 	if(!prs_uint32("access", ps, depth, &q_o->access_mask))
-		return False;
-  
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_R_OPEN_TRUSTED_DOMAIN structure.
-********************************************************************/
-
-bool lsa_io_r_open_trusted_domain(const char *desc, LSA_R_OPEN_TRUSTED_DOMAIN *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_open_trusted_domain");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if (!smb_io_pol_hnd("handle", &out->handle, ps, depth))
-		return False;
-
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool lsa_io_q_create_trusted_domain(const char *desc, LSA_Q_CREATE_TRUSTED_DOMAIN *in, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_create_trusted_domain");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!smb_io_pol_hnd("", &in->handle, ps, depth))
-		return False;
-
-	if(!prs_unistr4 ("secretname", ps, depth, &in->secretname))
-		return False;
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("access", ps, depth, &in->access))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool lsa_io_r_create_trusted_domain(const char *desc, LSA_R_CREATE_TRUSTED_DOMAIN *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_create_trusted_domain");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if (!smb_io_pol_hnd("", &out->handle, ps, depth))
-		return False;
-
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-********************************************************************/
-
-bool lsa_io_q_create_secret(const char *desc, LSA_Q_CREATE_SECRET *in, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_create_secret");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!smb_io_pol_hnd("", &in->handle, ps, depth))
-		return False;
-
-	if(!prs_unistr4 ("secretname", ps, depth, &in->secretname))
-		return False;
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("access", ps, depth, &in->access))
-		return False;
-
-	return True;
-}
-


-- 
Samba Shared Repository


More information about the samba-cvs mailing list