Skip to content

Commit 5589717

Browse files
author
Brent Cook
committed
Land rapid7#5058, @wvu-r7's default workspace saving
2 parents 72b9647 + 6c2585c commit 5589717

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/msf/ui/console/driver.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,13 @@ def load_config(path=nil)
387387
if (conf.group?(ConfigGroup))
388388
conf[ConfigGroup].each_pair { |k, v|
389389
case k.downcase
390-
when "activemodule"
390+
when 'activemodule'
391391
run_single("use #{v}")
392+
when 'activeworkspace'
393+
if framework.db.active
394+
workspace = framework.db.find_workspace(v)
395+
framework.db.workspace = workspace if workspace
396+
end
392397
end
393398
}
394399
end
@@ -405,6 +410,12 @@ def save_config
405410
group['ActiveModule'] = active_module.fullname
406411
end
407412

413+
if framework.db.active
414+
unless framework.db.workspace.default?
415+
group['ActiveWorkspace'] = framework.db.workspace.name
416+
end
417+
end
418+
408419
# Save it
409420
begin
410421
Msf::Config.save(ConfigGroup => group)

0 commit comments

Comments
 (0)