Index: third_party/sqlite/src/test/tkt3457.test |
diff --git a/third_party/sqlite/src/test/tkt3457.test b/third_party/sqlite/src/test/tkt3457.test |
index 71eb424640facb32dfa39cac131e683040a30ad1..04757413221c16d0143da057d438d3f68c905f1c 100644 |
--- a/third_party/sqlite/src/test/tkt3457.test |
+++ b/third_party/sqlite/src/test/tkt3457.test |
@@ -46,8 +46,8 @@ do_test tkt3457-1.1 { |
INSERT INTO t1 VALUES(4, 5, 6); |
} |
- file copy -force test.db bak.db |
- file copy -force test.db-journal bak.db-journal |
+ forcecopy test.db bak.db |
+ forcecopy test.db-journal bak.db-journal |
# Fix the first journal-header in the journal-file. Because the |
# journal file has not yet been synced, the 8-byte magic string at the |
@@ -62,26 +62,40 @@ do_test tkt3457-1.1 { |
execsql COMMIT |
} {} |
+# Disable fchmod to make sure SQLite itself does not try to change the |
+# permission bits on us |
+# |
+catch { |
+ test_syscall install fchmod |
+ test_syscall fault 1 1 |
+} |
+ |
do_test tkt3457-1.2 { |
- file copy -force bak.db-journal test.db-journal |
+ forcecopy bak.db-journal test.db-journal |
file attributes test.db-journal -permissions --------- |
catchsql { SELECT * FROM t1 } |
} {1 {unable to open database file}} |
do_test tkt3457-1.3 { |
- file copy -force bak.db-journal test.db-journal |
+ forcecopy bak.db-journal test.db-journal |
file attributes test.db-journal -permissions -w--w--w- |
catchsql { SELECT * FROM t1 } |
} {1 {unable to open database file}} |
do_test tkt3457-1.4 { |
- file copy -force bak.db-journal test.db-journal |
+ forcecopy bak.db-journal test.db-journal |
file attributes test.db-journal -permissions r--r--r-- |
catchsql { SELECT * FROM t1 } |
} {1 {unable to open database file}} |
do_test tkt3457-1.5 { |
- file copy -force bak.db-journal test.db-journal |
+ forcecopy bak.db-journal test.db-journal |
file attributes test.db-journal -permissions rw-rw-rw- |
catchsql { SELECT * FROM t1 } |
} {0 {1 2 3 4 5 6}} |
+# Reenable fchmod |
+catch { |
+ test_syscall uninstall |
+ test_syscall fault 0 0 |
+} |
+ |
finish_test |