mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-26 11:28:51 -06:00
fix: give data tree files the umask mode
Verified bytes reach their place through one helper that sets the mode a plain open() gives and clears a read-only attribute. A data tree member skipped both and landed 0600, unreadable by the emulator after a sudo install. The expected digests of an entry are read by one function.
This commit is contained in:
1 parent
83b1976903
commit
c41fb9e609
10 files changed
+66
-48
No files matched your search
@@ -192,6 +192,17 @@ class InstalledFileModes(unittest.TestCase):
|
||||
finally:
|
||||
os.umask(umask)
|
||||
|
||||
def test_a_data_tree_member_too(self):
|
||||
data = b"cheat"
|
||||
meta = {"size": len(data), "sha1": hashlib.sha1(data).hexdigest()}
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
target = Path(tmp) / "sub" / "file.ini"
|
||||
target.parent.mkdir()
|
||||
status, _ = install._install_data_member(
|
||||
lambda: io.BytesIO(data), meta, target, Path(tmp), "data", "file.ini", [])
|
||||
self.assertEqual(status, "installed")
|
||||
self.assertEqual(target.stat().st_mode & 0o777, 0o666 & ~install._UMASK)
|
||||
|
||||
|
||||
class ProgramsAreMarked(unittest.TestCase):
|
||||
"""The manifest says which files are programs, read from their header:
|
||||
|
||||
Reference in new issue
Block a user