xdg-94.0.4606.71.patch 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. diff -ruN a/base/nix/xdg_util.cc b/base/nix/xdg_util.cc
  2. --- a/base/nix/xdg_util.cc 2021-10-01 03:36:37.000000000 +0200
  3. +++ b/base/nix/xdg_util.cc 2021-10-11 23:38:26.553638013 +0200
  4. @@ -29,6 +29,8 @@
  5. const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME";
  6. const char kXdgCurrentDesktopEnvVar[] = "XDG_CURRENT_DESKTOP";
  7. const char kXdgSessionTypeEnvVar[] = "XDG_SESSION_TYPE";
  8. +const char kDotDataDir[] = ".local/share";
  9. +const char kXdgDataHomeEnvVar[] = "XDG_DATA_HOME";
  10. FilePath GetXDGDirectory(Environment* env, const char* env_name,
  11. const char* fallback_dir) {
  12. diff -ruN a/base/nix/xdg_util.h b/base/nix/xdg_util.h
  13. --- a/base/nix/xdg_util.h 2021-10-11 23:57:48.607012470 +0200
  14. +++ b/base/nix/xdg_util.h 2021-10-12 00:04:46.457027239 +0200
  15. @@ -37,6 +37,12 @@
  16. // The XDG session type environment variable.
  17. BASE_EXPORT extern const char kXdgSessionTypeEnvVar[];
  18. +// The default XDG data directory name.
  19. +BASE_EXPORT extern const char kDotDataDir[];
  20. +
  21. +// The XDG data directory environment variable.
  22. +BASE_EXPORT extern const char kXdgDataHomeEnvVar[];
  23. +
  24. // Utility function for getting XDG directories.
  25. // |env_name| is the name of an environment variable that we want to use to get
  26. // a directory path. |fallback_dir| is the directory relative to $HOME that we
  27. diff -ruN a/crypto/nss_util.cc b/crypto/nss_util.cc
  28. --- a/crypto/nss_util.cc 2021-10-01 03:36:49.000000000 +0200
  29. +++ b/crypto/nss_util.cc 2021-10-12 12:45:52.235119130 +0200
  30. @@ -30,6 +30,9 @@
  31. #include "build/chromeos_buildflags.h"
  32. #include "crypto/nss_crypto_module_delegate.h"
  33. #include "crypto/nss_util_internal.h"
  34. +#include "base/environment.h"
  35. +#include "base/nix/xdg_util.h"
  36. +#include "chrome/common/chrome_constants.h"
  37. namespace crypto {
  38. @@ -45,12 +48,21 @@
  39. base::FilePath GetDefaultConfigDirectory() {
  40. base::FilePath dir;
  41. +#if defined(OS_LINUX)
  42. + std::unique_ptr<base::Environment> env(base::Environment::Create());
  43. + dir = base::nix::GetXDGDirectory(env.get(), base::nix::kXdgDataHomeEnvVar, base::nix::kDotDataDir);
  44. +#else
  45. base::PathService::Get(base::DIR_HOME, &dir);
  46. +#endif
  47. if (dir.empty()) {
  48. - LOG(ERROR) << "Failed to get home directory.";
  49. + LOG(ERROR) << "Failed to get $HOME or $XDG_DATA_HOME directory.";
  50. return dir;
  51. }
  52. +#if defined(OS_LINUX)
  53. + dir = dir.Append(chrome::kBrowserProcessExecutableName).AppendASCII("pki").AppendASCII("nssdb");
  54. +#else
  55. dir = dir.AppendASCII(".pki").AppendASCII("nssdb");
  56. +#endif
  57. if (!base::CreateDirectory(dir)) {
  58. LOG(ERROR) << "Failed to create " << dir.value() << " directory.";
  59. dir.clear();
  60. @@ -136,7 +148,7 @@
  61. NSSInitSingleton() {
  62. // Initializing NSS causes us to do blocking IO.
  63. // Temporarily allow it until we fix
  64. - // http://code.google.com/p/chromium/issues/detail?id=59847
  65. + // http://code.9oo91e.qjz9zk/p/chromium/issues/detail?id=59847
  66. base::ThreadRestrictions::ScopedAllowIO allow_io;
  67. EnsureNSPRInit();
  68. @@ -273,7 +285,7 @@
  69. // Shouldn't need to const_cast here, but SECMOD doesn't properly declare
  70. // input string arguments as const. Bug
  71. - // https://bugzilla.mozilla.org/show_bug.cgi?id=642546 was filed on NSS
  72. + // https://bugzilla.m0z111a.qjz9zk/show_bug.cgi?id=642546 was filed on NSS
  73. // codebase to address this.
  74. SECMODModule* module = SECMOD_LoadUserModule(
  75. const_cast<char*>(modparams.c_str()), nullptr, PR_FALSE);