aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZev Weiss <zev@bewilderbeest.net>2017-11-23 00:03:45 -0600
committerZev Weiss <zev@bewilderbeest.net>2017-11-24 21:52:56 -0600
commit4816957b55da56ad51915f5e031f15d2dc552d79 (patch)
treee0676c966541bacf69427ae1a03d835c5be845e6
parent17888c778bc84e633ee160928603fd32537772b2 (diff)
downloadvirtme-4816957b55da56ad51915f5e031f15d2dc552d79.tar.gz
virtme-init: make resolv.conf world-readable.
'mktemp' creates files that are only accessible to the current user (and doesn't have any options to change this), but in this case the file we're creating is going to end up as resolv.conf, which should be world-readable. So here we manually chmod it as such after creating it. Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
-rwxr-xr-xvirtme/guest/virtme-init1
1 files changed, 1 insertions, 0 deletions
diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init
index bde30d2..e3b30f0 100755
--- a/virtme/guest/virtme-init
+++ b/virtme/guest/virtme-init
@@ -143,6 +143,7 @@ ip link set dev lo up
if cat /proc/cmdline |grep -q -E '(^| )virtme.dhcp($| )'; then
if [[ -f /etc/resolv.conf ]]; then
tmpfile="`mktemp --tmpdir=/tmp`"
+ chmod 644 "$tmpfile"
mount --bind "$tmpfile" /etc/resolv.conf
rm "$tmpfile"
fi