.. | .. |
---|
1 | | -// SPDX-License-Identifier: GPL-2.0 |
---|
| 1 | +// SPDX-License-Identifier: LGPL-2.1 |
---|
2 | 2 | #ifndef SECCOMP_SET_MODE_STRICT |
---|
3 | 3 | #define SECCOMP_SET_MODE_STRICT 0 |
---|
4 | 4 | #endif |
---|
.. | .. |
---|
8 | 8 | |
---|
9 | 9 | static size_t syscall_arg__scnprintf_seccomp_op(char *bf, size_t size, struct syscall_arg *arg) |
---|
10 | 10 | { |
---|
| 11 | + bool show_prefix = arg->show_string_prefix; |
---|
| 12 | + const char *prefix = "SECCOMP_SET_MODE_"; |
---|
11 | 13 | int op = arg->val; |
---|
12 | 14 | size_t printed = 0; |
---|
13 | 15 | |
---|
14 | 16 | switch (op) { |
---|
15 | | -#define P_SECCOMP_SET_MODE_OP(n) case SECCOMP_SET_MODE_##n: printed = scnprintf(bf, size, #n); break |
---|
| 17 | +#define P_SECCOMP_SET_MODE_OP(n) case SECCOMP_SET_MODE_##n: printed = scnprintf(bf, size, "%s%s", show_prefix ? prefix : "", #n); break |
---|
16 | 18 | P_SECCOMP_SET_MODE_OP(STRICT); |
---|
17 | 19 | P_SECCOMP_SET_MODE_OP(FILTER); |
---|
18 | 20 | #undef P_SECCOMP_SET_MODE_OP |
---|
.. | .. |
---|
31 | 33 | static size_t syscall_arg__scnprintf_seccomp_flags(char *bf, size_t size, |
---|
32 | 34 | struct syscall_arg *arg) |
---|
33 | 35 | { |
---|
| 36 | + bool show_prefix = arg->show_string_prefix; |
---|
| 37 | + const char *prefix = "SECCOMP_FILTER_FLAG_"; |
---|
34 | 38 | int printed = 0, flags = arg->val; |
---|
35 | 39 | |
---|
36 | 40 | #define P_FLAG(n) \ |
---|
37 | 41 | if (flags & SECCOMP_FILTER_FLAG_##n) { \ |
---|
38 | | - printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "|" : "", #n); \ |
---|
| 42 | + printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \ |
---|
39 | 43 | flags &= ~SECCOMP_FILTER_FLAG_##n; \ |
---|
40 | 44 | } |
---|
41 | 45 | |
---|