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:
parent
e2df68a588
commit
c50ecd7c5a
|
@ -35,6 +35,7 @@ def main():
|
||||||
# Parse arguments, set up logging
|
# Parse arguments, set up logging
|
||||||
args = parse.arguments()
|
args = parse.arguments()
|
||||||
pmb_logging.init(args)
|
pmb_logging.init(args)
|
||||||
|
os.umask(0o22)
|
||||||
|
|
||||||
# Wrap everything to display nice error messages
|
# Wrap everything to display nice error messages
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue