From e22faa0f77db22df7d7c7e41f6c8af3dd51c6ea7 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 17 Oct 2016 14:16:55 +0100 Subject: [PATCH] elements: Drop executable bits from environment files Files in $element/environment.d are meant to be sourced, so drop the executable bit. Moreover, drop the executable bit from a couple of other scripts that are either meant to be sourced or simply because they are configuration files. Change-Id: I7f724dd9d409f4a835a136f12f48a84aa9acc41e --- bin/dib-lint | 6 +++++- elements/centos/environment.d/00-bootloader.bash | 0 .../stable-build-succeeds/environment.d/10-set-distro.bash | 0 .../testing-build-succeeds/environment.d/10-set-distro.bash | 0 .../build-succeeds/environment.d/09-debian-stable | 0 elements/devuser/environment.d/50-devuser | 0 .../dynamic-login/init-scripts/upstart/dynamic-login.conf | 0 elements/gentoo/environment.d/00-gentoo-envars.bash | 0 elements/manifests/environment.d/14-manifests | 0 elements/pip-cache/environment.d/10-pip-cache | 0 elements/ramdisk-base/extra-data.d/scripts/d/init-func | 0 elements/redhat-common/environment.d/50-redhat-common | 0 12 files changed, 5 insertions(+), 1 deletion(-) mode change 100755 => 100644 elements/centos/environment.d/00-bootloader.bash mode change 100755 => 100644 elements/debian-minimal/test-elements/stable-build-succeeds/environment.d/10-set-distro.bash mode change 100755 => 100644 elements/debian-minimal/test-elements/testing-build-succeeds/environment.d/10-set-distro.bash mode change 100755 => 100644 elements/debian/test-elements/build-succeeds/environment.d/09-debian-stable mode change 100755 => 100644 elements/devuser/environment.d/50-devuser mode change 100755 => 100644 elements/dynamic-login/init-scripts/upstart/dynamic-login.conf mode change 100755 => 100644 elements/gentoo/environment.d/00-gentoo-envars.bash mode change 100755 => 100644 elements/manifests/environment.d/14-manifests mode change 100755 => 100644 elements/pip-cache/environment.d/10-pip-cache mode change 100755 => 100644 elements/ramdisk-base/extra-data.d/scripts/d/init-func mode change 100755 => 100644 elements/redhat-common/environment.d/50-redhat-common diff --git a/bin/dib-lint b/bin/dib-lint index a8c10d4da..a34b8330a 100755 --- a/bin/dib-lint +++ b/bin/dib-lint @@ -156,11 +156,15 @@ for i in $(find elements -type f \ fi fi - # check that environment files don't "set -x" + # check that environment files don't "set -x" and they have no executable + # bits set if [[ "$i" =~ (environment.d) ]]; then if grep -q "set -x" $i; then error "Environment file $i should not set tracing" fi + if [[ -x $i ]]; then + error "Environment file $i should not be marked as executable" + fi fi # check that sudo calls in phases run outside the chroot look diff --git a/elements/centos/environment.d/00-bootloader.bash b/elements/centos/environment.d/00-bootloader.bash old mode 100755 new mode 100644 diff --git a/elements/debian-minimal/test-elements/stable-build-succeeds/environment.d/10-set-distro.bash b/elements/debian-minimal/test-elements/stable-build-succeeds/environment.d/10-set-distro.bash old mode 100755 new mode 100644 diff --git a/elements/debian-minimal/test-elements/testing-build-succeeds/environment.d/10-set-distro.bash b/elements/debian-minimal/test-elements/testing-build-succeeds/environment.d/10-set-distro.bash old mode 100755 new mode 100644 diff --git a/elements/debian/test-elements/build-succeeds/environment.d/09-debian-stable b/elements/debian/test-elements/build-succeeds/environment.d/09-debian-stable old mode 100755 new mode 100644 diff --git a/elements/devuser/environment.d/50-devuser b/elements/devuser/environment.d/50-devuser old mode 100755 new mode 100644 diff --git a/elements/dynamic-login/init-scripts/upstart/dynamic-login.conf b/elements/dynamic-login/init-scripts/upstart/dynamic-login.conf old mode 100755 new mode 100644 diff --git a/elements/gentoo/environment.d/00-gentoo-envars.bash b/elements/gentoo/environment.d/00-gentoo-envars.bash old mode 100755 new mode 100644 diff --git a/elements/manifests/environment.d/14-manifests b/elements/manifests/environment.d/14-manifests old mode 100755 new mode 100644 diff --git a/elements/pip-cache/environment.d/10-pip-cache b/elements/pip-cache/environment.d/10-pip-cache old mode 100755 new mode 100644 diff --git a/elements/ramdisk-base/extra-data.d/scripts/d/init-func b/elements/ramdisk-base/extra-data.d/scripts/d/init-func old mode 100755 new mode 100644 diff --git a/elements/redhat-common/environment.d/50-redhat-common b/elements/redhat-common/environment.d/50-redhat-common old mode 100755 new mode 100644