Skip to content

Commit 7704c38

Browse files
committed
Land rapid7#2974 - Recover missing code in method exists?
2 parents e690583 + 4a0f37d commit 7704c38

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/msf/core/post/file.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,14 @@ def exist?(path)
9898
return !!(stat)
9999
else
100100
if session.platform =~ /win/
101-
# XXX
101+
f = cmd_exec("cmd.exe /C IF exist \"#{path}\" ( echo true )")
102102
else
103103
f = session.shell_command_token("test -e '#{path}' && echo true")
104-
return false if f.nil? or f.empty?
105-
return false unless f =~ /true/
106-
return true
107104
end
105+
106+
return false if f.nil? or f.empty?
107+
return false unless f =~ /true/
108+
return true
108109
end
109110
end
110111

0 commit comments

Comments
 (0)