From 8f55384986c10d742813c8cb8a19094c298e9717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20=C3=81lvaro?= Date: Thu, 14 Sep 2023 22:28:17 +0200 Subject: [PATCH] fix: Set salt home directory permissions Closes #211 --- CHANGELOG.md | 4 ++++ Dockerfile | 2 +- assets/build/install.sh | 4 ++++ tests/basic/test.sh | 5 +++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 708171d..a113914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file only reflects the changes that are made in this image. Please refer to the [Salt 3006.3 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3006.3.html) for the list of changes in SaltStack. +**3006.3_1** + +- Fix salt home directory permissions. Issue #211 + **3006.3** - Upgrade `salt-master` to `3006.3` *Sulfur*. diff --git a/Dockerfile b/Dockerfile index ed72e6c..6e6b4c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG VCS_REF # https://github.com/saltstack/salt/releases ENV SALT_VERSION="3006.3" -ENV IMAGE_VERSION="${SALT_VERSION}" +ENV IMAGE_VERSION="${SALT_VERSION}_1" ENV SALT_DOCKER_DIR="/etc/docker-salt" \ SALT_ROOT_DIR="/etc/salt" \ diff --git a/assets/build/install.sh b/assets/build/install.sh index c92833f..208b897 100755 --- a/assets/build/install.sh +++ b/assets/build/install.sh @@ -108,3 +108,7 @@ apt-get clean --yes rm -rf /var/lib/apt/lists/* export -n DEBIAN_FRONTEND + +# Set home directory permissions +log_info "Setting ${SALT_USER} home directory permissions ..." +chown -R "${SALT_USER}:${SALT_USER}" "${SALT_HOME}" diff --git a/tests/basic/test.sh b/tests/basic/test.sh index eab7e73..855b6a5 100755 --- a/tests/basic/test.sh +++ b/tests/basic/test.sh @@ -46,3 +46,8 @@ ok "salt-minion started" salt "${TEST_MINION_ID}" test.ping || error "${TEST_MINION_ID} ping" ok "${TEST_MINION_ID} ping" + +# Test salt home permissions +# shellcheck disable=SC2016 +docker-exec bash -c 'test $(stat -c "%U:%G" "${SALT_HOME}") = "${SALT_USER}:${SALT_USER}"' || error "salt home permissions" +ok "salt home permissions"