t_access.c (313227) | t_access.c (350328) |
---|---|
1/* $NetBSD: t_access.c,v 2.2 2017/01/10 22:36:29 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. --- 48 unchanged lines hidden (view full) --- 57} 58 59ATF_TC_BODY(access_access, tc) 60{ 61 const int perm[3] = { 0200, 0400, 0000 }; 62 size_t i; 63 int fd; 64 | 1/* $NetBSD: t_access.c,v 2.2 2017/01/10 22:36:29 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. --- 48 unchanged lines hidden (view full) --- 57} 58 59ATF_TC_BODY(access_access, tc) 60{ 61 const int perm[3] = { 0200, 0400, 0000 }; 62 size_t i; 63 int fd; 64 |
65 fd = open(path, O_RDONLY | O_CREAT); | 65 fd = open(path, O_RDONLY | O_CREAT, 0600); |
66 67 if (fd < 0) 68 return; 69 70 for (i = 0; i < __arraycount(mode) - 1; i++) { 71 72 ATF_REQUIRE(fchmod(fd, perm[i]) == 0); 73 --- 147 unchanged lines hidden --- | 66 67 if (fd < 0) 68 return; 69 70 for (i = 0; i < __arraycount(mode) - 1; i++) { 71 72 ATF_REQUIRE(fchmod(fd, perm[i]) == 0); 73 --- 147 unchanged lines hidden --- |