We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 284ef5b commit 64c2bf3Copy full SHA for 64c2bf3
lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb
@@ -324,16 +324,8 @@ def cmd_edit(*args)
324
meterp_temp.binmode
325
temp_path = meterp_temp.path
326
327
- begin
328
- # Download the remote file to the temporary file
329
- client.fs.file.download_file(temp_path, args[0])
330
- rescue RequestError => re
331
- # If the file doesn't exist, then it's okay. Otherwise, throw the
332
- # error.
333
- if re.result != 2
334
- raise $!
335
- end
336
+ # Try to download the file, but don't worry if it doesn't exist
+ client.fs.file.download_file(temp_path, args[0]) rescue nil
337
338
# Spawn the editor (default to vi)
339
editor = Rex::Compat.getenv('EDITOR') || 'vi'
0 commit comments