shaddox 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2e3018cbb246b1eedda1bc33c1aa19fbdca26fc
4
- data.tar.gz: c722bf453d5ac94b4b44a9c696404c0eeff20045
3
+ metadata.gz: 5453ebbc5938bd3524a2717fbd412b3c6cbae940
4
+ data.tar.gz: e29e70aef8c4ea1a13630d9d2876753175eda65f
5
5
  SHA512:
6
- metadata.gz: 9916d6654391f168a0af158fef3ec2aae3d6c5b7bd055ed00dca272bd8390129acd90b6882224209fb90f987f419610d1ef4450d93e56f13c0fd3acdc8ede513
7
- data.tar.gz: e16dcfdbacd98b46bc28cbe67185e12d83d6583bfe9e1ca7132fe485093353ca9c17ff6e18ee7dd386b62773af88eca63d893e37c71f3e994cc1bdf961c053b1
6
+ metadata.gz: 3c4948e0476e99926f220e62382ca39507b866140d4a0f4e52aa57efafc12967880dcfbe00a69222a7dfa8accaea43ff2d4bfe4a92c9c6c49c0a2b4e335db479
7
+ data.tar.gz: 20af0a2218f08ed384007ed82e7a488cd60453c4802827f8d9312798bdadf87a62a696d162fad214c682b559d1834edcb1e8fd7c28962d265d2ade70202814bb
@@ -120,22 +120,17 @@ module Shaddox
120
120
  def exec(command)
121
121
  exit_code = nil
122
122
  @ssh.open_channel do |channel|
123
- channel.exec(command) do |ch, success|
124
- ch.request_pty :want_reply => true
125
- #return nil if !success
126
- ch.on_data do |ch, data|
123
+ channel.request_pty do |c, success|
124
+ raise "SSH could not obtain a pty." unless success
125
+ channel.exec(command)
126
+ channel.on_data do |c_, data|
127
127
  $stdout.print data
128
128
  if data =~ /^\[sudo\]|Password/i
129
- channel.send_data(gets.strip)
129
+ warning "Target is asking for password: ", 1
130
+ channel.send_data(gets.strip + "\n")
130
131
  end
131
132
  end
132
- #ch.on_extended_data do |ch, data|
133
- #$stderr.print data
134
- #if data =~ /^\[sudo\] password for user:/
135
- #channel.send_data(gets.strip)
136
- #end
137
- #end
138
- ch.on_request('exit-status') do |ch, data|
133
+ channel.on_request('exit-status') do |ch, data|
139
134
  exit_code = data.read_long
140
135
  end
141
136
  end
@@ -1,3 +1,3 @@
1
1
  module Shaddox
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaddox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshglendenning
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-12 00:00:00.000000000 Z
11
+ date: 2014-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sourcify