control file authority from 600 to 400

This commit is contained in:
jiangshuqiang 2021-06-09 16:52:57 +08:00
parent 0fce707dd9
commit 0602a3f160
2 changed files with 7 additions and 2 deletions

View File

@ -5,4 +5,5 @@ approvers:
- zlq2020
- stsuteng
- c_34
- liangchenghui
- liangchenghui
- yelihua

View File

@ -27,7 +27,7 @@ from ..._c_expression import EventWriter_
from ._summary_adapter import package_init_event
FREE_DISK_SPACE_TIMES = 32
FILE_MODE = 0o600
FILE_MODE = 0o400
class BaseWriter:
@ -77,6 +77,10 @@ class BaseWriter:
def close(self):
"""Close the writer."""
try:
os.chmod(self._filepath, FILE_MODE)
except FileNotFoundError:
pass
if self._writer is not None:
self._writer.Shut()