diff options
author | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-05 19:01:45 -0500 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /fs/ocfs2/xattr.h | |
parent | 8920d5ad6ba74ae8ab020e90cc4d976980e68701 (diff) | |
parent | f01d1d546abb2f4028b5299092f529eefb01253a (diff) |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'fs/ocfs2/xattr.h')
-rw-r--r-- | fs/ocfs2/xattr.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.h b/fs/ocfs2/xattr.h index 1d8314c7656d..5a1ebc789f7e 100644 --- a/fs/ocfs2/xattr.h +++ b/fs/ocfs2/xattr.h | |||
@@ -30,13 +30,58 @@ enum ocfs2_xattr_type { | |||
30 | OCFS2_XATTR_MAX | 30 | OCFS2_XATTR_MAX |
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct ocfs2_security_xattr_info { | ||
34 | int enable; | ||
35 | char *name; | ||
36 | void *value; | ||
37 | size_t value_len; | ||
38 | }; | ||
39 | |||
33 | extern struct xattr_handler ocfs2_xattr_user_handler; | 40 | extern struct xattr_handler ocfs2_xattr_user_handler; |
34 | extern struct xattr_handler ocfs2_xattr_trusted_handler; | 41 | extern struct xattr_handler ocfs2_xattr_trusted_handler; |
42 | extern struct xattr_handler ocfs2_xattr_security_handler; | ||
43 | #ifdef CONFIG_OCFS2_FS_POSIX_ACL | ||
44 | extern struct xattr_handler ocfs2_xattr_acl_access_handler; | ||
45 | extern struct xattr_handler ocfs2_xattr_acl_default_handler; | ||
46 | #endif | ||
35 | extern struct xattr_handler *ocfs2_xattr_handlers[]; | 47 | extern struct xattr_handler *ocfs2_xattr_handlers[]; |
36 | 48 | ||
37 | ssize_t ocfs2_listxattr(struct dentry *, char *, size_t); | 49 | ssize_t ocfs2_listxattr(struct dentry *, char *, size_t); |
50 | int ocfs2_xattr_get_nolock(struct inode *, struct buffer_head *, int, | ||
51 | const char *, void *, size_t); | ||
38 | int ocfs2_xattr_set(struct inode *, int, const char *, const void *, | 52 | int ocfs2_xattr_set(struct inode *, int, const char *, const void *, |
39 | size_t, int); | 53 | size_t, int); |
54 | int ocfs2_xattr_set_handle(handle_t *, struct inode *, struct buffer_head *, | ||
55 | int, const char *, const void *, size_t, int, | ||
56 | struct ocfs2_alloc_context *, | ||
57 | struct ocfs2_alloc_context *); | ||
40 | int ocfs2_xattr_remove(struct inode *, struct buffer_head *); | 58 | int ocfs2_xattr_remove(struct inode *, struct buffer_head *); |
59 | int ocfs2_init_security_get(struct inode *, struct inode *, | ||
60 | struct ocfs2_security_xattr_info *); | ||
61 | int ocfs2_init_security_set(handle_t *, struct inode *, | ||
62 | struct buffer_head *, | ||
63 | struct ocfs2_security_xattr_info *, | ||
64 | struct ocfs2_alloc_context *, | ||
65 | struct ocfs2_alloc_context *); | ||
66 | int ocfs2_calc_security_init(struct inode *, | ||
67 | struct ocfs2_security_xattr_info *, | ||
68 | int *, int *, struct ocfs2_alloc_context **); | ||
69 | int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *, | ||
70 | int, struct ocfs2_security_xattr_info *, | ||
71 | int *, int *, struct ocfs2_alloc_context **); | ||
72 | |||
73 | /* | ||
74 | * xattrs can live inside an inode, as part of an external xattr block, | ||
75 | * or inside an xattr bucket, which is the leaf of a tree rooted in an | ||
76 | * xattr block. Some of the xattr calls, especially the value setting | ||
77 | * functions, want to treat each of these locations as equal. Let's wrap | ||
78 | * them in a structure that we can pass around instead of raw buffer_heads. | ||
79 | */ | ||
80 | struct ocfs2_xattr_value_buf { | ||
81 | struct buffer_head *vb_bh; | ||
82 | ocfs2_journal_access_func vb_access; | ||
83 | struct ocfs2_xattr_value_root *vb_xv; | ||
84 | }; | ||
85 | |||
41 | 86 | ||
42 | #endif /* OCFS2_XATTR_H */ | 87 | #endif /* OCFS2_XATTR_H */ |