From: jon@ringle.org
To: ptxdist@pengutronix.de
Cc: Jon Ringle <jringle@gridpoint.com>
Subject: [ptxdist] [PATCH] ptxdist: unset: env: remove func prefix/suffix added by shellshock
Date: Sun, 12 Oct 2014 01:09:34 -0400 [thread overview]
Message-ID: <1413090574-30326-1-git-send-email-jon@ringle.org> (raw)
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
next reply other threads:[~2014-10-12 5:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-12 5:09 jon [this message]
2014-10-14 5:35 ` Michael Olbrich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413090574-30326-1-git-send-email-jon@ringle.org \
--to=jon@ringle.org \
--cc=jringle@gridpoint.com \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox