Skip to content

Commit

Permalink
chore(cd): update file permission of kong.logrotate (#12629)
Browse files Browse the repository at this point in the history
origin file permission of kong.logrotate is 664, but the correct file permission is 644

Fix: https://konghq.atlassian.net/browse/FTI-5756

---------

Signed-off-by: tzssangglass <[email protected]>
  • Loading branch information
tzssangglass committed Mar 1, 2024
1 parent 1984174 commit 743cefd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
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

0 comments on commit 743cefd

Please sign in to comment.