[LTP] [PATCH] security/prot_hsymlinks: Set umask before mkdir

Zhao Gongyi zhaogongyi@huawei.com
Thu Apr 1 15:56:38 CEST 2021


When uid is nobody, umask is 0077, the test process might has
not permmission to access the file which created by SAFE_MKDIR
with mode 0755.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
index ecb393297..d883ab508 100644
--- a/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
+++ b/testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c
@@ -227,6 +227,8 @@ static void setup(int argc, char *argv[])

 	tst_tmpdir();

+	umask(0);
+
 	init_base_dirs();

 	init_files_dirs();
--
2.17.1



More information about the ltp mailing list