1 /* Generated by ./xlat/gen.sh from ./xlat/secbits.in; do not edit. */
2 
3 #include "gcc_compat.h"
4 #include "static_assert.h"
5 
6 #if defined(SECBIT_NOROOT) || (defined(HAVE_DECL_SECBIT_NOROOT) && HAVE_DECL_SECBIT_NOROOT)
7 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
8 static_assert((SECBIT_NOROOT) == ((1 << 0)), "SECBIT_NOROOT != (1 << 0)");
9 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
10 #else
11 # define SECBIT_NOROOT (1 << 0)
12 #endif
13 #if defined(SECBIT_NOROOT_LOCKED) || (defined(HAVE_DECL_SECBIT_NOROOT_LOCKED) && HAVE_DECL_SECBIT_NOROOT_LOCKED)
14 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
15 static_assert((SECBIT_NOROOT_LOCKED) == ((1 << 1)), "SECBIT_NOROOT_LOCKED != (1 << 1)");
16 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
17 #else
18 # define SECBIT_NOROOT_LOCKED (1 << 1)
19 #endif
20 #if defined(SECBIT_NO_SETUID_FIXUP) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP)
21 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
22 static_assert((SECBIT_NO_SETUID_FIXUP) == ((1 << 2)), "SECBIT_NO_SETUID_FIXUP != (1 << 2)");
23 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
24 #else
25 # define SECBIT_NO_SETUID_FIXUP (1 << 2)
26 #endif
27 #if defined(SECBIT_NO_SETUID_FIXUP_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED)
28 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
29 static_assert((SECBIT_NO_SETUID_FIXUP_LOCKED) == ((1 << 3)), "SECBIT_NO_SETUID_FIXUP_LOCKED != (1 << 3)");
30 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
31 #else
32 # define SECBIT_NO_SETUID_FIXUP_LOCKED (1 << 3)
33 #endif
34 #if defined(SECBIT_KEEP_CAPS) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS) && HAVE_DECL_SECBIT_KEEP_CAPS)
35 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
36 static_assert((SECBIT_KEEP_CAPS) == ((1 << 4)), "SECBIT_KEEP_CAPS != (1 << 4)");
37 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
38 #else
39 # define SECBIT_KEEP_CAPS (1 << 4)
40 #endif
41 #if defined(SECBIT_KEEP_CAPS_LOCKED) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED) && HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED)
42 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
43 static_assert((SECBIT_KEEP_CAPS_LOCKED) == ((1 << 5)), "SECBIT_KEEP_CAPS_LOCKED != (1 << 5)");
44 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
45 #else
46 # define SECBIT_KEEP_CAPS_LOCKED (1 << 5)
47 #endif
48 #if defined(SECBIT_NO_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE)
49 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
50 static_assert((SECBIT_NO_CAP_AMBIENT_RAISE) == ((1 << 6)), "SECBIT_NO_CAP_AMBIENT_RAISE != (1 << 6)");
51 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
52 #else
53 # define SECBIT_NO_CAP_AMBIENT_RAISE (1 << 6)
54 #endif
55 #if defined(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)
56 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
57 static_assert((SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) == ((1 << 7)), "SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED != (1 << 7)");
58 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
59 #else
60 # define SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED (1 << 7)
61 #endif
62 
63 #ifndef XLAT_MACROS_ONLY
64 
65 # ifdef IN_MPERS
66 
67 #  error static const struct xlat secbits in mpers mode
68 
69 # else
70 
71 static
72 const struct xlat secbits[] = {
73  XLAT(SECBIT_NOROOT),
74  XLAT(SECBIT_NOROOT_LOCKED),
75  XLAT(SECBIT_NO_SETUID_FIXUP),
76  XLAT(SECBIT_NO_SETUID_FIXUP_LOCKED),
77  XLAT(SECBIT_KEEP_CAPS),
78  XLAT(SECBIT_KEEP_CAPS_LOCKED),
79  XLAT(SECBIT_NO_CAP_AMBIENT_RAISE),
80  XLAT(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED),
81  XLAT_END
82 };
83 
84 # endif /* !IN_MPERS */
85 
86 #endif /* !XLAT_MACROS_ONLY */
87