pkg: reset umask for package scripts

It is unreasonable to assume that all package writers would except
to reset umask themselves. It's done currently in most packages,
but we had first issue of this kind recently, so better just reset
umask.
cute-signatures
Timo Teräs 2016-08-23 14:21:16 +03:00
parent ac0a9659d1
commit 0545fa0d35
1 changed files with 1 additions and 0 deletions

View File

@ -1019,6 +1019,7 @@ void apk_ipkg_run_script(struct apk_installed_package *ipkg,
if (pid == -1) if (pid == -1)
goto error; goto error;
if (pid == 0) { if (pid == 0) {
umask(0022);
if (fchdir(root_fd) == 0 && chroot(".") == 0) if (fchdir(root_fd) == 0 && chroot(".") == 0)
execve(fn, argv, environment); execve(fn, argv, environment);
exit(1); exit(1);