Package ghidra.pty.ssh
Class SshPtyChild
java.lang.Object
ghidra.pty.ssh.SshPtyEndpoint
ghidra.pty.ssh.SshPtyChild
- All Implemented Interfaces:
PtyChild,PtyEndpoint
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.pty.PtyChild
PtyChild.Echo, PtyChild.TermMode -
Field Summary
Fields inherited from class ghidra.pty.ssh.SshPtyEndpoint
channel, inputStream, outputStream -
Constructor Summary
ConstructorsConstructorDescriptionSshPtyChild(com.jcraft.jsch.ChannelExec channel, OutputStream outputStream, InputStream inputStream) -
Method Summary
Modifier and TypeMethodDescriptionGet the input stream for this end of the ptyGet the output stream for this end of the ptyStart a session without a real leader, instead obtaining the pty's namesession(String[] args, Map<String, String> env, File workingDirectory, Collection<PtyChild.TermMode> mode) Spawn a subprocess in a new session whose controlling tty is this pseudo-terminalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.pty.PtyChild
nullSession, session, session
-
Constructor Details
-
SshPtyChild
public SshPtyChild(com.jcraft.jsch.ChannelExec channel, OutputStream outputStream, InputStream inputStream)
-
-
Method Details
-
session
public SshPtySession session(String[] args, Map<String, String> env, File workingDirectory, Collection<PtyChild.TermMode> mode) throws IOExceptionDescription copied from interface:PtyChildSpawn a subprocess in a new session whose controlling tty is this pseudo-terminalThis method or
PtyChild.nullSession(Collection)can only be invoked once per pty.- Specified by:
sessionin interfacePtyChild- Parameters:
args- the image path and argumentsenv- the environmentworkingDirectory- the working directorymode- the terminal mode. If a mode is not implemented, it may be silently ignored.- Returns:
- a handle to the subprocess
- Throws:
IOException- if the session could not be started
-
nullSession
Description copied from interface:PtyChildStart a session without a real leader, instead obtaining the pty's nameThis method or any other
sessionmethod can only be invoked once per pty. It must be called before anyone reads the parent's output stream, since obtaining the filename may be implemented by the parent sending commands to its child.If the child end of the pty is on a remote system, this should be the file (or other resource) name as it would be accessed on that remote system.
- Specified by:
nullSessionin interfacePtyChild- Parameters:
mode- the terminal mode. If a mode is not implemented, it may be silently ignored.- Returns:
- the file name
- Throws:
IOException- if the session could not be started or the pty name could not be determined
-
getInputStream
Description copied from interface:PtyEndpointGet the input stream for this end of the ptyWrites to the output stream of the opposite end arrive here, subject to the terminal's line discipline.
- Specified by:
getInputStreamin interfacePtyEndpoint- Overrides:
getInputStreamin classSshPtyEndpoint- Returns:
- the input stream
-
getOutputStream
Description copied from interface:PtyEndpointGet the output stream for this end of the ptyWrites to this stream arrive on the input stream for the opposite end, subject to the terminal's line discipline.
- Specified by:
getOutputStreamin interfacePtyEndpoint- Overrides:
getOutputStreamin classSshPtyEndpoint- Returns:
- the output stream
-