Files
Tobias WaldekranzandJoachim Wiberg 8eb67c1d13 test: Fixup permissions of generated files when using docker
Since containers managed by docker runs as root, files created in bind
mounted volumes will be owned by root:root. This is a problem for
files generated during test execution, as the calling user does not
have permission to remove them.

Therefore, add a wrapper entrypoint that hooks up an exit handler that
will fixup the permissions before exiting the container.
2024-05-24 19:10:10 +02:00

15 lines
158 B
Bash
Executable File

#!/bin/sh
set -e
fixup_owner()
{
for dir in $HOST_CHOWN_PATH; do
chown -R $HOST_CHOWN_UID:$HOST_CHOWN_GID $dir
done
}
trap fixup_owner EXIT
"$@"