Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: "Ricardo B. Marlière" <rbm@suse.com>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v4 8/8] syscalls/mknod08: Convert to new API
Date: Thu, 5 Jun 2025 09:23:42 +0200	[thread overview]
Message-ID: <20250605072342.GA1190804@pevik> (raw)
In-Reply-To: <20250425-conversions-mknod-v4-8-222e0d2e7ef1@suse.com>

Hi Ricardo,

...
> -/*
> - * Test Name: mknod08
> - *
> - * Test Description:
> - *  Verify that mknod(2) succeeds when used to create a filesystem
> - *  node on a directory without set group-ID bit set. The node created
> - *  should not have set group-ID bit set and its gid should be equal to that
> - *  of its parent directory.
> - *
> - * Expected Result:
> - *  mknod() should return value 0 on success and node created should not
> - *  have set group-ID bit set.
> - *
> - * Algorithm:
> - *  Setup:
> - *   Setup signal handling.
> - *   Create temporary directory.
> - *   Pause for SIGUSR1 if option specified.
> - *
> - *  Test:
> - *   Loop if the proper options are given.
> - *   Execute system call
> - *   Check return code, if system call failed (return=-1)
> - *	Log the errno and Issue a FAIL message.
> - *   Otherwise,
> - *	Verify the Functionality of system call
> - *      if successful,
> - *		Issue Functionality-Pass message.
> - *      Otherwise,
> - *		Issue Functionality-Fail message.
...
> +/*\
> + * Verify that mknod(2) succeeds when used to create a filesystem node on a
> + * directory without set group-ID bit set. The node created should not have
> + * set group-ID bit set and its gid should be equal to that of its parent
> + * directory.
>   */

...
> -#define MODE_RWX	S_IFIFO | S_IRWXU | S_IRWXG | S_IRWXO
> +#define MODE_RWX 0777

I'm not sure if that's omitted by accident or intentional, but I don't think
it's ok to drop S_IFIFO:

man mknod(2):

       The file type must be one of S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO,
       or S_IFSOCK to specify a regular file (which will be created
       empty), character special file, block special file, FIFO (named
       pipe), or UNIX domain socket, respectively.  (Zero file type is
       equivalent to type S_IFREG.)
=> we don't test on named pipe but on a regular file.

Could you please use the same approach as you use in mknod06.c?
#define MODE_FIFO_RWX (S_IFIFO | 0777)

...
> +uid_t nobody_uid;
> +gid_t nobody_gid, free_gid;

make check reports:

mknod08.c:24:7: warning: Symbol 'nobody_uid' has no prototype or library ('tst_') prefix. Should it be static?
mknod08.c:25:7: warning: Symbol 'nobody_gid' has no prototype or library ('tst_') prefix. Should it be static?
mknod08.c:25:19: warning: Symbol 'free_gid' has no prototype or library ('tst_') prefix. Should it be static?

With that fixed you can add:
Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr

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

  reply	other threads:[~2025-06-05  7:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 18:06 [LTP] [PATCH v4 0/8] syscalls/mknod: Refactor all tests Ricardo B. Marlière via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 1/8] syscalls/mknod01: Fix checkpatch.pl warnings Ricardo B. Marlière via ltp
2025-06-03 11:08   ` Andrea Cervesato via ltp
2025-06-05  7:26   ` Petr Vorel
2025-04-25 18:06 ` [LTP] [PATCH v4 2/8] syscalls/mknod02: Use relative path to avoid use of SAFE_CHDIR Ricardo B. Marlière via ltp
2025-05-20 12:46   ` Andrea Cervesato via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 3/8] syscalls/mknod03: Convert to new API Ricardo B. Marlière via ltp
2025-06-05  7:32   ` Petr Vorel
2025-04-25 18:06 ` [LTP] [PATCH v4 4/8] syscalls/mknod04: " Ricardo B. Marlière via ltp
2025-06-03 13:44   ` Andrea Cervesato via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 5/8] syscalls/mknod05: " Ricardo B. Marlière via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 6/8] syscalls/mknod06: " Ricardo B. Marlière via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 7/8] syscalls/mknod07: " Ricardo B. Marlière via ltp
2025-04-25 18:06 ` [LTP] [PATCH v4 8/8] syscalls/mknod08: " Ricardo B. Marlière via ltp
2025-06-05  7:23   ` Petr Vorel [this message]
2025-06-05 12:53     ` Ricardo B. Marlière via ltp
2025-06-04 14:36 ` [LTP] [PATCH v4 0/8] syscalls/mknod: Refactor all tests Andrea Cervesato via ltp
2025-06-04 14:37   ` 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=20250605072342.GA1190804@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    --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