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

Set the mode on saved files to a less surprising 644 instead of 777. #154

Merged

Conversation

scgtrp
Copy link
Contributor

@scgtrp scgtrp commented Mar 29, 2022

Also, chmod -x src/document.cpp. My headcanon is that you wrote this file with rehex itself.

Also, chmod -x src/document.cpp. My headcanon is that you wrote this file with rehex itself.
@scgtrp
Copy link
Contributor Author

scgtrp commented Mar 29, 2022

n.b. in case it wasn't obvious: the mode argument to open() is only used when creating new files, so this does not change the permissions on existing executable files, nor does the current implementation make edited files executable upon saving over them.

My rationale here is that it's highly unlikely that a user creating a new file in a hex editor (on any system more modern than DOS) intended it to be a valid executable for their host system.

@solemnwarning solemnwarning merged commit aaf10f6 into solemnwarning:master Mar 29, 2022
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.

2 participants