From e920c46e7d6a007290c755ea66ec3367b3478e89 Mon Sep 17 00:00:00 2001 From: Jorge Lucangeli Obes Date: Wed, 2 Sep 2015 16:19:59 -0700 Subject: [PATCH] Use CAP_MASK_LONG for file capabilities. Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid repeating it. Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98 --- include/private/android_filesystem_config.h | 2 ++ libcutils/fs_config.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/private/android_filesystem_config.h b/include/private/android_filesystem_config.h index 7047e0feb..3e8d62af3 100644 --- a/include/private/android_filesystem_config.h +++ b/include/private/android_filesystem_config.h @@ -32,6 +32,8 @@ #include "android_filesystem_capability.h" #endif +#define CAP_MASK_LONG(cap_name) (1ULL << (cap_name)) + /* This is the master Users and Groups config for the platform. * DO NOT EVER RENUMBER */ diff --git a/libcutils/fs_config.c b/libcutils/fs_config.c index 5f6f8f957..27981ff61 100644 --- a/libcutils/fs_config.c +++ b/libcutils/fs_config.c @@ -135,8 +135,8 @@ static const struct fs_path_config android_files[] = { { 04770, AID_ROOT, AID_RADIO, 0, "system/bin/pppd-ril" }, /* the following files have enhanced capabilities and ARE included in user builds. */ - { 00750, AID_ROOT, AID_SHELL, (1ULL << CAP_SETUID) | (1ULL << CAP_SETGID), "system/bin/run-as" }, - { 00700, AID_SYSTEM, AID_SHELL, (1ULL << CAP_BLOCK_SUSPEND), "system/bin/inputflinger" }, + { 00750, AID_ROOT, AID_SHELL, CAP_MASK_LONG(CAP_SETUID) | CAP_MASK_LONG(CAP_SETGID), "system/bin/run-as" }, + { 00700, AID_SYSTEM, AID_SHELL, CAP_MASK_LONG(CAP_BLOCK_SUSPEND), "system/bin/inputflinger" }, { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/uncrypt" }, { 00750, AID_ROOT, AID_ROOT, 0, "system/bin/install-recovery.sh" },