]> glassweightruler.freedombox.rocks Git - waydroid.git/commit
user_manager: Respect user umask and use less code
authorArusekk <arek_koz@o2.pl>
Sun, 24 Sep 2023 09:16:12 +0000 (11:16 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Fri, 29 Sep 2023 17:45:59 +0000 (19:45 +0200)
commit11dabde2b39a6578b8d1a91d4651cfee4b5eaec8
treeabad4757736dda1060237cf1480a9a183026c6dc
parentd0ca6a32a9eded6e2fbc7dc1fe2f70b503dde8dc
user_manager: Respect user umask and use less code

chmod(0o644) is no longer necessary after umask(0) removal in
da4772c4e54467920d642e2a792c5d16d3b7bf33 ("tools: Remove umask 0")
as the default umask is 0o022, but if the umask is stricter (e.g.
0o027), then the user would expect the created files to be 0o640.
Creating the directory with the correct mode already also avoids
potential race conditions on systems with insufficient umask.

While at it, also use templating strings for .desktop file creation to
simplify the logic and split the template from the actual code a bit.
tools/services/user_manager.py