Skip to content

Commit

Permalink
setbtmac: dumb hack to fix permission
Browse files Browse the repository at this point in the history
When the service runs, the mode set with O_CREAT gets ignored
and is set to rw by owner and nothing else. If the binary is ran
on its own, it works fine. chmod it again because somehow this fixes it.
  • Loading branch information
Daz Jones committed Jan 27, 2013
1 parent 55b3da5 commit 9c65e77
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions setbtmac/setbtmac.c
Expand Up @@ -18,6 +18,7 @@
#include <string.h>
#include <cutils/log.h>
#include <cutils/properties.h>
#include <sys/stat.h>

static const char PROP_SERIALNO[] = "ro.serialno";
static const char PROP_BDADDR[] = "ro.bt.bdaddr_path";
Expand Down Expand Up @@ -55,6 +56,7 @@ void SetMAC(void)
}
write(file, bdaddr, strlen(bdaddr));
close(file);
chmod(FILE_BDADDR, 00600|00060|00006);

property_set(PROP_BDADDR, FILE_BDADDR);
}

0 comments on commit 9c65e77

Please sign in to comment.