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

permissions: allow to set custom permission bits on log files #3

Merged
merged 4 commits into from
Nov 29, 2022

Conversation

tixxdz
Copy link
Member

@tixxdz tixxdz commented Nov 29, 2022

This adds the FileMode field to allow setting custom permission bits
on log files. We have use cases where the logs should be viewed only
by privileged.

This custom FileMode is used only if set by callers. It does not
perform validation on the passed permissions and code is kept minimal.
Callers should know what to pass.

Signed-off-by: Djalal Harouni tixxdz@gmail.com

Fix test by appending tmpSuffix as the hooked chown inside
compressLogFile() is called on a tmp file, that is to be saved in
the fakefs map.

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
This adds the FileMode field to allow setting custom permission bits
on log files. We have use cases where the logs should be viewed only
by privileged.

This custom FileMode is used only if set by callers. It does not
perform validation on the passed permissions and code is kept minimal.
Callers should know what to pass.

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
Adds:
 - Mutliple tests to check if testMaintainMode() maintains the
   mode and that rotated logs do also have the right permissions.
 - TestFileModeIsSet() to assert fileModeIsSet()

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
This tests testCompressMaintainMode() with multiple custom valid
permissions, and non valid or non set ones, to ensure that we
fallback to default mode.

Signed-off-by: Djalal Harouni <tixxdz@gmail.com>
Copy link
Collaborator

@chancez chancez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. LGTM.

@chancez chancez merged commit 7bbbe59 into cilium:master Nov 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
2 participants