mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-12 18:34:52 +02:00
fix: Apply SELinux security context after moving to mail-state (#3890)
* fix: Apply SELinux security context after moving to mail-state * fix: Ignore failing chcon on non-SELinux systems
This commit is contained in:
parent
79a9656f48
commit
a815bf5ab4
2 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,9 @@ function _setup_save_states() {
|
|||
_log 'trace' "Moving ${SERVICEFILE} to ${DEST}"
|
||||
# Empty volume was mounted, or new content from enabling a feature ENV:
|
||||
mv "${SERVICEFILE}" "${DEST}"
|
||||
# Apply SELinux security context to match the state directory, so access
|
||||
# is not restricted to the current running container:
|
||||
chcon -R --reference="${STATEDIR}" "${DEST}" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Symlink the original file in the container ($SERVICEFILE) to be
|
||||
|
@ -69,6 +72,9 @@ function _setup_save_states() {
|
|||
_log 'trace' "Moving contents of ${SERVICEDIR} to ${DEST}"
|
||||
# Empty volume was mounted, or new content from enabling a feature ENV:
|
||||
mv "${SERVICEDIR}" "${DEST}"
|
||||
# Apply SELinux security context to match the state directory, so access
|
||||
# is not restricted to the current running container:
|
||||
chcon -R --reference="${STATEDIR}" "${DEST}" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Symlink the original path in the container ($SERVICEDIR) to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue