util: Drop unused variable mask_perms
authorMartin Schwenke <martin@meltin.net>
Tue, 15 Feb 2022 09:27:24 +0000 (20:27 +1100)
committerVolker Lendecke <vl@samba.org>
Thu, 17 Feb 2022 18:12:51 +0000 (18:12 +0000)
clang complains:

../../source3/smbd/posix_acls.c:2783:9: error: variable 'mask_perms' set but not used [-Werror,-Wunused-but-set-variable]
        mode_t mask_perms = 0;
               ^

That is, the variable is initialised and updated but the value is
never used.

This potentially points to a bug in commit
f735551b9edef66b152261cf6eb2f29b7b69d65b from 2002.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/posix_acls.c

index 245d904f3802e323e510ff0b478281c4d346f4ce..4cfb821fc14838a7be5c2d611562c01426074610 100644 (file)
@@ -2780,7 +2780,6 @@ static bool set_canon_ace_list(files_struct *fsp,
        SMB_ACL_PERMSET_T mask_permset;
        SMB_ACL_TYPE_T the_acl_type = (default_ace ? SMB_ACL_TYPE_DEFAULT : SMB_ACL_TYPE_ACCESS);
        bool needs_mask = False;
-       mode_t mask_perms = 0;
        int sret;
 
        /* Use the psbuf that was passed in. */
@@ -2818,9 +2817,6 @@ static bool set_canon_ace_list(files_struct *fsp,
 
                if (p_ace->type == SMB_ACL_USER || p_ace->type == SMB_ACL_GROUP) {
                        needs_mask = True;
-                       mask_perms |= p_ace->perms;
-               } else if (p_ace->type == SMB_ACL_GROUP_OBJ) {
-                       mask_perms |= p_ace->perms;
                }
 
                /*