there is no need to call XGetErrorDatabaseText() to cache the XErrorDB anymore

so remove it for now
This commit is contained in:
robert 2023-01-29 11:31:00 +00:00
parent fd01a80a29
commit 5bf2f4aef5
9 changed files with 53 additions and 125 deletions

View File

@ -7,7 +7,7 @@ DPB_PROPERTIES= parallel parallel2
COMMENT= Chromium browser
V= 109.0.5414.119
REVISION= 1
REVISION= 2
DISTNAME= chromium-${V}

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/freebsd/sandbox_freebsd.cc
--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig
+++ sandbox/policy/freebsd/sandbox_freebsd.cc
@@ -0,0 +1,253 @@
@@ -0,0 +1,241 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -61,11 +61,8 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+#include "crypto/nss_util.h"
+#endif
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
@ -126,15 +123,6 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+ crypto::EnsureNSSInit();
+#endif
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/openbsd/sandbox_openbsd.cc
--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig
+++ sandbox/policy/openbsd/sandbox_openbsd.cc
@@ -0,0 +1,413 @@
@@ -0,0 +1,401 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -64,11 +64,8 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+
+#include "third_party/boringssl/src/include/openssl/crypto.h"
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
@ -134,15 +131,6 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ if (process_type.empty())
+ CRYPTO_pre_sandbox_init();
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+

View File

