From 04a58bcbdf1002ccaddeb03bb13505350baeb996 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 28 Oct 2021 06:33:00 -0400 Subject: libsandbox: hoist the *at pre-check functions up a level The reason we put these in wrapper-funcs/ is because we normally dynamically include them when the corresponding symbol is available. For example, if the C library supports symbol foo, and there is a wrapper-funcs/foo_pre_check.c, we'll automatically include it based on the assumption that wrapper-funcs/foo.c needs it. But if the C library doesn't have a symbol foo, we won't include foo.c or the foo_pre_check.c file at all. Sounds fine. The *at family of functions is a bit different because we end up using them both in the wrapper-funcs/ files, and in the trace code, the latter of which we use unconditionally. This lead to a build issue early on (see commit b27df46f349e850067ae388fe067b043abf3aecb ("libsandbox: fix missing *at pre_checks")) whereby we hacked in these *at pre-check symbols all the time. At which point, having them be in wrapper-funcs/ was more out of convention with how we manage all our other APIs. We want to support running ptrace from the sandbox binary directly which requires linking (most of) libsandbox into it, and to that end, hoist these pre-check functions out of wrapper-funcs. This makes it a bit clearer that we always want to compile these. Signed-off-by: Mike Frysinger --- scripts/gen_symbol_header.awk | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts') diff --git a/scripts/gen_symbol_header.awk b/scripts/gen_symbol_header.awk index e669c85..0180f6c 100644 --- a/scripts/gen_symbol_header.awk +++ b/scripts/gen_symbol_header.awk @@ -201,8 +201,6 @@ END { } } - printf("#include \"wrapper-funcs/__pre_check.c\"\n"); - printf("#define SB_MAX_STRING_LEN %i\n\n", SB_MAX_STRING_LEN); printf("#endif /* __symbols_h */\n"); -- cgit v1.2.3-65-gdbad