threads / patch / 12368

patchtemplates/Makefile: don't depend on local umask setting

Subject: [PATCH] templates/Makefile: don't depend on local umask setting

## tl;dr

2 messages between Feb 28, 2008 and Feb 28, 2008. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Gerrit Pape· Feb 28, 2008, 18:44 UTC · lore

Don't take the local umask setting into account when installing the templates/* files and directories, running 'make install' with umask set to 077 resulted in template/* installed with permissions 700 and 600.

The problem was discovered by Florian Zumbiehl, reported through
 http://bugs.debian.org/467518
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 templates/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to templates/Makefile +3 −3
diff --git a/templates/Makefile b/templates/Makefile
index ebd3a62..bda9d13 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -29,10 +29,10 @@ boilerplates.made : $(bpsrc)
 		case "$$boilerplate" in *~) continue ;; esac && \
 		dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
 		dir=`expr "$$dst" : '\(.*\)/'` && \
-		mkdir -p blt/$$dir && \
+		$(INSTALL) -d -m 755 blt/$$dir && \
 		case "$$boilerplate" in \
 		*--) ;; \
-		*) cp $$boilerplate blt/$$dst ;; \
+		*) cp -p $$boilerplate blt/$$dst ;; \
 		esac || exit; \
 	done && \
 	date >$@
@@ -48,4 +48,4 @@ clean:
 install: all
 	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_dir_SQ)'
 	(cd blt && $(TAR) cf - .) | \
-	(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && $(TAR) xf -)
+	(cd '$(DESTDIR_SQ)$(template_dir_SQ)' && umask 022 && $(TAR) xf -)
-- 
1.5.4.3
Junio C Hamano· Feb 28, 2008, 20:52 UTC · re: Gerrit Pape · lore

Re: [PATCH] templates/Makefile: don't depend on local umask setting

Gerrit Pape <pape@smarden.org> writes:
> Don't take the local umask setting into account when installing the
> templates/* files and directories, running 'make install' with umask set
> to 077 resulted in template/* installed with permissions 700 and 600.

Well spotted. As the current Makefile seems to assume the users like 022 umask (existing "$(INSTALL) -d" uses "-m 755"), your changes are consistent with it.

← back to recent threads