eBPF-based security platform
include: poison what <shirudo/string.h> replaces
Daniel Borkmann2519b44d73fa
diff --git a/include/shirudo/string.h b/include/shirudo/string.hindex 10d7ca4f..283b7143 100644--- a/include/shirudo/string.h+++ b/include/shirudo/string.h@@ -8,7 +8,11 @@#ifndef SHIRUDO_STRING_H#define SHIRUDO_STRING_H+#include <inttypes.h>#include <stddef.h>+#include <stdio.h>+#include <stdlib.h>+#include <string.h>#include <sys/types.h>#include <shirudo/misc.h>@@ -42,4 +46,15 @@ ssize_t strscpy(char *dst, const char *src, size_t size);int strsprintf(char *buf, size_t size, const char *fmt, ...)__attribute__((format(printf, 3, 4), warn_unused_result));+/*+ * What the functions above replace, refused once the headers included+ * above have declared it, so that a later include of those still works.+ */+#pragma GCC poison strtol strtoll strtoul strtoull strtoimax strtoumax+#pragma GCC poison strtod strtof strtold atoi atol atoll atof+#pragma GCC poison strcpy strncpy strcat strncat strlcpy+/* Fortified glibc makes sprintf() a macro for clang; poison the name alone. */+#undef sprintf+#pragma GCC poison sprintf vsprintf+#endif /* SHIRUDO_STRING_H */diff --git a/util/image_runtime.c b/util/image_runtime.cindex 09cddd84..35632f0a 100644--- a/util/image_runtime.c+++ b/util/image_runtime.c@@ -1,9 +1,6 @@// SPDX-License-Identifier: BSD-2-Clause/* Copyright (c) 2026 Authors of shirudo */-#include <shirudo/misc.h>-#include <shirudo/string.h>-#include <errno.h>#include <fcntl.h>#include <limits.h>@@ -23,6 +20,9 @@#include <bpf/bpf.h>+#include <shirudo/misc.h>+#include <shirudo/string.h>+#include "../builtin.h"#include "config.h"#include "config_image.h"diff --git a/util/upatch_decode.c b/util/upatch_decode.cindex 87724bc6..86e067df 100644--- a/util/upatch_decode.c+++ b/util/upatch_decode.c@@ -8,9 +8,6 @@#include <errno.h>-#include <shirudo/misc.h>-#include <shirudo/string.h>-#include "upatch_decode.h"#ifndef SHIRUDO_HAVE_LUAJIT@@ -82,6 +79,9 @@ int upatch_decode_map_file_otel(const char *path,#include <lualib.h>#include <luajit.h>+#include <shirudo/misc.h>+#include <shirudo/string.h>+#include "json.h"#include "hex.h"#include "macros.h"