[diffoscope] 01/01: Recursively reset the permissions of temporary directories prior to deletion to ensure that non-writable permissions such as 0555 are removed and do not cause a traceback. (Closes: #891363)

Chris Lamb chris at chris-lamb.co.uk
Sat Mar 3 09:55:07 CET 2018


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 7345efa0b0db84069b28ee81fc3f9d8a5656cb0a
Author: Chris Lamb <lamby at debian.org>
Date:   Sat Mar 3 08:54:40 2018 +0000

    Recursively reset the permissions of temporary directories prior to deletion to ensure that non-writable permissions such as 0555 are removed and do not cause a traceback. (Closes: #891363)
---
 diffoscope/tempfiles.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/diffoscope/tempfiles.py b/diffoscope/tempfiles.py
index 50fa825..65adb2c 100644
--- a/diffoscope/tempfiles.py
+++ b/diffoscope/tempfiles.py
@@ -58,6 +58,13 @@ def clean_all_temp_files():
     logger.debug("Cleaning %d temporary directories", len(_DIRS))
 
     for x in _DIRS:
+        # Recursively reset the permissions of temporary directories prior to
+        # deletion to ensure that non-writable permissions such as 0555 are
+        # removed and do not cause a traceback. (#891363)
+        for dirpath, ys, _ in os.walk(x.name):
+            for y in ys:
+                os.chmod(os.path.join(dirpath, y), 0o777)
+
         try:
             x.cleanup()
         except FileNotFoundError:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list