netboot: adjust SMACK label for /etc/resolv.conf 73/21873/2
authorStephane Desneux <stephane.desneux@iot.bzh>
Fri, 12 Jul 2019 17:13:35 +0000 (17:13 +0000)
committerStephane Desneux <stephane.desneux@iot.bzh>
Fri, 12 Jul 2019 17:18:01 +0000 (17:18 +0000)
When using netboot, the kernel is responsible for establishing the IP connection.
For this reason, connman is instructed to "forget" this boot interface and
/etc/resolv.conf is generated by the initrd script (from /proc/net/pnp).

This patch removes the previously set SMACK label 'System' so file has label _,
which makes it readable by any process.

Bug-AGL: SPEC-2640

Change-Id: I13704827434a795aab2264755dc01ec796be8847
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
meta-netboot/recipes-core/initramfs-netboot/files/init.sh

index 7064314..7b8fbb5 100644 (file)
@@ -139,6 +139,7 @@ fi
 # also use /proc/net/pnp to generate /etc/resolv.conf
 rm -f /etc/resolv.conf
 grep -v bootserver /proc/net/pnp | sed 's/^domain/search/g' >/etc/resolv.conf
+chsmack -A /etc/resolv.conf
 
 # unmount tmp and run to let systemd remount them with correct smack labels (SPEC-2596)
 log_info "Unmounting /tmp and /run"