diff options
author | Eric Paris <eparis@redhat.com> | 2009-12-17 21:24:34 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:59:01 -0400 |
commit | c4ec54b40d33f8016fea970a383cc584dd0e6019 (patch) | |
tree | 8e8865170cf340d1e79dc379f56417588715b2c8 /include/linux/fsnotify_backend.h | |
parent | d14f1729483fad3a8817fbbcbd017678b7d1ad26 (diff) |
fsnotify: new fsnotify hooks and events types for access decisions
introduce a new fsnotify hook, fsnotify_perm(), which is called from the
security code. This hook is used to allow fsnotify groups to make access
control decisions about events on the system. We also must change the
generic fsnotify function to return an error code if we intend these hooks
to be in any way useful.
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include/linux/fsnotify_backend.h')
-rw-r--r-- | include/linux/fsnotify_backend.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index efe9ba321cf2..c34728e7d8cb 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -41,6 +41,9 @@ | |||
41 | #define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ | 41 | #define FS_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ |
42 | #define FS_IN_IGNORED 0x00008000 /* last inotify event here */ | 42 | #define FS_IN_IGNORED 0x00008000 /* last inotify event here */ |
43 | 43 | ||
44 | #define FS_OPEN_PERM 0x00010000 /* open event in an permission hook */ | ||
45 | #define FS_ACCESS_PERM 0x00020000 /* access event in a permissions hook */ | ||
46 | |||
44 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ | 47 | #define FS_IN_ISDIR 0x40000000 /* event occurred against dir */ |
45 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ | 48 | #define FS_IN_ONESHOT 0x80000000 /* only send event once */ |
46 | 49 | ||
@@ -282,8 +285,8 @@ struct fsnotify_mark { | |||
282 | /* called from the vfs helpers */ | 285 | /* called from the vfs helpers */ |
283 | 286 | ||
284 | /* main fsnotify call to send events */ | 287 | /* main fsnotify call to send events */ |
285 | extern void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 288 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
286 | const unsigned char *name, u32 cookie); | 289 | const unsigned char *name, u32 cookie); |
287 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); | 290 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); |
288 | extern void __fsnotify_inode_delete(struct inode *inode); | 291 | extern void __fsnotify_inode_delete(struct inode *inode); |
289 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | 292 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); |
@@ -413,9 +416,11 @@ extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder, | |||
413 | 416 | ||
414 | #else | 417 | #else |
415 | 418 | ||
416 | static inline void fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 419 | static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
417 | const unsigned char *name, u32 cookie) | 420 | const unsigned char *name, u32 cookie) |
418 | {} | 421 | { |
422 | return 0; | ||
423 | } | ||
419 | 424 | ||
420 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 425 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) |
421 | {} | 426 | {} |