From: Andreas Gruenbacher <agruenba@redhat.com> To: Al Viro <viro@zeniv.linux.org.uk> Cc: Steve French <sfrench@samba.org>, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, cluster-devel@redhat.com Subject: [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Date: Thu, 14 Apr 2016 00:30:14 +0200 [thread overview] Message-ID: <1460586620-5717-3-git-send-email-agruenba@redhat.com> (raw) In-Reply-To: <1460586620-5717-1-git-send-email-agruenba@redhat.com> In-Reply-To: <20160413182026.GR25498@ZenIV.linux.org.uk> The two values ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT are meant to be enumerations, not bits in a bit mask. Use '==' instead of '&' to check for these values. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> --- fs/cifs/cifssmb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 76fcb50..f24a89c 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -3366,7 +3366,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, if (le16_to_cpu(cifs_acl->version) != CIFS_ACL_VERSION) return -EOPNOTSUPP; - if (acl_type & ACL_TYPE_ACCESS) { + if (acl_type == ACL_TYPE_ACCESS) { count = le16_to_cpu(cifs_acl->access_entry_count); pACE = &cifs_acl->ace_array[0]; size = sizeof(struct cifs_posix_acl); @@ -3377,7 +3377,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, size_of_data_area, size); return -EINVAL; } - } else if (acl_type & ACL_TYPE_DEFAULT) { + } else if (acl_type == ACL_TYPE_DEFAULT) { count = le16_to_cpu(cifs_acl->access_entry_count); size = sizeof(struct cifs_posix_acl); size += sizeof(struct cifs_posix_ace) * count; -- 2.4.11
WARNING: multiple messages have this Message-ID (diff)
From: Andreas Gruenbacher <agruenba@redhat.com> To: cluster-devel.redhat.com Subject: [Cluster-devel] [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Date: Thu, 14 Apr 2016 00:30:14 +0200 [thread overview] Message-ID: <1460586620-5717-3-git-send-email-agruenba@redhat.com> (raw) In-Reply-To: <1460586620-5717-1-git-send-email-agruenba@redhat.com> The two values ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT are meant to be enumerations, not bits in a bit mask. Use '==' instead of '&' to check for these values. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> --- fs/cifs/cifssmb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 76fcb50..f24a89c 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -3366,7 +3366,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, if (le16_to_cpu(cifs_acl->version) != CIFS_ACL_VERSION) return -EOPNOTSUPP; - if (acl_type & ACL_TYPE_ACCESS) { + if (acl_type == ACL_TYPE_ACCESS) { count = le16_to_cpu(cifs_acl->access_entry_count); pACE = &cifs_acl->ace_array[0]; size = sizeof(struct cifs_posix_acl); @@ -3377,7 +3377,7 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen, size_of_data_area, size); return -EINVAL; } - } else if (acl_type & ACL_TYPE_DEFAULT) { + } else if (acl_type == ACL_TYPE_DEFAULT) { count = le16_to_cpu(cifs_acl->access_entry_count); size = sizeof(struct cifs_posix_acl); size += sizeof(struct cifs_posix_ace) * count; -- 2.4.11
next prev parent reply other threads:[~2016-04-13 22:30 UTC|newest] Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-04-13 12:57 [PATCH] xattr: Fail with -EINVAL for NULL attribute names Andreas Gruenbacher 2016-04-13 15:40 ` [PATCH] xattr: Export xattr_resolve_name Andreas Gruenbacher 2016-04-13 18:20 ` Al Viro [not found] ` <20160413182026.GR25498-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher [not found] ` <1460586466-5518-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2016-04-13 22:27 ` [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 3/8] cifs: Fix removexattr for os2.* xattrs Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 6/8] ceph: kill __ceph_removexattr() Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:30 ` [PATCH] xattr: Export xattr_resolve_name Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher [not found] ` <1460586620-5717-1-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2016-04-13 22:30 ` [PATCH 1/8] cifs: Fix xattr name checks Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher [not found] ` <1460586620-5717-2-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2016-04-14 4:26 ` Steve French 2016-04-14 4:26 ` [Cluster-devel] " Steve French [not found] ` <CAH2r5mumJ22+Q0bASFcXp5fK39Ubh+sznfOpVUtSJ94_c5gkxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2016-04-14 4:37 ` Al Viro 2016-04-14 4:37 ` [Cluster-devel] " Al Viro 2016-04-14 4:43 ` Steve French 2016-04-14 4:43 ` [Cluster-devel] " Steve French [not found] ` <CAH2r5ms6USEO3a_EPUpgsnvTZgSHB2QqJnUnCSCQdFmvV0yPDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2016-04-14 4:49 ` Steve French 2016-04-14 4:49 ` [Cluster-devel] " Steve French 2016-04-14 4:59 ` Al Viro 2016-04-14 4:59 ` [Cluster-devel] " Al Viro [not found] ` <20160414045920.GT25498-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> 2016-04-15 3:01 ` Steve French 2016-04-15 3:01 ` [Cluster-devel] " Steve French 2016-04-13 22:30 ` [PATCH 3/8] cifs: Fix removexattr for os2.* xattrs Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher [not found] ` <1460586620-5717-4-git-send-email-agruenba-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 2016-04-14 4:27 ` Steve French 2016-04-14 4:27 ` [Cluster-devel] " Steve French 2016-04-13 22:30 ` [PATCH 8/8] gfs2: Switch to generic xattr handlers Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 1/8] cifs: Fix xattr name checks Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 4/8] ceph: Get rid of d_find_alias in ceph_set_acl Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 5/8] ceph: Switch to generic xattr handlers Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 7/8] posix acls: Export xattr_handler functions Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:27 ` [PATCH 8/8] gfs2: Switch to generic xattr handlers Andreas Gruenbacher 2016-04-13 22:27 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:27 ` Andreas Gruenbacher 2016-04-13 22:30 ` Andreas Gruenbacher [this message] 2016-04-13 22:30 ` [Cluster-devel] [PATCH 2/8] cifs: Check for equality with ACL_TYPE_ACCESS and ACL_TYPE_DEFAULT Andreas Gruenbacher 2016-04-14 4:26 ` Steve French 2016-04-14 4:26 ` [Cluster-devel] " Steve French 2016-04-13 22:30 ` [PATCH 4/8] ceph: Get rid of d_find_alias in ceph_set_acl Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:30 ` [PATCH 5/8] ceph: Switch to generic xattr handlers Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:30 ` [PATCH 6/8] ceph: kill __ceph_removexattr() Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher 2016-04-13 22:30 ` [PATCH 7/8] posix acls: Export xattr_handler functions Andreas Gruenbacher 2016-04-13 22:30 ` [Cluster-devel] " Andreas Gruenbacher
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1460586620-5717-3-git-send-email-agruenba@redhat.com \ --to=agruenba@redhat.com \ --cc=ceph-devel@vger.kernel.org \ --cc=cluster-devel@redhat.com \ --cc=linux-cifs@vger.kernel.org \ --cc=sfrench@samba.org \ --cc=viro@zeniv.linux.org.uk \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.