Skip to content

Commit

Permalink
don't log mlock warnings for tests
Browse files Browse the repository at this point in the history
mlock is used by sqlcipher but is not allowed on our test containers
see sqlcipher/sqlcipher-android#48 (comment)
see systemd/systemd#9414 (comment)
  • Loading branch information
kibibytium authored and tuta-sudipg committed Jan 31, 2025
1 parent 16f7f13 commit e47b5c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/desktop/db/DesktopSqlCipher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SqlCipherFacade } from "../../native/common/generatedipc/SqlCipherFacad
import { OfflineDbClosedError } from "../../api/common/error/OfflineDbClosedError.js"
import { ProgrammingError } from "../../api/common/error/ProgrammingError.js"
import { TaggedSqlValue, tagSqlObject, untagSqlValue } from "../../api/worker/offline/SqlValue.js"
import { Mode } from "../../api/common/Env.js"

export class DesktopSqlCipher implements SqlCipherFacade {
private _db: Database | null = null
Expand Down Expand Up @@ -81,6 +82,9 @@ export class DesktopSqlCipher implements SqlCipherFacade {
// integrity check breaks tests
integrityCheck: boolean
}) {
if (env.mode === Mode.Test) {
this.db.pragma("cipher_log_source = NONE")
}
if (enableMemorySecurity) {
this.db.pragma("cipher_memory_security = ON")
}
Expand Down

0 comments on commit e47b5c5

Please sign in to comment.