修复SQLite嵌套路径迁移校验
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-06 09:01:14 +08:00
1 parent 9404d7f9c8
commit 33b4258fbb
5 files changed
+45 -3

No files matched your search

+14
View File
@@ -47,9 +47,23 @@ func TestSQLiteLocalRefIsBackendReferenceOnly(t *testing.T) {
if err := ValidateDatabaseConfig(valid); err != nil {
t.Fatalf("valid SQLite database rejected: %v", err)
}
for _, localRef := range []string{
"archive/review.db",
"data/2026/smail.db",
} {
t.Run("nested/"+localRef, func(t *testing.T) {
candidate := valid
candidate.LocalRef = localRef
if err := ValidateDatabaseConfig(candidate); err != nil {
t.Fatalf("nested SQLite localRef %q was rejected: %v", localRef, err)
}
})
}
for _, localRef := range []string{
"../smail.db",
"config/smail.db",
"archive/../smail.db",
"archive//smail.db",
"C:\\data\\smail.db",
"/var/lib/smail/smail.db",
"\\\\server\\share\\smail.db",