Skip to content

Commit

Permalink
Use /etc/brave/policies even if it doesn't exist.
Browse files Browse the repository at this point in the history
PathService::Override() requires that the new target path exists,
and tries to create it if it doesn't. Since the user doesn't have
permission to create `/etc/brave` the override fails if an
administrator hadn't already installed something there, and the
original `/etc/chromium` path for policy files remains active.

Current uses of this path are few and seem to be robust against
the directory not existing, so this seems a safer fix than patching
the upstream default.

Closes brave/brave-browser#19052
  • Loading branch information
rillian committed Oct 29, 2021
1 parent c649cca commit 6f2f55b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/brave_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ void BraveMainDelegate::PreSandboxStartup() {
#endif // defined(OS_LINUX) || defined(OS_MAC)

#if defined(OS_POSIX) && !defined(OS_MAC)
base::PathService::Override(
base::PathService::OverrideAndCreateIfNeeded(
chrome::DIR_POLICY_FILES,
base::FilePath(FILE_PATH_LITERAL("/etc/brave/policies")));
base::FilePath(FILE_PATH_LITERAL("/etc/brave/policies")), true, false);
#endif

if (brave::SubprocessNeedsResourceBundle()) {
Expand Down

0 comments on commit 6f2f55b

Please sign in to comment.