t_mprotect.c (309466) | t_mprotect.c (350328) |
---|---|
1/* $NetBSD: t_mprotect.c,v 1.4 2016/05/28 14:34:49 christos Exp $ */ 2 3/*- 4 * Copyright (c) 2011 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jukka Ruohonen. --- 102 unchanged lines hidden (view full) --- 111 112ATF_TC_BODY(mprotect_access, tc) 113{ 114 int prot[2] = { PROT_NONE, PROT_READ }; 115 void *map; 116 size_t i; 117 int fd; 118 | 1/* $NetBSD: t_mprotect.c,v 1.4 2016/05/28 14:34:49 christos Exp $ */ 2 3/*- 4 * Copyright (c) 2011 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jukka Ruohonen. --- 102 unchanged lines hidden (view full) --- 111 112ATF_TC_BODY(mprotect_access, tc) 113{ 114 int prot[2] = { PROT_NONE, PROT_READ }; 115 void *map; 116 size_t i; 117 int fd; 118 |
119 fd = open(path, O_RDONLY | O_CREAT); | 119 fd = open(path, O_RDONLY | O_CREAT, 0600); |
120 ATF_REQUIRE(fd >= 0); 121 122 /* 123 * The call should fail with EACCES if we try to mark 124 * a PROT_NONE or PROT_READ file/section as PROT_WRITE. 125 */ 126 for (i = 0; i < __arraycount(prot); i++) { 127 --- 241 unchanged lines hidden --- | 120 ATF_REQUIRE(fd >= 0); 121 122 /* 123 * The call should fail with EACCES if we try to mark 124 * a PROT_NONE or PROT_READ file/section as PROT_WRITE. 125 */ 126 for (i = 0; i < __arraycount(prot); i++) { 127 --- 241 unchanged lines hidden --- |