-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Issue #7500: Use update-alternatives instead of symlinks to executable if available. Where possible, use `update-alternatives` instead to avoid hardcoding links in Linux. This will allow for downstream users to specify paths to their own executables with higher priority if they wish. Backward compatibility is preserved by still using the symlinking route if the command `update-alternatives` is not available.
- Loading branch information
Showing
4 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
"app-builder-lib": patch | ||
--- | ||
|
||
Use `update-alternatives` when available. | ||
|
||
## What is changing? | ||
Test for `update-alternatives` in DEB based installations and use this whenever possible. | ||
In this way, middleware and downstream projects and users can specify binaries of their | ||
own priority that would override this programs' configured executable. | ||
|
||
## Why is this changing? | ||
Personally, I don't want apps running as myself or a privileged user in my system. | ||
For this. I have a shell that is executed to drop permissions first, then execute the | ||
selected software. | ||
Electron apps don't conform to this since they link directly rather than using a linking | ||
system. | ||
|
||
This change is to ensure that system is used before resorting to direct links. | ||
|
||
## How should this be consumed? | ||
Simply update as normal and this package will switch to using update-alternatives. | ||
This will allow middleware and end-users to better control the active executable. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Delete the link to the binary | ||
rm -f '/usr/bin/${executable}' | ||
if type update-alternatives >/dev/null 2>&1; then | ||
update-alternatives --remove '${executable}' '/usr/bin/${executable}' | ||
else | ||
rm -f '/usr/bin/${executable}' | ||
fi |
This file contains 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