cifsd: fix a precedence bug in parse_dacl()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 18 Mar 2021 13:10:21 +0000 (16:10 +0300)
committerSteve French <stfrench@microsoft.com>
Tue, 11 May 2021 00:15:20 +0000 (19:15 -0500)
The shift has higher precedence than mask so this doesn't work as
intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/smbacl.c

index 8d8360c..294c5a8 100644 (file)
@@ -520,7 +520,7 @@ static void parse_dacl(struct smb_acl *pdacl, char *end_of_acl,
                        fattr->cf_gid;
                acl_state.groups->aces[acl_state.groups->n++].perms.allow =
                        (mode & 0070) >> 3;
-               default_acl_state.group.allow = mode & 0070 >> 3;
+               default_acl_state.group.allow = (mode & 0070) >> 3;
                default_acl_state.groups->aces[default_acl_state.groups->n].gid =
                        fattr->cf_gid;
                default_acl_state.groups->aces[default_acl_state.groups->n++].perms.allow =