Update Homebrew upgradeable table implementation #1847
Merged
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.
There was an issue raised with this table where the implementation didn't quite make sense as it attempts to run Brew for multiple users. Homebrew in nature is owned and ran by a single non-root user.
I believe the customer who reported the issue has a good suggestion on detecting the owner of the binary and using that user as the running user context. Therefore I've updated the table implementation to do just this. There is a possible question of if we want to put this into the allowedcmd method, but I assumed we don't want to put operations like this in that area of the codebase.
I haven't removed the uid column from the table, so this change will not break anything for the Homebrew packages up-to-date check while I refactor that to not join against the users table.
I've also added the MacOS Intel Homebrew binary path.