Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve permission bits on updateself #76

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexkeizer
Copy link

@alexkeizer alexkeizer commented Jan 1, 2023

Tries to preserve any changed permissions on the bitwarden.sh script when updating it (with updateself).
For example, I like to have my instances bitwarden.sh to be group executable, so this change would keep it group executable after updates.

One thing is that I'm not sure whether the --reference option to chmod is specific to the GNU implementation. Is that is a concern?

@@ -60,6 +60,9 @@ echo ""
function downloadSelf() {
if curl -L -s -w "http_code %{http_code}" -o $SCRIPT_PATH.1 $BITWARDEN_SCRIPT_URL | grep -q "^http_code 20[0-9]"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normal method of controlling permissions is to specifically set them, not to merely copy them and rely on the history of permissions of the previous deployment. Relying on history that is out of the control of the deployment tool creates uncertainty of deployment, a dangerous practice for a security tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants