summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport/WebCookieJar.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-12-07 14:51:01 -0800
committerJohn Reck <jreck@google.com>2010-12-10 10:44:53 -0800
commitbe2100c6dda5250b84fe4e0a6eed77bcd6d6e781 (patch)
treed3aa5d30a2b9efa93906b05d50e6e86f1dcc783a /WebKit/android/WebCoreSupport/WebCookieJar.cpp
parent83ddee4501f0c2f48d1073e0185a2fb0a732c929 (diff)
downloadexternal_webkit-be2100c6dda5250b84fe4e0a6eed77bcd6d6e781.zip
external_webkit-be2100c6dda5250b84fe4e0a6eed77bcd6d6e781.tar.gz
external_webkit-be2100c6dda5250b84fe4e0a6eed77bcd6d6e781.tar.bz2
Fixes cookiejar and webicon permissions
Bug: 3244281 Change-Id: Ib7359e5524aeaf4f82f52603e83dde3e99c507c2
Diffstat (limited to 'WebKit/android/WebCoreSupport/WebCookieJar.cpp')
-rw-r--r--WebKit/android/WebCoreSupport/WebCookieJar.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/WebKit/android/WebCoreSupport/WebCookieJar.cpp b/WebKit/android/WebCoreSupport/WebCookieJar.cpp
index afa87c2..374dcd9 100644
--- a/WebKit/android/WebCoreSupport/WebCookieJar.cpp
+++ b/WebKit/android/WebCoreSupport/WebCookieJar.cpp
@@ -94,6 +94,16 @@ WebCookieJar::WebCookieJar(const std::string& databaseFilePath)
// This is needed for the page cycler. See http://b/2944150
net::CookieMonster::EnableFileScheme();
+ // Setup the permissions for the file
+ const char* cDatabasePath = databaseFilePath.c_str();
+ mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
+ if (access(cDatabasePath, F_OK) == 0)
+ chmod(cDatabasePath, mode);
+ else {
+ int fd = open(cDatabasePath, O_CREAT, mode);
+ if (fd >= 0)
+ close(fd);
+ }
FilePath cookiePath(databaseFilePath.c_str());
m_cookieDb = new SQLitePersistentCookieStore(cookiePath);
m_cookieStore = new net::CookieMonster(m_cookieDb.get(), 0);