From 2cf0186dbd5e7c9183a610f8d0e85c57de49a1e9 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Fri, 27 Oct 2006 00:50:26 +0000 Subject: [PATCH] Bug 162018 - try setting ssh environment through jsch --- .../rse/services/ssh/shell/SshHostShell.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java index 3b4b734e8b7..4f5c4ee6f15 100644 --- a/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java +++ b/rse/plugins/org.eclipse.rse.services.ssh/src/org/eclipse/rse/services/ssh/shell/SshHostShell.java @@ -20,11 +20,13 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; +import java.util.Hashtable; import java.util.regex.Pattern; import org.eclipse.core.runtime.IProgressMonitor; import com.jcraft.jsch.Channel; +import com.jcraft.jsch.ChannelShell; import com.jcraft.jsch.Session; import org.eclipse.rse.services.shells.AbstractHostShell; @@ -55,6 +57,24 @@ public class SshHostShell extends AbstractHostShell implements IHostShell { //if(fChannel instanceof ChannelShell) { // ((ChannelShell)fChannel).setPty(false); //} + + //Try to set the user envionment. On most sshd configurations, this will + //not work since in sshd_config, PermitUserEnvironment and AcceptEnv + //settings are disabled. Still, it's worth a try. + if (environment!=null && environment.length>0 && fChannel instanceof ChannelShell) { + Hashtable envTable=new Hashtable(); + for(int i=0; i0 && idx