diff options
author | Shiva Prasanth <kesavarapu.siva@gmail.com> | 2019-04-10 10:48:28 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-04-10 10:49:43 -0700 |
commit | 7140b1fdca1cc9c9c711955a49e6e7fc41f339d9 (patch) | |
tree | 71a783c420dd83ae620ca55aac1310ac86bb25d5 /test | |
parent | 0e14e48b84fd8f759bb5a0f5261cdb090d1ffe90 (diff) |
Fixed /proc/cpuinfo permissions
This also applies these permissions to other static proc files.
Change-Id: I4167e585fed49ad271aa4e1f1260babb3239a73d
PiperOrigin-RevId: 242898575
Diffstat (limited to 'test')
-rw-r--r-- | test/syscalls/linux/proc.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/syscalls/linux/proc.cc b/test/syscalls/linux/proc.cc index 2da7006cf..67d3d18c7 100644 --- a/test/syscalls/linux/proc.cc +++ b/test/syscalls/linux/proc.cc @@ -725,6 +725,10 @@ TEST(ProcCpuinfo, RequiredFieldsArePresent) { } } +TEST(ProcCpuinfo, DeniesWrite) { + EXPECT_THAT(open("/proc/cpuinfo", O_WRONLY), SyscallFailsWithErrno(EACCES)); +} + // Sanity checks that uptime is present. TEST(ProcUptime, IsPresent) { std::string proc_uptime = ASSERT_NO_ERRNO_AND_VALUE(GetContents("/proc/uptime")); |