fix: resolve current account home directory - #233
Conversation
|
@viatearz can you provide some feedback? I can't tell if this is entirely necessary, i.e. why not just utilize |
@TheMoonThatRises I also prefer the simpler solution, as it will be easier to maintain. But I would choose to strip the path at the first occurrence of |
Should we reply on the uncertain behavior of NSHomeDirectoryForUser which causes the issue in the first place? |
|
From what I gather |
|
@TheMoonThatRises I think the |
|
Is it possible for the code to be simplified though? Theres a lot of memory operations for retrieving the home path |
|
@ohaiibuzzle can I get your opinions on this? |
|
@Max-Sum could you provide an instance of an app running into issues without this? Please keep in mind that we do make use of the Apple App Sandbox, where If your app requires this, it's made wrong and broke Apple's rules. https://developer.apple.com/documentation/foundation/nshomedirectory()?language=objc |
Previous implementation uses /Users, it already break out from the sandbox container. This patch does not introduce this behavior. All it does, together with #221, is just fixing crashes and unfunctional keymapping when the the home directory path is changed. As far as the sandbox design, I have no opinion over this. |
NSHomeDirectoryForUser could return a container path instead of user directory.
Use getpwuid_r(getuid()) instead.
And also fix the hard-coded path in keymapping.
Originally posted by @viatearz in #221 (comment)