[
https://issues.apache.org/jira/browse/SSHD-1273?focusedWorklogId=787179&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-787179
]
ASF GitHub Bot logged work on SSHD-1273:
----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Jul/22 17:34
Start Date: 01/Jul/22 17:34
Worklog Time Spent: 10m
Work Description: andreid911 commented on code in PR #230:
URL: https://github.com/apache/mina-sshd/pull/230#discussion_r912141534
##########
sshd-core/src/main/java/org/apache/sshd/client/channel/ChannelSession.java:
##########
@@ -48,6 +53,7 @@ public class ChannelSession extends AbstractClientChannel {
private CloseableExecutorService pumperService;
private Future<?> pumper;
+ private Map<String, Object> env = new LinkedHashMap<>();
Review Comment:
agree, no reasons to leave it mutable. Fixed
##########
sshd-core/src/main/java/org/apache/sshd/client/channel/PtyCapableChannelSession.java:
##########
@@ -200,21 +199,6 @@ public void setPtyModes(Map<PtyMode, Integer> ptyModes) {
config.setPtyModes((ptyModes == null) ? Collections.emptyMap() :
ptyModes);
}
- /**
- * @param key The (never {@code null}) key (Note: may be empty...)
- * @param value The value to set - if {@code null} then the pre-existing
value for the key (if any) is
- * <U>removed</U>.
- * @return The replaced/removed previous value - {@code null} if no
previous value set for the key.
- */
- public Object setEnv(String key, Object value) {
- ValidateUtils.checkNotNull(key, "No key provided");
Review Comment:
it is just deleted code :)
Issue Time Tracking
-------------------
Worklog Id: (was: 787179)
Time Spent: 40m (was: 0.5h)
> Send environment variable and open subsystem at the same time for SSH session
> -----------------------------------------------------------------------------
>
> Key: SSHD-1273
> URL: https://issues.apache.org/jira/browse/SSHD-1273
> Project: MINA SSHD
> Issue Type: Improvement
> Affects Versions: 2.8.0
> Reporter: Andrei Danilenka
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> I use Apache Mina SSH client. The request that I want to send looks like:
> {code:java}
> user@host -w my_password -o SendEnv=SOME_VAR -s subsystem_name{code}
> But for now it is impossible to use env vars and subsystem together.
> What I have tried so far
> 1. ChannelShell class has setEnv(key, value) method but I can't go in
> subsystem
> 2. ChannelSubsystem class allows to go to subsystem but it has no
> setEnv(key, value) method
> 3. Also I have tried to open ChannelShell, set env, then open
> ChannelSubsystem using the same session as was used for ChannelShell, but it
> seems env variable hasn't gotten to ChannelSubsystem.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]