Skip to content

Commit 9bf55ef

Browse files
committed
Minor improvements to datastore and http// checks in msftidy
1 parent be1440b commit 9bf55ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/msftidy.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def check_lines
537537
#
538538
# https://dev.metasploit.com/redmine/issues/8498#note-16
539539
if ln =~ /(?<!\.)datastore\[["'][^"']+["']\]\s*(=|<<)(?![=~>])/
540-
info("datastore is modified in code: #{ln}", idx)
540+
info("datastore is modified in code with '#{Regexp.last_match(1)}': #{ln}", idx)
541541
end
542542

543543
# do not read Set-Cookie header (ignore commented lines)
@@ -590,8 +590,12 @@ def check_udp_sock_get
590590
end
591591
end
592592

593+
# At one point in time, somebody committed a module with a bad metasploit.com URL
594+
# in the header -- http//metasploit.com/download rather than http://metasploit.com/download.
595+
# This module then got copied and committed 20+ times and is used in numerous other places.
596+
# This ensures that this stops.
593597
def check_invalid_url_scheme
594-
test = @source.scan(/^.+http\/\/.+$/)
598+
test = @source.scan(/^#.+http\/\/metasploit.com/)
595599
unless test.empty?
596600
test.each { |item|
597601
info("Invalid URL: #{item}")

0 commit comments

Comments
 (0)