mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] ptxdist: unset: env: remove func prefix/suffix added by shellshock
@ 2014-10-12  5:09 jon
  2014-10-14  5:35 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: jon @ 2014-10-12  5:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Jon Ringle

From: Jon Ringle <jringle@gridpoint.com>

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
---
 bin/ptxdist | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/ptxdist b/bin/ptxdist
index f823ebe..10fc492 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2146,8 +2146,15 @@ setup_env() {
 	whitelist="${*}"
 	whitelist="${whitelist:+|}${whitelist// /|}"
 
+	ptx_test_func_env_name(){ :; }
+	export -f ptx_test_func_env_name
+	func_env_name=$(/usr/bin/env | grep ptx_test_func_env_name|cut -f1 -d=)
+	func_prefix=${func_env_name/ptx_test_func_env_name*}
+	func_suffix=${func_env_name/*ptx_test_func_env_name}
+
 	unset $(/usr/bin/env | \
 		sed -n -e "s/^\([^=[:space:]]\+\)=.*$/\1/p" | \
+		sed -e "s/^${func_prefix}\(.*\)${func_suffix}$/\1/g" | \
 		egrep -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$" )
 
 	######## the environment is clean now ########
-- 
1.8.5.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] ptxdist: unset: env: remove func prefix/suffix added by shellshock
  2014-10-12  5:09 [ptxdist] [PATCH] ptxdist: unset: env: remove func prefix/suffix added by shellshock jon
@ 2014-10-14  5:35 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2014-10-14  5:35 UTC (permalink / raw)
  To: ptxdist

On Sun, Oct 12, 2014 at 01:09:34AM -0400, jon@ringle.org wrote:
> From: Jon Ringle <jringle@gridpoint.com>
> 

I've pushed a different patch that uses the builtin 'export' to get the
list. My hope is, that it will hide any changes like this in the future.

Michael

> Signed-off-by: Jon Ringle <jringle@gridpoint.com>
> ---
>  bin/ptxdist | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/bin/ptxdist b/bin/ptxdist
> index f823ebe..10fc492 100755
> --- a/bin/ptxdist
> +++ b/bin/ptxdist
> @@ -2146,8 +2146,15 @@ setup_env() {
>  	whitelist="${*}"
>  	whitelist="${whitelist:+|}${whitelist// /|}"
>  
> +	ptx_test_func_env_name(){ :; }
> +	export -f ptx_test_func_env_name
> +	func_env_name=$(/usr/bin/env | grep ptx_test_func_env_name|cut -f1 -d=)
> +	func_prefix=${func_env_name/ptx_test_func_env_name*}
> +	func_suffix=${func_env_name/*ptx_test_func_env_name}
> +
>  	unset $(/usr/bin/env | \
>  		sed -n -e "s/^\([^=[:space:]]\+\)=.*$/\1/p" | \
> +		sed -e "s/^${func_prefix}\(.*\)${func_suffix}$/\1/g" | \
>  		egrep -v "^(PTXDIST_PTXRC|PTX_AUTOBUILD_DESTDIR|CCACHE_.*|PWD|HOME|USER|PATH|TERM|COLUMNS|LINES|DISPLAY|TMPDIR|http_proxy|https_proxy|ftp_proxy|no_proxy${whitelist})$" )
>  
>  	######## the environment is clean now ########
> -- 
> 1.8.5.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-10-14  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-12  5:09 [ptxdist] [PATCH] ptxdist: unset: env: remove func prefix/suffix added by shellshock jon
2014-10-14  5:35 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox