Skip to content

Commit 2916c5a

Browse files
committed
Rescue Rex::Proto::SunRPC::RPCTimeout
Coincidentally, this also fixes the rescue in the library, since rescuing Timeout instead of Timeout::Error does nothing.
1 parent 0c9f1d7 commit 2916c5a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/rex/proto/sunrpc/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def recv_rpc(sock, maxwait=self.timeout)
179179
buf = nil
180180
begin
181181
Timeout.timeout(maxwait) { buf = sock.get }
182-
rescue ::Timeout
182+
rescue Timeout::Error
183+
raise RPCTimeout
183184
end
184185

185186
return nil if not buf

modules/auxiliary/gather/nis_bootparamd_domain.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ def run
7878
rescue Rex::Proto::SunRPC::RPCError
7979
print_error('Could not call bootparamd procedure')
8080
return
81-
# XXX: This bubbles up from Rex::Proto::SunRPC::Client
82-
# TODO: Make it raise Rex::Proto::SunRPC::RPCTimeout
83-
rescue Timeout::Error
81+
rescue Rex::Proto::SunRPC::RPCTimeout
8482
print_error('Could not disclose NIS domain name (try another CLIENT?)')
8583
return
8684
ensure

0 commit comments

Comments
 (0)