@matheusbsbs / matheus-bagliano / commits / d8bdc49265
Fork 0

Fix permission bits on sources checked out with an overtight umask

Two patches 9907721 (templates/Makefile: don't depend on local umask setting, 2008-02-28) and 96cda0b (templates/Makefile: install is unnecessary, just use mkdir -p, 2008-08-21) tried to prevent an overtight umask the builder/installer might have from screwing over the installation procedure, but we forgot there was another source of trouble. If the person who checked out the source tree had an overtight umask, it will leak out to the built products, which is propagated to the installation destination. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Aug 21, 2008 at 19:31 UTC d8bdc49265559786533d7f7377b2c39038dd6309
1 file changed +7 -5
templates/Makefile
+7 -5
@@ -23,17 +23,19 @@ all: boilerplates.made custom
23
24 bpsrc = $(filter-out %~,$(wildcard *--*))
25 boilerplates.made : $(bpsrc)
26 - $(QUIET)ls *--* 2>/dev/null | \
26 + $(QUIET)umask 022 && ls *--* 2>/dev/null | \
27 while read boilerplate; \
28 do \
29 case "$$boilerplate" in *~) continue ;; esac && \
30 dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
31 dir=`expr "$$dst" : '\(.*\)/'` && \
32 - $(INSTALL) -d -m 755 blt/$$dir && \
32 + mkdir -p blt/$$dir && \
33 case "$$boilerplate" in \
34 - *--) ;; \
35 - *) cp -p $$boilerplate blt/$$dst ;; \
36 - esac || exit; \
34 + *--) continue;; \
35 + esac && \
36 + cp $$boilerplate blt/$$dst && \
37 + if test -x "blt/$$dst"; then rx=rx; else rx=r; fi && \
38 + chmod a+$$rx "blt/$$dst" || exit; \
39 done && \
40 date >$@
41