diff options
Diffstat (limited to 'www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc')
-rw-r--r-- | www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc index 00e026995def..421d198975d1 100644 --- a/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc +++ b/www/chromium/files/patch-sandbox_policy_openbsd_sandbox__openbsd.cc @@ -1,6 +1,6 @@ ---- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2025-05-05 10:57:53 UTC +--- sandbox/policy/openbsd/sandbox_openbsd.cc.orig 2025-07-02 06:08:04 UTC +++ sandbox/policy/openbsd/sandbox_openbsd.cc -@@ -0,0 +1,392 @@ +@@ -0,0 +1,400 @@ +// 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. @@ -194,6 +194,7 @@ +bool SandboxLinux::SetUnveil(const std::string process_type, sandbox::mojom::Sandbox sandbox_type) { + FILE *fp; + char *s = NULL, *cp = NULL, *home = NULL, **ap, *tokens[MAXTOKENS]; ++ char *xdg_var = NULL; + char path[PATH_MAX]; + const char *ufile; + size_t len = 0, lineno = 0; @@ -258,6 +259,13 @@ + strncpy(path, home, sizeof(path) - 1); + path[sizeof(path) - 1] = '\0'; + strncat(path, tokens[0], sizeof(path) - 1 - strlen(path)); ++ } else if (strncmp(tokens[0], "XDG_", 4) == 0) { ++ if ((xdg_var = getenv(tokens[0])) == NULL || *xdg_var == '\0') { ++ LOG(ERROR) << "failed to get " << tokens[0]; ++ continue; ++ } ++ strncpy(path, xdg_var, sizeof(path) - 1); ++ path[sizeof(path) - 1] = '\0'; + } else { + strncpy(path, tokens[0], sizeof(path) - 1); + path[sizeof(path) - 1] = '\0'; |