summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Test/D02glob.ztst36
2 files changed, 39 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f6dfe3ed..5f291fec0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2020-03-25 Daniel Shahaf <d.s@daniel.shahaf.name>
+ * 45583/0001: Test/D02glob.ztst: Add tests for the segfault on
+ resolving a symlink loop bug (workers/45282).
+
* 45590/0002 (in part): Test/B12limit.ztst: zsh/rlimits: Test
that ulimit letters are unique.
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 4e6dc2a7a..248cc7ff5 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -757,6 +757,42 @@
-f:(workers/45367) modifier ':P' squashes multiple slashes
>/dev
+ ln -s loop glob.tmp/loop
+ ln -s loop glob.tmp/trap
+ {
+ (set -- glob.tmp/trap; echo $1:P)
+ (set -- glob.tmp/loop; echo $1:P)
+ } always {
+ rm -f glob.tmp/trap glob.tmp/loop
+ }
+-f:the ':P' modifier handles symlink loops in the last path component
+*>*/(trap|loop)
+*>*/(trap|loop)
+
+ ln -s loop glob.tmp/loop
+ ln -s loop glob.tmp/trap
+ {
+ (set -- glob.tmp/loop/trailing/components; echo $1:P)
+ (set -- glob.tmp/trap/trailing/components; echo $1:P)
+ } always {
+ rm -f glob.tmp/trap glob.tmp/loop
+ }
+-f:the ':P' modifier handles symlink loops before the last path component
+*>*/glob.tmp/loop/trailing/components
+*>*/glob.tmp/(loop|trap)/trailing/components
+
+ ln -s flip glob.tmp/flop
+ ln -s flop glob.tmp/flip
+ {
+ (set -- glob.tmp/flip; echo $1:P)
+ (set -- glob.tmp/flip/trailing/components; echo $1:P)
+ } always {
+ rm -f glob.tmp/flip glob.tmp/flop
+ }
+-f:the ':P' modifier handles symlink loops other than the trivial case
+*>*/glob.tmp/(flip|flop)
+*>*/glob.tmp/(flip|flop)/trailing/components
+
%clean
# Fix unreadable-directory permissions so ztst can clean up properly