@ -12,7 +12,7 @@ COMMENT= Iridium browser
V= 2023.01.109
REVISION= 5
REVISION= 6
DISTNAME= iridium-browser-${V}
PKGNAME= iridium-${V}

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/freebsd/sandbox_freebsd.cc
--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig
+++ sandbox/policy/freebsd/sandbox_freebsd.cc
@@ -0,0 +1,253 @@
@@ -0,0 +1,241 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -61,21 +61,18 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+#include "crypto/nss_util.h"
+#endif
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/iridium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/iridium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/iridium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/iridium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/iridium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/iridium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/iridium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/iridium/unveil.utility_video";
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
+
+namespace sandbox {
+namespace policy {
@ -126,22 +123,13 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+ crypto::EnsureNSSInit();
+#endif
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+
+ base::PathService::Get(base::DIR_CACHE, &cache_directory);
+ base::PathService::Get(base::DIR_HOME, &local_directory);
+
+ cache_directory = cache_directory.AppendASCII("iridium");
+ cache_directory = cache_directory.AppendASCII("chromium");
+ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
+
+ if (!base::CreateDirectory(cache_directory)) {

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/openbsd/sandbox_openbsd.cc
--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig
+++ sandbox/policy/openbsd/sandbox_openbsd.cc
@@ -0,0 +1,413 @@
@@ -0,0 +1,401 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -64,21 +64,18 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+
+#include "third_party/boringssl/src/include/openssl/crypto.h"
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/iridium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/iridium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/iridium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/iridium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/iridium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/iridium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/iridium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/iridium/unveil.utility_video";
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
+
+namespace sandbox {
+namespace policy {
@ -134,22 +131,13 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ if (process_type.empty())
+ CRYPTO_pre_sandbox_init();
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+
+ base::PathService::Get(base::DIR_CACHE, &cache_directory);
+ base::PathService::Get(base::DIR_HOME, &local_directory);
+
+ cache_directory = cache_directory.AppendASCII("iridium");
+ cache_directory = cache_directory.AppendASCII("chromium");
+ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
+
+ if (!base::CreateDirectory(cache_directory)) {
@ -325,7 +313,7 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ if (process_type.empty()) {
+ // XXX use a file for listing pledges of the main process for now
+ // XXX not having the file is not a fatal error
+ SetPledge(NULL, "/etc/iridium/pledge.main");
+ SetPledge(NULL, "/etc/chromium/pledge.main");
+ } else if (process_type == switches::kRendererProcess) {
+ // prot_exec needed by v8
+ // flock needed by sqlite3 locking
@ -337,11 +325,11 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ SetPledge("stdio rpath prot_exec recvfd sendfd", NULL);
+ } else if (process_type == switches::kUtilityProcess) {
+ if (sandbox_type == sandbox::mojom::Sandbox::kAudio)
+ SetPledge(NULL, "/etc/iridium/pledge.utility_audio");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_audio");
+ else if (sandbox_type == sandbox::mojom::Sandbox::kNetwork)
+ SetPledge(NULL, "/etc/iridium/pledge.utility_network");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_network");
+ else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture)
+ SetPledge(NULL, "/etc/iridium/pledge.utility_video");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_video");
+ else
+ SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL);
+ } else {

View File

@ -10,7 +10,7 @@ COMMENT= Chromium browser sans integration with Google
V= 109.0.5414.119
UGV= ${V}-1
REVISION= 1
REVISION= 2
DISTNAME= ungoogled-chromium-${V}

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/freebsd/sandbox_freebsd.cc
--- sandbox/policy/freebsd/sandbox_freebsd.cc.orig
+++ sandbox/policy/freebsd/sandbox_freebsd.cc
@@ -0,0 +1,253 @@
@@ -0,0 +1,241 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -61,21 +61,18 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+#include "crypto/nss_util.h"
+#endif
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/ungoogled-chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/ungoogled-chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/ungoogled-chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/ungoogled-chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/ungoogled-chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/ungoogled-chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/ungoogled-chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/ungoogled-chromium/unveil.utility_video";
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
+
+namespace sandbox {
+namespace policy {
@ -126,22 +123,13 @@ Index: sandbox/policy/freebsd/sandbox_freebsd.cc
+ crypto::EnsureNSSInit();
+#endif
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+
+ base::PathService::Get(base::DIR_CACHE, &cache_directory);
+ base::PathService::Get(base::DIR_HOME, &local_directory);
+
+ cache_directory = cache_directory.AppendASCII("ungoogled-chromium");
+ cache_directory = cache_directory.AppendASCII("chromium");
+ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
+
+ if (!base::CreateDirectory(cache_directory)) {

View File

@ -1,7 +1,7 @@
Index: sandbox/policy/openbsd/sandbox_openbsd.cc
--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig
+++ sandbox/policy/openbsd/sandbox_openbsd.cc
@@ -0,0 +1,413 @@
@@ -0,0 +1,401 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
@ -64,21 +64,18 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+
+#include "third_party/boringssl/src/include/openssl/crypto.h"
+
+#include "ui/gfx/x/connection.h"
+#include "ui/gfx/font_util.h"
+
+#include <X11/Xlib.h>
+
+#define MAXTOKENS 3
+
+#define _UNVEIL_MAIN "/etc/ungoogled-chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/ungoogled-chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/ungoogled-chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/ungoogled-chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/ungoogled-chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/ungoogled-chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/ungoogled-chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/ungoogled-chromium/unveil.utility_video";
+#define _UNVEIL_MAIN "/etc/chromium/unveil.main";
+#define _UNVEIL_RENDERER "/etc/chromium/unveil.renderer";
+#define _UNVEIL_GPU "/etc/chromium/unveil.gpu";
+#define _UNVEIL_PLUGIN "/etc/chromium/unveil.plugin";
+#define _UNVEIL_UTILITY "/etc/chromium/unveil.utility";
+#define _UNVEIL_UTILITY_NETWORK "/etc/chromium/unveil.utility_network";
+#define _UNVEIL_UTILITY_AUDIO "/etc/chromium/unveil.utility_audio";
+#define _UNVEIL_UTILITY_VIDEO "/etc/chromium/unveil.utility_video";
+
+namespace sandbox {
+namespace policy {
@ -134,22 +131,13 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ if (process_type.empty())
+ CRYPTO_pre_sandbox_init();
+
+ // cache the XErrorDB by forcing a read on it
+ {
+ auto* connection = x11::Connection::Get();
+ auto* display = connection->GetXlibDisplay().display();
+
+ char buf[1];
+ XGetErrorDatabaseText(display, "XProtoError", "0", "", buf, std::size(buf));
+ }
+
+ if (process_type.empty()) {
+ base::FilePath cache_directory, local_directory;
+
+ base::PathService::Get(base::DIR_CACHE, &cache_directory);
+ base::PathService::Get(base::DIR_HOME, &local_directory);
+
+ cache_directory = cache_directory.AppendASCII("ungoogled-chromium");
+ cache_directory = cache_directory.AppendASCII("chromium");
+ local_directory = local_directory.AppendASCII(".local").AppendASCII("share").AppendASCII("applications");
+
+ if (!base::CreateDirectory(cache_directory)) {
@ -325,7 +313,7 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ if (process_type.empty()) {
+ // XXX use a file for listing pledges of the main process for now
+ // XXX not having the file is not a fatal error
+ SetPledge(NULL, "/etc/ungoogled-chromium/pledge.main");
+ SetPledge(NULL, "/etc/chromium/pledge.main");
+ } else if (process_type == switches::kRendererProcess) {
+ // prot_exec needed by v8
+ // flock needed by sqlite3 locking
@ -337,11 +325,11 @@ Index: sandbox/policy/openbsd/sandbox_openbsd.cc
+ SetPledge("stdio rpath prot_exec recvfd sendfd", NULL);
+ } else if (process_type == switches::kUtilityProcess) {
+ if (sandbox_type == sandbox::mojom::Sandbox::kAudio)
+ SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_audio");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_audio");
+ else if (sandbox_type == sandbox::mojom::Sandbox::kNetwork)
+ SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_network");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_network");
+ else if (sandbox_type == sandbox::mojom::Sandbox::kVideoCapture)
+ SetPledge(NULL, "/etc/ungoogled-chromium/pledge.utility_video");
+ SetPledge(NULL, "/etc/chromium/pledge.utility_video");
+ else
+ SetPledge("stdio rpath cpath wpath fattr flock sendfd recvfd prot_exec", NULL);
+ } else {