[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-460-g6dab6cf

Michael Adam obnox at samba.org
Thu Mar 27 09:09:45 GMT 2008


The branch, v3-2-test has been updated
       via  6dab6cf0647d7db01e5e472f8b5cf21395b7dbf0 (commit)
      from  ffe77dc8b0476b7a5d81d63c3cf67f81033df12e (commit)

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


- Log -----------------------------------------------------------------
commit 6dab6cf0647d7db01e5e472f8b5cf21395b7dbf0
Author: Michael Adam <obnox at samba.org>
Date:   Thu Mar 27 10:09:24 2008 +0100

    posix_acls: clarify loop condition code, removing unneeded counter variable.
    
    Coverity ID 545 falsely classified this as a NULL dereferencing bug.
    By putting the loop of walking the list of aces more naturely not using
    additional counters, it becomes much more obvious that it is not entered
    when dir_ace == NULL.
    
    The same modifications are done for the file_ace loop.
    
    Michael

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

Summary of changes:
 source/smbd/posix_acls.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index f60329a..c3c9d2e 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -2882,7 +2882,6 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
 		{
 			canon_ace *ace;
 			enum security_ace_type nt_acl_type;
-			int i;
 
 			if (nt4_compatible_acls() && dir_ace) {
 				/*
@@ -2948,9 +2947,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
 			 * Create the NT ACE list from the canonical ace lists.
 			 */
 
-			ace = file_ace;
-
-			for (i = 0; i < num_acls; i++, ace = ace->next) {
+			for (ace = file_ace; ace != NULL; ace = ace->next) {
 				SEC_ACCESS acc;
 
 				acc = map_canon_ace_perms(SNUM(conn),
@@ -2977,9 +2974,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
 						acc, 0);
 			}
 
-			ace = dir_ace;
-
-			for (i = 0; i < num_def_acls; i++, ace = ace->next) {
+			for (ace = dir_ace; ace != NULL; ace = ace->next) {
 				SEC_ACCESS acc;
 
 				acc = map_canon_ace_perms(SNUM(conn),


-- 
Samba Shared Repository


More information about the samba-cvs mailing list