Skip to content

Use native user temporary directory path for the browser socket in macOS#13484

Open
varjolintu wants to merge 1 commit into
keepassxreboot:developfrom
varjolintu:fix/macos_native_tmp_dir
Open

Use native user temporary directory path for the browser socket in macOS#13484
varjolintu wants to merge 1 commit into
keepassxreboot:developfrom
varjolintu:fix/macos_native_tmp_dir

Conversation

@varjolintu

@varjolintu varjolintu commented Jul 1, 2026

Copy link
Copy Markdown
Member

In macOS for example Homebrew can override the user's temporary directory using the $TMPDIR environment variable. Qt's internal functions will resolve that path instead of the one we actually want to create the socket for browser integration.

Added a new function to BrowserShared that returns the native temporary directory from _CS_DARWIN_USER_TEMP_DIR directly. It will always return the randomly generated temporary directory under /var/.

Testing strategy

For debugging, you can start e.g. CLion with:
env TMPDIR=/private/tmp /Applications/CLion.app/Contents/MacOS/clion and see that that Qt's own function will respect the $TMPDIR environment variable. The new implementation still returns the correct path.

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@varjolintu varjolintu added this to the v2.8.0 milestone Jul 1, 2026
@varjolintu
varjolintu marked this pull request as draft July 1, 2026 15:04
@varjolintu
varjolintu force-pushed the fix/macos_native_tmp_dir branch from 6b9cc9e to b567621 Compare July 3, 2026 16:04
@varjolintu
varjolintu force-pushed the fix/macos_native_tmp_dir branch from b567621 to ebd3c9f Compare July 3, 2026 16:05
@varjolintu
varjolintu marked this pull request as ready for review July 3, 2026 17:26
sameerbajaj added a commit to sameerbajaj/keepassxc that referenced this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Browser integration fails ("key exchange not successful") when KeePassXC and the proxy resolve different $TMPDIR socket paths

1 participant