From d98f8dfd8916c6e302bf214256ffeb430e54f78e Mon Sep 17 00:00:00 2001 From: HD Moore Date: Mon, 2 May 2011 21:39:09 +0000 Subject: [PATCH] Make it clear that all Rex::IO::Stream implementations must accept a second parameter called opts for the read, write, and put methods git-svn-id: file:///home/svn/framework3/trunk@12515 4d416f70-5f16-0410-b530-b9f4589650da --- lib/msf/core/auxiliary/commandshell.rb | 8 ++++---- lib/msf/core/handler/reverse_tcp_double.rb | 8 ++++---- lib/rex/io/ring_buffer.rb | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/msf/core/auxiliary/commandshell.rb b/lib/msf/core/auxiliary/commandshell.rb index c390180eb2..90aacf58d8 100644 --- a/lib/msf/core/auxiliary/commandshell.rb +++ b/lib/msf/core/auxiliary/commandshell.rb @@ -21,13 +21,13 @@ module Auxiliary::CommandShell # Ghetto # module CRLFLineEndings - def put(str) + def put(str, opts={}) return super if not str - super(str.strip + "\r\n") + super(str.strip + "\r\n", opts) end - def write(str) + def write(str, opts={}) return super if not str - super(str.strip + "\r\n") + super(str.strip + "\r\n", opts) end end diff --git a/lib/msf/core/handler/reverse_tcp_double.rb b/lib/msf/core/handler/reverse_tcp_double.rb index 25a572900f..82517027c1 100644 --- a/lib/msf/core/handler/reverse_tcp_double.rb +++ b/lib/msf/core/handler/reverse_tcp_double.rb @@ -266,12 +266,12 @@ protected } end - def write(buf) - @sock_inp.write(buf) + def write(buf, opts={}) + @sock_inp.write(buf, opts) end - def read(length=0) - @sock_out.read(length) + def read(length=0, opts={}) + @sock_out.read(length, opts) end # diff --git a/lib/rex/io/ring_buffer.rb b/lib/rex/io/ring_buffer.rb index 7f44f2c1b0..15175f3327 100644 --- a/lib/rex/io/ring_buffer.rb +++ b/lib/rex/io/ring_buffer.rb @@ -74,8 +74,8 @@ class RingBuffer # Push data back into the associated stream socket. Logging must occur # elsewhere, this function is simply a passthrough. # - def put(data) - self.fd.put(data) + def put(data, opts={}) + self.fd.put(data, opts={}) end #