From 79c54146a0ccc0405b8300c7b7844b581cc56ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Fri, 5 Nov 2021 14:32:30 +0100 Subject: [PATCH] Ignore umask on when installing headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use install(1) with explicit permission to create directories and files. In case umask(2) is set too strict the installed files will otherwise not be readable by unprivileged users. Signed-off-by: Christian Göttsche --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9252b5a04..b01f67bad 100644 --- a/Makefile +++ b/Makefile @@ -532,17 +532,19 @@ $(appdir)/%: $(appconf)/% # Install policy headers # install-headers: $(layerxml) $(tunxml) $(boolxml) - @mkdir -p $(headerdir) + $(verbose) $(INSTALL) -d -m 755 $(headerdir) @echo "Installing $(NAME) policy headers." $(verbose) $(INSTALL) -m 644 $^ $(headerdir) - $(verbose) mkdir -p $(headerdir)/support + $(verbose) $(INSTALL) -d -m 755 $(headerdir)/support $(verbose) $(INSTALL) -m 644 $(m4support) $(xmldtd) $(headerdir)/support $(verbose) $(INSTALL) -m 755 $(word $(words $(genxml)),$(genxml)) $(headerdir)/support + $(verbose) $(INSTALL) -m 644 /dev/null $(headerdir)/support/all_perms.spt $(verbose) $(genperm) $(avs) $(secclass) > $(headerdir)/support/all_perms.spt $(verbose) for i in $(notdir $(all_layers)); do \ - mkdir -p $(headerdir)/$$i ;\ + $(INSTALL) -d -m 755 $(headerdir)/$$i ;\ $(INSTALL) -m 644 $(moddir)/$$i/*.if $(headerdir)/$$i ;\ done + $(verbose) $(INSTALL) -m 644 /dev/null $(headerdir)/build.conf $(verbose) echo "TYPE ?= $(TYPE)" > $(headerdir)/build.conf $(verbose) echo "NAME ?= $(NAME)" >> $(headerdir)/build.conf ifneq "$(DISTRO)" ""