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: <4424b86b-b80d-4fdc-ba56-5cea5dc0b9a4@linuxfoundation.org>
Date: Fri, 28 Mar 2025 14:05:43 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Yosry Ahmed <yosry.ahmed@...ux.dev>, Shuah Khan <shuah@...nel.org>
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] selftests/run_kselftest.sh: Use readlink if realpath is
 not available

On 3/18/25 10:05, Yosry Ahmed wrote:
> 'realpath' is not always available,  fallback to 'readlink -f' if is not
> available. They seem to work equally well in this context.

Can you add more specifics on "realpath" is not always available,"

No issues with the patch itself. I would like to know the cases
where "realpath" command is missing.


> 
> Signed-off-by: Yosry Ahmed <yosry.ahmed@...ux.dev>
> ---
>   tools/testing/selftests/run_kselftest.sh | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/run_kselftest.sh b/tools/testing/selftests/run_kselftest.sh
> index 50e03eefe7ac7..0443beacf3621 100755
> --- a/tools/testing/selftests/run_kselftest.sh
> +++ b/tools/testing/selftests/run_kselftest.sh
> @@ -3,7 +3,14 @@
>   #
>   # Run installed kselftest tests.
>   #
> -BASE_DIR=$(realpath $(dirname $0))
> +
> +# Fallback to readlink if realpath is not available
> +if which realpath > /dev/null; then
> +        BASE_DIR=$(realpath $(dirname $0))
> +else
> +        BASE_DIR=$(readlink -f $(dirname $0))
> +fi
> +
>   cd $BASE_DIR
>   TESTS="$BASE_DIR"/kselftest-list.txt
>   if [ ! -r "$TESTS" ] ; then

thanks,
-- Shuah


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