[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-1839-gd2d91dd

Günther Deschner gd at samba.org
Mon Feb 4 16:54:28 GMT 2008


The branch, v3-2-test has been updated
       via  d2d91dd4968dbd1349bdb973e2679f68c608c2ed (commit)
       via  ca233bfe0e5350cb699312e4937c6bd1cb43f7c1 (commit)
       via  ceb3b6a0a3ed15c04bdb518a28167531403cc928 (commit)
       via  35a691c2595883a7f15d039839de11798b9a7ceb (commit)
       via  e1cae5517f3a9a8fb8a79c440363243592565363 (commit)
       via  79c3aa6588c6d79a2127153dc0bcc75ecc468de8 (commit)
      from  92a9c6c56fa90aead3b7f4a07bf4f3973ba23555 (commit)

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


- Log -----------------------------------------------------------------
commit d2d91dd4968dbd1349bdb973e2679f68c608c2ed
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 17:14:57 2008 +0100

    Remove unused marshalling for SAMR_CONNECT5.
    
    Guenther

commit ca233bfe0e5350cb699312e4937c6bd1cb43f7c1
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 17:10:16 2008 +0100

    Use pidl for _samr_Connect5().
    
    Guenther

commit ceb3b6a0a3ed15c04bdb518a28167531403cc928
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 16:35:32 2008 +0100

    Use pidl for _samr_Connect4().
    
    Guenther

commit 35a691c2595883a7f15d039839de11798b9a7ceb
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 16:23:46 2008 +0100

    Use pidl for _samr_Connect2().
    
    Guenther

commit e1cae5517f3a9a8fb8a79c440363243592565363
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 16:20:25 2008 +0100

    Remove unused marshalling for SAMR_CONNECT_ANON.
    
    Guenther

commit 79c3aa6588c6d79a2127153dc0bcc75ecc468de8
Author: Günther Deschner <gd at samba.org>
Date:   Mon Feb 4 16:17:20 2008 +0100

    Use pidl for _samr_Connect().
    
    Guenther

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

Summary of changes:
 source/include/rpc_samr.h       |   40 ---------
 source/rpc_parse/parse_samr.c   |  178 ---------------------------------------
 source/rpc_server/srv_samr.c    |   96 +--------------------
 source/rpc_server/srv_samr_nt.c |  147 +++++++++++---------------------
 4 files changed, 54 insertions(+), 407 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h
index 4ebee5e..227f709 100644
--- a/source/include/rpc_samr.h
+++ b/source/include/rpc_samr.h
@@ -1505,21 +1505,6 @@ typedef struct r_samr_del_alias_mem_info
 } SAMR_R_DEL_ALIASMEM;
 
 
