Fix permissions - #7
Open
Dimariqe wants to merge 2 commits into
Open
Conversation
Changed strconv.ParseInt calls for KEY_PERM and CERT_PERM to use base 8 and 32-bit size, ensuring correct parsing of octal file permission values from environment variables.
Adds explicit os.Chmod calls after writing key, cert, and pfx files to guarantee correct file permissions are set. Improves reliability of permission handling and updates log messages to reflect permission changes.
Owner
|
I appreciate these efforts and I am not ignoring them. I am in the middle of doing a large refactor to try and un-spaghetti a lot of this code and will work on matching these PRs up after. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request improves the handling of file permissions for certificate and key files in the application, ensuring permissions are set correctly and consistently. The changes primarily affect how permissions are parsed from environment variables and how file permissions are applied during file creation and updates.
File Permission Handling Improvements
KEY_PERMandCERT_PERMenvironment variables to use base 8 (octal) and a 32-bit integer size for correct permission values inpkg/main/config.go. [1] [2]Explicit Permission Setting After File Writes
updateCertFilesAndRestartContainers(inpkg/main/update_common.go) to explicitly set file permissions usingos.Chmodafter writing key, certificate, and PFX files. This ensures permissions are correctly applied, even if the underlying OS or filesystem does not honor the permissions set during file creation. [1] [2] [3]