aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordan <Dan Kennedy>2023-01-10 14:31:56 +0000
committerdan <Dan Kennedy>2023-01-10 14:31:56 +0000
commit2e77734b982d6b64766b51fba5113d62cd44324f (patch)
tree0fdde5ae5d5f75c0cea36e6aee38ccf509f2a977 /test
parentbf395ec58e00e9997fb852ec71dcd327839da4c5 (diff)
downloadsqlite-2e77734b982d6b64766b51fba5113d62cd44324f.tar.gz
sqlite-2e77734b982d6b64766b51fba5113d62cd44324f.zip
Fix handling of unix paths that contain ".." components such that "/" is considered its own parent directory.
FossilOrigin-Name: 3c6cadb396de3981bd950eddd532daa8134bd4bf22c578620e323835c96a8500
Diffstat (limited to 'test')
-rw-r--r--test/symlink.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/symlink.test b/test/symlink.test
index 98b2a32c0..685cae5a4 100644
--- a/test/symlink.test
+++ b/test/symlink.test
@@ -207,4 +207,32 @@ do_test 4.4.2 {
list [file exists x/test.db-wal] [file exists w/test.db-wal]
} {1 0}
+#-------------------------------------------------------------------------
+# Check that extra ".." in a path are ignored.
+reset_db
+do_execsql_test 5.0 {
+ CREATE TABLE xyz(x, y, z);
+ INSERT INTO xyz VALUES(1, 2, 3);
+}
+
+set path [pwd]
+set nLink [llength [split $path /]]
+set path "[string repeat ../ [expr $nLink*2]]..${path}/test.db"
+
+sqlite3 db2 $path
+do_execsql_test -db db2 5.1 {
+ SELECT * FROM xyz;
+} {1 2 3}
+db close
+
+forcedelete test.db2
+file link test.db2 $path
+sqlite3 db2 test.db2
+do_execsql_test -db db2 5.2 {
+ SELECT * FROM xyz;
+} {1 2 3}
+forcedelete test.db2
+
+
+
finish_test