[LTP] [PATCH] syscalls/access01: Set umask value before run case

Bixuan Cui cuibixuan@huawei.com
Tue Sep 19 15:04:37 CEST 2017


The case will fail when set the umask to 0077 acquiescently in system.
Because the value of actual mode is 'set value' & ~'default value
for the umask' when create dir.
So add 'umask(0022)' in setup().

Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
---
 testcases/kernel/syscalls/access/access01.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/syscalls/access/access01.c b/testcases/kernel/syscalls/access/access01.c
index 7a92525..b679832 100644
--- a/testcases/kernel/syscalls/access/access01.c
+++ b/testcases/kernel/syscalls/access/access01.c
@@ -315,6 +315,8 @@ static void setup(void)
 {
 	struct passwd *pw;

+	umask(0022);
+
 	pw = SAFE_GETPWNAM("nobody");

 	uid = pw->pw_uid;
--
2.6.2



More information about the ltp mailing list