]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - repair/attr_repair.h
xfsprogs: Release v6.7.0
[thirdparty/xfsprogs-dev.git] / repair / attr_repair.h
CommitLineData
959ef981 1// SPDX-License-Identifier: GPL-2.0
2bd0ea18 2/*
da23017d
NS
3 * Copyright (c) 2000-2002,2004-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
2bd0ea18 5 */
2bd0ea18
NS
6#ifndef _XR_ATTRREPAIR_H
7#define _XR_ATTRREPAIR_H
8
33a4da69
NS
9/*
10 * Access Control Lists
11 */
fc49813f
NS
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 */
43533211 17#define ACL_OTHER 0x20 /* other entry */
fc49813f 18
0b656633
NS
19#define ACL_READ 04
20#define ACL_WRITE 02
21#define ACL_EXECUTE 01
22
14f8b681
DW
23typedef uint16_t xfs_acl_perm_t;
24typedef int32_t xfs_acl_type_t;
25typedef int32_t xfs_acl_tag_t;
26typedef int32_t xfs_acl_id_t;
33a4da69 27
b5f5c2d1
DC
28/*
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.
33 */
34struct xfs_icacl_entry {
33a4da69
NS
35 xfs_acl_tag_t ae_tag;
36 xfs_acl_id_t ae_id;
37 xfs_acl_perm_t ae_perm;
b5f5c2d1 38};
33a4da69 39
b5f5c2d1 40struct xfs_icacl {
14f8b681 41 int32_t acl_cnt;
b5f5c2d1
DC
42 struct xfs_icacl_entry acl_entry[0];
43};
33a4da69 44
33a4da69
NS
45/*
46 * Mandatory Access Control Labels (IRIX)
47 */
48#define XFS_MAC_MAX_SETS 250
49typedef struct xfs_mac_label {
14f8b681
DW
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 */
33a4da69 56 /* Category set, then Division set */
14f8b681 57 uint16_t ml_list[XFS_MAC_MAX_SETS];
33a4da69
NS
58} xfs_mac_label_t;
59
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 */
70
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 */
76
77#define SGI_MAC_FILE "SGI_MAC_FILE"
78#define SGI_MAC_FILE_SIZE (sizeof(SGI_MAC_FILE)-1)
79
80
81/*
82 * Capabilities (IRIX)
83 */
14f8b681 84typedef uint64_t xfs_cap_value_t;
33a4da69
NS
85
86typedef 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 */
90} xfs_cap_set_t;
91
92#define SGI_CAP_FILE "SGI_CAP_FILE"
93#define SGI_CAP_FILE_SIZE (sizeof(SGI_CAP_FILE)-1)
94
95
96/*
97 * External functions
98 */
8c4a2bb0 99struct blkmap;
7328ea6e 100extern int process_attributes (xfs_mount_t *, xfs_ino_t, struct xfs_dinode *,
8c4a2bb0 101 struct blkmap *, int *);
2bd0ea18 102
2bd0ea18 103#endif /* _XR_ATTRREPAIR_H */