Merged
Conversation
Changing log permissions to 0640 would allow the administrator to set sticky group on the log directory, and for a selected log-users (in a specific group) without root-permissions to read the log files. Fixes containers#539 Signed-off-by: Jindrich Novy <jnovy@redhat.com>
Collaborator
Author
|
@haircommander PTAL |
src/ctr_logging.c
Outdated
| struct timespec ts; | ||
| /* Initialize timestamp variables with sensible defaults. */ | ||
| struct timespec ts = {.tv_sec = 0, .tv_nsec = 0}; | ||
| struct tm current_tm = {.tm_year = 70, .tm_mon = 0, .tm_mday = 1, .tm_hour = 0, .tm_min = 0, .tm_sec = 0, .tm_gmtoff = 0}; |
Collaborator
There was a problem hiding this comment.
if we're setting all of these when we fail anyway, do we need to initialize? we could leave this struct timespec ts; and then set the default if it fails
Collaborator
Author
|
Fair enough - there's no need to set it twice - just left the zero initialization @haircommander PTAL again. |
Collaborator
|
can you run |
If, for whatever reason, quering current time fails then the whole log message is dropped. This PR assures the log message is not lost and the output is done with the default timestamp. Signed-off-by: Jindrich Novy <jnovy@redhat.com>
Collaborator
Author
|
Done @haircommander |
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.
Make timestamp generation never fail.
If, for whatever reason, quering current time fails then the whole log message is dropped.
This PR assures the log message is not lost and the output is done with the default timestamp.