From: Arusekk Date: Sun, 24 Sep 2023 09:16:12 +0000 (+0200) Subject: user_manager: Respect user umask and use less code X-Git-Tag: 1.4.2~9 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/waydroid.git/commitdiff_plain/11dabde2b39a6578b8d1a91d4651cfee4b5eaec8?hp=11dabde2b39a6578b8d1a91d4651cfee4b5eaec8 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. ---