Skip to content

Commit 3d36818

Browse files
author
Tod Beardsley
committed
Fix linux download_exec for rapid7#2961
Note! This module already seems pretty broken, in that it doesn't appear to correctly locate curl or wget. Will open another bug on that. [See RM rapid7#8777]
1 parent 4d3f871 commit 3d36818

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/post/linux/manage/download_exec.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,19 @@ def cmd_exec_vprint(cmd)
4545
end
4646

4747
def exists_exe?(exe)
48-
path = session.sys.config.getenv("PATH")
48+
vprint_status "Searching for #{exe} in the current $PATH..."
49+
path = get_env("PATH")
4950
if path.nil? or path.empty?
5051
return false
52+
vprint_error "No local $PATH set!"
53+
else
54+
vprint_status "$PATH is #{path.strip!}"
5155
end
5256

5357
path.split(":").each{ |p|
54-
return true if file_exist?(p + "/" + exe)
58+
full_path = p + "/" + exe
59+
vprint_status "Searching for '#{full_path}' ..."
60+
return true if file_exist?(full_path)
5561
}
5662

5763
return false

0 commit comments

Comments
 (0)