1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2002,2004-2005 Silicon Graphics, Inc.
6 #ifndef _XR_ATTRREPAIR_H
7 #define _XR_ATTRREPAIR_H
10 * Access Control Lists
12 #define ACL_USER_OBJ 0x01 /* owner */
13 #define ACL_USER 0x02 /* additional users */
14 #define ACL_GROUP_OBJ 0x04 /* group */
15 #define ACL_GROUP 0x08 /* additional groups */
16 #define ACL_MASK 0x10 /* mask entry */
17 #define ACL_OTHER 0x20 /* other entry */
21 #define ACL_EXECUTE 01
23 typedef uint16_t xfs_acl_perm_t
;
24 typedef int32_t xfs_acl_type_t
;
25 typedef int32_t xfs_acl_tag_t
;
26 typedef int32_t xfs_acl_id_t
;
29 * "icacl" = in-core ACL. There is no equivalent in the XFS kernel code,
30 * so they are magic names just for repair. The "acl" types are what the kernel
31 * code uses for the on-disk format names, so use them here too for the on-disk
32 * ACL format definitions.
34 struct xfs_icacl_entry
{
37 xfs_acl_perm_t ae_perm
;
42 struct xfs_icacl_entry acl_entry
[0];
46 * Mandatory Access Control Labels (IRIX)
48 #define XFS_MAC_MAX_SETS 250
49 typedef struct xfs_mac_label
{
50 uint8_t ml_msen_type
; /* MSEN label type */
51 uint8_t ml_mint_type
; /* MINT label type */
52 uint8_t ml_level
; /* Hierarchical level */
53 uint8_t ml_grade
; /* Hierarchical grade */
54 uint16_t ml_catcount
; /* Category count */
55 uint16_t ml_divcount
; /* Division count */
56 /* Category set, then Division set */
57 uint16_t ml_list
[XFS_MAC_MAX_SETS
];
60 /* MSEN label type names. Choose an upper case ASCII character. */
61 #define XFS_MSEN_ADMIN_LABEL 'A' /* Admin: low<admin != tcsec<high */
62 #define XFS_MSEN_EQUAL_LABEL 'E' /* Wildcard - always equal */
63 #define XFS_MSEN_HIGH_LABEL 'H' /* System High - always dominates */
64 #define XFS_MSEN_MLD_HIGH_LABEL 'I' /* System High, multi-level dir */
65 #define XFS_MSEN_LOW_LABEL 'L' /* System Low - always dominated */
66 #define XFS_MSEN_MLD_LABEL 'M' /* TCSEC label on a multi-level dir */
67 #define XFS_MSEN_MLD_LOW_LABEL 'N' /* System Low, multi-level dir */
68 #define XFS_MSEN_TCSEC_LABEL 'T' /* TCSEC label */
69 #define XFS_MSEN_UNKNOWN_LABEL 'U' /* unknown label */
71 /* MINT label type names. Choose a lower case ASCII character. */
72 #define XFS_MINT_BIBA_LABEL 'b' /* Dual of a TCSEC label */
73 #define XFS_MINT_EQUAL_LABEL 'e' /* Wildcard - always equal */
74 #define XFS_MINT_HIGH_LABEL 'h' /* High Grade - always dominates */
75 #define XFS_MINT_LOW_LABEL 'l' /* Low Grade - always dominated */
77 #define SGI_MAC_FILE "SGI_MAC_FILE"
78 #define SGI_MAC_FILE_SIZE (sizeof(SGI_MAC_FILE)-1)
84 typedef uint64_t xfs_cap_value_t
;
86 typedef struct xfs_cap_set
{
87 xfs_cap_value_t cap_effective
; /* use in capability checks */
88 xfs_cap_value_t cap_permitted
; /* combined with file attrs */
89 xfs_cap_value_t cap_inheritable
;/* pass through exec */
92 #define SGI_CAP_FILE "SGI_CAP_FILE"
93 #define SGI_CAP_FILE_SIZE (sizeof(SGI_CAP_FILE)-1)
100 extern int process_attributes (xfs_mount_t
*, xfs_ino_t
, xfs_dinode_t
*,
101 struct blkmap
*, int *);
103 #endif /* _XR_ATTRREPAIR_H */