summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Leukkunen <lle@rahina.org>2007-04-22 23:12:38 +0300
committerLauri Leukkunen <lle@rahina.org>2007-04-22 23:12:38 +0300
commit3cb06654d93c6c09c69cc02b6ecc263f92a133b2 (patch)
tree179d6917f7f9fb41728cb2d3a8919e0a55237d87
parent9636bb307a1f1c63a2791fd4fd6bde8209250641 (diff)
Catch symlinks referring to themselves and break the resulting loop
Signed-off-by: Lauri Leukkunen <lle@rahina.org>
-rw-r--r--redir_scripts/main.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/redir_scripts/main.lua b/redir_scripts/main.lua
index 6eaf66e..a8f3c3a 100644
--- a/redir_scripts/main.lua
+++ b/redir_scripts/main.lua
@@ -144,6 +144,10 @@ function adjust_for_mapping_leakage(path)
-- not a symlink
return path
end
+ if (tmp == basename(path)) then
+ -- symlink refers to itself
+ return path
+ end
-- make it an absolute path if it's not
if (string.sub(tmp, 1, 1) ~= "/") then
tmp = dirname(path) .. "/" .. tmp