[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-test-2227-g5b700ab

Günther Deschner gd at samba.org
Thu Feb 14 13:03:09 GMT 2008


The branch, v3-2-test has been updated
       via  5b700aba1a2e1559c17fec9d82e87312e8a5b15d (commit)
       via  0c9904864b5c3b893f99abdebb18d9624aa0f560 (commit)
       via  e55bb83f84d0d459f4280c2a4bfa4cc14bd3924d (commit)
       via  21f82166982784c9685a6403c8db21f421ed0bad (commit)
       via  8125d8557fb4b27873f8eabc6ad1019491d18cce (commit)
       via  c15243dd1faaa01cd05d6e2f6ae873cc32097397 (commit)
       via  87dc2471d1c2a5be17604399d4f684193a6bba38 (commit)
       via  05386f70566e272247ed917b51d712054196ebcb (commit)
       via  004598bc1322b6e2deb62115713768682fee988e (commit)
       via  c28b52dcfedd575f5ae4ed7942857d3853bdd051 (commit)
      from  a33ed085094b200e153939cb1b02e567f07b1e50 (commit)

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


- Log -----------------------------------------------------------------
commit 5b700aba1a2e1559c17fec9d82e87312e8a5b15d
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 14:01:49 2008 +0100

    Remove unused marshalling for LSA_ADDPRIVS and LSA_REMOVEPRIVS.
    
    Guenther

commit 0c9904864b5c3b893f99abdebb18d9624aa0f560
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:50:32 2008 +0100

    Use pidl for _lsa_AddPrivilegesToAccount and _lsa_RemovePrivilegesFromAccount.
    
    Guenther

commit e55bb83f84d0d459f4280c2a4bfa4cc14bd3924d
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:46:39 2008 +0100

    Add lsaaddpriv and lsadelpriv commands to rpcclient.
    
    Guenther

commit 21f82166982784c9685a6403c8db21f421ed0bad
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 12:47:04 2008 +0100

    Fix IDL for lsa_AddPrivilegesToAccount.
    
    Guenther

commit 8125d8557fb4b27873f8eabc6ad1019491d18cce
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:31:55 2008 +0100

    Remove unused marshalling for LSA_LOOKUP_PRIV_VALUE.
    
    Guenther

commit c15243dd1faaa01cd05d6e2f6ae873cc32097397
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:29:18 2008 +0100

    Use rpccli_lsa_LookupPrivValue() in rpcclient.
    
    Guenther

commit 87dc2471d1c2a5be17604399d4f684193a6bba38
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:25:42 2008 +0100

    Use pidl for _lsa_LookupPrivValue().
    
    Guenther

commit 05386f70566e272247ed917b51d712054196ebcb
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 13:09:54 2008 +0100

    Fix IDL for lsa_LookupPrivValue.
    
    Guenther

commit 004598bc1322b6e2deb62115713768682fee988e
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 12:15:17 2008 +0100

    Remove unused marshalling for LSA_ENUMPRIVSACCOUNT.
    
    Guenther

commit c28b52dcfedd575f5ae4ed7942857d3853bdd051
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 14 12:13:13 2008 +0100

    Use rpccli_lsa_EnumPrivsAccount() in rpcclient.
    
    Guenther

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

Summary of changes:
 source/include/rpc_lsa.h       |   56 -------
 source/lib/privileges_basic.c  |    4 +-
 source/librpc/idl/lsa.idl      |    6 +-
 source/rpc_client/cli_lsarpc.c |   96 ------------
 source/rpc_parse/parse_lsa.c   |  329 ----------------------------------------
 source/rpc_server/srv_lsa.c    |   72 +---------
 source/rpc_server/srv_lsa_nt.c |   59 +++-----
 source/rpcclient/cmd_lsarpc.c  |  203 +++++++++++++++++++++++--
 8 files changed, 220 insertions(+), 605 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index 46a01d5..e7e013f 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -494,60 +494,4 @@ typedef struct
 	NTSTATUS status;
 } LSA_R_REMOVE_ACCT_RIGHTS;
 
