From 4eb0dd623d70f0ee00bd1140c2afb2294bd1990d Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Thu, 11 Apr 2024 18:13:39 +0200 Subject: [PATCH] add testcase for cd without read permission --- tests/checks/cd.fish | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/checks/cd.fish b/tests/checks/cd.fish index 98a7757df..2ece86287 100644 --- a/tests/checks/cd.fish +++ b/tests/checks/cd.fish @@ -271,3 +271,25 @@ end complete -C'cd .' # CHECK: ../ # CHECK: ./ + +# Check that cd works with minimal permissions (issue #10432) +begin + set -l oldpwd (pwd) + set -l tmp (mktemp -d) + cd $tmp + mkdir -p a/b/c + chmod -r a + + cd a; pwd + # CHECK: {{.*}}/a + + cd b + pwd + ls + # CHECK: {{.*}}/a/b + # CHECK: c + + cd $oldpwd + chmod -R +rx $tmp # we must be able to list the directory to delete its children + rm -rf $tmp +end