6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/newrelic_security/instrumentation-security/dir/chain.rb', line 6
def self.instrument!
::Dir.class_eval do
class << self
include ::NewRelic::Security::Instrumentation::Dir
alias_method :mkdir_without_security, :mkdir
def mkdir(*var)
retval = nil
event = mkdir_on_enter(*var) { retval = mkdir_without_security(*var) }
mkdir_on_exit(event, retval) { return retval }
end
alias_method :rmdir_without_security, :rmdir
def rmdir(name)
retval = nil
event = rmdir_on_enter(name) { retval = rmdir_without_security(name) }
rmdir_on_exit(event, retval) { return retval }
end
alias_method :unlink_without_security, :unlink
def unlink(name)
retval = nil
event = unlink_on_enter(name) { retval = unlink_without_security(name) }
unlink_on_exit(event, retval) { return retval }
end
end
end
end
|