Check the return value of setuid(2).

I'd like to mark setuid() WARN_UNUSED_RESULT to prevent security bugs.
This line would break because the file is compiled with -Werror.

Bug: 34251640
Test: Build, run unit test.
Change-Id: Ibb6fa5e5b899d47f77f2a32da762165de310101d
This commit is contained in:
Jorge Lucangeli Obes 2017-01-12 15:42:22 -05:00 committed by Mark Salyzyn
parent dc40813167
commit f4ae42f6a8

View file

@ -1831,7 +1831,7 @@ TEST(liblog, __security_buffer) {
return;
}
setuid(AID_SYSTEM); // only one that can read security buffer
EXPECT_EQ(0, setuid(AID_SYSTEM)); // only one that can read security buffer
pid_t pid = getpid();