contrib: adapt max reject string size in tracing demo

The Script errors were last touched in 2020. This value was calculated after that
in 2022 (commit 4b7aec2951). The previous commit
made the size of the largest reject reason string 4 characters smaller ("mandatory"
became "block"), so adapt the constant.
This commit is contained in:
Antoine Poinsot
2025-08-08 13:16:15 -04:00
parent 9a04635432
commit b3f781a0ef

View File

@@ -17,9 +17,9 @@ from bcc import BPF, USDT
PROGRAM = """
# include <uapi/linux/ptrace.h>
// The longest rejection reason is 118 chars and is generated in case of SCRIPT_ERR_EVAL_FALSE by
// The longest rejection reason is 114 chars and is generated in case of SCRIPT_ERR_EVAL_FALSE by
// strprintf("block-script-verify-flag-failed (%s)", ScriptErrorString(check.GetScriptError()))
#define MAX_REJECT_REASON_LENGTH 118
#define MAX_REJECT_REASON_LENGTH 114
// The longest string returned by RemovalReasonToString() is 'sizelimit'
#define MAX_REMOVAL_REASON_LENGTH 9
#define HASH_LENGTH 32