[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Mon Feb 21 03:36:02 MST 2011


The branch, master has been updated
       via  2ba57fd s4:smbtorture do not leave output directory around
       via  d2b336a libcli/security/security_descriptor.c - fix three wrong counter variables
       via  618c11c libcli/security/privileges.c - fix wrong counter type
       via  e7659fa libcli/security/privileges.c - fix the counting of privileges
       via  a2ded04 libcli/security/sddl.c - fix wrong counter type
       via  055857a libcli/security/display_sec.c - fix wrong counter type
      from  e37db96 s4: avoid overwritting the dceprc.h file from toplevel librpc

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2ba57fd1832a4bc3c4c652c08e5f62054ecab79b
Author: Christian Ambach <christian.ambach at de.ibm.com>
Date:   Fri Feb 18 15:02:35 2011 +0100

    s4:smbtorture do not leave output directory around
    
    calling smbtorture with no or invalid arguments left the temporary
    output directory around
    this patches removes the dead-end exit from usage and makes the
    logic go on until the final cleanup state is reached
    
    output directory will still be left around when test times out
    or testcases itself force an exit
    
    also make sure that the directory itself is deleted, not just
    the objects in it
    
    Signed-off-by: Matthias Dieter Wallnöfer <mdw at samba.org>
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User: Matthias Dieter Wallnöfer <mdw at samba.org>
    Autobuild-Date: Mon Feb 21 11:35:30 CET 2011 on sn-devel-104

commit d2b336ae319053dee96476131a3dc0c45b306b5f
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Wed Feb 16 09:22:43 2011 +0100

    libcli/security/security_descriptor.c - fix three wrong counter variables
    
    These strictly need to be "uint32_t" since "acl*->num_aces" has been
    defined by this type.
    
    This counter patchset has been reviewed by Andrew Bartlett.

commit 618c11cc15b0c7b16cd21e9bc10dbe474aa514ff
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Wed Feb 16 09:12:17 2011 +0100

    libcli/security/privileges.c - fix wrong counter type
    
    This strictly needs to be from type "uint32_t" since "privset->count"
    is defined with this type.

commit e7659fa802627b472bd514672de76193b4694aa2
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Wed Feb 16 09:20:11 2011 +0100

    libcli/security/privileges.c - fix the counting of privileges
    
    Since the privileges are always counted with a signed integer, there is no
    reason to specify the upper limit with a "uint32_t".

commit a2ded049730074beb05cc1124c24ca848a28c297
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Wed Feb 16 09:12:17 2011 +0100

    libcli/security/sddl.c - fix wrong counter type
    
    This strictly needs to be from type "uint32_t" since "acl->num_aces" is
    defined of this type.

commit 055857a8d46f315014f13a845c9a66a837d86f76
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date:   Wed Feb 16 09:12:17 2011 +0100

    libcli/security/display_sec.c - fix wrong counter type
    
    This strictly needs to be of type "uint32_t" due to
    "sec_acl->num_aces" which is of type "uint32_t".

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

Summary of changes:
 lib/torture/torture.c                 |    1 +
 libcli/security/display_sec.c         |    2 +-
 libcli/security/privileges.c          |   15 +++++----------
 libcli/security/sddl.c                |    2 +-
 libcli/security/security_descriptor.c |    6 +++---
 source4/torture/smbtorture.c          |   23 ++++++++++-------------
 6 files changed, 21 insertions(+), 28 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/torture/torture.c b/lib/torture/torture.c
index a12ce65..a0b35bf 100644
--- a/lib/torture/torture.c
+++ b/lib/torture/torture.c
@@ -138,6 +138,7 @@ static int local_deltree(const char *path)
 		}
 	}
 	closedir(dir);
+	rmdir(path);
 	return ret;
 }
 
