Merge changes from topic 'remove_cap'
* changes: libcutils: remove storaged caps storaged: reduce storaged privilege
This commit is contained in:
commit
390f926140
3 changed files with 2 additions and 23 deletions
|
@ -149,10 +149,6 @@ static const struct fs_path_config android_files[] = {
|
|||
"system/bin/run-as" },
|
||||
{ 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_BLOCK_SUSPEND),
|
||||
"system/bin/inputflinger" },
|
||||
{ 00750, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_SETUID) |
|
||||
CAP_MASK_LONG(CAP_SETGID) |
|
||||
CAP_MASK_LONG(CAP_SYS_PTRACE),
|
||||
"system/bin/storaged" },
|
||||
|
||||
/* Support FIFO scheduling mode in SurfaceFlinger. */
|
||||
{ 00755, AID_SYSTEM, AID_GRAPHICS, CAP_MASK_LONG(CAP_SYS_NICE),
|
||||
|
|
|
@ -44,20 +44,6 @@
|
|||
|
||||
storaged_t storaged;
|
||||
|
||||
static int drop_privs() {
|
||||
// privilege setting
|
||||
struct sched_param param;
|
||||
memset(¶m, 0, sizeof(param));
|
||||
|
||||
if (set_sched_policy(0, SP_BACKGROUND) < 0) return -1;
|
||||
|
||||
if (sched_setscheduler((pid_t) 0, SCHED_BATCH, ¶m) < 0) return -1;
|
||||
|
||||
if (setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_BACKGROUND) < 0) return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Function of storaged's main thread
|
||||
void* storaged_main(void* s) {
|
||||
storaged_t* storaged = (storaged_t*)s;
|
||||
|
@ -133,10 +119,6 @@ int main(int argc, char** argv) {
|
|||
if (fd_emmc < 0)
|
||||
fd_emmc = TEMP_FAILURE_RETRY(open(mmc0_ext_csd, O_RDONLY));
|
||||
|
||||
if (drop_privs() != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
storaged.set_privileged_fds(fd_emmc);
|
||||
|
||||
// Start the main thread of storaged
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
service storaged /system/bin/storaged
|
||||
class main
|
||||
priority 10
|
||||
file /d/mmc0/mmc0:0001/ext_csd r
|
||||
writepid /dev/cpuset/system-background/tasks
|
||||
user root
|
||||
group system package_info
|
||||
group package_info
|
Loading…
Reference in a new issue