bug/bundler_fix
wchen-r7 2015-04-30 15:07:11 -05:00
parent 70ab938951
commit f315eb4afd
1 changed files with 7 additions and 3 deletions

View File

@ -517,7 +517,11 @@ public
# Sets a workspace. # Sets a workspace.
# #
# @param [String] wspace Workspace name. # @param [String] wspace Workspace name.
# @raise [Msf::RPC::Exception] 500 Database not loaded. # @raise [Msf::RPC::ServerException] You might get one of these errors:
# * 500 ActiveRecord::ConnectionNotEstablished. Try: rpc.call('console.create').
# * 500 Database not loaded. Try: rpc.call('console.create')
# * 500 Invalid workspace
# * 404 Workspace not found.
# @return [Hash] A hash indicating whether the action was successful or not. You will get: # @return [Hash] A hash indicating whether the action was successful or not. You will get:
# * 'result' [String] A message that says either 'success' or 'failed' # * 'result' [String] A message that says either 'success' or 'failed'
# @example Here's how you would use this from the client: # @example Here's how you would use this from the client:
@ -526,7 +530,7 @@ public
def rpc_set_workspace(wspace) def rpc_set_workspace(wspace)
::ActiveRecord::Base.connection_pool.with_connection { ::ActiveRecord::Base.connection_pool.with_connection {
db_check db_check
workspace = self.framework.db.find_workspace(wspace) workspace = find_workspace(wspace)
if(workspace) if(workspace)
self.framework.db.workspace = workspace self.framework.db.workspace = workspace
return { 'result' => "success" } return { 'result' => "success" }
@ -551,7 +555,7 @@ public
::ActiveRecord::Base.connection_pool.with_connection { ::ActiveRecord::Base.connection_pool.with_connection {
db_check db_check
# Delete workspace # Delete workspace
workspace = self.framework.db.find_workspace(wspace) workspace = find_workspace(wspace)
if workspace.nil? if workspace.nil?
error(404, "Workspace not found: #{wspace}") error(404, "Workspace not found: #{wspace}")
elsif workspace.default? elsif workspace.default?