Skip to content

Commit d3ebb8a

Browse files
committed
Style cleanup of auth checking
1 parent e96596e commit d3ebb8a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

modules/auxiliary/scanner/rsync/modules_list.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,22 @@ def read_timeout
5858
datastore['READ_TIMEOUT']
5959
end
6060

61-
def rsync_requires_auth?(rmodule)
61+
def get_rsync_auth_state(rmodule)
6262
sock.puts("#{rmodule}\n")
6363
res = sock.get_once(-1, read_timeout)
6464
if res
6565
if res =~ /^#{RSYNC_HEADER} AUTHREQD/
66-
true
66+
'required'
6767
elsif res =~ /^#{RSYNC_HEADER} OK/
68-
false
68+
'not required'
6969
else
7070
vprint_error("#{peer} - unexpected response when connecting to #{rmodule}: #{res}")
71-
'unknown'
71+
'unexpected response'
7272
end
7373
else
7474
vprint_error("#{peer} - no response when connecting to #{rmodule}")
75-
'unknown'
75+
'no response'
7676
end
77-
7877
end
7978

8079
def rsync_list
@@ -176,7 +175,7 @@ def run_host(ip)
176175
modules_metadata.each do |module_metadata|
177176
connect
178177
rsync_negotiate
179-
module_metadata[:authentication?] = rsync_requires_auth?(module_metadata[:name])
178+
module_metadata[:authentication?] = get_rsync_auth_state(module_metadata[:name])
180179
disconnect
181180
end
182181
end

0 commit comments

Comments
 (0)