summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Android.mk2
-rw-r--r--init/builtins.c5
-rw-r--r--init/devices.c1
-rwxr-xr-xinit/init.c1
-rw-r--r--init/keychords.c8
-rwxr-xr-xinit/property_service.c8
6 files changed, 18 insertions, 7 deletions
diff --git a/init/Android.mk b/init/Android.mk
index 00d2144..ef62bce 100644
--- a/init/Android.mk
+++ b/init/Android.mk
@@ -35,7 +35,9 @@ LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
LOCAL_STATIC_LIBRARIES := \
libfs_mgr \
+ liblogwrap \
libcutils \
+ liblog \
libc \
libselinux
diff --git a/init/builtins.c b/init/builtins.c
index 07bd6d3..576f0d9 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -464,6 +464,7 @@ int do_mount_all(int nargs, char **args)
int child_ret = -1;
int status;
const char *prop;
+ struct fstab *fstab;
if (nargs != 2) {
return -1;
@@ -487,7 +488,9 @@ int do_mount_all(int nargs, char **args)
} else if (pid == 0) {
/* child, call fs_mgr_mount_all() */
klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */
- child_ret = fs_mgr_mount_all(args[1]);
+ fstab = fs_mgr_read_fstab(args[1]);
+ child_ret = fs_mgr_mount_all(fstab);
+ fs_mgr_free_fstab(fstab);
if (child_ret == -1) {
ERROR("fs_mgr_mount_all returned an error\n");
}
diff --git a/init/devices.c b/init/devices.c
index 41ab85e..1893642 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -787,6 +787,7 @@ loading_close_out:
file_free_out:
free(file1);
free(file2);
+ free(file3);
data_free_out:
free(data);
loading_free_out:
diff --git a/init/init.c b/init/init.c
index c21a495..28d2863 100755
--- a/init/init.c
+++ b/init/init.c
@@ -903,6 +903,7 @@ int main(int argc, char **argv)
*/
restorecon("/dev");
restorecon("/dev/socket");
+ restorecon("/dev/__properties__");
is_charger = !strcmp(bootmode, "charger");
diff --git a/init/keychords.c b/init/keychords.c
index d18a6e4..4a64042 100644
--- a/init/keychords.c
+++ b/init/keychords.c
@@ -95,15 +95,11 @@ void keychord_init()
void handle_keychord()
{
struct service *svc;
- char debuggable[PROP_VALUE_MAX];
char adb_enabled[PROP_VALUE_MAX];
int ret;
__u16 id;
- // only handle keychords if ro.debuggable is set or adb is enabled.
- // the logic here is that bugreports should be enabled in userdebug or eng builds
- // and on user builds for users that are developers.
- property_get("ro.debuggable", debuggable);
+ // Only handle keychords if adb is enabled.
property_get("init.svc.adbd", adb_enabled);
ret = read(keychord_fd, &id, sizeof(id));
if (ret != sizeof(id)) {
@@ -111,7 +107,7 @@ void handle_keychord()
return;
}
- if (!strcmp(debuggable, "1") || !strcmp(adb_enabled, "running")) {
+ if (!strcmp(adb_enabled, "running")) {
svc = service_find_by_keychord(id);
if (svc) {
INFO("starting service %s from keychord\n", svc->name);
diff --git a/init/property_service.c b/init/property_service.c
index 70ee4a6..6c71807 100755
--- a/init/property_service.c
+++ b/init/property_service.c
@@ -27,6 +27,7 @@
#include <cutils/misc.h>
#include <cutils/sockets.h>
+#include <cutils/multiuser.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
@@ -220,12 +221,19 @@ static int check_control_perms(const char *name, unsigned int uid, unsigned int
static int check_perms(const char *name, unsigned int uid, unsigned int gid, char *sctx)
{
int i;
+ unsigned int app_id;
+
if(!strncmp(name, "ro.", 3))
name +=3;
if (uid == 0)
return check_mac_perms(name, sctx);
+ app_id = multiuser_get_app_id(uid);
+ if (app_id == AID_BLUETOOTH) {
+ uid = app_id;
+ }
+
for (i = 0; property_perms[i].prefix; i++) {
if (strncmp(property_perms[i].prefix, name,
strlen(property_perms[i].prefix)) == 0) {