Skip to content

Commit

Permalink
Filter nonexistent directories passed to find
Browse files Browse the repository at this point in the history
With the `set -e` option, the deb scripts can fail when passing
nonexistent directory to find.
  • Loading branch information
baby-gnu committed Jul 4, 2024
1 parent 987945a commit 8fd0a7d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/debian/salt-master.preinst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ case "$1" in
PY_VER=$(/opt/saltstack/salt/bin/python3 -c "import sys; sys.stdout.write('{}.{}'.format(*sys.version_info)); sys.stdout.flush();")

# Reset permissions to fix previous installs
find ${SALT_HOME} /etc/salt /var/log/salt /var/cache/salt /var/run/salt \
SALT_DIRS=""
for salt_dir in ${SALT_HOME} /etc/salt /var/log/salt /var/cache/salt /var/run/salt
do
[ -d "${salt_dir}" ] && SALT_DIRS="${SALT_DIRS:+${SALT_DIRS} }${salt_dir}"
done
find ${SALT_DIRS} \
\! \( -path /etc/salt/cloud.deploy.d\* -o -path /var/log/salt/cloud -o -path /opt/saltstack/salt/lib/python${PY_VER}/site-packages/salt/cloud/deploy\* \) -a \
\( -user ${SALT_USER} -o -group ${SALT_GROUP} \) -exec chown root:root \{\} \;

Expand Down

0 comments on commit 8fd0a7d

Please sign in to comment.