maint: add a syntax-check rule to check for vulnerable Makefile.in
authorJim Meyering <meyering@redhat.com>
Thu, 28 Jan 2010 08:37:12 +0000 (09:37 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 28 Jan 2010 08:37:12 +0000 (09:37 +0100)
* top/maint.mk (sc_vulnerable_makefile_CVE-2009-4029): New rule.

ChangeLog
top/maint.mk

index 25159f1..8b5597f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-28  Jim Meyering  <meyering@redhat.com>
+
+       maint: add a syntax-check rule to check for vulnerable Makefile.in
+       * top/maint.mk (sc_vulnerable_makefile_CVE-2009-4029): New rule.
+
 2010-01-27  Jim Meyering  <meyering@redhat.com>
 
        ncftpput-ftp: clean up spaces
index d384ca6..f9eed6a 100644 (file)
@@ -726,6 +726,19 @@ sc_Wundef_boolean:
        @grep -Ei '^#define.*(yes|no|true|false)$$' '$(CONFIG_INCLUDE)' && \
          { echo 'Use 0 or 1 for macro values' 1>&2; exit 1; } || :
 
+sc_vulnerable_makefile_CVE-2009-4029:
+       @files=$$(find $(srcdir) -name Makefile.in);                    \
+       if test -n "$$files"; then                                      \
+         grep -E                                                       \
+           'perm -777 -exec chmod a\+rwx|chmod 777 \$$\(distdir\)'     \
+           $$files &&                                                  \
+         { echo '$(ME): the above files are vulnerable; beware of'     \
+           'running "make dist*" rules, and upgrade to fixed automake' \
+           'see http://bugzilla.redhat.com/542609 for details'         \
+               1>&2; exit 1; } || :;                                   \
+       else :;                                                         \
+       fi
+
 vc-diff-check:
        (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
        if test -s vc-diffs; then                               \