fix(config): resolve symlinks when locating config dir#985
Merged
Conversation
os.Executable() can return a symlink path; using filepath.Dir on it anchors config beside the symlink rather than the real binary. On macOS this surfaces when /usr/local/bin/dmt-console symlinks into /usr/local/device-management-toolkit/console: the app tries to mkdir /usr/local/bin/config and fails with EACCES.
madhavilosetty-intel
approved these changes
May 18, 2026
graikhel-intel
approved these changes
May 18, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates default config path resolution so the config directory is anchored next to the real executable when the launched binary path is a symlink.
Changes:
- Resolves symlinks returned by
os.Executable()before deriving the default config path. - Falls back to the original executable path if symlink evaluation fails.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #985 +/- ##
=======================================
Coverage 41.40% 41.41%
=======================================
Files 134 134
Lines 12319 12321 +2
=======================================
+ Hits 5101 5103 +2
Misses 6672 6672
Partials 546 546 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 1.26.6 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
os.Executable() can return a symlink path; using filepath.Dir on it anchors config beside the symlink rather than the real binary. On macOS this surfaces when /usr/local/bin/dmt-console symlinks into /usr/local/device-management-toolkit/console: the app tries to mkdir /usr/local/bin/config and fails with EACCES.