From 7e8ecaf0846989fdf46637fc3ca562e6d2d22781 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Wed, 18 Dec 2013 15:27:45 -0800 Subject: [PATCH] Relabel sensors files In device/asus/flo commit 9d6624a0, /data/misc/sensors and /data/system/sensors were changed from system_data_file to sensors_data_file. /data/nfc was changed from system_data_file to nfc_data_file. However, we forgot to fix up existing files. Addresses the following sensors denials: <5>[ 103.234466] type=1400 audit(1387408621.036:26): avc: denied { setattr } for pid=4833 comm="sensors.qcom" name="debug" dev="mmcblk0p31" ino=188441 scontext=u:r:sensors:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir <5>[ 103.254089] type=1400 audit(1387408621.066:27): avc: denied { append } for pid=4833 comm="sensors.qcom" name="error_log" dev="mmcblk0p31" ino=188442 scontext=u:r:sensors:s0 tcontext=u:object_r:system_data_file:s0 tclass=file <5>[ 103.273681] type=1400 audit(1387408621.086:28): avc: denied { open } for pid=4833 comm="sensors.qcom" name="error_log" dev="mmcblk0p31" ino=188442 scontext=u:r:sensors:s0 tcontext=u:object_r:system_data_file:s0 tclass=file <5>[ 103.293914] type=1400 audit(1387408621.106:29): avc: denied { read } for pid=4833 comm="sensors.qcom" name="debug" dev="mmcblk0p31" ino=188441 scontext=u:r:sensors:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir <5>[ 103.313537] type=1400 audit(1387408621.126:30): avc: denied { open } for pid=4833 comm="sensors.qcom" name="debug" dev="mmcblk0p31" ino=188441 scontext=u:r:sensors:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir nfc denials: <5>[ 579.726409] type=1400 audit(1387410509.432:35): avc: denied { write } for pid=1257 comm=4173796E635461736B202331 name="nfc" dev="mmcblk0p31" ino=253953 scontext=u:r:nfc:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir <5>[ 579.746185] type=1400 audit(1387410509.452:36): avc: denied { add_name } for pid=1257 comm=4173796E635461736B202331 name="halStorage.bin4" scontext=u:r:nfc:s0 tcontext=u:object_r:system_data_file:s0 tclass=dir <5>[ 579.765014] type=1400 audit(1387410509.472:37): avc: denied { create } for pid=1257 comm=4173796E635461736B202331 name="halStorage.bin4" scontext=u:r:nfc:s0 tcontext=u:object_r:system_data_file:s0 tclass=file <5>[ 579.783477] type=1400 audit(1387410509.492:38): avc: denied { write } for pid=1257 comm=4173796E635461736B202331 name="halStorage.bin4" dev="mmcblk0p31" ino=253956 scontext=u:r:nfc:s0 tcontext=u:object_r:system_data_file:s0 tclass=file Change-Id: Ic2076102123f9336c35974a944664ecbf8d216ae --- init.deb.rc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.deb.rc b/init.deb.rc index 3ee0703..3c81643 100644 --- a/init.deb.rc +++ b/init.deb.rc @@ -120,6 +120,7 @@ on boot # NFC: create data/nfc for nv storage mkdir /data/nfc 770 nfc nfc + restorecon_recursive /data/nfc mkdir /data/nfc/param 770 nfc nfc # Assign TCP buffer thresholds to be ceiling value of technology maximums @@ -177,13 +178,15 @@ on post-fs-data #Create directory used by sensor subsystem(dsps) mkdir /data/system/sensors - chmod 665 /data/system/sensors + chmod 775 /data/system/sensors + restorecon_recursive /data/system/sensors write /data/system/sensors/settings 1 chmod 660 /data/system/sensors/settings # AKM setting data mkdir /data/misc/sensors chmod 775 /data/misc/sensors + restorecon_recursive /data/misc/sensors mkdir /persist/sensors chmod 775 /persist/sensors