Updates to configuration file parsing#383
Merged
cgzones merged 11 commits intologrotate:masterfrom Apr 30, 2021
Merged
Conversation
The man page states Values are separated from directives by whitespace and/or an optional =. But logrotate does accept no separator, like rotate7 Log those occurrences with a normal severity, as this usage is not intended.
isolateWord() only fails on OOM and EOF.
Consider the following configuration:
olddir /var/log/foo
noolddir
Do not leak the memory of the initial olddir path.
Allow a tab in between the option keyword and its value, like
dateformat\t.%Y%m%d
Currently the tab would be included in the format string, leading to
tabs in rotated files.
Also drop unnecessary continue block, since this is the default next
action.
Reiterating the loop is the default next action.
Fail on a parse error of a required option value of the directives include, extension, addextension, rotate, start, minage, maxage, shredcycles and su. Failing is better than silently skipping a directive and running with an undesired configuration.
Make it more visible. No one sees debug logs if nothing fails.
Increase severity from debug to normal in case the configuration has a potential dangerous file mode; make it more visible. No one sees debug logs if nothing fails.
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.
No description provided.