aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test5.in
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-06-20 12:26:03 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-06-20 12:32:30 -0700
commit4621e763b63dd764bc96cc5fe36613b4e0404e6b (patch)
tree13243f5fd4083548718ba45e094cb7858759b9ee /tests/test5.in
parent8db162e04809aed2ccde7eb277caf60b732bcb0d (diff)
Fix wildcard expansion in directories without read permissions
When performing wildcard expansion with a literal path segment, instead of enumerating the files in the directory, simply apply the path segment as if we found the directory and continue on. This enables us to expand strings that contain unreadable directory components (common with $HOME) and also improves performance, since we don't waste time enumerating directories unnecessarily. Adds a test too. Fixes #2099
Diffstat (limited to 'tests/test5.in')
-rw-r--r--tests/test5.in12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test5.in b/tests/test5.in
index a3e2256c..1afc0cc7 100644
--- a/tests/test5.in
+++ b/tests/test5.in
@@ -23,3 +23,15 @@ switch $smurf
case "?????"
echo Test 3 pass
end
+
+# Verify that we can do wildcard expansion when we
+# don't have read access to some path components
+# See #2099
+set -l where /tmp/fish_wildcard_permissions_test/noaccess/yesaccess
+mkdir -p $where
+chmod 300 (dirname $where) # no read permissions
+mkdir -p $where
+touch $where/alpha.txt $where/beta.txt $where/delta.txt
+echo $where/*
+chmod 700 (dirname $where) # so we can delete it
+rm -rf /tmp/fish_wildcard_permissions_test