From c50ecd7c5a1995c58f52bde188d773a093ada208 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Tue, 14 Nov 2017 22:02:56 +0100 Subject: [PATCH] Unset restrictive umask before creating files (#908) If a user has a restrictive umask (for example 0077) set, it will be inherited to sudo and thus files created with sudo where not readable by the normal user. In that case, when setting up a new chroot, the etc/apk/repositories file would have umask 600 and a os.path.exists() (in update_repository_list) would return false. Setting the umask to 022 (octal) first, results in world readable files and directories, so the user running `./pmbootstrap.py install` can read them. --- pmb/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pmb/__init__.py b/pmb/__init__.py index 3d4b32db..2ee0f121 100644 --- a/pmb/__init__.py +++ b/pmb/__init__.py @@ -35,6 +35,7 @@ def main(): # Parse arguments, set up logging args = parse.arguments() pmb_logging.init(args) + os.umask(0o22) # Wrap everything to display nice error messages try: