Skip to content

Commit c9d231b

Browse files
David MaloneyDavid Maloney
authored andcommitted
remove old rpc methods
added rpc methods to create new creds removing the old methods for the obsolete cred models
1 parent e29b2ae commit c9d231b

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

lib/msf/core/rpc/v10/rpc_db.rb

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -542,15 +542,6 @@ def rpc_notes(xopts)
542542
}
543543
end
544544

545-
def rpc_report_auth_info(xopts)
546-
::ActiveRecord::Base.connection_pool.with_connection {
547-
opts, wspace = init_db_opts_workspace(xopts)
548-
res = self.framework.db.report_auth_info(opts)
549-
return { :result => 'success' } if(res)
550-
{ :result => 'failed' }
551-
}
552-
end
553-
554545
def rpc_get_auth_info(xopts)
555546
::ActiveRecord::Base.connection_pool.with_connection {
556547
opts, wspace = init_db_opts_workspace(xopts)
@@ -880,42 +871,6 @@ def rpc_loots(xopts)
880871
}
881872
end
882873

883-
# requires host, port, user, pass, ptype, and active
884-
def rpc_report_cred(xopts)
885-
::ActiveRecord::Base.connection_pool.with_connection {
886-
opts, wspace = init_db_opts_workspace(xopts)
887-
res = framework.db.find_or_create_cred(opts)
888-
return { :result => 'success' } if res
889-
{ :result => 'failed' }
890-
}
891-
end
892-
893-
#right now workspace is the only option supported
894-
def rpc_creds(xopts)
895-
::ActiveRecord::Base.connection_pool.with_connection {
896-
opts, wspace = init_db_opts_workspace(xopts)
897-
limit = opts.delete(:limit) || 100
898-
offset = opts.delete(:offset) || 0
899-
900-
ret = {}
901-
ret[:creds] = []
902-
::Mdm::Cred.find(:all, :include => {:service => :host}, :conditions => ["hosts.workspace_id = ?",
903-
framework.db.workspace.id ], :limit => limit, :offset => offset).each do |c|
904-
cred = {}
905-
cred[:host] = c.service.host.address if(c.service.host)
906-
cred[:updated_at] = c.updated_at.to_i
907-
cred[:port] = c.service.port
908-
cred[:proto] = c.service.proto
909-
cred[:sname] = c.service.name
910-
cred[:type] = c.ptype
911-
cred[:user] = c.user
912-
cred[:pass] = c.pass
913-
cred[:active] = c.active
914-
ret[:creds] << cred
915-
end
916-
ret
917-
}
918-
end
919874

920875
def rpc_import_data(xopts)
921876
::ActiveRecord::Base.connection_pool.with_connection {

0 commit comments

Comments
 (0)