From: Junio C Hamano Date: Fri, 22 Aug 2008 00:31:50 +0000 (-0500) Subject: Fix permission bits on sources checked out with an overtight umask X-Git-Tag: v1.6.0.3~81^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d8bdc49265559786533d7f7377b2c39038dd6309;p=git.git 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 --- diff --git a/templates/Makefile b/templates/Makefile index cc3fc3094..a12c6e214 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -23,17 +23,19 @@ all: boilerplates.made custom bpsrc = $(filter-out %~,$(wildcard *--*)) boilerplates.made : $(bpsrc) - $(QUIET)ls *--* 2>/dev/null | \ + $(QUIET)umask 022 && ls *--* 2>/dev/null | \ while read boilerplate; \ do \ case "$$boilerplate" in *~) continue ;; esac && \ dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \ dir=`expr "$$dst" : '\(.*\)/'` && \ - $(INSTALL) -d -m 755 blt/$$dir && \ + mkdir -p blt/$$dir && \ case "$$boilerplate" in \ - *--) ;; \ - *) cp -p $$boilerplate blt/$$dst ;; \ - esac || exit; \ + *--) continue;; \ + esac && \ + cp $$boilerplate blt/$$dst && \ + if test -x "blt/$$dst"; then rx=rx; else rx=r; fi && \ + chmod a+$$rx "blt/$$dst" || exit; \ done && \ date >$@