1 2 29 30 package com.jcraft.jsch; 31 32 class RequestExec extends Request{ 33 private String command=""; 34 RequestExec(String foo){ 35 this.command=foo; 36 } 37 public void request(Session session, Channel channel) throws Exception { 38 super.request(session, channel); 39 40 Packet packet=session.packet; 41 Buffer buf=session.buf; 42 43 packet.reset(); 50 buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST); 51 buf.putInt(channel.getRecipient()); 52 buf.putString("exec".getBytes()); 53 buf.putByte((byte)(waitForReply() ? 1 : 0)); 54 buf.putString(command.getBytes()); 55 write(packet); 56 } 57 } 58 | Popular Tags |