aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Farden <adam@farden.cz>2016-10-24 09:56:13 +0200
committerAdam Farden <adam@farden.cz>2016-10-24 09:56:23 +0200
commita2a73a4fff49fa0318c3d5094732fd7354618f03 (patch)
treebba6e005696ade5edff812fdace220ec37734509
parentf9caf6871b17a678b4bf443326cbcf2115a41849 (diff)
macaddr: remove dangerous sepolicy permissions
Write the bluetooth macaddr to a place that is natively readable by bluetooth services, instead of creating new locations which requires excessive permissions. Signed-off-by: Adam Farden <adam@farden.cz>
-rw-r--r--macaddrsetup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/macaddrsetup.c b/macaddrsetup.c
index 90f369c..8bcea15 100644
--- a/macaddrsetup.c
+++ b/macaddrsetup.c
@@ -11,7 +11,7 @@
#define LOG_TAG "macaddrsetup"
#include <cutils/log.h>
-#define BT_MAC_FILE "/data/etc/bluetooth_bdaddr"
+#define BT_MAC_FILE "/data/misc/bluetooth/bluetooth_bdaddr"
extern const char *__progname;
extern int ta_open(uint8_t p, uint8_t m, uint8_t c);
@@ -70,8 +70,6 @@ int main(int argc, char **argv)
fclose(fpb);
exit(1);
}
- chown(BT_MAC_FILE, AID_BLUETOOTH, AID_BLUETOOTH);
- chmod(BT_MAC_FILE, S_IRUSR | S_IWUSR | S_IRGRP); // 640
if (argc > 1) {
fpw = fopen(argv[1], "w");