From: bluhm Date: Sun, 11 Jun 2017 20:50:32 +0000 (+0000) Subject: Use umask 077 instead of cp -p when installing the kernel as root. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9262a9bd75f613f49b1aae2bba7ce3c81818e34f;p=openbsd Use umask 077 instead of cp -p when installing the kernel as root. Otherwise owner of /bsd could be the build user with permissions inherited from the compile directory. OK deraadt@ tb@ --- diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha index fafd19cbf0e..a023c77df3d 100644 --- a/sys/arch/alpha/conf/Makefile.alpha +++ b/sys/arch/alpha/conf/Makefile.alpha @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.alpha,v 1.98 2017/06/05 17:49:06 deraadt Exp $ +# $OpenBSD: Makefile.alpha,v 1.99 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -155,7 +155,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index a6e1345f87f..a2fbe3f46a1 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.amd64,v 1.81 2017/06/05 15:58:14 deraadt Exp $ +# $OpenBSD: Makefile.amd64,v 1.82 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -159,7 +159,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/arm64/conf/Makefile.arm64 b/sys/arch/arm64/conf/Makefile.arm64 index cd940bd47f5..e1914c653e9 100644 --- a/sys/arch/arm64/conf/Makefile.arm64 +++ b/sys/arch/arm64/conf/Makefile.arm64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.arm64,v 1.11 2017/06/06 02:35:40 jsg Exp $ +# $OpenBSD: Makefile.arm64,v 1.12 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -160,7 +160,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/armv7/conf/Makefile.armv7 b/sys/arch/armv7/conf/Makefile.armv7 index cd8a7847c6e..c4ab27f3b2c 100644 --- a/sys/arch/armv7/conf/Makefile.armv7 +++ b/sys/arch/armv7/conf/Makefile.armv7 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armv7,v 1.23 2017/06/05 12:43:59 deraadt Exp $ +# $OpenBSD: Makefile.armv7,v 1.24 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -147,7 +147,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/hppa/conf/Makefile.hppa b/sys/arch/hppa/conf/Makefile.hppa index fcd781cf404..43787320a68 100644 --- a/sys/arch/hppa/conf/Makefile.hppa +++ b/sys/arch/hppa/conf/Makefile.hppa @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.hppa,v 1.92 2017/06/05 18:59:07 deraadt Exp $ +# $OpenBSD: Makefile.hppa,v 1.93 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -164,7 +164,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index 919ba8b722b..0429ab14583 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.107 2017/06/05 12:43:59 deraadt Exp $ +# $OpenBSD: Makefile.i386,v 1.108 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -160,7 +160,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/landisk/conf/Makefile.landisk b/sys/arch/landisk/conf/Makefile.landisk index d189c7438f7..5207acdeef7 100644 --- a/sys/arch/landisk/conf/Makefile.landisk +++ b/sys/arch/landisk/conf/Makefile.landisk @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.landisk,v 1.63 2017/06/08 05:35:23 deraadt Exp $ +# $OpenBSD: Makefile.landisk,v 1.64 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -153,7 +153,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/loongson/conf/Makefile.loongson b/sys/arch/loongson/conf/Makefile.loongson index 306d4e2b430..b8947b2853f 100644 --- a/sys/arch/loongson/conf/Makefile.loongson +++ b/sys/arch/loongson/conf/Makefile.loongson @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.loongson,v 1.57 2017/06/08 11:44:00 visa Exp $ +# $OpenBSD: Makefile.loongson,v 1.58 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -166,7 +166,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k index 1252f8fd4d6..03a2309c5c7 100644 --- a/sys/arch/luna88k/conf/Makefile.luna88k +++ b/sys/arch/luna88k/conf/Makefile.luna88k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.luna88k,v 1.68 2017/06/05 12:43:59 deraadt Exp $ +# $OpenBSD: Makefile.luna88k,v 1.69 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -147,7 +147,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/macppc/conf/Makefile.macppc b/sys/arch/macppc/conf/Makefile.macppc index 957f935fbce..ce5b16610d9 100644 --- a/sys/arch/macppc/conf/Makefile.macppc +++ b/sys/arch/macppc/conf/Makefile.macppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.macppc,v 1.80 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.macppc,v 1.81 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -140,7 +140,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/octeon/conf/Makefile.octeon b/sys/arch/octeon/conf/Makefile.octeon index bb47dec5fe5..92d5b76da0e 100644 --- a/sys/arch/octeon/conf/Makefile.octeon +++ b/sys/arch/octeon/conf/Makefile.octeon @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.octeon,v 1.33 2017/06/05 15:23:11 visa Exp $ +# $OpenBSD: Makefile.octeon,v 1.34 2017/06/11 20:50:32 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -167,7 +167,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/sgi/conf/Makefile.sgi b/sys/arch/sgi/conf/Makefile.sgi index 99b7f828fc8..c2942b57f92 100644 --- a/sys/arch/sgi/conf/Makefile.sgi +++ b/sys/arch/sgi/conf/Makefile.sgi @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sgi,v 1.81 2017/06/08 11:47:24 visa Exp $ +# $OpenBSD: Makefile.sgi,v 1.82 2017/06/11 20:50:33 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -167,7 +167,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/socppc/conf/Makefile.socppc b/sys/arch/socppc/conf/Makefile.socppc index 23b886ed680..4e2dc9afd4d 100644 --- a/sys/arch/socppc/conf/Makefile.socppc +++ b/sys/arch/socppc/conf/Makefile.socppc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.socppc,v 1.51 2017/06/03 22:21:34 deraadt Exp $ +# $OpenBSD: Makefile.socppc,v 1.52 2017/06/11 20:50:33 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -140,7 +140,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64 index 78fece436a4..8bac1700052 100644 --- a/sys/arch/sparc64/conf/Makefile.sparc64 +++ b/sys/arch/sparc64/conf/Makefile.sparc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc64,v 1.83 2017/06/05 12:43:59 deraadt Exp $ +# $OpenBSD: Makefile.sparc64,v 1.84 2017/06/11 20:50:33 bluhm Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -141,7 +141,7 @@ install: install-kernel-${MACHINE_NAME} .if !target(install-kernel-${MACHINE_NAME}}) install-kernel-${MACHINE_NAME}: cmp -s bsd /bsd || ln -f /bsd /obsd - cp -p bsd /nbsd + umask 077; cp bsd /nbsd mv /nbsd /bsd .endif