File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -1512,6 +1512,7 @@ def report_auth_info(opts={})
1512
1512
raise ArgumentError . new ( "Invalid address or object for :host (#{ opts [ :host ] . inspect } )" )
1513
1513
end
1514
1514
1515
+ ::ActiveRecord ::Base . connection_pool . with_connection {
1515
1516
host = opts . delete ( :host )
1516
1517
ptype = opts . delete ( :type ) || "password"
1517
1518
token = [ opts . delete ( :user ) , opts . delete ( :pass ) ]
@@ -1623,6 +1624,7 @@ def report_auth_info(opts={})
1623
1624
end
1624
1625
1625
1626
ret [ :cred ] = cred
1627
+ }
1626
1628
end
1627
1629
1628
1630
alias :report_cred :report_auth_info
@@ -1922,8 +1924,10 @@ def report_vuln_details(vuln, details)
1922
1924
# Note that this *can* update data across workspaces
1923
1925
#
1924
1926
def update_vuln_details ( details )
1927
+ ::ActiveRecord ::Base . connection_pool . with_connection {
1925
1928
criteria = details . delete ( :key ) || { }
1926
1929
::Mdm ::VulnDetail . update ( key , details )
1930
+ }
1927
1931
end
1928
1932
1929
1933
#
Original file line number Diff line number Diff line change @@ -107,13 +107,17 @@ def initialize(framework)
107
107
# processing time for large session lists from skewing our update interval.
108
108
109
109
last_seen_timer = Time . now . utc
110
- values . each do |s |
111
- # Update the database entry on a regular basis, marking alive threads
112
- # as recently seen. This notifies other framework instances that this
113
- # session is being maintained.
114
- if framework . db . active and s . db_record
115
- s . db_record . last_seen = Time . now . utc
116
- s . db_record . save
110
+ if framework . db . active
111
+ ::ActiveRecord ::Base . connection_pool . with_connection do
112
+ values . each do |s |
113
+ # Update the database entry on a regular basis, marking alive threads
114
+ # as recently seen. This notifies other framework instances that this
115
+ # session is being maintained.
116
+ if s . db_record
117
+ s . db_record . last_seen = Time . now . utc
118
+ s . db_record . save
119
+ end
120
+ end
117
121
end
118
122
end
119
123
end
You can’t perform that action at this time.
0 commit comments