-
-typedef struct lsa_q_enumprivsaccount
-{
-	POLICY_HND pol; /* policy handle */
-} LSA_Q_ENUMPRIVSACCOUNT;
-
-typedef struct lsa_r_enumprivsaccount
-{
-	uint32 ptr;
-	uint32 count;
-	PRIVILEGE_SET set;
-	NTSTATUS status;
-} LSA_R_ENUMPRIVSACCOUNT;
-
-typedef struct {
-	UNIHDR hdr;
-	UNISTR2 unistring;
-} LSA_STRING;
-
-typedef struct {
-	POLICY_HND pol; /* policy handle */
-	LSA_STRING privname;
-} LSA_Q_LOOKUP_PRIV_VALUE;
-
-typedef struct {
-	LUID luid;
-	NTSTATUS status;
-} LSA_R_LOOKUP_PRIV_VALUE;
-
-typedef struct lsa_q_addprivs
-{
-	POLICY_HND pol; /* policy handle */
-	uint32 count;
-	PRIVILEGE_SET set;
-} LSA_Q_ADDPRIVS;
-
-typedef struct lsa_r_addprivs
-{
-	NTSTATUS status;
-} LSA_R_ADDPRIVS;
-
-
-typedef struct lsa_q_removeprivs
-{
-	POLICY_HND pol; /* policy handle */
-	uint32 allrights;
-	uint32 ptr;
-	uint32 count;
-	PRIVILEGE_SET set;
-} LSA_Q_REMOVEPRIVS;
-
-typedef struct lsa_r_removeprivs
-{
-	NTSTATUS status;
-} LSA_R_REMOVEPRIVS;
-
 #endif /* _RPC_LSA_H */
diff --git a/source/lib/privileges_basic.c b/source/lib/privileges_basic.c
index 753f726..865c1f6 100644
--- a/source/lib/privileges_basic.c
+++ b/source/lib/privileges_basic.c
@@ -473,7 +473,7 @@ bool se_priv_to_privilege_set( PRIVILEGE_SET *set, SE_PRIV *mask )
 /*******************************************************************
 *******************************************************************/
 
-static bool luid_to_se_priv( LUID *luid, SE_PRIV *mask )
+static bool luid_to_se_priv( struct lsa_LUID *luid, SE_PRIV *mask )
 {
 	int i;
 	uint32 num_privs = count_all_privileges();
@@ -491,7 +491,7 @@ static bool luid_to_se_priv( LUID *luid, SE_PRIV *mask )
 /*******************************************************************
 *******************************************************************/
 
-bool privilege_set_to_se_priv( SE_PRIV *mask, PRIVILEGE_SET *privset )
+bool privilege_set_to_se_priv( SE_PRIV *mask, struct lsa_PrivilegeSet *privset )
 {
 	int i;
 	
diff --git a/source/librpc/idl/lsa.idl b/source/librpc/idl/lsa.idl
index 390debc..6bb34a9 100644
--- a/source/librpc/idl/lsa.idl
+++ b/source/librpc/idl/lsa.idl
@@ -461,7 +461,7 @@ import "security.idl";
 	/* Function:            0x13 */
 	NTSTATUS lsa_AddPrivilegesToAccount(
 		[in]         policy_handle *handle,
-		[in]         lsa_PrivilegeSet *privs
+		[in,ref]     lsa_PrivilegeSet *privs
 		);
 	
 
@@ -637,8 +637,8 @@ import "security.idl";
 	/* Function:     0x1f */
 	NTSTATUS lsa_LookupPrivValue(
 		[in]     policy_handle *handle,
-		[in]     lsa_String *name,
-		[out]    lsa_LUID *luid
+		[in,ref] lsa_String *name,
+		[out,ref] lsa_LUID *luid
 		);
 
 
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 20a0fe2..9d9a131 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -452,102 +452,6 @@ NTSTATUS rpccli_lsa_lookup_names(struct rpc_pipe_client *cli,
 	return result;
 }
 
-/** Enumerate user privileges
- *
- * @param cli Handle on an initialised SMB connection */
-
-NTSTATUS rpccli_lsa_enum_privsaccount(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-                             POLICY_HND *pol, uint32 *count, LUID_ATTR **set)
-{
-	prs_struct qbuf, rbuf;
-	LSA_Q_ENUMPRIVSACCOUNT q;
-	LSA_R_ENUMPRIVSACCOUNT r;
-	NTSTATUS result;
-	int i;
-
-	ZERO_STRUCT(q);
-	ZERO_STRUCT(r);
-
-	/* Initialise input parameters */
-
-	init_lsa_q_enum_privsaccount(&q, pol);
-
-	CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_ENUMPRIVSACCOUNT,
-		q, r,
-		qbuf, rbuf,
-		lsa_io_q_enum_privsaccount,
-		lsa_io_r_enum_privsaccount,
-		NT_STATUS_UNSUCCESSFUL);
-
-	/* Return output parameters */
-
-	result = r.status;
-
-	if (!NT_STATUS_IS_OK(result)) {
-		goto done;
-	}
-
-	if (r.count == 0)
-		goto done;
-
-	if (!((*set = TALLOC_ARRAY(mem_ctx, LUID_ATTR, r.count)))) {
-		DEBUG(0, ("(cli_lsa_enum_privsaccount): out of memory\n"));
-		result = NT_STATUS_UNSUCCESSFUL;
-		goto done;
-	}
-
-	for (i=0; i<r.count; i++) {
-		(*set)[i].luid.low = r.set.set[i].luid.low;
-		(*set)[i].luid.high = r.set.set[i].luid.high;
-		(*set)[i].attr = r.set.set[i].attr;
-	}
-
-	*count=r.count;
- done:
-
-	return result;
-}
-
-/** Get a privilege value given its name */
-
-NTSTATUS rpccli_lsa_lookup_priv_value(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
-				 POLICY_HND *pol, const char *name, LUID *luid)
-{
-	prs_struct qbuf, rbuf;
-	LSA_Q_LOOKUP_PRIV_VALUE q;
-	LSA_R_LOOKUP_PRIV_VALUE r;
-	NTSTATUS result;
-
-	ZERO_STRUCT(q);
-	ZERO_STRUCT(r);
-
-	/* Marshall data and send request */
-
-	init_lsa_q_lookup_priv_value(&q, pol, name);
-
-	CLI_DO_RPC( cli, mem_ctx, PI_LSARPC, LSA_LOOKUPPRIVVALUE,
-		q, r,
-		qbuf, rbuf,
-		lsa_io_q_lookup_priv_value,
-		lsa_io_r_lookup_priv_value,
-		NT_STATUS_UNSUCCESSFUL);
-
-	result = r.status;
-
-	if (!NT_STATUS_IS_OK(result)) {
-		goto done;
-	}
-
-	/* Return output parameters */
-
-	(*luid).low=r.luid.low;
-	(*luid).high=r.luid.high;
-
- done:
-
-	return result;
-}
-
 /* Enumerate account rights This is similar to enum_privileges but
    takes a SID directly, avoiding the open_account call.
 */
diff --git a/source/rpc_parse/parse_lsa.c b/source/rpc_parse/parse_lsa.c
index 6a80bb2..d4d3253 100644
--- a/source/rpc_parse/parse_lsa.c
+++ b/source/rpc_parse/parse_lsa.c
@@ -1207,339 +1207,10 @@ bool lsa_io_r_lookup_names4(const char *desc, LSA_R_LOOKUP_NAMES4 *out, prs_stru
 	return True;
 }
 
-void init_lsa_q_enum_privsaccount(LSA_Q_ENUMPRIVSACCOUNT *trn, POLICY_HND *hnd)
-{
-	memcpy(&trn->pol, hnd, sizeof(trn->pol));
-
-}
-
-/*******************************************************************
- Reads or writes an LSA_Q_ENUMPRIVSACCOUNT structure.
-********************************************************************/
-
-bool lsa_io_q_enum_privsaccount(const char *desc, LSA_Q_ENUMPRIVSACCOUNT *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_enum_privsaccount");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!smb_io_pol_hnd("pol", &out->pol, ps, depth))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LUID structure.
-********************************************************************/
-
-static bool lsa_io_luid(const char *desc, LUID *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_luid");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!prs_uint32("low", ps, depth, &out->low))
-		return False;
-
-	if(!prs_uint32("high", ps, depth, &out->high))
-		return False;
-
-	return True;
-}
-
 /*******************************************************************
  Reads or writes an LUID_ATTR structure.
 ********************************************************************/
 
-static bool lsa_io_luid_attr(const char *desc, LUID_ATTR *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_luid_attr");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if (!lsa_io_luid(desc, &out->luid, ps, depth))
-		return False;
-
-	if(!prs_uint32("attr", ps, depth, &out->attr))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an PRIVILEGE_SET structure.
-********************************************************************/
-
-static bool lsa_io_privilege_set(const char *desc, PRIVILEGE_SET *out, prs_struct *ps, int depth)
-{
-	uint32 i, dummy;
-
-	prs_debug(ps, depth, desc, "lsa_io_privilege_set");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!prs_uint32("count", ps, depth, &dummy))
-		return False;
-	if(!prs_uint32("control", ps, depth, &out->control))
-		return False;
-
-	for (i=0; i<out->count; i++) {
-		if (!lsa_io_luid_attr(desc, &out->set[i], ps, depth))
-			return False;
-	}
-	
-	return True;
-}
-
-NTSTATUS init_lsa_r_enum_privsaccount(TALLOC_CTX *mem_ctx, LSA_R_ENUMPRIVSACCOUNT *out, LUID_ATTR *set, uint32 count, uint32 control)
-{
-	NTSTATUS ret = NT_STATUS_OK;
-
-	out->ptr = 1;
-	out->count = count;
-
-	if ( !NT_STATUS_IS_OK(ret = privilege_set_init_by_ctx(mem_ctx, &(out->set))) )
-		return ret;
-	
-	out->set.count = count;
-	
-	if (!NT_STATUS_IS_OK(ret = dup_luid_attr(out->set.mem_ctx, &(out->set.set), set, count)))
-		return ret;
-
-	DEBUG(10,("init_lsa_r_enum_privsaccount: %d privileges\n", out->count));
-
-	return ret;
-}
-
-/*******************************************************************
- Reads or writes an LSA_R_ENUMPRIVSACCOUNT structure.
-********************************************************************/
-
-bool lsa_io_r_enum_privsaccount(const char *desc, LSA_R_ENUMPRIVSACCOUNT *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_enum_privsaccount");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!prs_uint32("ptr", ps, depth, &out->ptr))
-		return False;
-
-	if (out->ptr!=0) {
-		if(!prs_uint32("count", ps, depth, &out->count))
-			return False;
-
-		/* malloc memory if unmarshalling here */
-
-		if (UNMARSHALLING(ps) && out->count != 0) {
-			if (!NT_STATUS_IS_OK(privilege_set_init_by_ctx(ps->mem_ctx, &(out->set))))
-				return False;
-
-			if (!(out->set.set = PRS_ALLOC_MEM(ps,LUID_ATTR,out->count)))
-				return False;
-
-		}
-		
-		if(!lsa_io_privilege_set(desc, &out->set, ps, depth))
-			return False;
-	}
-
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-void init_lsa_string( LSA_STRING *uni, const char *string )
-{
-	init_unistr2(&uni->unistring, string, UNI_FLAGS_NONE);
-	init_uni_hdr(&uni->hdr, &uni->unistring);
-}
-
-void init_lsa_q_lookup_priv_value(LSA_Q_LOOKUP_PRIV_VALUE *q_u, POLICY_HND *hnd, const char *name)
-{
-	memcpy(&q_u->pol, hnd, sizeof(q_u->pol));
-	init_lsa_string( &q_u->privname, name );
-}
-
-bool smb_io_lsa_string( const char *desc, LSA_STRING *string, prs_struct *ps, int depth )
-{
-	prs_debug(ps, depth, desc, "smb_io_lsa_string");
-	depth++;
-
-	if(!smb_io_unihdr ("hdr", &string->hdr, ps, depth))
-		return False;
-	if(!smb_io_unistr2("unistring", &string->unistring, string->hdr.buffer, ps, depth))
-		return False;
-	
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_Q_LOOKUP_PRIV_VALUE  structure.
-********************************************************************/
-
-bool lsa_io_q_lookup_priv_value(const char *desc, LSA_Q_LOOKUP_PRIV_VALUE  *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_lookup_priv_value");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!smb_io_pol_hnd("pol", &out->pol, ps, depth))
-		return False;
-	if(!smb_io_lsa_string("privname", &out->privname, ps, depth))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an  LSA_R_LOOKUP_PRIV_VALUE structure.
-********************************************************************/
-
-bool lsa_io_r_lookup_priv_value(const char *desc, LSA_R_LOOKUP_PRIV_VALUE  *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_lookup_priv_value");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-		
-	if(!lsa_io_luid("luid", &out->luid, ps, depth))
-		return False;
- 
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-
-/*******************************************************************
- Reads or writes an LSA_Q_ADDPRIVS structure.
-********************************************************************/
-
-bool lsa_io_q_addprivs(const char *desc, LSA_Q_ADDPRIVS *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_q_addprivs");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!smb_io_pol_hnd("pol", &out->pol, ps, depth))
-		return False;
-	
-	if(!prs_uint32("count", ps, depth, &out->count))
-		return False;
-
-	if (UNMARSHALLING(ps) && out->count!=0) {
-		if (!NT_STATUS_IS_OK(privilege_set_init_by_ctx(ps->mem_ctx, &(out->set))))
-			return False;
-		
-		if (!(out->set.set = PRS_ALLOC_MEM(ps, LUID_ATTR, out->count)))
-			return False;
-	}
-	
-	if(!lsa_io_privilege_set(desc, &out->set, ps, depth))
-		return False;
-	
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_R_ADDPRIVS structure.
-********************************************************************/
-
-bool lsa_io_r_addprivs(const char *desc, LSA_R_ADDPRIVS *out, prs_struct *ps, int depth)
-{
-	prs_debug(ps, depth, desc, "lsa_io_r_addprivs");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
- 
-	if(!prs_ntstatus("status", ps, depth, &out->status))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes an LSA_Q_REMOVEPRIVS structure.
-********************************************************************/
-


-- 
Samba Shared Repository


More information about the samba-cvs mailing list