diff options
| author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-02-15 01:10:39 -0500 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2010-02-15 17:25:13 -0500 |
| commit | 084da356f6e55ce42f1d2739178502023908c107 (patch) | |
| tree | bdb021a9e0aa6e48ea0a9a4f1248c87c03e00525 | |
| parent | 847b173ea3d6f50936823d07f2245059bf44713b (diff) | |
TOMOYO: Use enum for index numbers.
Use enum to declare index numbers.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
| -rw-r--r-- | security/tomoyo/common.h | 99 |
1 files changed, 54 insertions, 45 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h index 1c8c97a4c069..3727296f01f9 100644 --- a/security/tomoyo/common.h +++ b/security/tomoyo/common.h | |||
| @@ -62,15 +62,18 @@ struct linux_binprm; | |||
| 62 | #define TOMOYO_ROOT_NAME_LEN (sizeof(TOMOYO_ROOT_NAME) - 1) | 62 | #define TOMOYO_ROOT_NAME_LEN (sizeof(TOMOYO_ROOT_NAME) - 1) |
| 63 | 63 | ||
| 64 | /* Index numbers for Access Controls. */ | 64 | /* Index numbers for Access Controls. */ |
| 65 | #define TOMOYO_MAC_FOR_FILE 0 /* domain_policy.conf */ | 65 | enum tomoyo_mac_index { |
| 66 | #define TOMOYO_MAX_ACCEPT_ENTRY 1 | 66 | TOMOYO_MAC_FOR_FILE, /* domain_policy.conf */ |
| 67 | #define TOMOYO_VERBOSE 2 | 67 | TOMOYO_MAX_ACCEPT_ENTRY, |
| 68 | #define TOMOYO_MAX_CONTROL_INDEX 3 | 68 | TOMOYO_VERBOSE, |
| 69 | TOMOYO_MAX_CONTROL_INDEX | ||
| 70 | }; | ||
| 69 | 71 | ||
| 70 | /* Index numbers for Access Controls. */ | 72 | /* Index numbers for Access Controls. */ |
| 71 | 73 | enum tomoyo_acl_entry_type_index { | |
| 72 | #define TOMOYO_TYPE_SINGLE_PATH_ACL 0 | 74 | TOMOYO_TYPE_SINGLE_PATH_ACL, |
| 73 | #define TOMOYO_TYPE_DOUBLE_PATH_ACL 1 | 75 | TOMOYO_TYPE_DOUBLE_PATH_ACL, |
| 76 | }; | ||
| 74 | 77 | ||
| 75 | /* Index numbers for File Controls. */ | 78 | /* Index numbers for File Controls. */ |
| 76 | 79 | ||
| @@ -83,44 +86,50 @@ struct linux_binprm; | |||
| 83 | * automatically cleared if TYPE_READ_WRITE_ACL is cleared. | 86 | * automatically cleared if TYPE_READ_WRITE_ACL is cleared. |
| 84 | */ | 87 | */ |
| 85 | 88 | ||
| 86 | #define TOMOYO_TYPE_READ_WRITE_ACL 0 | 89 | enum tomoyo_path_acl_index { |
| 87 | #define TOMOYO_TYPE_EXECUTE_ACL 1 | 90 | TOMOYO_TYPE_READ_WRITE_ACL, |
| 88 | #define TOMOYO_TYPE_READ_ACL 2 | 91 | TOMOYO_TYPE_EXECUTE_ACL, |
| 89 | #define TOMOYO_TYPE_WRITE_ACL 3 | 92 | TOMOYO_TYPE_READ_ACL, |
| 90 | #define TOMOYO_TYPE_CREATE_ACL 4 | 93 | TOMOYO_TYPE_WRITE_ACL, |
| 91 | #define TOMOYO_TYPE_UNLINK_ACL 5 | 94 | TOMOYO_TYPE_CREATE_ACL, |
| 92 | #define TOMOYO_TYPE_MKDIR_ACL 6 | 95 | TOMOYO_TYPE_UNLINK_ACL, |
| 93 | #define TOMOYO_TYPE_RMDIR_ACL 7 | 96 | TOMOYO_TYPE_MKDIR_ACL, |
| 94 | #define TOMOYO_TYPE_MKFIFO_ACL 8 | 97 | TOMOYO_TYPE_RMDIR_ACL, |
| 95 | #define TOMOYO_TYPE_MKSOCK_ACL 9 | 98 | TOMOYO_TYPE_MKFIFO_ACL, |
| 96 | #define TOMOYO_TYPE_MKBLOCK_ACL 10 | 99 | TOMOYO_TYPE_MKSOCK_ACL, |
| 97 | #define TOMOYO_TYPE_MKCHAR_ACL 11 | 100 | TOMOYO_TYPE_MKBLOCK_ACL, |
| 98 | #define TOMOYO_TYPE_TRUNCATE_ACL 12 | 101 | TOMOYO_TYPE_MKCHAR_ACL, |
| 99 | #define TOMOYO_TYPE_SYMLINK_ACL 13 | 102 | TOMOYO_TYPE_TRUNCATE_ACL, |
| 100 | #define TOMOYO_TYPE_REWRITE_ACL 14 | 103 | TOMOYO_TYPE_SYMLINK_ACL, |
| 101 | #define TOMOYO_TYPE_IOCTL_ACL 15 | 104 | TOMOYO_TYPE_REWRITE_ACL, |
| 102 | #define TOMOYO_TYPE_CHMOD_ACL 16 | 105 | TOMOYO_TYPE_IOCTL_ACL, |
| 103 | #define TOMOYO_TYPE_CHOWN_ACL 17 | 106 | TOMOYO_TYPE_CHMOD_ACL, |
| 104 | #define TOMOYO_TYPE_CHGRP_ACL 18 | 107 | TOMOYO_TYPE_CHOWN_ACL, |
| 105 | #define TOMOYO_TYPE_CHROOT_ACL 19 | 108 | TOMOYO_TYPE_CHGRP_ACL, |
| 106 | #define TOMOYO_TYPE_MOUNT_ACL 20 | 109 | TOMOYO_TYPE_CHROOT_ACL, |
| 107 | #define TOMOYO_TYPE_UMOUNT_ACL 21 | 110 | TOMOYO_TYPE_MOUNT_ACL, |
| 108 | #define TOMOYO_MAX_SINGLE_PATH_OPERATION 22 | 111 | TOMOYO_TYPE_UMOUNT_ACL, |
| 109 | 112 | TOMOYO_MAX_SINGLE_PATH_OPERATION | |
| 110 | #define TOMOYO_TYPE_LINK_ACL 0 | 113 | }; |
| 111 | #define TOMOYO_TYPE_RENAME_ACL 1 | 114 | |
| 112 | #define TOMOYO_TYPE_PIVOT_ROOT_ACL 2 | 115 | enum tomoyo_path2_acl_index { |
| 113 | #define TOMOYO_MAX_DOUBLE_PATH_OPERATION 3 | 116 | TOMOYO_TYPE_LINK_ACL, |
| 114 | 117 | TOMOYO_TYPE_RENAME_ACL, | |
| 115 | #define TOMOYO_DOMAINPOLICY 0 | 118 | TOMOYO_TYPE_PIVOT_ROOT_ACL, |
| 116 | #define TOMOYO_EXCEPTIONPOLICY 1 | 119 | TOMOYO_MAX_DOUBLE_PATH_OPERATION |
| 117 | #define TOMOYO_DOMAIN_STATUS 2 | 120 | }; |
| 118 | #define TOMOYO_PROCESS_STATUS 3 | 121 | |
| 119 | #define TOMOYO_MEMINFO 4 | 122 | enum tomoyo_securityfs_interface_index { |
| 120 | #define TOMOYO_SELFDOMAIN 5 | 123 | TOMOYO_DOMAINPOLICY, |
| 121 | #define TOMOYO_VERSION 6 | 124 | TOMOYO_EXCEPTIONPOLICY, |
| 122 | #define TOMOYO_PROFILE 7 | 125 | TOMOYO_DOMAIN_STATUS, |
| 123 | #define TOMOYO_MANAGER 8 | 126 | TOMOYO_PROCESS_STATUS, |
| 127 | TOMOYO_MEMINFO, | ||
| 128 | TOMOYO_SELFDOMAIN, | ||
| 129 | TOMOYO_VERSION, | ||
| 130 | TOMOYO_PROFILE, | ||
| 131 | TOMOYO_MANAGER | ||
| 132 | }; | ||
| 124 | 133 | ||
| 125 | /********** Structure definitions. **********/ | 134 | /********** Structure definitions. **********/ |
| 126 | 135 | ||
