@@ -9,7 +9,7 @@ def creds(opts)
99 end
1010
1111 wspace = Msf ::Util ::DBManager . process_opts_workspace ( opts , framework )
12- search_term = opts . delete ( :search_term )
12+ search_term = opts [ :search_term ]
1313
1414 query = Metasploit ::Credential ::Core . where ( workspace_id : wspace . id )
1515 query = query . includes ( :private , :public , :logins , :realm ) . references ( :private , :public , :logins , :realm )
@@ -108,24 +108,24 @@ def report_auth_info(opts={})
108108 end
109109
110110 ::ActiveRecord ::Base . connection_pool . with_connection {
111- host = opts . delete ( :host )
112- ptype = opts . delete ( :type ) || "password"
113- token = [ opts . delete ( :user ) , opts . delete ( :pass ) ]
114- sname = opts . delete ( :sname )
115- port = opts . delete ( :port )
116- proto = opts . delete ( :proto ) || "tcp"
117- proof = opts . delete ( :proof )
118- source_id = opts . delete ( :source_id )
119- source_type = opts . delete ( :source_type )
120- duplicate_ok = opts . delete ( :duplicate_ok )
111+ host = opts [ :host ]
112+ ptype = opts [ :type ] || "password"
113+ token = [ opts [ :user ] , opts [ :pass ] ]
114+ sname = opts [ :sname ]
115+ port = opts [ :port ]
116+ proto = opts [ :proto ] || "tcp"
117+ proof = opts [ :proof ]
118+ source_id = opts [ :source_id ]
119+ source_type = opts [ :source_type ]
120+ duplicate_ok = opts [ :duplicate_ok ]
121121 # Nil is true for active.
122122 active = ( opts [ :active ] || opts [ :active ] . nil? ) ? true : false
123123
124124 wspace = Msf ::Util ::DBManager . process_opts_workspace ( opts , framework )
125125
126126 # Service management; assume the user knows what
127127 # he's talking about.
128- service = opts . delete ( :service ) || report_service ( :host => host , :port => port , :proto => proto , :name => sname , :workspace => wspace )
128+ service = opts [ :service ] || report_service ( :host => host , :port => port , :proto => proto , :name => sname , :workspace => wspace )
129129
130130 # Non-US-ASCII usernames are tripping up the database at the moment, this is a temporary fix until we update the tables
131131 if ( token [ 0 ] )
@@ -226,6 +226,8 @@ def update_credential(opts)
226226 ::ActiveRecord ::Base . connection_pool . with_connection {
227227 # process workspace string for update if included in opts
228228 wspace = Msf ::Util ::DBManager . process_opts_workspace ( opts , framework , false )
229+ opts = opts . clone ( )
230+ opts . delete ( :workspace )
229231 opts [ :workspace ] = wspace if wspace
230232
231233 if opts [ :public ]
0 commit comments