Package: command-not-found
Version: 18.04.5-1
Followup-For: Bug #916783
Tags: patch

This patch seems to be working for me:

--- a/CommandNotFound/db/creator.py
+++ b/CommandNotFound/db/creator.py
@@ -88,6 +88,7 @@ class DbCreator:
                 "%s does not require an update (inputs unchanged)", dbname)
             return
         tmpdb = dbname+".tmp"
+        oldmask = os.umask(0o022)
         with sqlite3.connect(tmpdb) as con:
             con.executescript(create_db_sql)
             self._fill_commands(con)
@@ -98,6 +99,7 @@ class DbCreator:
         # add new metadata
         with open(metadata_file, "w") as fp:
             json.dump(self._calc_input_metadata(), fp)
+        os.umask(oldmask)
     def _db_update_needed(self, metadata_file):
         if not os.path.exists(metadata_file):
             return True

I'm not sure if it's the correct way to solve this.

Regards,
Adam

Attachment: signature.asc
Description: PGP signature

Reply via email to