Skip to content
Permalink
Browse files Browse the repository at this point in the history
[sosreport] fix archive permissions regression
Restore the umask save/restore around archive creation and ensure
the effective umask is 077 at the time of archive creation.

Fixes #425.

Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
  • Loading branch information
bmr-cymru committed Oct 30, 2014
1 parent 48a99c9 commit d7759d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sos/sosreport.py
Expand Up @@ -1327,6 +1327,7 @@ def final_work(self):
self._finish_logging()
# package up the results for the support organization
if not self.opts.build:
old_umask = os.umask(0o077)
if not self.opts.quiet:
print(_("Creating compressed archive..."))
# compression could fail for a number of reasons
Expand All @@ -1345,6 +1346,8 @@ def final_work(self):
raise
else:
return False
finally:
os.umask(old_umask)
else:
final_filename = self.archive.get_archive_path()
self.policy.display_results(final_filename, build=self.opts.build)
Expand Down

0 comments on commit d7759d3

Please sign in to comment.