Skip to content

Commit 9625504

Browse files
committed
Land rapid7#5121, timestomp arg/opt order fix
2 parents 3ae533f + 8acc768 commit 9625504

File tree

1 file changed

+11
-2
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher/priv

1 file changed

+11
-2
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ def name
5252
#
5353
def cmd_timestomp(*args)
5454
if (args.length < 2)
55-
print_line("\nUsage: timestomp file_path OPTIONS\n" +
55+
print_line("\nUsage: timestomp OPTIONS file_path\n" +
5656
@@timestomp_opts.usage)
5757
return
5858
end
5959

60-
file_path = args.shift
60+
file_path = nil
61+
args.each { |a| file_path = a unless a[0] == "-" }
62+
63+
if file_path.nil?
64+
print_line("\nNo file_path specified.")
65+
return
66+
end
67+
68+
args.delete(file_path)
69+
6170
modified = nil
6271
accessed = nil
6372
creation = nil

0 commit comments

Comments
 (0)