diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-04-10 02:44:01 +0100 |
---|---|---|
committer | Raphaël Hertzog <raphael@offensive-security.com> | 2020-04-23 12:20:35 +0200 |
commit | 91d446d93ed717b1082bb646fbef65cd1cbc25f5 (patch) | |
tree | b98c1a53fcf770702ad7b2e64ad78cc7d7702093 | |
parent | 6fa4b5bae9e3f30167004e53e317f21fb8a4ac24 (diff) | |
download | vyos-live-build-91d446d93ed717b1082bb646fbef65cd1cbc25f5.tar.gz vyos-live-build-91d446d93ed717b1082bb646fbef65cd1cbc25f5.zip |
Fix permissions & ownership of copied /etc/resolv.conf
Closes: #857740
[tweaked by Raphaël Hertzog to fix the chown root:root call]
-rwxr-xr-x | scripts/build/chroot_resolv | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/build/chroot_resolv b/scripts/build/chroot_resolv index 7066e53a6..b7957259e 100755 --- a/scripts/build/chroot_resolv +++ b/scripts/build/chroot_resolv @@ -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 |