public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Wei Gao via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] statx07.c: set umask to 0 within setup
Date: Sun,  3 Mar 2024 05:31:05 -0500	[thread overview]
Message-ID: <20240303103105.13401-1-wegao@suse.com> (raw)

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

             reply	other threads:[~2024-03-03 10:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 10:31 Wei Gao via ltp [this message]
2024-03-03 12:36 ` [LTP] [PATCH v1] statx07.c: set umask to 0 within setup Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240303103105.13401-1-wegao@suse.com \
    --to=ltp@lists.linux.it \
    --cc=wegao@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox