<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 10, 2014 at 6:13 AM, Barrie Stott <span dir="ltr">&lt;<a href="mailto:zen146410@zen.co.uk" target="_blank">zen146410@zen.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">Wouldn&#39;t the stopping of function export from MacPorts&#39; bash be a big restriction on bash use. For example, I want to be able to type &quot;mvim&quot;, with or without parameters, to open a MacVim window. At present, I get the error:<br>
&quot;/bin/sh: line 8: `BASH_FUNC_usenosql%%&#39;: not a valid identifier&quot;. Would not the prevention of function export prevent me from opening a MacVim window?</div></blockquote></div><br>Nope. This is still the Shellshock attack vector, just with a little protection around it: bash is opportunistically sucking in functions from the environment and blindly eval-ing them, to no purpose in this case. If anything, defining the wrong functions could break MacVim in very obscure ways, instead of this obvious one. User functions should not be visible to system level shell scripts; they should be deterministic, not randomly modifiable by the user&#39;s environment.</div><div class="gmail_extra"><br></div><div class="gmail_extra">The correct thing to do is, and always has been, to define functions in your dotfiles and not have them affect arbitrary shells, only interactive-mode ones. MacVim in particular knows how --- and when --- to run the shell in this mode and get your functions. This is why the Debian/FreeBSD patch is the correct one, but Bash upstream and Red Hat refuse to do the right thing in this case... and this means, among other things, that Shellshock-patched bash is not compatible with unpatched bash if you define shell fucntions, which is the source of your immediate problem.</div><div class="gmail_extra"><div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>