summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/acl.c
diff options
context:
space:
mode:
authorTiger Yang <tiger.yang@oracle.com>2008-11-14 11:17:18 +0800
committerMark Fasheh <mfasheh@suse.com>2009-01-05 08:34:20 -0800
commit23fc2702bea686569281708ad519b41a11d0a2f4 (patch)
treea567f38647047836332d1cfc17d7ad0be05c55ef /fs/ocfs2/acl.c
parent929fb014e041c6572c5e8c3686f1e32742b5b953 (diff)
downloadlinux-23fc2702bea686569281708ad519b41a11d0a2f4.tar.gz
linux-23fc2702bea686569281708ad519b41a11d0a2f4.tar.bz2
linux-23fc2702bea686569281708ad519b41a11d0a2f4.zip
ocfs2: add ocfs2_check_acl
This function is used to enhance permission checking with POSIX ACLs. Signed-off-by: Tiger Yang <tiger.yang@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/acl.c')
-rw-r--r--fs/ocfs2/acl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
index 62d0faad600b..a6a2bf6d6845 100644
--- a/fs/ocfs2/acl.c
+++ b/fs/ocfs2/acl.c
@@ -230,6 +230,21 @@ static int ocfs2_set_acl(handle_t *handle,
return ret;
}
+int ocfs2_check_acl(struct inode *inode, int mask)
+{
+ struct posix_acl *acl = ocfs2_get_acl(inode, ACL_TYPE_ACCESS);
+
+ if (IS_ERR(acl))
+ return PTR_ERR(acl);
+ if (acl) {
+ int ret = posix_acl_permission(inode, acl, mask);
+ posix_acl_release(acl);
+ return ret;
+ }
+
+ return -EAGAIN;
+}
+
static size_t ocfs2_xattr_list_acl_access(struct inode *inode,
char *list,
size_t list_len,