mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
ios: Fail Crashpad initialization with invalid database path.
Bug: crashpad:31 Change-Id: I1853af83a18675bee6dd99636f179db127e1ac47 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3247291 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
parent
9c6a751e4b
commit
15c4663b8c
@ -28,13 +28,15 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Creates directory at |path|.
|
// Creates directory at |path|.
|
||||||
void CreateDirectory(const base::FilePath& path) {
|
bool CreateDirectory(const base::FilePath& path) {
|
||||||
if (mkdir(path.value().c_str(), 0755) == 0) {
|
if (mkdir(path.value().c_str(), 0755) == 0) {
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
if (errno != EEXIST) {
|
if (errno != EEXIST) {
|
||||||
PLOG(ERROR) << "mkdir " << path.value();
|
PLOG(ERROR) << "mkdir " << path.value();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The file extension used to indicate a file is locked.
|
// The file extension used to indicate a file is locked.
|
||||||
@ -63,6 +65,9 @@ bool InProcessHandler::Initialize(
|
|||||||
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
|
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
|
||||||
annotations_ = annotations;
|
annotations_ = annotations;
|
||||||
database_ = CrashReportDatabase::Initialize(database);
|
database_ = CrashReportDatabase::Initialize(database);
|
||||||
|
if (!database_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bundle_identifier_and_seperator_ =
|
bundle_identifier_and_seperator_ =
|
||||||
system_data.BundleIdentifier() + kBundleSeperator;
|
system_data.BundleIdentifier() + kBundleSeperator;
|
||||||
|
|
||||||
@ -80,11 +85,13 @@ bool InProcessHandler::Initialize(
|
|||||||
database_.get(), url, upload_thread_options));
|
database_.get(), url, upload_thread_options));
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateDirectory(database);
|
if (!CreateDirectory(database))
|
||||||
|
return false;
|
||||||
static constexpr char kPendingSerializediOSDump[] =
|
static constexpr char kPendingSerializediOSDump[] =
|
||||||
"pending-serialized-ios-dump";
|
"pending-serialized-ios-dump";
|
||||||
base_dir_ = database.Append(kPendingSerializediOSDump);
|
base_dir_ = database.Append(kPendingSerializediOSDump);
|
||||||
CreateDirectory(base_dir_);
|
if (!CreateDirectory(base_dir_))
|
||||||
|
return false;
|
||||||
|
|
||||||
prune_thread_.reset(new PruneIntermediateDumpsAndCrashReportsThread(
|
prune_thread_.reset(new PruneIntermediateDumpsAndCrashReportsThread(
|
||||||
database_.get(),
|
database_.get(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user