Loading adb/daemon/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ int adbd_main(int server_port) { D("Local port disabled\n"); } else { if ((root_seclabel != nullptr) && (is_selinux_enabled() > 0)) { if (root_seclabel != nullptr) { if (setcon(root_seclabel) < 0) { LOG(FATAL) << "Could not set selinux context"; } Loading debuggerd/debuggerd.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -134,8 +134,6 @@ static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* ou return fields == 7 ? 0 : -1; } static int selinux_enabled; /* * Corresponds with debugger_action_t enum type in * include/cutils/debugger.h. Loading @@ -153,9 +151,6 @@ static bool selinux_action_allowed(int s, pid_t tid, debugger_action_t action) const char *perm; bool allowed = false; if (selinux_enabled <= 0) return true; if (action <= 0 || action >= (sizeof(debuggerd_perms)/sizeof(debuggerd_perms[0]))) { ALOGE("SELinux: No permission defined for debugger action %d", action); return false; Loading Loading @@ -589,7 +584,6 @@ static void usage() { int main(int argc, char** argv) { union selinux_callback cb; if (argc == 1) { selinux_enabled = is_selinux_enabled(); cb.func_log = selinux_log_callback; selinux_set_callback(SELINUX_CB_LOG, cb); return do_server(); Loading init/devices.cpp +5 −10 Original line number Diff line number Diff line Loading @@ -241,10 +241,8 @@ static void make_device(const char *path, mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); if (sehandle) { selabel_lookup_best_match(sehandle, &secontext, path, links, mode); setfscreatecon(secontext); } dev = makedev(major, minor); /* Temporarily change egid to avoid race condition setting the gid of the Loading Loading @@ -907,7 +905,7 @@ void handle_device_fd() struct uevent uevent; parse_event(msg, &uevent); if (sehandle && selinux_status_updated() > 0) { if (selinux_status_updated() > 0) { struct selabel_handle *sehandle2; sehandle2 = selinux_android_file_context_handle(); if (sehandle2) { Loading Loading @@ -974,11 +972,8 @@ static void coldboot(const char *path) } void device_init() { sehandle = NULL; if (is_selinux_enabled() > 0) { sehandle = selinux_android_file_context_handle(); selinux_status_open(true); } /* is 256K enough? udev uses 16MB! */ device_fd = uevent_open_socket(256*1024, true); Loading init/init.cpp +30 −32 Original line number Diff line number Diff line Loading @@ -220,7 +220,6 @@ void service_start(struct service *svc, const char *dynamic_args) } char* scon = NULL; if (is_selinux_enabled() > 0) { if (svc->seclabel) { scon = strdup(svc->seclabel); if (!scon) { Loading Loading @@ -255,7 +254,6 @@ void service_start(struct service *svc, const char *dynamic_args) return; } } } NOTICE("Starting service '%s'...\n", svc->name); Loading Loading @@ -335,7 +333,7 @@ void service_start(struct service *svc, const char *dynamic_args) } } if (svc->seclabel) { if (is_selinux_enabled() > 0 && setexeccon(svc->seclabel) < 0) { if (setexeccon(svc->seclabel) < 0) { ERROR("cannot setexeccon('%s'): %s\n", svc->seclabel, strerror(errno)); _exit(127); } Loading init/property_service.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,6 @@ void property_init() { static int check_mac_perms(const char *name, char *sctx) { if (is_selinux_enabled() <= 0) return 1; char *tctx = NULL; int result = 0; Loading Loading
adb/daemon/main.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -171,7 +171,7 @@ int adbd_main(int server_port) { D("Local port disabled\n"); } else { if ((root_seclabel != nullptr) && (is_selinux_enabled() > 0)) { if (root_seclabel != nullptr) { if (setcon(root_seclabel) < 0) { LOG(FATAL) << "Could not set selinux context"; } Loading
debuggerd/debuggerd.cpp +0 −6 Original line number Diff line number Diff line Loading @@ -134,8 +134,6 @@ static int get_process_info(pid_t tid, pid_t* out_pid, uid_t* out_uid, uid_t* ou return fields == 7 ? 0 : -1; } static int selinux_enabled; /* * Corresponds with debugger_action_t enum type in * include/cutils/debugger.h. Loading @@ -153,9 +151,6 @@ static bool selinux_action_allowed(int s, pid_t tid, debugger_action_t action) const char *perm; bool allowed = false; if (selinux_enabled <= 0) return true; if (action <= 0 || action >= (sizeof(debuggerd_perms)/sizeof(debuggerd_perms[0]))) { ALOGE("SELinux: No permission defined for debugger action %d", action); return false; Loading Loading @@ -589,7 +584,6 @@ static void usage() { int main(int argc, char** argv) { union selinux_callback cb; if (argc == 1) { selinux_enabled = is_selinux_enabled(); cb.func_log = selinux_log_callback; selinux_set_callback(SELINUX_CB_LOG, cb); return do_server(); Loading
init/devices.cpp +5 −10 Original line number Diff line number Diff line Loading @@ -241,10 +241,8 @@ static void make_device(const char *path, mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); if (sehandle) { selabel_lookup_best_match(sehandle, &secontext, path, links, mode); setfscreatecon(secontext); } dev = makedev(major, minor); /* Temporarily change egid to avoid race condition setting the gid of the Loading Loading @@ -907,7 +905,7 @@ void handle_device_fd() struct uevent uevent; parse_event(msg, &uevent); if (sehandle && selinux_status_updated() > 0) { if (selinux_status_updated() > 0) { struct selabel_handle *sehandle2; sehandle2 = selinux_android_file_context_handle(); if (sehandle2) { Loading Loading @@ -974,11 +972,8 @@ static void coldboot(const char *path) } void device_init() { sehandle = NULL; if (is_selinux_enabled() > 0) { sehandle = selinux_android_file_context_handle(); selinux_status_open(true); } /* is 256K enough? udev uses 16MB! */ device_fd = uevent_open_socket(256*1024, true); Loading
init/init.cpp +30 −32 Original line number Diff line number Diff line Loading @@ -220,7 +220,6 @@ void service_start(struct service *svc, const char *dynamic_args) } char* scon = NULL; if (is_selinux_enabled() > 0) { if (svc->seclabel) { scon = strdup(svc->seclabel); if (!scon) { Loading Loading @@ -255,7 +254,6 @@ void service_start(struct service *svc, const char *dynamic_args) return; } } } NOTICE("Starting service '%s'...\n", svc->name); Loading Loading @@ -335,7 +333,7 @@ void service_start(struct service *svc, const char *dynamic_args) } } if (svc->seclabel) { if (is_selinux_enabled() > 0 && setexeccon(svc->seclabel) < 0) { if (setexeccon(svc->seclabel) < 0) { ERROR("cannot setexeccon('%s'): %s\n", svc->seclabel, strerror(errno)); _exit(127); } Loading
init/property_service.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -92,9 +92,6 @@ void property_init() { static int check_mac_perms(const char *name, char *sctx) { if (is_selinux_enabled() <= 0) return 1; char *tctx = NULL; int result = 0; Loading