summaryrefslogtreecommitdiff
path: root/src/package.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-08-23 14:21:16 +0300
committerTimo Teräs <timo.teras@iki.fi>2016-08-23 14:21:16 +0300
commit0545fa0d355416e8a0144a2991fe7fe5490e9551 (patch)
tree9944abdde0ebca3a054e16aedd87dd23b6d091d1 /src/package.c
parentac0a9659d1c86e9c0b4234a16486e084bcb0a555 (diff)
downloadapk-tools-0545fa0d355416e8a0144a2991fe7fe5490e9551.tar.gz
apk-tools-0545fa0d355416e8a0144a2991fe7fe5490e9551.tar.bz2
apk-tools-0545fa0d355416e8a0144a2991fe7fe5490e9551.tar.xz
apk-tools-0545fa0d355416e8a0144a2991fe7fe5490e9551.zip
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.
Diffstat (limited to 'src/package.c')
-rw-r--r--src/package.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/package.c b/src/package.c
index d6eff07..c6e8e48 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1019,6 +1019,7 @@ void apk_ipkg_run_script(struct apk_installed_package *ipkg,
if (pid == -1)
goto error;
if (pid == 0) {
+ umask(0022);
if (fchdir(root_fd) == 0 && chroot(".") == 0)
execve(fn, argv, environment);
exit(1);