[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2005-g5ddfa6c

Günther Deschner gd at samba.org
Fri Feb 8 09:41:10 GMT 2008


The branch, v3-2-test has been updated
       via  5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e (commit)
       via  28ef55cbf1662dfe6b64a837ade830f5c864b4b9 (commit)
       via  f193d7d944e89f94b968a369d6566d13a4fbef5c (commit)
       via  ce22abcea3446e4ad42e8e04654b9855b173c5a1 (commit)
      from  0fac016d9d0018c983576d5cc8c3e06f40360b73 (commit)

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


- Log -----------------------------------------------------------------
commit 5ddfa6cbe96460c7816a4ec65c6d2497d1d4190e
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 8 10:23:47 2008 +0100

    Use rpccli_lsa_QueryInfoPolicy() in net.
    
    Guenther

commit 28ef55cbf1662dfe6b64a837ade830f5c864b4b9
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 8 10:21:25 2008 +0100

    Use rpccli_lsa_QueryInfoPolicy() in libnet_join.
    
    Guenther

commit f193d7d944e89f94b968a369d6566d13a4fbef5c
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 8 02:25:54 2008 +0100

    Remove unused marshalling for LSA_QUERY_INFO.
    
    Guenther

commit ce22abcea3446e4ad42e8e04654b9855b173c5a1
Author: Günther Deschner <gd at samba.org>
Date:   Fri Feb 8 02:12:30 2008 +0100

    Use rpccli_lsa_QueryInfoPolicy() all over the place.
    
    Guenther

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

Summary of changes:
 source/include/rpc_lsa.h       |  109 -------------
 source/libnet/libnet_join.c    |   11 +-
 source/rpc_client/cli_lsarpc.c |   87 ----------
 source/rpc_parse/parse_lsa.c   |  351 ----------------------------------------
 source/rpcclient/rpcclient.c   |   12 +-
 source/utils/net_domain.c      |   10 +-
 source/utils/net_rpc.c         |   55 ++++---
 source/utils/net_rpc_join.c    |   10 +-
 source/winbindd/winbindd_cm.c  |   31 ++--
 9 files changed, 80 insertions(+), 596 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index b86324d..45470e7 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -89,81 +89,6 @@
 #define LSA_AUDIT_NUM_CATEGORIES_WIN2K	9
 #define LSA_AUDIT_NUM_CATEGORIES LSA_AUDIT_NUM_CATEGORIES_NT4
 
-/* level 1 is auditing settings */
-typedef struct dom_query_1
-{
-	uint32 percent_full;
-	uint32 log_size;
-	NTTIME retention_time;
-	uint8 shutdown_in_progress;
-	NTTIME time_to_shutdown;
-	uint32 next_audit_record;
-	uint32 unknown;
-} DOM_QUERY_1;
-
-
-/* level 2 is auditing settings */
-typedef struct dom_query_2
-{
-	uint32 auditing_enabled;
-	uint32 count1; /* usualy 7, at least on nt4sp4 */
-	uint32 count2; /* the same */
-	uint32 ptr;
-	uint32 *auditsettings;
-} DOM_QUERY_2;
-
-/* DOM_QUERY - info class 3 and 5 LSA Query response */
-typedef struct dom_query_info_3
-{
-	uint16 uni_dom_max_len; /* domain name string length * 2 */
-	uint16 uni_dom_str_len; /* domain name string length * 2 */
-	uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */
-	uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */
-	UNISTR2 uni_domain_name; /* domain name (unicode string) */
-	DOM_SID2 dom_sid; /* domain SID */
-
-} DOM_QUERY_3;
-
-/* level 5 is same as level 3. */
-typedef DOM_QUERY_3 DOM_QUERY_5;
-
-/* level 6 is server role information */
-typedef struct dom_query_6
-{
-	uint16 server_role; /* 2=backup, 3=primary */
-} DOM_QUERY_6;
-
-/* level 10 is audit full set info */
-typedef struct dom_query_10
-{
-        uint8 shutdown_on_full;
-} DOM_QUERY_10;
-
-/* level 11 is audit full query info */
-typedef struct dom_query_11
-{
-	uint16 unknown;
-	uint8 shutdown_on_full;
-	uint8 log_is_full;
-} DOM_QUERY_11;
-
-/* level 12 is DNS domain info */
-typedef struct lsa_dns_dom_info
-{
-	UNIHDR  hdr_nb_dom_name; /* netbios domain name */
-	UNIHDR  hdr_dns_dom_name;
-	UNIHDR  hdr_forest_name;
-
-	struct GUID dom_guid; /* domain GUID */
-
-	UNISTR2 uni_nb_dom_name;
-	UNISTR2 uni_dns_dom_name;
-	UNISTR2 uni_forest_name;
-
-	uint32 ptr_dom_sid;
-	DOM_SID2   dom_sid; /* domain SID */
-} DOM_QUERY_12;
-
 typedef struct seq_qos_info
 {
 	uint32 len; /* 12 */
@@ -270,40 +195,6 @@ typedef struct lsa_r_open_pol2_info
                             POLICY_VIEW_LOCAL_INFORMATION    |\
                             POLICY_LOOKUP_NAMES )
 
-/* LSA_Q_QUERY_INFO - LSA query info policy */
-typedef struct lsa_query_info
-{
-	POLICY_HND pol; /* policy handle */
-	uint16 info_class; /* info class */
-
-} LSA_Q_QUERY_INFO;
-
-/* LSA_INFO_CTR */
-typedef struct lsa_info_ctr
-{
-	uint16 info_class;
-	union {
-		DOM_QUERY_1 id1;
-		DOM_QUERY_2 id2;
-		DOM_QUERY_3 id3;
-		DOM_QUERY_5 id5;
-		DOM_QUERY_6 id6;
-		DOM_QUERY_10 id10;
-		DOM_QUERY_11 id11;
-		DOM_QUERY_12 id12;
-	} info;
-
-} LSA_INFO_CTR;
-
-/* LSA_R_QUERY_INFO - response to LSA query info policy */
-typedef struct lsa_r_query_info
-{
-	uint32 dom_ptr; /* undocumented buffer pointer */
-	LSA_INFO_CTR ctr; 
-	NTSTATUS status; /* return code */
-
-} LSA_R_QUERY_INFO;
-
 /*******************************************************/
 
 typedef struct {
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 2f8d3e3..07d4960 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -654,13 +654,16 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 	}
 
 	if (!NT_STATUS_IS_OK(status)) {
-		status = rpccli_lsa_query_info_policy(pipe_hnd, mem_ctx, &lsa_pol,
-						      5,
-						      &r->out.netbios_domain_name,
-						      &r->out.domain_sid);
+		status = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
+						    &lsa_pol,
+						    LSA_POLICY_INFO_ACCOUNT_DOMAIN,
+						    &info);
 		if (!NT_STATUS_IS_OK(status)) {
 			goto done;
 		}
+
+		r->out.netbios_domain_name = info->account_domain.name.string;
+		r->out.domain_sid = info->account_domain.sid;
 	}
 
 	rpccli_lsa_Close(pipe_hnd, mem_ctx, &lsa_pol);
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index b28a126..250bf3e 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -465,93 +465,6 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
 	return result;
 }
 
-/** Query info policy
- *
- *  @param domain_sid - returned remote server's domain sid */
-
-NTSTATUS rpccli_lsa_query_info_policy(struct rpc_pipe_client *cli,
-				      TALLOC_CTX *mem_ctx,
-				      POLICY_HND *pol, uint16 info_class,
-				      const char **domain_name,
-				      DOM_SID **domain_sid)
-{
-	prs_struct qbuf, rbuf;
-	LSA_Q_QUERY_INFO q;
-	LSA_R_QUERY_INFO r;
-	NTSTATUS result;
-
-	ZERO_STRUCT(q);
-	ZERO_STRUCT(r);
-
-	init_q_query(&q, pol, info_class);
-
-	CLI_DO_RPC(cli, mem_ctx, PI_LSARPC, LSA_QUERYINFOPOLICY,
-		q, r,
-		qbuf, rbuf,
-		lsa_io_q_query,
-		lsa_io_r_query,
-		NT_STATUS_UNSUCCESSFUL);
-
-	result = r.status;
-
-	if (!NT_STATUS_IS_OK(result)) {
-		goto done;
-	}
-
-	/* Return output parameters */
-
-	switch (info_class) {
-
-	case 3:
-		if (domain_name && (r.ctr.info.id3.buffer_dom_name != 0)) {
-			*domain_name = unistr2_to_ascii_talloc(mem_ctx,
-						   &r.ctr.info.id3.
-						   uni_domain_name);
-			if (!*domain_name) {
-				return NT_STATUS_NO_MEMORY;
-			}
-		}
-
-		if (domain_sid && (r.ctr.info.id3.buffer_dom_sid != 0)) {
-			*domain_sid = TALLOC_P(mem_ctx, DOM_SID);
-			if (!*domain_sid) {
-				return NT_STATUS_NO_MEMORY;
-			}
-			sid_copy(*domain_sid, &r.ctr.info.id3.dom_sid.sid);
-		}
-
-		break;
-
-	case 5:
-
-		if (domain_name && (r.ctr.info.id5.buffer_dom_name != 0)) {
-			*domain_name = unistr2_to_ascii_talloc(mem_ctx,
-						   &r.ctr.info.id5.
-						   uni_domain_name);
-			if (!*domain_name) {
-				return NT_STATUS_NO_MEMORY;
-			}
-		}
-
-		if (domain_sid && (r.ctr.info.id5.buffer_dom_sid != 0)) {
-			*domain_sid = TALLOC_P(mem_ctx, DOM_SID);
-			if (!*domain_sid) {
-				return NT_STATUS_NO_MEMORY;
-			}
-			sid_copy(*domain_sid, &r.ctr.info.id5.dom_sid.sid);
-		}
-		break;
-
-	default:
-		DEBUG(3, ("unknown info class %d\n", info_class));
-		break;
-	}
-
- done:
-
-	return result;
-}
-
 /**
  * Enumerate list of trusted domains
  *
diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c
index 3e79058..1574df5 100644
--- a/source/rpc_parse/parse_lsa.c
+++ b/source/rpc_parse/parse_lsa.c
@@ -419,38 +419,6 @@ bool lsa_io_r_open_pol2(const char *desc, LSA_R_OPEN_POL2 *out, prs_struct *ps,
 }
 
 /*******************************************************************
- Inits an LSA_Q_QUERY_INFO structure.
-********************************************************************/
-
-void init_q_query(LSA_Q_QUERY_INFO *in, POLICY_HND *hnd, uint16 info_class)
-{
-	DEBUG(5, ("init_q_query\n"));
-
-	memcpy(&in->pol, hnd, sizeof(in->pol));
-
-	in->info_class = info_class;
-}
-
-/*******************************************************************
- Reads or writes an LSA_Q_QUERY_INFO structure.
-********************************************************************/
-
-bool lsa_io_q_query(const char *desc, LSA_Q_QUERY_INFO *in, prs_struct *ps, 
-		    int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_query");
-	depth++;
-
-	if(!smb_io_pol_hnd("", &in->pol, ps, depth))
-		return False;
-
-	if(!prs_uint16("info_class", ps, depth, &in->info_class))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
 makes an LSA_Q_ENUM_TRUST_DOM structure.
 ********************************************************************/
 bool init_q_enum_trust_dom(LSA_Q_ENUM_TRUST_DOM * q_e, POLICY_HND *pol,
@@ -616,325 +584,6 @@ bool lsa_io_r_enum_trust_dom(const char *desc, LSA_R_ENUM_TRUST_DOM *out,
 }
 
 /*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_1(const char *desc, DOM_QUERY_1 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_1");
-	depth++;
-
-	if (!prs_align(ps))
-		return False;
-
-	if (!prs_uint32("percent_full", ps, depth, &d_q->percent_full))
-		return False;
-	if (!prs_uint32("log_size", ps, depth, &d_q->log_size))
-		return False;
-	if (!smb_io_nttime("retention_time", ps, depth, &d_q->retention_time))
-		return False;
-	if (!prs_uint8("shutdown_in_progress", ps, depth, &d_q->shutdown_in_progress))
-		return False;
-	if (!smb_io_nttime("time_to_shutdown", ps, depth, &d_q->time_to_shutdown))
-		return False;
-	if (!prs_uint32("next_audit_record", ps, depth, &d_q->next_audit_record))
-		return False;
-	if (!prs_uint32("unknown", ps, depth, &d_q->unknown))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_2(const char *desc, DOM_QUERY_2 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_2");
-	depth++;
-
-	if (!prs_align(ps))
-		return False;
-
-	if (!prs_uint32("auditing_enabled", ps, depth, &d_q->auditing_enabled))
-		return False;
-	if (!prs_uint32("ptr   ", ps, depth, &d_q->ptr))
-		return False;
-	if (!prs_uint32("count1", ps, depth, &d_q->count1))
-		return False;
-
-	if (d_q->ptr) {
-
-		if (!prs_uint32("count2", ps, depth, &d_q->count2))
-			return False;
-
-		if (d_q->count1 != d_q->count2)
-			return False;
-
-		if (UNMARSHALLING(ps)) {
-			if (d_q->count2) {
-				d_q->auditsettings = TALLOC_ZERO_ARRAY(ps->mem_ctx, uint32, d_q->count2);
-				if (!d_q->auditsettings) {
-					return False;
-				}
-			} else {
-				d_q->auditsettings = NULL;
-			}
-		}
-
-		if (!prs_uint32s(False, "auditsettings", ps, depth, d_q->auditsettings, d_q->count2))
-			return False;
-	}
-
-	return True;
-}
-
-/*******************************************************************
-reads or writes a dom query structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_3(const char *desc, DOM_QUERY_3 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_3");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint16("uni_dom_max_len", ps, depth, &d_q->uni_dom_max_len)) /* domain name string length * 2 */
-		return False;
-	if(!prs_uint16("uni_dom_str_len", ps, depth, &d_q->uni_dom_str_len)) /* domain name string length * 2 */
-		return False;
-
-	if(!prs_uint32("buffer_dom_name", ps, depth, &d_q->buffer_dom_name)) /* undocumented domain name string buffer pointer */
-		return False;
-	if(!prs_uint32("buffer_dom_sid ", ps, depth, &d_q->buffer_dom_sid)) /* undocumented domain SID string buffer pointer */
-		return False;
-
-	if(!smb_io_unistr2("unistr2", &d_q->uni_domain_name, d_q->buffer_dom_name, ps, depth)) /* domain name (unicode string) */
-		return False;
-
-	if(!prs_align(ps))
-		return False;
-
-	if (d_q->buffer_dom_sid != 0) {
-		if(!smb_io_dom_sid2("", &d_q->dom_sid, ps, depth)) /* domain SID */
-			return False;
-	} else {
-		memset((char *)&d_q->dom_sid, '\0', sizeof(d_q->dom_sid));
-	}
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes a dom query structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_5(const char *desc, DOM_QUERY_5 *d_q, prs_struct *ps, int depth)
-{
-	return lsa_io_dom_query_3("", d_q, ps, depth);
-}
-
-/*******************************************************************
- Reads or writes a dom query structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_6(const char *desc, DOM_QUERY_6 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_6");
-	depth++;
-
-	if (!prs_uint16("server_role", ps, depth, &d_q->server_role))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes a dom query structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_10(const char *desc, DOM_QUERY_10 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_10");
-	depth++;
-
-	if (!prs_uint8("shutdown_on_full", ps, depth, &d_q->shutdown_on_full))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes a dom query structure.
-********************************************************************/
-
-static bool lsa_io_dom_query_11(const char *desc, DOM_QUERY_11 *d_q, prs_struct *ps, int depth)
-{
-	if (d_q == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_11");
-	depth++;
-
-	if (!prs_uint16("unknown", ps, depth, &d_q->unknown))
-		return False;
-	if (!prs_uint8("shutdown_on_full", ps, depth, &d_q->shutdown_on_full))
-		return False;
-	if (!prs_uint8("log_is_full", ps, depth, &d_q->log_is_full))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_DNS_DOM_INFO structure.
-********************************************************************/
-
-bool lsa_io_dom_query_12(const char *desc, DOM_QUERY_12 *info, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_dom_query_12");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-	if(!smb_io_unihdr("nb_name", &info->hdr_nb_dom_name, ps, depth))
-		return False;
-	if(!smb_io_unihdr("dns_name", &info->hdr_dns_dom_name, ps, depth))
-		return False;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list