]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Use umask to control new file/directory permissions 1738/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 5 Aug 2023 15:14:08 +0000 (17:14 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 6 Aug 2023 07:43:53 +0000 (09:43 +0200)
commit0a748ec729924b5582bf73fa7578099da368dd97
treeb018faee683a4f4490eba42a7cf8c90f546b5d7d
parent02f5a39d55679e6fd56d5d1aacc029b1d6018648
Use umask to control new file/directory permissions

The primary reason to use umask is that python's mkdir() functions
and methods only apply the given mode to the final component of the
path, and not to its parent paths if parents=True is specified. Aside
from that, it's also just nicer to make sure the file/directory has
the right mode from the start instead of having to modify it later with
chmod().

We also clean up permissions in general, making sure we set umask
explicitly whenever we create a file or directory in state.root and
remove explicit permissions when we're not writing files in state.root.
mkosi/__init__.py
mkosi/distributions/debian.py
mkosi/install.py
mkosi/installer/apt.py
mkosi/installer/pacman.py
mkosi/mounts.py
mkosi/qemu.py
mkosi/state.py
mkosi/tree.py
mkosi/util.py
tests/test_parse_load_args.py