2011-06-22 Eric Blake <eblake@redhat.com>
+ maint.mk: add syntax-check to avoid char[PATH_MAX]
+ * top/maint.mk (sc_prohibit_path_max_array): New rule.
+
stat: be robust to PATH_MAX definition
* lib/stat.c (rpl_stat): Require reasonable PATH_MAX.
* modules/stat (Depends-on): Add verify.
# the other init.sh-using tests also get it right.
_hv_file ?= $(srcdir)/tests/help-version
_hv_regex_weak ?= ^ *\. .*/init\.sh"
+# Fix syntax-highlighters "
_hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
sc_cross_check_PATH_usage_in_tests:
@if test -f $(_hv_file); then \
halt='Use 0 or 1 for macro values' \
$(_sc_search_regexp)
+# Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might
+# not be constant. In general, use PATH_MAX as a limit, not an array
+# allocation bound.
+sc_prohibit_path_max_array:
+ @prohibit='\[PATH''_MAX' \
+ halt='Avoid arrays of size PATH_MAX' \
+ $(_sc_search_regexp)
+
sc_vulnerable_makefile_CVE-2009-4029:
@prohibit='perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)' \
in_files=$$(find $(srcdir) -name Makefile.in) \