From: "Ricardo B. Marlière via ltp" <ltp@lists.linux.it>
To: "Petr Vorel" <pvorel@suse.cz>, "Ricardo B. Marlière" <rbm@suse.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v5 4/8] syscalls/mknod04: Convert to new API
Date: Fri, 06 Jun 2025 08:31:48 -0300 [thread overview]
Message-ID: <DAFF0QSC0XFW.12UHYZ9YEBXPT@suse.com> (raw)
In-Reply-To: <20250606112720.GC1289709@pevik>
On Fri Jun 6, 2025 at 8:27 AM -03, Petr Vorel wrote:
> Hi Ricardo,
>
> ...
>> -#define MODE_RWX S_IFIFO | S_IRWXU | S_IRWXG | S_IRWXO
>
> Similarly, to what I noted to mknod03.c in v4:
> https://lore.kernel.org/ltp/20250605073231.GC1190804@pevik/
Exactly!
>
> Originally here was also S_IFIFO (used for both mkdir() and mknod()). Although
> the tests "works" IMHO we should use mknod() with S_IFIFO (and I believe it's
> not needed for mkdir().
>
>> -#define MODE_SGID S_IFIFO | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO
>
>> +#define MODE_RWX 0777
> But you omit it.
>
>> +#define MODE_SGID (S_ISGID | 0777)
> ...
>> - /*
>> - * TEST CASE CONDITION:
>> - * Attempt to create a filesystem node on a directory
>> - * with group id (sgid) bit set such that,
>> - * the node created by mknod(2) should not have group id
>> - * (sgid) bit set and node's gid should be equal to the
>> - * effective gid of the process.
>> - */
>> - TEST(mknod(node_name, MODE_RWX, 0));
>> + SAFE_MKNOD(TEMP_NODE, MODE_RWX, 0);
>
> I vote for following diff (no need to repost).
Thanks!
>
> Kind regards,
> Petr
>
> +++ testcases/kernel/syscalls/mknod/mknod04.c
> @@ -17,6 +17,7 @@
> #include "tst_test.h"
>
> #define MODE_RWX 0777
> +#define MODE_FIFO (S_IFIFO | 0777)
> #define MODE_SGID (S_ISGID | 0777)
>
> #define TEMP_DIR "testdir"
> @@ -29,7 +30,7 @@ static void run(void)
> {
> struct stat buf;
>
> - SAFE_MKNOD(TEMP_NODE, MODE_RWX, 0);
> + SAFE_MKNOD(TEMP_NODE, MODE_FIFO, 0);
>
> SAFE_STAT(TEMP_NODE, &buf);
> TST_EXP_EQ_LI(buf.st_mode & S_ISGID, 0);
Can you please also apply this one:
diff --git a/testcases/kernel/syscalls/mknod/mknod05.c b/testcases/kernel/syscalls/mknod/mknod05.c
index 4b7e9577266e..34611b57ee92 100644
--- a/testcases/kernel/syscalls/mknod/mknod05.c
+++ b/testcases/kernel/syscalls/mknod/mknod05.c
@@ -18,6 +18,7 @@
#define MODE_RWX 0777
#define MODE_SGID (S_ISGID | 0777)
+#define MODE_FIFO_SGID (S_IFIFO | S_ISGID | 0777)
#define TEMP_DIR "testdir"
#define TEMP_NODE TEMP_DIR "/testnode"
@@ -29,7 +30,7 @@ static void run(void)
{
struct stat buf;
- SAFE_MKNOD(TEMP_NODE, MODE_SGID, 0);
+ SAFE_MKNOD(TEMP_NODE, MODE_FIFO_SGID, 0);
SAFE_STAT(TEMP_NODE, &buf);
TST_EXP_EQ_LI(buf.st_mode & S_ISGID, S_ISGID);
Thanks a lot,
RBM
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-06-06 11:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 12:52 [LTP] [PATCH v5 0/8] syscalls/mknod: Refactor all tests Ricardo B. Marlière via ltp
2025-06-05 12:52 ` [LTP] [PATCH v5 1/8] syscalls/mknod01: Fix checkpatch.pl warnings Ricardo B. Marlière via ltp
2025-06-05 12:52 ` [LTP] [PATCH v5 2/8] syscalls/mknod02: Use relative path to avoid use of SAFE_CHDIR Ricardo B. Marlière via ltp
2025-06-06 10:08 ` Petr Vorel
2025-06-05 12:52 ` [LTP] [PATCH v5 3/8] syscalls/mknod03: Convert to new API Ricardo B. Marlière via ltp
2025-06-06 10:34 ` Petr Vorel
2025-06-06 11:49 ` Petr Vorel
2025-06-06 11:57 ` Ricardo B. Marlière via ltp
2025-06-06 12:33 ` Petr Vorel
2025-06-05 12:52 ` [LTP] [PATCH v5 4/8] syscalls/mknod04: " Ricardo B. Marlière via ltp
2025-06-06 10:48 ` Petr Vorel
2025-06-06 11:05 ` Ricardo B. Marlière via ltp
2025-06-06 11:27 ` Petr Vorel
2025-06-06 11:31 ` Ricardo B. Marlière via ltp [this message]
2025-06-06 13:59 ` Petr Vorel
2025-06-05 12:52 ` [LTP] [PATCH v5 5/8] syscalls/mknod05: " Ricardo B. Marlière via ltp
2025-06-06 11:44 ` Petr Vorel
2025-06-06 11:45 ` Ricardo B. Marlière via ltp
2025-06-05 12:52 ` [LTP] [PATCH v5 6/8] syscalls/mknod06: " Ricardo B. Marlière via ltp
2025-06-06 12:06 ` Petr Vorel
2025-06-05 12:52 ` [LTP] [PATCH v5 7/8] syscalls/mknod07: " Ricardo B. Marlière via ltp
2025-06-06 12:21 ` Petr Vorel
2025-06-05 12:52 ` [LTP] [PATCH v5 8/8] syscalls/mknod08: " Ricardo B. Marlière via ltp
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=DAFF0QSC0XFW.12UHYZ9YEBXPT@suse.com \
--to=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
--cc=rbm@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