diff --git a/libcli/security/display_sec.c b/libcli/security/display_sec.c
index 3d60e42..0aa89b4 100644
--- a/libcli/security/display_sec.c
+++ b/libcli/security/display_sec.c
@@ -233,7 +233,7 @@ void display_sec_ace(struct security_ace *ace)
  ****************************************************************************/
 void display_sec_acl(struct security_acl *sec_acl)
 {
-	int i;
+	uint32_t i;
 
 	printf("\tACL\tNum ACEs:\t%u\trevision:\t%x\n",
 			 sec_acl->num_aces, sec_acl->revision); 
diff --git a/libcli/security/privileges.c b/libcli/security/privileges.c
index e215b5f..adb67c1 100644
--- a/libcli/security/privileges.c
+++ b/libcli/security/privileges.c
@@ -190,10 +190,9 @@ uint64_t sec_privilege_mask(enum sec_privilege privilege)
 void se_priv_put_all_privileges(uint64_t *privilege_mask)
 {
 	int i;
-	uint32_t num_privs = ARRAY_SIZE(privs);
 
 	*privilege_mask = 0;
-	for ( i=0; i<num_privs; i++ ) {
+	for ( i=0; i<ARRAY_SIZE(privs); i++ ) {
 		*privilege_mask |= privs[i].privilege_mask;
 	}
 }
@@ -205,8 +204,7 @@ void se_priv_put_all_privileges(uint64_t *privilege_mask)
 bool se_priv_from_name( const char *name, uint64_t *privilege_mask )
 {
 	int i;
-	uint32_t num_privs = ARRAY_SIZE(privs);
-	for ( i=0; i<num_privs; i++ ) {
+	for ( i=0; i<ARRAY_SIZE(privs); i++ ) {
 		if ( strequal( privs[i].name, name ) ) {
 			*privilege_mask = privs[i].privilege_mask;
 			return true;
@@ -220,13 +218,11 @@ const char* get_privilege_dispname( const char *name )
 {
 	int i;
 
-	uint32_t num_privs = ARRAY_SIZE(privs);
-
 	if (!name) {
 		return NULL;
 	}
 
-	for ( i=0; i<num_privs; i++ ) {
+	for ( i=0; i<ARRAY_SIZE(privs); i++ ) {
 		if ( strequal( privs[i].name, name ) ) {
 			return privs[i].description;
 		}
@@ -276,13 +272,12 @@ static bool privilege_set_add(PRIVILEGE_SET *priv_set, struct lsa_LUIDAttribute
 bool se_priv_to_privilege_set( PRIVILEGE_SET *set, uint64_t privilege_mask )
 {
 	int i;
-	uint32_t num_privs = ARRAY_SIZE(privs);
 	struct lsa_LUIDAttribute luid;
 
 	luid.attribute = 0;
 	luid.luid.high = 0;
 
-	for ( i=0; i<num_privs; i++ ) {
+	for ( i=0; i<ARRAY_SIZE(privs); i++ ) {
 		if ((privilege_mask & privs[i].privilege_mask) == 0)
 			continue;
 
@@ -301,7 +296,7 @@ bool se_priv_to_privilege_set( PRIVILEGE_SET *set, uint64_t privilege_mask )
 
 bool privilege_set_to_se_priv( uint64_t *privilege_mask, struct lsa_PrivilegeSet *privset )
 {
-	int i;
+	uint32_t i;
 
 	ZERO_STRUCTP( privilege_mask );
 
diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c
index 5b605c0..c1f2e96 100644
--- a/libcli/security/sddl.c
+++ b/libcli/security/sddl.c
@@ -566,7 +566,7 @@ static char *sddl_encode_acl(TALLOC_CTX *mem_ctx, const struct security_acl *acl
 			     uint32_t flags, const struct dom_sid *domain_sid)
 {
 	char *sddl;
-	int i;
+	uint32_t i;
 
 	/* add any ACL flags */
 	sddl = sddl_flags_to_string(mem_ctx, acl_flags, flags, false);
diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c
index 60f9de8..574dd4e 100644
--- a/libcli/security/security_descriptor.c
+++ b/libcli/security/security_descriptor.c
@@ -85,7 +85,7 @@ struct security_acl *security_acl_concatenate(TALLOC_CTX *mem_ctx,
                                               const struct security_acl *acl2)
 {
         struct security_acl *nacl;
-        int i;
+        uint32_t i;
 
         if (!acl1 && !acl2)
                 return NULL;
@@ -270,7 +270,7 @@ static NTSTATUS security_descriptor_acl_del(struct security_descriptor *sd,
 					    bool sacl_del,
 					    const struct dom_sid *trustee)
 {
-	int i;
+	uint32_t i;
 	bool found = false;
 	struct security_acl *acl = NULL;
 
@@ -364,7 +364,7 @@ bool security_ace_equal(const struct security_ace *ace1,
 bool security_acl_equal(const struct security_acl *acl1, 
 			const struct security_acl *acl2)
 {
-	int i;
+	uint32_t i;
 
 	if (acl1 == acl2) return true;
 	if (!acl1 || !acl2) return false;
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index cfa8b0f..62cf0ab 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -285,7 +285,7 @@ void torture_print_testsuites(bool structured)
 	}
 }
 
-_NORETURN_ static void usage(poptContext pc)
+static void usage(poptContext pc)
 {
 	poptPrintUsage(pc, stdout, 0);
 	printf("\n");
@@ -341,7 +341,6 @@ _NORETURN_ static void usage(poptContext pc)
 
 	print_structured_testsuite_list();
 
-	exit(1);
 }
 
 _NORETURN_ static void max_runtime_handler(int sig)
@@ -702,19 +701,17 @@ int main(int argc,char *argv[])
 		if (argc_new < 3) {
 			printf("You must specify a test to run, or 'ALL'\n");
 			usage(pc);
-			exit(1);
-		}
-
+			torture->results->returncode = 1;
+		} else if (!torture_parse_target(cmdline_lp_ctx, argv_new[1])) {
 		/* Take the target name or binding. */
-		if (!torture_parse_target(cmdline_lp_ctx, argv_new[1])) {
 			usage(pc);
-			exit(1);
-		}
-
-		for (i=2;i<argc_new;i++) {
-			if (!torture_run_named_tests(torture, argv_new[i],
-				    (const char **)restricted)) {
-				correct = false;
+			torture->results->returncode = 1;
+		} else {
+			for (i=2;i<argc_new;i++) {
+				if (!torture_run_named_tests(torture, argv_new[i],
+					    (const char **)restricted)) {
+					correct = false;
+				}
 			}
 		}
 	}


-- 
Samba Shared Repository


More information about the samba-cvs mailing list