summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-27 10:09:24 +0100
committerMichael Adam <obnox@samba.org>2008-03-27 10:09:24 +0100
commit3c213a1f8d7da283a48574eabcd3f81b46ea7b74 (patch)
tree22619635a71af0d73d9615fa4f95614067c882c6 /source3/smbd
parentd8d1eea13663ceb28aefdf734592b90a108891b0 (diff)
downloadsamba-3c213a1f8d7da283a48574eabcd3f81b46ea7b74.tar.gz
samba-3c213a1f8d7da283a48574eabcd3f81b46ea7b74.tar.bz2
samba-3c213a1f8d7da283a48574eabcd3f81b46ea7b74.zip
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 (This used to be commit 6dab6cf0647d7db01e5e472f8b5cf21395b7dbf0)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/posix_acls.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index f60329a039..c3c9d2e60c 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/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),