Skip to content

Commit 4089b33

Browse files
enedpaulb777
authored andcommitted
Disable data protection when opening the Rmq2PeristentStore (#2963)
1 parent 3326cb4 commit 4089b33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Firebase/Messaging/FIRMessagingRmq2PersistentStore.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ - (void)openDatabase:(NSString *)dbName {
279279
BOOL didOpenDatabase = YES;
280280
if (![fileManager fileExistsAtPath:path]) {
281281
// We've to separate between different versions here because of backwards compatbility issues.
282-
int result = sqlite3_open([path UTF8String], &_database);
282+
int result = sqlite3_open_v2([path UTF8String],
283+
&_database,
284+
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FILEPROTECTION_NONE,
285+
NULL);
283286
if (result != SQLITE_OK) {
284287
NSString *errorString = FIRMessagingStringFromSQLiteResult(result);
285288
NSString *errorMessage =
@@ -299,7 +302,10 @@ - (void)openDatabase:(NSString *)dbName {
299302
[self createTableWithName:kTableS2DRmqIds command:kCreateTableS2DRmqIds];
300303
} else {
301304
// Calling sqlite3_open should create the database, since the file doesn't exist.
302-
int result = sqlite3_open([path UTF8String], &_database);
305+
int result = sqlite3_open_v2([path UTF8String],
306+
&_database,
307+
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FILEPROTECTION_NONE,
308+
NULL);
303309
if (result != SQLITE_OK) {
304310
NSString *errorString = FIRMessagingStringFromSQLiteResult(result);
305311
NSString *errorMessage =

0 commit comments

Comments
 (0)