Fix permissions & ownership of copied /etc/resolv.conf

Closes: #857740

[tweaked by Raphaël Hertzog to fix the chown root:root call]
This commit is contained in:
Lyndon Brown 2020-04-10 02:44:01 +01:00 committed by Raphaël Hertzog
parent 6fa4b5bae9
commit 91d446d93e
1 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ case "${1}" in
if [ -f /etc/resolv.conf ]
then
# Copy resolv file
cp /etc/resolv.conf chroot/etc/resolv.conf
cp -a /etc/resolv.conf chroot/etc/resolv.conf
fi
# Creating stage file
@ -70,7 +70,9 @@ case "${1}" in
if [ -e config/includes.chroot/etc/resolv.conf ]
then
# Copying local resolv.conf
cp -a config/includes.chroot/etc/resolv.conf chroot/etc/resolv.conf
cp config/includes.chroot/etc/resolv.conf chroot/etc/resolv.conf
chmod 644 chroot/etc/resolv.conf
chown root:root chroot/etc/resolv.conf
rm -f chroot/etc/resolv.conf.orig
elif [ -e chroot/etc/resolv.conf.orig ] || [ -L chroot/etc/resolv.conf.orig ]
then