Skip to content

Commit 9389052

Browse files
committed
fix more broken RuntimeError calls
1 parent f42b980 commit 9389052

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

lib/msf/core/db_manager/report.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def report_artifact(opts)
4444

4545
unless artifact.valid?
4646
errors = artifact.errors.full_messages.join('; ')
47-
raise RuntimeError "Artifact to be imported is not valid: #{errors}"
47+
raise RuntimeError, "Artifact to be imported is not valid: #{errors}"
4848
end
4949
artifact.save
5050
end
@@ -66,7 +66,7 @@ def report_report(opts)
6666

6767
unless report.valid?
6868
errors = report.errors.full_messages.join('; ')
69-
raise RuntimeError "Report to be imported is not valid: #{errors}"
69+
raise RuntimeError, "Report to be imported is not valid: #{errors}"
7070
end
7171
report.state = :complete # Presume complete since it was exported
7272
report.save
@@ -83,4 +83,4 @@ def reports(wspace=workspace)
8383
wspace.reports
8484
}
8585
end
86-
end
86+
end

modules/auxiliary/scanner/discovery/arp_sweep.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def run_batch(hosts)
4646
@interface = datastore['INTERFACE'] || Pcap.lookupdev
4747
shost = datastore['SHOST']
4848
shost ||= get_ipv4_addr(@interface) if @netifaces
49-
raise RuntimeError ,'SHOST should be defined' unless shost
49+
raise RuntimeError, 'SHOST should be defined' unless shost
5050

5151
smac = datastore['SMAC']
5252
smac ||= get_mac(@interface) if @netifaces
53-
raise RuntimeError ,'SMAC should be defined' unless smac
53+
raise RuntimeError, 'SMAC should be defined' unless smac
5454

5555
begin
5656

modules/auxiliary/scanner/discovery/ipv6_neighbor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def run_batch(hosts)
4949
@interface = datastore['INTERFACE'] || Pcap.lookupdev
5050
@shost = datastore['SHOST']
5151
@shost ||= get_ipv4_addr(@interface) if @netifaces
52-
raise RuntimeError ,'SHOST should be defined' unless @shost
52+
raise RuntimeError, 'SHOST should be defined' unless @shost
5353

5454
@smac = datastore['SMAC']
5555
@smac ||= get_mac(@interface) if @netifaces
56-
raise RuntimeError ,'SMAC should be defined' unless @smac
56+
raise RuntimeError, 'SMAC should be defined' unless @smac
5757

5858
addrs = []
5959

modules/auxiliary/scanner/discovery/ipv6_neighbor_router_advertisement.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ def run
161161
@interface = datastore['INTERFACE'] || Pcap.lookupdev
162162
@shost = datastore['SHOST']
163163
@shost ||= get_ipv4_addr(@interface) if @netifaces
164-
raise RuntimeError ,'SHOST should be defined' unless @shost
164+
raise RuntimeError, 'SHOST should be defined' unless @shost
165165

166166
@smac = datastore['SMAC']
167167
@smac ||= get_mac(@interface) if @netifaces
168168
@smac ||= ipv6_mac
169-
raise RuntimeError ,'SMAC should be defined' unless @smac
169+
raise RuntimeError, 'SMAC should be defined' unless @smac
170170

171171
# Send router advertisement
172172
print_status("Sending router advertisement...")

modules/auxiliary/server/icmp_exfil.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def icmp_listener
153153
icmp_response, contents = icmp_packet(packet, datastore['RESP_START'])
154154

155155
if not icmp_response
156-
raise RuntimeError ,"Could not build ICMP response"
156+
raise RuntimeError, "Could not build ICMP response"
157157
else
158158
# send response packet icmp_pkt
159159
send_icmp(icmp_response, contents)
@@ -172,7 +172,7 @@ def icmp_listener
172172
icmp_response, contents = icmp_packet(packet, datastore['RESP_END'])
173173

174174
if not icmp_response
175-
raise RuntimeError , "Could not build ICMP response"
175+
raise RuntimeError, "Could not build ICMP response"
176176
else
177177
# send response packet icmp_pkt
178178
send_icmp(icmp_response, contents)
@@ -192,7 +192,7 @@ def icmp_listener
192192
icmp_response, contents = icmp_packet(packet, datastore['RESP_CONT'])
193193

194194
if not icmp_response
195-
raise RuntimeError , "Could not build ICMP response"
195+
raise RuntimeError, "Could not build ICMP response"
196196
else
197197
# send response packet icmp_pkt
198198
send_icmp(icmp_response, contents)

modules/auxiliary/spoof/arp/arp_poisoning.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def run
7272
@interface = get_interface_guid(@interface)
7373
@smac = datastore['SMAC']
7474
@smac ||= get_mac(@interface) if @netifaces
75-
raise RuntimeError ,'SMAC is not defined and can not be guessed' unless @smac
76-
raise RuntimeError ,'Source MAC is not in correct format' unless is_mac?(@smac)
75+
raise RuntimeError, 'SMAC is not defined and can not be guessed' unless @smac
76+
raise RuntimeError, 'Source MAC is not in correct format' unless is_mac?(@smac)
7777

7878
@sip = datastore['LOCALSIP']
7979
@sip ||= get_ipv4_addr(@interface) if @netifaces
@@ -162,7 +162,7 @@ def broadcast_spoof
162162

163163
def arp_poisoning
164164
lsmac = datastore['LOCALSMAC'] || @smac
165-
raise RuntimeError ,'Local Source Mac is not in correct format' unless is_mac?(lsmac)
165+
raise RuntimeError, 'Local Source Mac is not in correct format' unless is_mac?(lsmac)
166166

167167
dhosts_range = Rex::Socket::RangeWalker.new(datastore['DHOSTS'])
168168
@dhosts = []

0 commit comments

Comments
 (0)