mirror of
https://git.freebsd.org/ports.git
synced 2025-07-07 04:19:17 -04:00
Approved by: rene (mentor) Security: https://vuxml.freebsd.org/freebsd/310ca30e-a951-11ed-8314-a8a1599412c6.html
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
--- chrome/browser/profiles/profile_impl.cc.orig 2023-02-08 09:03:45 UTC
|
|
+++ chrome/browser/profiles/profile_impl.cc
|
|
@@ -257,6 +257,10 @@
|
|
#include "chrome/browser/spellchecker/spellcheck_service.h"
|
|
#endif
|
|
|
|
+#if BUILDFLAG(IS_OPENBSD)
|
|
+#include "sandbox/policy/openbsd/sandbox_openbsd.h"
|
|
+#endif
|
|
+
|
|
using bookmarks::BookmarkModel;
|
|
using content::BrowserThread;
|
|
using content::DownloadManagerDelegate;
|
|
@@ -861,7 +865,17 @@ void ProfileImpl::DoFinalInit(CreateMode create_mode)
|
|
}
|
|
|
|
base::FilePath ProfileImpl::last_selected_directory() {
|
|
+#if BUILDFLAG(IS_OPENBSD)
|
|
+ // If unveil(2) is used, force the file dialog directory to something we
|
|
+ // know is available.
|
|
+ auto* sandbox = sandbox::policy::SandboxLinux::GetInstance();
|
|
+ if (sandbox->unveil_initialized())
|
|
+ return GetPrefs()->GetFilePath(prefs::kDownloadDefaultDirectory);
|
|
+ else
|
|
+ return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
|
|
+#else
|
|
return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory);
|
|
+#endif
|
|
}
|
|
|
|
void ProfileImpl::set_last_selected_directory(const base::FilePath& path) {
|