commit: 818712f99f165011aaaad5fd82c40304004ace23
parent 05b9805bf98ddfc6a0ecf72b778182eb7af169e2
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Thu, 23 May 2024 00:35:38 +0200
pleroma_ctl: Use realpath(1) instead of readlink(1)
From realpath(1) in POSIX 202x Draft 4.1:
> If file does not name a symbolic link, readlink shall write a diagnostic
> message to standard error and exit with non-zero status.
Which also doesn't includes `-f`, in preference of `realpath`.
Diffstat:
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/changelog.d/realpath-over-readlink.fix b/changelog.d/realpath-over-readlink.fix
@@ -0,0 +1 @@
+pleroma_ctl: Use realpath(1) instead of readlink(1)
diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl
@@ -134,7 +134,7 @@ if [ -z "$1" ] || [ "$1" = "help" ]; then
"
else
- SCRIPT=$(readlink -f "$0")
+ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
FULL_ARGS="$*"