lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAmBGKfC72Q_JBG0@fedora>
Date: Thu, 24 Apr 2025 08:08:56 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Uday Shankar <ushankar@...estorage.com>
Cc: Shuah Khan <shuah@...nel.org>, linux-block@...r.kernel.org,
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] selftests: ublk: common: fix _get_disk_dev_t for
 pre-9.0 coreutils

On Wed, Apr 23, 2025 at 03:29:03PM -0600, Uday Shankar wrote:
> Some distributions, such as centos stream 9, still have a version of
> coreutils which does not yet support the %Hr and %Lr formats for stat(1)
> [1, 2]. Running ublk selftests on these distributions results in the
> following error in tests that use the _get_disk_dev_t helper:
> 
> line 23: ?r: syntax error: operand expected (error token is "?r")
> 
> To better accommodate older distributions, rewrite _get_disk_dev_t to
> use the much older %t and %T formats for stat instead.
> 
> [1] https://github.com/coreutils/coreutils/blob/v9.0/NEWS#L114
> [2] https://pkgs.org/download/coreutils
> 
> Signed-off-by: Uday Shankar <ushankar@...estorage.com>
> ---
>  tools/testing/selftests/ublk/test_common.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/ublk/test_common.sh b/tools/testing/selftests/ublk/test_common.sh
> index 9fc111f64576f91adb731d436c2d535f7dfe5c2e..a81210ca3e99d264f84260aab35827e0c00add01 100755
> --- a/tools/testing/selftests/ublk/test_common.sh
> +++ b/tools/testing/selftests/ublk/test_common.sh
> @@ -17,8 +17,8 @@ _get_disk_dev_t() {
>  	local minor
>  
>  	dev=/dev/ublkb"${dev_id}"
> -	major=$(stat -c '%Hr' "$dev")
> -	minor=$(stat -c '%Lr' "$dev")
> +	major="0x"$(stat -c '%t' "$dev")
> +	minor="0x"$(stat -c '%T' "$dev")

Reviewed-by: Ming Lei <ming.lei@...hat.com>


Thanks,
Ming


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