public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] statx07.c: set umask to 0 within setup
@ 2024-03-03 10:31 Wei Gao via ltp
  2024-03-03 12:36 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Gao via ltp @ 2024-03-03 10:31 UTC (permalink / raw)
  To: ltp

When system's default umask is 0077, this will trigger following issues:
statx07.c:108: TFAIL: statx() with AT_STATX_DONT_SYNC for mode 644 600

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

diff --git a/testcases/kernel/syscalls/statx/statx07.c b/testcases/kernel/syscalls/statx/statx07.c
index 4dbf83e18..1a568ec9e 100644
--- a/testcases/kernel/syscalls/statx/statx07.c
+++ b/testcases/kernel/syscalls/statx/statx07.c
@@ -118,11 +118,15 @@ static void setup(void)
 
 	cwd = tst_get_tmpdir();
 
+	mode_t old_umask = umask(0);
+
 	SAFE_MKDIR(SERV_PATH, DEFAULT_MODE);
 	SAFE_MKDIR(CLI_PATH, DEFAULT_MODE);
 	SAFE_CREAT(SERV_FORCE_SYNC, DEFAULT_MODE);
 	SAFE_CREAT(SERV_DONT_SYNC, DEFAULT_MODE);
 
+	umask(old_umask);
+
 	snprintf(server_path, sizeof(server_path), ":%s/%s", cwd, SERV_PATH);
 
 	snprintf(cmd, sizeof(cmd),
-- 
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH v1] statx07.c: set umask to 0 within setup
  2024-03-03 10:31 [LTP] [PATCH v1] statx07.c: set umask to 0 within setup Wei Gao via ltp
@ 2024-03-03 12:36 ` Petr Vorel
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vorel @ 2024-03-03 12:36 UTC (permalink / raw)
  To: Wei Gao; +Cc: ltp

Hi Wei,

> When system's default umask is 0077, this will trigger following issues:
> statx07.c:108: TFAIL: statx() with AT_STATX_DONT_SYNC for mode 644 600

Thanks, merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-03 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 10:31 [LTP] [PATCH v1] statx07.c: set umask to 0 within setup Wei Gao via ltp
2024-03-03 12:36 ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox