Skip to content

Commit 6c8df4b

Browse files
committed
Land rapid7#2699, @wvu fix for Linux download_exec post module
2 parents 0343aef + f3e71c2 commit 6c8df4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/post/linux/manage/download_exec.rb

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

4747
def exists_exe?(exe)
48-
path = expand_path(ENV['PATH'])
48+
path = expand_path("$PATH")
4949
if path.nil? or path.empty?
5050
return false
5151
end
@@ -108,10 +108,10 @@ def run
108108
return
109109
end
110110

111-
if datastore['URL'].match(/https/)
112-
cmd_exec_vprint("`which #{@http_client}` #{@stdout_option} #{@ssl_option} #{datastore['URL']} 2>/dev/null | `which #{@shell}` ")
111+
if datastore['URL'].match(%r{^https://})
112+
cmd_exec_vprint("#{@http_client} #{@stdout_option} #{@ssl_option} #{datastore['URL']} 2>/dev/null | #{@shell}")
113113
else
114-
cmd_exec_vprint("`which #{@http_client}` #{@stdout_option} #{datastore['URL']} 2>/dev/null | `which #{@shell}` ")
114+
cmd_exec_vprint("#{@http_client} #{@stdout_option} #{datastore['URL']} 2>/dev/null | #{@shell}")
115115
end
116116
end
117117

0 commit comments

Comments
 (0)