-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix SafeWriteConfig #450
Fix SafeWriteConfig #450
Conversation
If the config file does not exist and the force flag is not set, OpenFile would not use O_CREATE flag, causing viper to fail with error "File not exist" and to not create the config file. This patch changes the behavior of writeConfig() so that if force is set to false, OpenFile will use O_EXCL flag, thus failing if the file already exists or creating a new file otherwise. Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
Can someone please review this pull request? |
This patch works for me, and the default behavior is indeed broken. |
Given that this is a very small PR and that it is waiting for review for over one year, I believe this project has sadly been abandoned. |
The latest commit is just 12 days ago, so the project seems somewhat alive. That this doesn't work as documented is disheartening. |
Ping one of the frequent commiter ( |
@bep I'm sorry for pinging you directly, would you be able to merge this PR so as to fix this function? |
@sagikazarmark Could you possibly merge this when you have a chance? I've noticed you merging things recently, and know that bep and spf13 are not currently responding. |
Finally! \o/ |
Celebration! |
So when can we expect a new release containing this PR? |
If the config file does not exist and the force flag is not set,
OpenFile would not use O_CREATE flag, causing viper to fail with
error "File not exist" and to not create the config file.
This patch changes the behavior of writeConfig() so that if force is set
to false, OpenFile will use O_EXCL flag, thus failing if the file
already exists or creating a new file otherwise.
Signed-off-by: Rodrigo Chiossi rodrigo.chiossi@intel.com