[LTP] [PATCH v3 2/2] statx07.c: set umask to 0022

Petr Vorel pvorel@suse.cz
Wed Feb 21 08:32:49 CET 2024


Hi Wei,

> When system's default umask is 0077, this will trigger issues.

> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  testcases/kernel/syscalls/statx/statx07.c | 2 ++
>  1 file changed, 2 insertions(+)

> diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
> index 4dbf83e18..1ad02fb3e 100644
> --- a/testcases/kernel/syscalls/statx/statx07.c
> +++ b/testcases/kernel/syscalls/statx/statx07.c
> @@ -116,6 +116,8 @@ static void setup(void)
>  	int ret;
>  	char server_path[BUFF_SIZE];

> +	umask(0022);
Even this works, why not completely reset umask with umask(0), as I asked
previously? That's the safest option.

Kind regards,
Petr

> +
>  	cwd = tst_get_tmpdir();

>  	SAFE_MKDIR(SERV_PATH, DEFAULT_MODE);


More information about the ltp mailing list