aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-11-05 14:32:30 +0100
committerJason Zaman <perfinion@gentoo.org>2021-11-11 13:26:50 -0800
commitbf6fdfd10493e1d4b51195cc9daa4a7093402c4f (patch)
treeed07348374ecd1a9a6bf9c8f85e6f21c521bbb69 /Makefile
parentdevices: make usbfs pseudofs instead of noxattrfs (diff)
downloadhardened-refpolicy-bf6fdfd10493e1d4b51195cc9daa4a7093402c4f.tar.gz
hardened-refpolicy-bf6fdfd10493e1d4b51195cc9daa4a7093402c4f.tar.bz2
hardened-refpolicy-bf6fdfd10493e1d4b51195cc9daa4a7093402c4f.zip
Ignore umask on when installing headers
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 <cgzones@googlemail.com> Signed-off-by: Jason Zaman <perfinion@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ba346a27..53af1468 100644
--- a/Makefile
+++ b/Makefile
@@ -534,17 +534,19 @@ $(appdir)/%: $(appconf)/%
# Install policy headers
#
install-headers: $(layerxml) $(tunxml) $(boolxml) $(gentooxml)
- @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)" ""