Skip to content

Commit

Permalink
[clean] Respect permissions of sanitised files
Browse files Browse the repository at this point in the history
When copying files we applied a substitution in, we must replace just
original file content (shutil.copyfile) and not also its stat data
(shutil.copy).

Resolves: #3292

Signed-off-by: Pavel Moravec <[email protected]>
  • Loading branch information
pmoravec committed Jun 28, 2023
1 parent 2aec599 commit 719d750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sos/cleaner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def obfuscate_file(self, filename, short_name=None, arc_name=None):
% (short_name, err), caller=arc_name)
tfile.seek(0)
if subs:
shutil.copy(tfile.name, filename)
shutil.copyfile(tfile.name, filename)
tfile.close()

_ob_short_name = self.obfuscate_string(short_name.split('/')[-1])
Expand Down

0 comments on commit 719d750

Please sign in to comment.