bug 444351 - do not send client UUID / GUID with crash reports. r=bsmedberg, a=blocking1.9.1
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 06 Jan 2009 15:55:27 -0500
changeset 22724 97024aa042e57c0cbaf9104e6f80c0c1f6512ddd
parent 22723 218ca51f2cff60cd5a7c491fae01bfc1fb2ab8b7
child 22725 ac02c42d1484926e622322685aaf5e8bdfcc79a6
push id379
push usertmielczarek@mozilla.com
push dateWed, 07 Jan 2009 13:10:43 +0000
reviewersbsmedberg, blocking1
bugs444351
milestone1.9.1b3pre
bug 444351 - do not send client UUID / GUID with crash reports. r=bsmedberg, a=blocking1.9.1
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -531,56 +531,16 @@ GetOrInit(nsIFile* aDir, const nsACStrin
   else {
     // just get the file's contents
     rv = GetFileContents(dataFile, aContents);
   }
 
   return rv;
 }
 
-// Generate a unique user ID.  We're using a GUID form,
-// but not jumping through hoops to make it cryptographically
-// secure.  We just want it to distinguish unique users.
-static nsresult
-InitUserID(nsACString& aUserID)
-{
-  nsID id;
-
-  // copied shamelessly from nsUUIDGenerator.cpp
-#if defined(XP_WIN)
-  HRESULT hr = CoCreateGuid((GUID*)&id);
-  if (NS_FAILED(hr))
-    return NS_ERROR_FAILURE;
-#elif defined(XP_MACOSX)
-  CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
-  if (!uuid)
-    return NS_ERROR_FAILURE;
-
-  CFUUIDBytes bytes = CFUUIDGetUUIDBytes(uuid);
-  memcpy(&id, &bytes, sizeof(nsID));
-
-  CFRelease(uuid);
-#else
-  // UNIX or some such thing
-  id.m0 = random();
-  id.m1 = random();
-  id.m2 = random();
-  *reinterpret_cast<PRUint32*>(&id.m3[0]) = random();
-  *reinterpret_cast<PRUint32*>(&id.m3[4]) = random();
-#endif
-
-  char* id_cstr = id.ToString();
-  NS_ENSURE_TRUE(id_cstr, NS_ERROR_OUT_OF_MEMORY);
-  nsDependentCString id_str(id_cstr);
-  aUserID = Substring(id_str, 1, id_str.Length()-2);
-
-  PR_Free(id_cstr);
-  return NS_OK;
-}
-
 // Init the "install time" data.  We're taking an easy way out here
 // and just setting this to "the time when this version was first run".
 static nsresult
 InitInstallTime(nsACString& aInstallTime)
 {
   time_t t = time(NULL);
   char buf[16];
   sprintf(buf, "%ld", t);
@@ -635,20 +595,16 @@ nsresult SetupExtraData(nsILocalFile* aA
 
   char* env = ToNewCString(dataDirEnv);
   NS_ENSURE_TRUE(env, NS_ERROR_OUT_OF_MEMORY);
 
   PR_SetEnv(env);
 #endif
 
   nsCAutoString data;
-  if(NS_SUCCEEDED(GetOrInit(dataDirectory, NS_LITERAL_CSTRING("UserID"),
-                            data, InitUserID)))
-    AnnotateCrashReport(NS_LITERAL_CSTRING("UserID"), data);
-
   if(NS_SUCCEEDED(GetOrInit(dataDirectory,
                             NS_LITERAL_CSTRING("InstallTime") + aBuildID,
                             data, InitInstallTime)))
     AnnotateCrashReport(NS_LITERAL_CSTRING("InstallTime"), data);
 
   // this is a little different, since we can't init it with anything,
   // since it's stored at crash time, and we can't annotate the
   // crash report with the stored value, since we really want