This source file includes following definitions.
- ext2_permission
1
2
3
4
5
6
7
8
9
10
11
12 #include <linux/errno.h>
13 #include <linux/fs.h>
14 #include <linux/ext2_fs.h>
15 #include <linux/kernel.h>
16 #include <linux/sched.h>
17 #include <linux/stat.h>
18
19
20
21
22
23
24 int ext2_permission (struct inode * inode, int mask)
25 {
26 unsigned short mode = inode->i_mode;
27
28
29 if (suser ())
30 return 1;
31
32 else if (current->euid == inode->i_uid)
33 mode >>= 6;
34 else if (in_group_p (inode->i_gid))
35 mode >>= 3;
36 if (((mode & mask & S_IRWXO) == mask))
37 return 1;
38 else
39 return 0;
40 }