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

[backport -> release/3.5.x] chore(cd): update file permission of kong.logrotate #12674

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build/package/nfpm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ contents:
dst: /lib/systemd/system/kong.service
- src: build/package/kong.logrotate
dst: /etc/kong/kong.logrotate
file_info:
mode: 0644

scripts:
postinstall: ./build/package/postinstall.sh
replaces:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: update file permission of kong.logrotate to 644
type: bugfix
scope: Core
8 changes: 5 additions & 3 deletions scripts/explain_manifest/explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ def __init__(self, path, relpath):

# use lstat to get the mode, uid, gid of the symlink itself
self.mode = os.lstat(path).st_mode
# unix style mode
self.file_mode = '0' + oct(self.mode & 0o777)[2:]
self.uid = os.lstat(path).st_uid
self.gid = os.lstat(path).st_gid

if not Path(path).is_symlink():
self.size = os.stat(path).st_size

self._lazy_evaluate_attrs.update({
"binary_content": lambda: open(path, "rb").read(),
"text_content": lambda: open(path, "rb").read().decode('utf-8'),
Expand Down Expand Up @@ -129,7 +131,7 @@ def __init__(self, path, relpath):
binary = lief.parse(path)
if not binary: # not an ELF file, malformed, etc
return

self.arch = binary.header.machine_type.name

for d in binary.dynamic_entries:
Expand All @@ -152,7 +154,7 @@ def __init__(self, path, relpath):
self.version_requirement[f.name] = [LooseVersion(
a.name) for a in f.get_auxiliary_symbols()]
self.version_requirement[f.name].sort()

self._lazy_evaluate_attrs.update({
"exported_symbols": self.get_exported_symbols,
"imported_symbols": self.get_imported_symbols,
Expand Down
2 changes: 2 additions & 0 deletions scripts/explain_manifest/suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def common_suites(expect, libxcrypt_no_obsolete_api: bool = False):

expect("/etc/kong/kong.logrotate", "includes logrotate config").exists()

expect("/etc/kong/kong.logrotate", "logrotate config should have 0644 permissions").file_mode.equals("0644")

expect("/usr/local/kong/include/openssl/**.h", "includes OpenSSL headers").exists()

# binary correctness
Expand Down
Loading