security/prot_hsymlinks: Set umask before mkdir
PATCH 1/1 security/prot_hsymlinks: Set umask before mkdir
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 <[email protected]>
--- testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c | 2 ++ 1 file changed, 2 insertions(+)
testcases/kernel/security/prot_hsymlinks/prot_hsymlinks.c +2 -0
@@ -227,6 +227,8 @@ static void setup(int argc, char *argv[])tst_tmpdir (); +umask (0 ); +init_base_dirs ();init_files_dirs ();
--
2.17.1
PATCH 1/1 security/prot_hsymlinks: Set umask before mkdir
Hi,
Quoted 1 line
When uid is nobody, umask is 0077, the test process might has
it's actually hsym user.
Quoted 1 line
not permmission to access the file which created by
SAFE_MKDIR
(permission)
Quoted 1 line
with mode 0755.
Thanks for your fix!
Merged with comment in the code. BTW I guess we might want to add this umask to SAFE_MKDIR() instead of fixing all tests which are affected by 0077.
Kind regards,
Petr