Commit 084da356 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by James Morris

TOMOYO: Use enum for index numbers.

Use enum to declare index numbers.
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 847b173e
...@@ -62,15 +62,18 @@ struct linux_binprm; ...@@ -62,15 +62,18 @@ struct linux_binprm;
#define TOMOYO_ROOT_NAME_LEN (sizeof(TOMOYO_ROOT_NAME) - 1) #define TOMOYO_ROOT_NAME_LEN (sizeof(TOMOYO_ROOT_NAME) - 1)
/* Index numbers for Access Controls. */ /* Index numbers for Access Controls. */
#define TOMOYO_MAC_FOR_FILE 0 /* domain_policy.conf */ enum tomoyo_mac_index {
#define TOMOYO_MAX_ACCEPT_ENTRY 1 TOMOYO_MAC_FOR_FILE, /* domain_policy.conf */
#define TOMOYO_VERBOSE 2 TOMOYO_MAX_ACCEPT_ENTRY,
#define TOMOYO_MAX_CONTROL_INDEX 3 TOMOYO_VERBOSE,
TOMOYO_MAX_CONTROL_INDEX
};
/* Index numbers for Access Controls. */ /* Index numbers for Access Controls. */
enum tomoyo_acl_entry_type_index {
#define TOMOYO_TYPE_SINGLE_PATH_ACL 0 TOMOYO_TYPE_SINGLE_PATH_ACL,
#define TOMOYO_TYPE_DOUBLE_PATH_ACL 1 TOMOYO_TYPE_DOUBLE_PATH_ACL,
};
/* Index numbers for File Controls. */ /* Index numbers for File Controls. */
...@@ -83,44 +86,50 @@ struct linux_binprm; ...@@ -83,44 +86,50 @@ struct linux_binprm;
* automatically cleared if TYPE_READ_WRITE_ACL is cleared. * automatically cleared if TYPE_READ_WRITE_ACL is cleared.
*/ */
#define TOMOYO_TYPE_READ_WRITE_ACL 0 enum tomoyo_path_acl_index {
#define TOMOYO_TYPE_EXECUTE_ACL 1 TOMOYO_TYPE_READ_WRITE_ACL,
#define TOMOYO_TYPE_READ_ACL 2 TOMOYO_TYPE_EXECUTE_ACL,
#define TOMOYO_TYPE_WRITE_ACL 3 TOMOYO_TYPE_READ_ACL,
#define TOMOYO_TYPE_CREATE_ACL 4 TOMOYO_TYPE_WRITE_ACL,
#define TOMOYO_TYPE_UNLINK_ACL 5 TOMOYO_TYPE_CREATE_ACL,
#define TOMOYO_TYPE_MKDIR_ACL 6 TOMOYO_TYPE_UNLINK_ACL,
#define TOMOYO_TYPE_RMDIR_ACL 7 TOMOYO_TYPE_MKDIR_ACL,
#define TOMOYO_TYPE_MKFIFO_ACL 8 TOMOYO_TYPE_RMDIR_ACL,
#define TOMOYO_TYPE_MKSOCK_ACL 9 TOMOYO_TYPE_MKFIFO_ACL,
#define TOMOYO_TYPE_MKBLOCK_ACL 10 TOMOYO_TYPE_MKSOCK_ACL,
#define TOMOYO_TYPE_MKCHAR_ACL 11 TOMOYO_TYPE_MKBLOCK_ACL,
#define TOMOYO_TYPE_TRUNCATE_ACL 12 TOMOYO_TYPE_MKCHAR_ACL,
#define TOMOYO_TYPE_SYMLINK_ACL 13 TOMOYO_TYPE_TRUNCATE_ACL,
#define TOMOYO_TYPE_REWRITE_ACL 14 TOMOYO_TYPE_SYMLINK_ACL,
#define TOMOYO_TYPE_IOCTL_ACL 15 TOMOYO_TYPE_REWRITE_ACL,
#define TOMOYO_TYPE_CHMOD_ACL 16 TOMOYO_TYPE_IOCTL_ACL,
#define TOMOYO_TYPE_CHOWN_ACL 17 TOMOYO_TYPE_CHMOD_ACL,
#define TOMOYO_TYPE_CHGRP_ACL 18 TOMOYO_TYPE_CHOWN_ACL,
#define TOMOYO_TYPE_CHROOT_ACL 19 TOMOYO_TYPE_CHGRP_ACL,
#define TOMOYO_TYPE_MOUNT_ACL 20 TOMOYO_TYPE_CHROOT_ACL,
#define TOMOYO_TYPE_UMOUNT_ACL 21 TOMOYO_TYPE_MOUNT_ACL,
#define TOMOYO_MAX_SINGLE_PATH_OPERATION 22 TOMOYO_TYPE_UMOUNT_ACL,
TOMOYO_MAX_SINGLE_PATH_OPERATION
#define TOMOYO_TYPE_LINK_ACL 0 };
#define TOMOYO_TYPE_RENAME_ACL 1
#define TOMOYO_TYPE_PIVOT_ROOT_ACL 2 enum tomoyo_path2_acl_index {
#define TOMOYO_MAX_DOUBLE_PATH_OPERATION 3 TOMOYO_TYPE_LINK_ACL,
TOMOYO_TYPE_RENAME_ACL,
#define TOMOYO_DOMAINPOLICY 0 TOMOYO_TYPE_PIVOT_ROOT_ACL,
#define TOMOYO_EXCEPTIONPOLICY 1 TOMOYO_MAX_DOUBLE_PATH_OPERATION
#define TOMOYO_DOMAIN_STATUS 2 };
#define TOMOYO_PROCESS_STATUS 3
#define TOMOYO_MEMINFO 4 enum tomoyo_securityfs_interface_index {
#define TOMOYO_SELFDOMAIN 5 TOMOYO_DOMAINPOLICY,
#define TOMOYO_VERSION 6 TOMOYO_EXCEPTIONPOLICY,
#define TOMOYO_PROFILE 7 TOMOYO_DOMAIN_STATUS,
#define TOMOYO_MANAGER 8 TOMOYO_PROCESS_STATUS,
TOMOYO_MEMINFO,
TOMOYO_SELFDOMAIN,
TOMOYO_VERSION,
TOMOYO_PROFILE,
TOMOYO_MANAGER
};
/********** Structure definitions. **********/ /********** Structure definitions. **********/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment