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