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.
This commit is contained in:
Jochen Sprickerhof 2017-11-14 22:02:56 +01:00 committed by Oliver Smith
parent e2df68a588
commit c50ecd7c5a
1 changed files with 1 additions and 0 deletions

View File

@ -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: