Message ID | 20210401135638.4111-1-zhaogongyi@huawei.com |
---|---|
State | Accepted |
Headers | show |
Series | security/prot_hsymlinks: Set umask before mkdir | expand |
Hi, > When uid is nobody, umask is 0077, the test process might has it's actually hsym user. > not permmission to access the file which created by SAFE_MKDIR (permission) > 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
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();
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(+) -- 2.17.1