Skip to content

Commit b292586

Browse files
committed
Avoid exception 'TypeError exception class/object expected'
1 parent e09169b commit b292586

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/msf/core/post/windows/services.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,6 @@ def service_start(name, server=nil)
424424
open_sc_manager(:host=>server, :access=>"SC_MANAGER_CONNECT") do |manager|
425425
open_service_handle(manager, name, "SERVICE_START") do |service_handle|
426426
retval = advapi32.StartServiceA(service_handle,0,nil)
427-
if retval["GetLastError"] == Error::SERVICE_ALREADY_RUNNING
428-
raise Error::SERVICE_ALREADY_RUNNING.to_s
429-
end
430427

431428
return retval["GetLastError"]
432429
end
@@ -527,7 +524,7 @@ def service_restart(name, start_type=START_TYPE_AUTO, server=nil)
527524
vprint_good("[#{name}] Service started")
528525
return true
529526
else
530-
raise status
527+
raise status.to_s
531528
end
532529
rescue RuntimeError => s
533530
if tried

0 commit comments

Comments
 (0)