aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-22 17:19:14 +0200
committerBrian Behlendorf <[email protected]>2021-06-11 09:10:21 -0700
commitfeb04e66802ef96aa77951c43d4b632b376041ef (patch)
tree0d78f6283f001f8f66828bef33c9ace4185f7802 /config
parent64dfdaba372f07f91a6eab598b3480693b1d14c8 (diff)
Forbid basename(3) and dirname(3)
There are at least two interpretations of basename(3), in addition to both functions being allowed to /both/ return a static buffer (unsuitable in multi-threaded environments) /and/ raze the input (which encourages overallocations, at best) Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12105
Diffstat (limited to 'config')
-rw-r--r--config/Rules.am3
1 files changed, 3 insertions, 0 deletions
diff --git a/config/Rules.am b/config/Rules.am
index ef10d4938..8fe2fa9ca 100644
--- a/config/Rules.am
+++ b/config/Rules.am
@@ -54,6 +54,9 @@ if BUILD_FREEBSD
AM_CPPFLAGS += -DTEXT_DOMAIN=\"zfs-freebsd-user\"
endif
AM_CPPFLAGS += -D"strtok(...)=strtok(__VA_ARGS__) __attribute__((deprecated(\"Use strtok_r(3) instead!\")))"
+AM_CPPFLAGS += -D"__xpg_basename(...)=__xpg_basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
+AM_CPPFLAGS += -D"basename(...)=basename(__VA_ARGS__) __attribute__((deprecated(\"basename(3) is underspecified. Use zfs_basename() instead!\")))"
+AM_CPPFLAGS += -D"dirname(...)=dirname(__VA_ARGS__) __attribute__((deprecated(\"dirname(3) is underspecified. Use zfs_dirnamelen() instead!\")))"
AM_LDFLAGS = $(DEBUG_LDFLAGS)
AM_LDFLAGS += $(ASAN_LDFLAGS)