aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-06-04 00:19:20 -0400
committerMike Frysinger <vapier@gentoo.org>2009-06-04 00:19:20 -0400
commit70f148095b7b9acd4e8329da0766aadc88b017d8 (patch)
treef9c69308721da245f85bf0f09dfffc6234d9ab61 /scripts
parentlibsandbox: make sure fopen64 uses 64bit funcs (diff)
downloadsandbox-70f148095b7b9acd4e8329da0766aadc88b017d8.tar.gz
sandbox-70f148095b7b9acd4e8329da0766aadc88b017d8.tar.bz2
sandbox-70f148095b7b9acd4e8329da0766aadc88b017d8.zip
libsandbox: add pre checks to static tracing
The normal wrapped functions go through some "pre checks" where certain normal conditions are not flagged as problematic. The static tracing lacked those pre checks though. URL: http://bugs.gentoo.org/265885 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Daniel Robbins <drobbins@funtoo.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_symbol_header.awk5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/gen_symbol_header.awk b/scripts/gen_symbol_header.awk
index 49e4540..749dabc 100644
--- a/scripts/gen_symbol_header.awk
+++ b/scripts/gen_symbol_header.awk
@@ -109,8 +109,10 @@ END {
# that we know what the name is in libsandbox.c ...
# Also do this for non-versioned libc's ...
if (sym_full_names[x] ~ /@@/ || !symbol_array[2]) {
+ sym_is_default = 1;
sym_real_name = sym_index "_DEFAULT";
} else {
+ sym_is_default = 0;
sym_real_name = sym_full_names[x];
gsub(/@|\./, "_", sym_real_name);
}
@@ -134,6 +136,9 @@ END {
printf("#define SB_NR_%s %i\n", toupper(sym_index), i);
printf("#define WRAPPER_NR SB_NR_%s\n", toupper(sym_index));
printf("#include \"wrapper-funcs/%s.c\"\n", sym_index);
+ pre_check = "wrapper-funcs/" sym_index "_pre_check.c"
+ if (sym_is_default && system("test -e " srcdir "/" pre_check) == 0)
+ printf("#include \"%s\"\n", pre_check);
printf("#undef STRING_NAME\n");
printf("#undef EXTERN_NAME\n");
printf("#undef WRAPPER_NAME\n");