Bug 1266440 - Remove diagnostic funciton mozilla::ipc::AnnotateProcessInformation() that contains PII. r=krizsa

MozReview-Commit-ID: AJyNT68zJlF
This commit is contained in:
Cervantes Yu 2016-08-01 18:41:09 +08:00
Родитель 981682b0b7
Коммит 8a084acd4c
2 изменённых файлов: 0 добавлений и 80 удалений

Просмотреть файл

@ -345,84 +345,6 @@ AnnotateSystemError()
nsPrintfCString("%lld", error));
}
}
void
AnnotateProcessInformation(base::ProcessId aPid)
{
#ifdef XP_WIN
ScopedProcessHandle processHandle(
OpenProcess(READ_CONTROL|PROCESS_QUERY_INFORMATION, FALSE, aPid));
if (!processHandle) {
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("IPCExtraSystemError"),
nsPrintfCString("Failed to get information of process %d, error(%d)",
aPid,
::GetLastError()));
return;
}
DWORD exitCode = 0;
if (!::GetExitCodeProcess(processHandle, &exitCode)) {
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("IPCExtraSystemError"),
nsPrintfCString("Failed to get exit information of process %d, error(%d)",
aPid,
::GetLastError()));
return;
}
if (exitCode != STILL_ACTIVE) {
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("IPCExtraSystemError"),
nsPrintfCString("Process %d is not alive. Exit code: %d",
aPid,
exitCode));
return;
}
ScopedPSecurityDescriptor secDesc(nullptr);
PSID ownerSid = nullptr;
DWORD rv = ::GetSecurityInfo(processHandle,
SE_KERNEL_OBJECT,
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
&ownerSid,
nullptr,
nullptr,
nullptr,
&secDesc.rwget());
if (rv != ERROR_SUCCESS) {
// GetSecurityInfo() failed.
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("IPCExtraSystemError"),
nsPrintfCString("Failed to get security information of process %d,"
" error(%d)",
aPid,
rv));
return;
}
ScopedLPTStr ownerSidStr(nullptr);
nsString annotation{};
annotation.AppendLiteral("Owner: ");
if (::ConvertSidToStringSid(ownerSid, &ownerSidStr.rwget())) {
annotation.Append(ownerSidStr.get());
}
ScopedLPTStr secDescStr(nullptr);
annotation.AppendLiteral(", Security Descriptor: ");
if (::ConvertSecurityDescriptorToStringSecurityDescriptor(secDesc,
SDDL_REVISION_1,
DACL_SECURITY_INFORMATION,
&secDescStr.rwget(),
nullptr)) {
annotation.Append(secDescStr.get());
}
CrashReporter::AnnotateCrashReport(
NS_LITERAL_CSTRING("IPCExtraSystemError"),
NS_ConvertUTF16toUTF8(annotation));
#endif
}
#endif
void

Просмотреть файл

@ -439,10 +439,8 @@ DuplicateHandle(HANDLE aSourceHandle,
*/
#ifdef MOZ_CRASHREPORTER
void AnnotateSystemError();
void AnnotateProcessInformation(base::ProcessId aPid);
#else
#define AnnotateSystemError() do { } while (0)
#define AnnotateProcessInformation(...) do { } while (0)
#endif
/**