Ensure osxphotos is responsible process by launching disclaimed #1587
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.
When osxphotos accesses the Photos library the macOS TCC system will check the responsible process for permission to access the library, and if none has been given, the user is asked to give permission via a dialog.
Normally, when an executable is launched from Terminal or iTerm, the responsible app is the terminal app itself, not osxphotos, which means the user needs to give the terminal app the permission to access the Photos library, effectively giving any command executed in the terminal at any point access to the library.
Worse yet, if the user has on some prior occasion denied the terminal app this access, then osxphotos will not get the needed access either, which has been a source for confusion and failures for users.
We now re-launch osxphotos at startup with a special spawn flag that ensures that osxphotos is the responsible process. This will result in TCC dialogs and permissions specific to osxphotos.