Skip to content

Commit

Permalink
Disable data protection when opening the Rmq2PeristentStore (#2963)
Browse files Browse the repository at this point in the history
  • Loading branch information
ened authored and paulb777 committed May 20, 2019
1 parent 3326cb4 commit 4089b33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Firebase/Messaging/FIRMessagingRmq2PersistentStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,10 @@ - (void)openDatabase:(NSString *)dbName {
BOOL didOpenDatabase = YES;
if (![fileManager fileExistsAtPath:path]) {
// We've to separate between different versions here because of backwards compatbility issues.
int result = sqlite3_open([path UTF8String], &_database);
int result = sqlite3_open_v2([path UTF8String],
&_database,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FILEPROTECTION_NONE,
NULL);
if (result != SQLITE_OK) {
NSString *errorString = FIRMessagingStringFromSQLiteResult(result);
NSString *errorMessage =
Expand All @@ -299,7 +302,10 @@ - (void)openDatabase:(NSString *)dbName {
[self createTableWithName:kTableS2DRmqIds command:kCreateTableS2DRmqIds];
} else {
// Calling sqlite3_open should create the database, since the file doesn't exist.
int result = sqlite3_open([path UTF8String], &_database);
int result = sqlite3_open_v2([path UTF8String],
&_database,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FILEPROTECTION_NONE,
NULL);
if (result != SQLITE_OK) {
NSString *errorString = FIRMessagingStringFromSQLiteResult(result);
NSString *errorMessage =
Expand Down

0 comments on commit 4089b33

Please sign in to comment.