diff options
-rw-r--r-- | source3/utils/net_rpc_service.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c index 1fabdef294..f1cd2a6b0d 100644 --- a/source3/utils/net_rpc_service.c +++ b/source3/utils/net_rpc_service.c @@ -551,7 +551,6 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, { struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; - fstring servicename; struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; if (argc != 1 ) { @@ -559,8 +558,6 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, return NT_STATUS_OK; } - fstrcpy( servicename, argv[0] ); - /* Open the Service Control Manager */ result = open_scm(b, mem_ctx, pipe_hnd->srv_name_slash, SC_RIGHT_MGR_ENUMERATE_SERVICE, @@ -569,7 +566,7 @@ static NTSTATUS rpc_service_stop_internal(struct net_context *c, return werror_to_ntstatus(result); } - result = control_service(pipe_hnd, mem_ctx, &hSCM, servicename, + result = control_service(pipe_hnd, mem_ctx, &hSCM, argv[0], SVCCTL_CONTROL_STOP, SVCCTL_STOPPED ); if (is_valid_policy_hnd(&hSCM)) { @@ -594,7 +591,6 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, { struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; - fstring servicename; struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; if (argc != 1 ) { @@ -602,8 +598,6 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, return NT_STATUS_OK; } - fstrcpy( servicename, argv[0] ); - /* Open the Service Control Manager */ result = open_scm(b, mem_ctx, pipe_hnd->srv_name_slash, SC_RIGHT_MGR_ENUMERATE_SERVICE, @@ -612,7 +606,7 @@ static NTSTATUS rpc_service_pause_internal(struct net_context *c, return werror_to_ntstatus(result); } - result = control_service(pipe_hnd, mem_ctx, &hSCM, servicename, + result = control_service(pipe_hnd, mem_ctx, &hSCM, argv[0], SVCCTL_CONTROL_PAUSE, SVCCTL_PAUSED ); if (is_valid_policy_hnd(&hSCM)) { @@ -637,7 +631,6 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, { struct policy_handle hSCM; WERROR result = WERR_GENERAL_FAILURE; - fstring servicename; struct dcerpc_binding_handle *b = pipe_hnd->binding_handle; if (argc != 1 ) { @@ -645,8 +638,6 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, return NT_STATUS_OK; } - fstrcpy( servicename, argv[0] ); - /* Open the Service Control Manager */ result = open_scm(b, mem_ctx, pipe_hnd->srv_name_slash, SC_RIGHT_MGR_ENUMERATE_SERVICE, @@ -655,7 +646,7 @@ static NTSTATUS rpc_service_resume_internal(struct net_context *c, return werror_to_ntstatus(result); } - result = control_service(pipe_hnd, mem_ctx, &hSCM, servicename, + result = control_service(pipe_hnd, mem_ctx, &hSCM, argv[0], SVCCTL_CONTROL_CONTINUE, SVCCTL_RUNNING ); if (is_valid_policy_hnd(&hSCM)) { |