mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
tests/realpath.in: We want to delete $PWD, darnit!
Illumos/OpenIndiana/SunOS/Solaris has an rm/rmdir that tries to protect the user by not allowing them to delete $PWD. Normally, this would be a good thing as deleting $PWD is a stupid thing to do. Except in this case, we absolutely need to do that. So instead we weasel around it by invoking an sh to cd out of the directory to then invoke an `rmdir` to delete it. That should throw off any attempts at protection (we could also have tried $PWD/. or similar, but that's possibly still protected against). This is the last failing test on Illumos/OpenIndiana/SunOS/Solaris/afunnyquip, so: Fixes #5472.
This commit is contained in:
parent
c62d95e428
commit
1ee57e9244
@ -35,7 +35,9 @@ builtin realpath /def///
|
||||
# Verify `realpath .` when cwd is a deleted directory gives a no such file or dir error.
|
||||
set -l tmpdir (mktemp -d)
|
||||
pushd $tmpdir
|
||||
rmdir $tmpdir
|
||||
# Solaris rmdir tries to protect against deleting $PWD.
|
||||
# But that's what we want to test, so we weasel around it.
|
||||
sh -c "cd ..; rmdir $tmpdir"
|
||||
builtin realpath .
|
||||
popd
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user