File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
lib/msf/core/module_manager Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def file_changed?(path)
30
30
31
31
# if uncached then it counts as changed
32
32
# Payloads can't be cached due to stage/stager matching
33
- if module_info . nil? or module_info [ :modification_time ] == Msf ::MODULE_PAYLOAD
33
+ if module_info . nil? or module_info [ :type ] == Msf ::MODULE_PAYLOAD
34
34
changed = true
35
35
else
36
36
begin
Original file line number Diff line number Diff line change 122
122
end
123
123
end
124
124
125
- it 'should return true if the cached modification time is Msf::MODULE_PAYLOAD' do
125
+ it 'should return true if the cached type is Msf::MODULE_PAYLOAD' do
126
126
Tempfile . open ( module_basename ) do |tempfile |
127
127
module_path = tempfile . path
128
+ modification_time = File . mtime ( module_path )
128
129
129
130
subject . send ( :module_info_by_path ) [ module_path ] = {
130
- :modification_time => Msf ::MODULE_PAYLOAD
131
+ # :modification_time must match so that it is the :type that is causing the `true` and not the
132
+ # :modification_time causing the `true`.
133
+ :modification_time => modification_time ,
134
+ :type => Msf ::MODULE_PAYLOAD
131
135
}
132
136
133
137
subject . file_changed? ( module_path ) . should be_true
You can’t perform that action at this time.
0 commit comments