mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-06 20:47:00 +02:00
build_library: Don't preserve file ownership when copying sysext files
The docker and containerd copy files from the repository, which are owned by the sdk user. This ownership leaks into the final image, which means the first created user could edit systemd files. This is bad. Modify the cp invocation to copy files without preserving ownership. The sysext-mangle script is called by build_sysext, which is executed using sudo. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
16dd403d55
commit
ff6279a6b0
@ -12,7 +12,8 @@ script_root="$(cd "$(dirname "$0")/../"; pwd)"
|
||||
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/containerd"
|
||||
|
||||
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
|
||||
cp -va "${files_dir}/"* "${rootfs}"
|
||||
# ATTENTION: don't preserve ownership as repo is owned by sdk user
|
||||
cp -vdR --preserve=mode,timestamps "${files_dir}/"* "${rootfs}"
|
||||
|
||||
mkdir -p "${rootfs}/usr/lib/systemd/system/multi-user.target.d"
|
||||
{ echo "[Unit]"; echo "Upholds=containerd.service"; } > "${rootfs}/usr/lib/systemd/system/multi-user.target.d/10-containerd-service.conf"
|
||||
|
@ -11,7 +11,8 @@ script_root="$(cd "$(dirname "$0")/../"; pwd)"
|
||||
files_dir="${script_root}/sdk_container/src/third_party/coreos-overlay/coreos/sysext/docker"
|
||||
|
||||
echo ">>> NOTICE $0: installing extra files from '${files_dir}'"
|
||||
cp -va "${files_dir}/"* "${rootfs}"
|
||||
# ATTENTION: don't preserve ownership as repo is owned by sdk user
|
||||
cp -vdR --preserve=mode,timestamps "${files_dir}/"* "${rootfs}"
|
||||
|
||||
mkdir -p "${rootfs}/usr/lib/systemd/system/sockets.target.d"
|
||||
{ echo "[Unit]"; echo "Upholds=docker.socket"; } > "${rootfs}/usr/lib/systemd/system/sockets.target.d/10-docker-socket.conf"
|
||||
|
Loading…
Reference in New Issue
Block a user