-/* SAMR_Q_CONNECT_ANON - probably an open */
-typedef struct q_samr_connect_anon_info {
-	uint32 ptr;                  /* ptr? */
-	uint16 unknown_0;	     /* Only pushed if ptr is non-zero. */
-	uint32 access_mask;
-} SAMR_Q_CONNECT_ANON;
-
-/* SAMR_R_CONNECT_ANON - probably an open */
-typedef struct r_samr_connect_anon_info
-{
-	POLICY_HND connect_pol;       /* policy handle */
-	NTSTATUS status;         /* return status */
-
-} SAMR_R_CONNECT_ANON;
-
 /* SAMR_Q_CONNECT - probably an open */
 typedef struct q_samr_connect_info
 {
@@ -1552,31 +1537,6 @@ typedef struct q_samr_connect4_info
 /* SAMR_R_CONNECT4 - same format as connect */
 typedef struct r_samr_connect_info SAMR_R_CONNECT4;       
 
-/* SAMR_Q_CONNECT5 */
-typedef struct q_samr_connect5_info
-{
-	uint32 ptr_srv_name; /* pointer to server name */
-	UNISTR2 uni_srv_name;
-	uint32 access_mask;
-	uint32 level;
-	/* These following are acutally a level dependent
-	   value. Fudge it for now. JRA */
-	uint32 info1_unk1;
-	uint32 info1_unk2;
-} SAMR_Q_CONNECT5;
-
-/* SAMR_R_CONNECT5 */
-typedef struct r_samr_connect_info5
-{
-	uint32 level;
-	uint32 info1_unk1;
-	uint32 info1_unk2;
-	POLICY_HND connect_pol;       /* policy handle */
-	NTSTATUS status;         /* return status */
-
-} SAMR_R_CONNECT5;
-
-
 /* SAMR_ENC_PASSWD */
 typedef struct enc_passwd_info
 {
diff --git a/source/rpc_parse/parse_samr.c b/source/rpc_parse/parse_samr.c
index 56a97b1..73b3086 100644
--- a/source/rpc_parse/parse_samr.c
+++ b/source/rpc_parse/parse_samr.c
@@ -6218,184 +6218,6 @@ bool samr_io_r_connect4(const char *desc, SAMR_R_CONNECT4 * r_u,
 }
 
 /*******************************************************************
-inits a SAMR_Q_CONNECT5 structure.
-********************************************************************/
-
-void init_samr_q_connect5(SAMR_Q_CONNECT5 * q_u,
-			  char *srv_name, uint32 access_mask)
-{
-	DEBUG(5, ("init_samr_q_connect5\n"));
-
-	/* make PDC server name \\server */
-	q_u->ptr_srv_name = (srv_name != NULL && *srv_name) ? 1 : 0;
-	init_unistr2(&q_u->uni_srv_name, srv_name, UNI_STR_TERMINATE);
-
-	/* example values: 0x0000 0002 */
-	q_u->access_mask = access_mask;
-
-	q_u->level = 1;
-	q_u->info1_unk1 = 3;
-	q_u->info1_unk2 = 0;
-}
-
-/*******************************************************************
-inits a SAMR_R_CONNECT5 structure.
-********************************************************************/
-
-void init_samr_r_connect5(SAMR_R_CONNECT5 * r_u, POLICY_HND *pol, NTSTATUS status)
-{
-	DEBUG(5, ("init_samr_q_connect5\n"));
-
-	r_u->level = 1;
-	r_u->info1_unk1 = 3;
-	r_u->info1_unk2 = 0;
-
-	r_u->connect_pol = *pol;
-	r_u->status = status;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_q_connect5(const char *desc, SAMR_Q_CONNECT5 * q_u,
-			prs_struct *ps, int depth)
-{
-	if (q_u == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "samr_io_q_connect5");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("ptr_srv_name", ps, depth, &q_u->ptr_srv_name))
-		return False;
-	if(!smb_io_unistr2("", &q_u->uni_srv_name, q_u->ptr_srv_name, ps, depth))
-		return False;
-
-	if(!prs_align(ps))
-		return False;
-	if(!prs_uint32("access_mask", ps, depth, &q_u->access_mask))
-		return False;
-
-	if(!prs_uint32("level", ps, depth, &q_u->level))
-		return False;
-	if(!prs_uint32("level", ps, depth, &q_u->level))
-		return False;
-	
-	if(!prs_uint32("info1_unk1", ps, depth, &q_u->info1_unk1))
-		return False;
-	if(!prs_uint32("info1_unk2", ps, depth, &q_u->info1_unk2))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_r_connect5(const char *desc, SAMR_R_CONNECT5 * r_u,
-			prs_struct *ps, int depth)
-{
-	if (r_u == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "samr_io_r_connect5");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("level", ps, depth, &r_u->level))
-		return False;
-	if(!prs_uint32("level", ps, depth, &r_u->level))
-		return False;
-	if(!prs_uint32("info1_unk1", ps, depth, &r_u->info1_unk1))
-		return False;
-	if(!prs_uint32("info1_unk2", ps, depth, &r_u->info1_unk2))
-		return False;
-
-	if(!smb_io_pol_hnd("connect_pol", &r_u->connect_pol, ps, depth))
-		return False;
-
-	if(!prs_ntstatus("status", ps, depth, &r_u->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-inits a SAMR_Q_CONNECT_ANON structure.
-********************************************************************/
-
-void init_samr_q_connect_anon(SAMR_Q_CONNECT_ANON * q_u)
-{
-	DEBUG(5, ("init_samr_q_connect_anon\n"));
-
-	q_u->ptr = 1;
-	q_u->unknown_0 = 0x5c;	/* server name (?!!) */
-	q_u->access_mask = MAXIMUM_ALLOWED_ACCESS;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_q_connect_anon(const char *desc, SAMR_Q_CONNECT_ANON * q_u,
-			    prs_struct *ps, int depth)
-{
-	if (q_u == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "samr_io_q_connect_anon");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("ptr      ", ps, depth, &q_u->ptr))
-		return False;
-	if (q_u->ptr) {
-		if(!prs_uint16("unknown_0", ps, depth, &q_u->unknown_0))
-			return False;
-	}
-	if(!prs_align(ps))
-		return False;
-	if(!prs_uint32("access_mask", ps, depth, &q_u->access_mask))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
-reads or writes a structure.
-********************************************************************/
-
-bool samr_io_r_connect_anon(const char *desc, SAMR_R_CONNECT_ANON * r_u,
-			    prs_struct *ps, int depth)
-{
-	if (r_u == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "samr_io_r_connect_anon");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!smb_io_pol_hnd("connect_pol", &r_u->connect_pol, ps, depth))
-		return False;
-
-	if(!prs_ntstatus("status", ps, depth, &r_u->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
 make a SAMR_ENC_PASSWD structure.
 ********************************************************************/
 
diff --git a/source/rpc_server/srv_samr.c b/source/rpc_server/srv_samr.c
index 94f7c6f..dd162c7 100644
--- a/source/rpc_server/srv_samr.c
+++ b/source/rpc_server/srv_samr.c
@@ -461,29 +461,7 @@ static bool api_samr_create_user(pipes_struct *p)
 
 static bool api_samr_connect_anon(pipes_struct *p)
 {
-	SAMR_Q_CONNECT_ANON q_u;
-	SAMR_R_CONNECT_ANON r_u;
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
-
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-
-	/* grab the samr open policy */
-	if(!samr_io_q_connect_anon("", &q_u, data, 0)) {
-		DEBUG(0,("api_samr_connect_anon: unable to unmarshall SAMR_Q_CONNECT_ANON.\n"));
-		return False;
-	}
-
-	r_u.status = _samr_connect_anon(p, &q_u, &r_u);
-
-	/* store the response in the SMB stream */
-	if(!samr_io_r_connect_anon("", &r_u, rdata, 0)) {
-		DEBUG(0,("api_samr_connect_anon: unable to marshall SAMR_R_CONNECT_ANON.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_samr_call(p, NDR_SAMR_CONNECT);
 }
 
 /*******************************************************************
@@ -492,29 +470,7 @@ static bool api_samr_connect_anon(pipes_struct *p)
 
 static bool api_samr_connect(pipes_struct *p)
 {
-	SAMR_Q_CONNECT q_u;
-	SAMR_R_CONNECT r_u;
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
-
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-
-	/* grab the samr open policy */
-	if(!samr_io_q_connect("", &q_u, data, 0)) {
-		DEBUG(0,("api_samr_connect: unable to unmarshall SAMR_Q_CONNECT.\n"));
-		return False;
-	}
-
-	r_u.status = _samr_connect(p, &q_u, &r_u);
-
-	/* store the response in the SMB stream */
-	if(!samr_io_r_connect("", &r_u, rdata, 0)) {
-		DEBUG(0,("api_samr_connect: unable to marshall SAMR_R_CONNECT.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_samr_call(p, NDR_SAMR_CONNECT2);
 }
 
 /*******************************************************************
@@ -523,29 +479,7 @@ static bool api_samr_connect(pipes_struct *p)
 
 static bool api_samr_connect4(pipes_struct *p)
 {
-	SAMR_Q_CONNECT4 q_u;
-	SAMR_R_CONNECT4 r_u;
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
-
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-
-	/* grab the samr open policy */
-	if(!samr_io_q_connect4("", &q_u, data, 0)) {
-		DEBUG(0,("api_samr_connect4: unable to unmarshall SAMR_Q_CONNECT4.\n"));
-		return False;
-	}
-
-	r_u.status = _samr_connect4(p, &q_u, &r_u);
-
-	/* store the response in the SMB stream */
-	if(!samr_io_r_connect4("", &r_u, rdata, 0)) {
-		DEBUG(0,("api_samr_connect4: unable to marshall SAMR_R_CONNECT4.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_samr_call(p, NDR_SAMR_CONNECT4);
 }
 
 /*******************************************************************
@@ -585,29 +519,7 @@ static bool api_samr_chgpasswd_user3(pipes_struct *p)
 
 static bool api_samr_connect5(pipes_struct *p)
 {
-	SAMR_Q_CONNECT5 q_u;
-	SAMR_R_CONNECT5 r_u;
-	prs_struct *data = &p->in_data.data;
-	prs_struct *rdata = &p->out_data.rdata;
-
-	ZERO_STRUCT(q_u);
-	ZERO_STRUCT(r_u);
-
-	/* grab the samr open policy */
-	if(!samr_io_q_connect5("", &q_u, data, 0)) {
-		DEBUG(0,("api_samr_connect5: unable to unmarshall SAMR_Q_CONNECT5.\n"));
-		return False;
-	}
-
-	r_u.status = _samr_connect5(p, &q_u, &r_u);
-
-	/* store the response in the SMB stream */
-	if(!samr_io_r_connect5("", &r_u, rdata, 0)) {
-		DEBUG(0,("api_samr_connect5: unable to marshall SAMR_R_CONNECT5.\n"));
-		return False;
-	}
-
-	return True;
+	return proxy_samr_call(p, NDR_SAMR_CONNECT5);
 }
 
 /**********************************************************************
diff --git a/source/rpc_server/srv_samr_nt.c b/source/rpc_server/srv_samr_nt.c
index c51aa39..4e0487f 100644
--- a/source/rpc_server/srv_samr_nt.c
+++ b/source/rpc_server/srv_samr_nt.c
@@ -2653,26 +2653,24 @@ NTSTATUS _samr_CreateUser2(pipes_struct *p,
 }
 
 /*******************************************************************
- samr_reply_connect_anon
+ _samr_Connect
  ********************************************************************/
 
-NTSTATUS _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CONNECT_ANON *r_u)
+NTSTATUS _samr_Connect(pipes_struct *p,
+		       struct samr_Connect *r)
 {
 	struct samr_info *info = NULL;
-	uint32    des_access = q_u->access_mask;
+	uint32    des_access = r->in.access_mask;
 
 	/* Access check */
 
 	if (!pipe_access_check(p)) {
-		DEBUG(3, ("access denied to samr_connect_anon\n"));
-		r_u->status = NT_STATUS_ACCESS_DENIED;
-		return r_u->status;
+		DEBUG(3, ("access denied to _samr_Connect\n"));
+		return NT_STATUS_ACCESS_DENIED;
 	}
 
 	/* set up the SAMR connect_anon response */
 
-	r_u->status = NT_STATUS_OK;
-
 	/* associate the user's SID with the new handle. */
 	if ((info = get_samr_info_by_sid(NULL)) == NULL)
 		return NT_STATUS_NO_MEMORY;
@@ -2688,150 +2686,141 @@ NTSTATUS _samr_connect_anon(pipes_struct *p, SAMR_Q_CONNECT_ANON *q_u, SAMR_R_CO
 
 	se_map_generic( &des_access, &sam_generic_mapping );
 	info->acc_granted = des_access & (SA_RIGHT_SAM_ENUM_DOMAINS|SA_RIGHT_SAM_OPEN_DOMAIN);
-	
-	info->status = q_u->unknown_0;
 
 	/* get a (unique) handle.  open a policy on it. */
-	if (!create_policy_hnd(p, &r_u->connect_pol, free_samr_info, (void *)info))
+	if (!create_policy_hnd(p, r->out.connect_handle, free_samr_info, (void *)info))
 		return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 
-	return r_u->status;
+	return NT_STATUS_OK;
 }
 
 /*******************************************************************
- samr_reply_connect
+ _samr_Connect2
  ********************************************************************/
 
-NTSTATUS _samr_connect(pipes_struct *p, SAMR_Q_CONNECT *q_u, SAMR_R_CONNECT *r_u)
+NTSTATUS _samr_Connect2(pipes_struct *p,
+			struct samr_Connect2 *r)
 {
 	struct samr_info *info = NULL;
 	SEC_DESC *psd = NULL;
 	uint32    acc_granted;
-	uint32    des_access = q_u->access_mask;
+	uint32    des_access = r->in.access_mask;
 	NTSTATUS  nt_status;
 	size_t    sd_size;
 
 
-	DEBUG(5,("_samr_connect: %d\n", __LINE__));
+	DEBUG(5,("_samr_Connect2: %d\n", __LINE__));
 
 	/* Access check */
 
 	if (!pipe_access_check(p)) {
-		DEBUG(3, ("access denied to samr_connect\n"));
-		r_u->status = NT_STATUS_ACCESS_DENIED;
-		return r_u->status;
+		DEBUG(3, ("access denied to _samr_Connect2\n"));
+		return NT_STATUS_ACCESS_DENIED;
 	}
 
 	make_samr_object_sd(p->mem_ctx, &psd, &sd_size, &sam_generic_mapping, NULL, 0);
 	se_map_generic(&des_access, &sam_generic_mapping);
 	
 	nt_status = access_check_samr_object(psd, p->pipe_user.nt_user_token, 
-		NULL, 0, des_access, &acc_granted, "_samr_connect");
+		NULL, 0, des_access, &acc_granted, "_samr_Connect2");
 	
 	if ( !NT_STATUS_IS_OK(nt_status) ) 
 		return nt_status;
 
-	r_u->status = NT_STATUS_OK;
-
 	/* associate the user's SID and access granted with the new handle. */
 	if ((info = get_samr_info_by_sid(NULL)) == NULL)
 		return NT_STATUS_NO_MEMORY;
 
 	info->acc_granted = acc_granted;
-	info->status = q_u->access_mask;
+	info->status = r->in.access_mask; /* this looks so wrong... - gd */
 
 	/* get a (unique) handle.  open a policy on it. */
-	if (!create_policy_hnd(p, &r_u->connect_pol, free_samr_info, (void *)info))
+	if (!create_policy_hnd(p, r->out.connect_handle, free_samr_info, (void *)info))
 		return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 
-	DEBUG(5,("_samr_connect: %d\n", __LINE__));
+	DEBUG(5,("_samr_Connect2: %d\n", __LINE__));
 
-	return r_u->status;
+	return nt_status;
 }
 
 /*******************************************************************
- samr_connect4
+ _samr_Connect4
  ********************************************************************/
 
-NTSTATUS _samr_connect4(pipes_struct *p, SAMR_Q_CONNECT4 *q_u, SAMR_R_CONNECT4 *r_u)
+NTSTATUS _samr_Connect4(pipes_struct *p,
+			struct samr_Connect4 *r)
 {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list