sanebox: don't assume 'readlink' is available in the environment
This commit is contained in:
@@ -31,6 +31,7 @@ stdenv.mkDerivation {
|
|||||||
--replace-fail '@iptables@' '${lib.getExe' iptables "iptables"}' \
|
--replace-fail '@iptables@' '${lib.getExe' iptables "iptables"}' \
|
||||||
--replace-fail '@landlockSandboxer@' '${lib.getExe landlock-sandboxer}' \
|
--replace-fail '@landlockSandboxer@' '${lib.getExe landlock-sandboxer}' \
|
||||||
--replace-fail '@pasta@' '${lib.getExe' passt "pasta"}' \
|
--replace-fail '@pasta@' '${lib.getExe' passt "pasta"}' \
|
||||||
|
--replace-fail '@readlink@' '${lib.getExe' coreutils "readlink"}' \
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
@@ -9,6 +9,7 @@ IP_FALLBACK='@ip@'
|
|||||||
IPTABLES_FALLBACK='@iptables@'
|
IPTABLES_FALLBACK='@iptables@'
|
||||||
LANDLOCK_SANDBOXER_FALLBACK='@landlockSandboxer@'
|
LANDLOCK_SANDBOXER_FALLBACK='@landlockSandboxer@'
|
||||||
PASTA_FALLBACK='@pasta@'
|
PASTA_FALLBACK='@pasta@'
|
||||||
|
READLINK_FALLBACK='@readlink@'
|
||||||
|
|
||||||
|
|
||||||
## EARLY DEBUG HOOKS
|
## EARLY DEBUG HOOKS
|
||||||
@@ -316,7 +317,8 @@ readlinkOnce() {
|
|||||||
linkTarget=${linkCache[$path]}
|
linkTarget=${linkCache[$path]}
|
||||||
elif [ -L "$path" ]; then
|
elif [ -L "$path" ]; then
|
||||||
# path is a link, but not in the cache
|
# path is a link, but not in the cache
|
||||||
linkTarget=$(readlink "$path")
|
locate _readlink "readlink" "$READLINK_FALLBACK"
|
||||||
|
linkTarget=$("$_readlink" "$path")
|
||||||
# insert it into the cache, in case we traverse it again
|
# insert it into the cache, in case we traverse it again
|
||||||
linkCache[$path]=$linkTarget
|
linkCache[$path]=$linkTarget
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user