it does not matter if we chown/restorecon before or after the rename,
but the logging message looks better this way: instead of fixing the
.tmp files, we are updating the attributes of the dest files w/o
.${pid}.tmp extension.
Signed-off-by: Kefu Chai <kchai@redhat.com>
with open(tmp, 'wb') as tmp_file:
tmp_file.write(text.encode('utf-8') + b'\n')
os.fsync(tmp_file.fileno())
- path_set_context(tmp)
os.rename(tmp, path)
+ path_set_context(path)
def init_get():