]>
Commit | Line | Data |
---|---|---|
5c03efc3 BB |
1 | dnl # |
2 | dnl # 2.6.39 API change | |
3 | dnl # The security_inode_init_security() function now takes an additional | |
4 | dnl # qstr argument which must be passed in from the dentry if available. | |
5 | dnl # Passing a NULL is safe when no qstr is available the relevant | |
6 | dnl # security checks will just be skipped. | |
7 | dnl # | |
608f8749 BB |
8 | AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS], [ |
9 | ZFS_LINUX_TEST_SRC([security_inode_init_security_6args], [ | |
5c03efc3 BB |
10 | #include <linux/security.h> |
11 | ],[ | |
166dd49d BB |
12 | struct inode *ip __attribute__ ((unused)) = NULL; |
13 | struct inode *dip __attribute__ ((unused)) = NULL; | |
14 | const struct qstr *str __attribute__ ((unused)) = NULL; | |
15 | char *name __attribute__ ((unused)) = NULL; | |
16 | void *value __attribute__ ((unused)) = NULL; | |
17 | size_t len __attribute__ ((unused)) = 0; | |
18 | ||
19 | security_inode_init_security(ip, dip, str, &name, &value, &len); | |
608f8749 BB |
20 | ]) |
21 | ]) | |
22 | ||
23 | AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS], [ | |
24 | AC_MSG_CHECKING([whether security_inode_init_security wants 6 args]) | |
25 | ZFS_LINUX_TEST_RESULT([security_inode_init_security_6args], [ | |
5c03efc3 BB |
26 | AC_MSG_RESULT(yes) |
27 | AC_DEFINE(HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY, 1, | |
608f8749 | 28 | [security_inode_init_security wants 6 args]) |
5c03efc3 BB |
29 | ],[ |
30 | AC_MSG_RESULT(no) | |
31 | ]) | |
5c03efc3 | 32 | ]) |
166dd49d BB |
33 | |
34 | dnl # | |
35 | dnl # 3.2 API change | |
36 | dnl # The security_inode_init_security() API has been changed to include | |
37 | dnl # a filesystem specific callback to write security extended attributes. | |
38 | dnl # This was done to support the initialization of multiple LSM xattrs | |
39 | dnl # and the EVM xattr. | |
40 | dnl # | |
608f8749 BB |
41 | AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK], [ |
42 | ZFS_LINUX_TEST_SRC([security_inode_init_security], [ | |
166dd49d BB |
43 | #include <linux/security.h> |
44 | ],[ | |
45 | struct inode *ip __attribute__ ((unused)) = NULL; | |
46 | struct inode *dip __attribute__ ((unused)) = NULL; | |
47 | const struct qstr *str __attribute__ ((unused)) = NULL; | |
48 | initxattrs func __attribute__ ((unused)) = NULL; | |
49 | ||
50 | security_inode_init_security(ip, dip, str, func, NULL); | |
608f8749 BB |
51 | ]) |
52 | ]) | |
53 | ||
54 | AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK], [ | |
55 | AC_MSG_CHECKING([whether security_inode_init_security wants callback]) | |
56 | ZFS_LINUX_TEST_RESULT([security_inode_init_security], [ | |
166dd49d BB |
57 | AC_MSG_RESULT(yes) |
58 | AC_DEFINE(HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY, 1, | |
608f8749 | 59 | [security_inode_init_security wants callback]) |
166dd49d BB |
60 | ],[ |
61 | AC_MSG_RESULT(no) | |
62 | ]) | |
166dd49d | 63 | ]) |
608f8749 BB |
64 | |
65 | AC_DEFUN([ZFS_AC_KERNEL_SRC_SECURITY_INODE], [ | |
66 | ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_6ARGS | |
67 | ZFS_AC_KERNEL_SRC_SECURITY_INODE_INIT_SECURITY_CALLBACK | |
68 | ]) | |
69 | ||
70 | AC_DEFUN([ZFS_AC_KERNEL_SECURITY_INODE], [ | |
71 | ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_6ARGS | |
72 | ZFS_AC_KERNEL_SECURITY_INODE_INIT_SECURITY_CALLBACK | |
73 | ]) |