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>
This commit is contained in:
Tetsuo Handa 2010-02-15 15:10:39 +09:00 committed by James Morris
parent 847b173ea3
commit 084da356f6

View file

@ -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;
* 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 enum tomoyo_path2_acl_index {
#define TOMOYO_TYPE_RENAME_ACL 1 TOMOYO_TYPE_LINK_ACL,
#define TOMOYO_TYPE_PIVOT_ROOT_ACL 2 TOMOYO_TYPE_RENAME_ACL,
#define TOMOYO_MAX_DOUBLE_PATH_OPERATION 3 TOMOYO_TYPE_PIVOT_ROOT_ACL,
TOMOYO_MAX_DOUBLE_PATH_OPERATION
};
#define TOMOYO_DOMAINPOLICY 0 enum tomoyo_securityfs_interface_index {
#define TOMOYO_EXCEPTIONPOLICY 1 TOMOYO_DOMAINPOLICY,
#define TOMOYO_DOMAIN_STATUS 2 TOMOYO_EXCEPTIONPOLICY,
#define TOMOYO_PROCESS_STATUS 3 TOMOYO_DOMAIN_STATUS,
#define TOMOYO_MEMINFO 4 TOMOYO_PROCESS_STATUS,
#define TOMOYO_SELFDOMAIN 5 TOMOYO_MEMINFO,
#define TOMOYO_VERSION 6 TOMOYO_SELFDOMAIN,
#define TOMOYO_PROFILE 7 TOMOYO_VERSION,
#define TOMOYO_MANAGER 8 TOMOYO_PROFILE,
TOMOYO_MANAGER
};
/********** Structure definitions. **********/ /********** Structure definitions. **********/