mirror of
https://bitbucket.org/atlassian-docker/docker-atlassian-confluence-server.git
synced 2024-08-30 18:22:16 +00:00
Added permissions check before re-applying permissions
This commit is contained in:
parent
ca78534396
commit
6ee5182477
@ -21,10 +21,13 @@ export JAVA_OPTS="${JAVA_OPTS} ${CATALINA_OPTS}"
|
||||
|
||||
# Start Bamboo as the correct user
|
||||
if [ "${UID}" -eq 0 ]; then
|
||||
echo "User is currently root. Will change directories to daemon control, then downgrade permission to daemon"
|
||||
mkdir -p "${CONFLUENCE_HOME}/lib" &&
|
||||
echo "User is currently root. Will change directory ownership to ${RUN_USER}:${RUN_GROUP}, then downgrade permission to ${RUN_USER}"
|
||||
PERMISSIONS_SIGNATURE=$(stat -c "%u:%U:%a" "${CONFLUENCE_HOME}")
|
||||
EXPECTED_PERMISSIONS=$(id -u ${RUN_USER}):${RUN_USER}:700
|
||||
if [ "${PERMISSIONS_SIGNATURE}" != "${EXPECTED_PERMISSIONS}" ]; then
|
||||
chmod -R 700 "${CONFLUENCE_HOME}" &&
|
||||
chown -R "${RUN_USER}:${RUN_GROUP}" "${CONFLUENCE_HOME}"
|
||||
chown -R "${RUN_USER}:${RUN_GROUP}" "${CONFLUENCE_HOME}"
|
||||
fi
|
||||
# Now drop privileges
|
||||
exec su -s /bin/bash "${RUN_USER}" -c "$CONFLUENCE_INSTALL_DIR/bin/start-confluence.sh $@"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user