Changeset 228971 in webkit
- Timestamp:
- Feb 23, 2018 6:01:36 PM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r228954 r228971 1 2018-02-23 Christopher Reid <chris.reid@sony.com> 2 3 [Curl] Cookie Database files are wrongfully getting deleted when the database is opened 4 https://bugs.webkit.org/show_bug.cgi?id=183051 5 6 Reviewed by Per Arne Vollan. 7 8 The file stat logic was backwards causing a wrongful detection of database corruption. 9 Fixed the logic and abstracted these calls to use FileSystem. 10 11 * platform/network/curl/CookieJarDB.cpp: 12 1 13 2018-02-23 Zalan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp
r228905 r228971 173 173 return; 174 174 175 FILE* f = fopen(getCorruptionMarkerPath().utf8().data(), "wb"); 176 fclose(f); 175 auto handle = FileSystem::openFile(getCorruptionMarkerPath(), FileSystem::FileOpenMode::Write); 176 if (FileSystem::isHandleValid(handle)) 177 FileSystem::closeFile(handle); 177 178 } 178 179 179 180 bool CookieJarDB::checkDatabaseCorruptionAndRemoveIfNeeded() 180 181 { 181 if (isOnMemory()) 182 return false; 183 184 struct stat st; 185 int ret = stat(getCorruptionMarkerPath().utf8().data(), &st); 186 if (!ret) 187 return false; 188 189 deleteAllDatabaseFiles(); 190 return true; 182 if (!isOnMemory() && FileSystem::fileExists(getCorruptionMarkerPath())) { 183 deleteAllDatabaseFiles(); 184 return true; 185 } 186 187 return false; 191 188 } 192 189
Note: See TracChangeset
for help on using the changeset viewer.