Browse Source

Restrict permissions on patching logfiles

This update sets restricted permissions on patching logfiles.

Change-Id: I922c6d278dc747c186288a15d12369bbddb40bea
Partial-Bug: 1836632
Signed-off-by: Don Penney <don.penney@windriver.com>
changes/66/671366/1
Don Penney 3 years ago
parent
commit
c001620050
  1. 2
      cgcs-patch/centos/build_srpm.data
  2. 8
      cgcs-patch/cgcs-patch/cgcs_patch/patch_functions.py

2
cgcs-patch/centos/build_srpm.data

@ -1 +1 @@
TIS_PATCH_VER=27
TIS_PATCH_VER=28

8
cgcs-patch/cgcs-patch/cgcs_patch/patch_functions.py

@ -83,11 +83,19 @@ def configure_logging(logtofile=True, level=logging.INFO):
main_log_handler = logging.FileHandler(logfile)
main_log_handler.setFormatter(formatter)
LOG.addHandler(main_log_handler)
try:
os.chmod(logfile, 0o640)
except Exception:
pass
auditLOG.setLevel(level)
api_log_handler = logging.FileHandler(apilogfile)
api_log_handler.setFormatter(formatter)
auditLOG.addHandler(api_log_handler)
try:
os.chmod(apilogfile, 0o640)
except Exception:
pass
# Log uncaught exceptions to file
sys.excepthook = handle_exception

Loading…
Cancel
Save