[Swift-devel] command line ssh provider...

Jonathan Monette jonmon at mcs.anl.gov
Tue Jan 17 17:08:16 CST 2012


On Jan 17, 2012, at 5:05 PM, Mihael Hategan wrote:

> On Tue, 2012-01-17 at 14:44 -0800, Mihael Hategan wrote:
>> That seems to be a limitation of Runtime.exec(). If you don't supply and
>> env array, the subprocess inherits the environment from the parent. If
>> you do, it overrides it (including unsetting the unspecified variables).
>> 
>> Traditionally, this was the only way of starting a subprocess. Starting
>> with 1.5, ProcessBuilder was added, which offers a solution to this
>> problem. I will change the code to use that.
> 
> Though now that I think about it, this wasn't strictly necessary since
> for the ssh-cl provider, the task environment variables shouldn't be
> passed to the ssh subprocess (they go on the command line of the ssh
> shell).
What do you mean by this?  When I saw the command line of the ssh shell no environment variables are being passed.

> 
> Anyway, I changed the code to use ProcessBuilder. This at least fixes
> similar issues with the local provider (and also ssh-cl).
> 
Thanks.  I'll give it a try again to see if it allows me to set the environment variable

> Mihael
> 




More information about the Swift-devel mailing list