init: fix type of 2nd argument passed to prctl
prctl(PR_SET_SECUREBITS, ...) expects an unsigned long as its 2nd argument.
Passing in a int64_t happens to work with a 64-bit kernel, but does not
work with a 32-bit kernel.
Bug: 63680332
Test: boot 32-bit kernel; verify services with capabilities can successfully
set those capabilties
Change-Id: I60250d107a77b54b2e9fe3419b4480b921c7e2f8
Signed-off-by: Ben Fennema <fennema@google.com>
This commit is contained in:
parent
a19f481c8c
commit
a72436067d
1 changed files with 2 additions and 2 deletions
|
|
@ -225,8 +225,8 @@ void Service::SetProcessAttributes() {
|
|||
if (capabilities_.any() && uid_) {
|
||||
// If Android is running in a container, some securebits might already
|
||||
// be locked, so don't change those.
|
||||
int64_t securebits = prctl(PR_GET_SECUREBITS);
|
||||
if (securebits == -1) {
|
||||
unsigned long securebits = prctl(PR_GET_SECUREBITS);
|
||||
if (securebits == -1UL) {
|
||||
PLOG(FATAL) << "prctl(PR_GET_SECUREBITS) failed for " << name_;
|
||||
}
|
||||
securebits |= SECBIT_KEEP_CAPS | SECBIT_KEEP_CAPS_LOCKED;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue