[pacman-dev,1/1] makepkg: set umask 0022 again after syncing deps

Message ID f134c108-bf24-5d9f-40ab-39c7ae826a1e@mailbox.org
State Accepted, archived
Headers show
Series [pacman-dev,1/1] makepkg: set umask 0022 again after syncing deps | expand

Commit Message

neindochoh.kraut+archmail@mailbox.org Feb. 25, 2018, 11:10 p.m. UTC
From: Felix Glaser <neindochoh.kraut@mailbox.org>

makepkg configures the umask 0022 as a sane default for building
packages. After installing dependencies, it sources `/etc/profile`
again. If the user configured a umask other than Arch's default of
0022 (or 022) in `/etc/profile`, this sane default is now gone and
needs to be set again.
---
 scripts/makepkg.sh.in | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Allan McRae March 14, 2018, 2:51 a.m. UTC | #1
On 26/02/18 09:10, neindochoh.kraut+archmail@mailbox.org wrote:
> From: Felix Glaser <neindochoh.kraut@mailbox.org>
> 
> makepkg configures the umask 0022 as a sane default for building
> packages. After installing dependencies, it sources `/etc/profile`
> again. If the user configured a umask other than Arch's default of
> 0022 (or 022) in `/etc/profile`, this sane default is now gone and
> needs to be set again.
> ---
>  scripts/makepkg.sh.in | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 63b6c3e1..3bd018f2 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -279,6 +279,10 @@ handle_deps() {
>  	shopt -u extglob
>  	source /etc/profile &>/dev/null
>  	eval "$shellopts"
> +	
> +	# umask might have been changed in /etc/profile
> +	# ensure that sane default is set again
> +	umask 0022
> 
>  	return $R_DEPS_SATISFIED
>  }
> 

I'm sure we handled this at some stage...

Applied,
A

Patch

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 63b6c3e1..3bd018f2 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -279,6 +279,10 @@  handle_deps() {
 	shopt -u extglob
 	source /etc/profile &>/dev/null
 	eval "$shellopts"
+	
+	# umask might have been changed in /etc/profile
+	# ensure that sane default is set again
+	umask 0022

 	return $R_DEPS_SATISFIED
 }