1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

No need to compose CLI_SERVER_NAME_SLASH in "net rpc service" anymore.

Guenther
This commit is contained in:
Günther Deschner 2008-03-20 01:24:55 +01:00
parent 818044d877
commit b5291d4773

View File

@ -19,10 +19,6 @@
#include "includes.h"
#include "utils/net.h"
#define CLI_SERVER_NAME_SLASH(_ctx, _p, _cli) \
_p = talloc_asprintf(_ctx, "\\\\%s", _cli->cli->desthost);
/********************************************************************
********************************************************************/
@ -172,7 +168,6 @@ static NTSTATUS rpc_service_list_internal(const DOM_SID *domain_sid,
fstring servicename;
fstring displayname;
uint32 num_services = 0;
const char *server_name;
int i;
if (argc != 0 ) {
@ -180,11 +175,8 @@ static NTSTATUS rpc_service_list_internal(const DOM_SID *domain_sid,
return NT_STATUS_OK;
}
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@ -235,7 +227,6 @@ static NTSTATUS rpc_service_status_internal(const DOM_SID *domain_sid,
SERVICE_STATUS service_status;
SERVICE_CONFIG config;
fstring ascii_string;
const char *server_name;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@ -243,11 +234,8 @@ static NTSTATUS rpc_service_status_internal(const DOM_SID *domain_sid,
}
/* Open the Service Control Manager */
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@ -349,7 +337,6 @@ static NTSTATUS rpc_service_stop_internal(const DOM_SID *domain_sid,
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
const char *server_name;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@ -359,11 +346,8 @@ static NTSTATUS rpc_service_stop_internal(const DOM_SID *domain_sid,
fstrcpy( servicename, argv[0] );
/* Open the Service Control Manager */
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@ -396,7 +380,6 @@ static NTSTATUS rpc_service_pause_internal(const DOM_SID *domain_sid,
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
const char *server_name;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@ -406,11 +389,8 @@ static NTSTATUS rpc_service_pause_internal(const DOM_SID *domain_sid,
fstrcpy( servicename, argv[0] );
/* Open the Service Control Manager */
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@ -443,7 +423,6 @@ static NTSTATUS rpc_service_resume_internal(const DOM_SID *domain_sid,
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
fstring servicename;
const char *server_name;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@ -453,11 +432,8 @@ static NTSTATUS rpc_service_resume_internal(const DOM_SID *domain_sid,
fstrcpy( servicename, argv[0] );
/* Open the Service Control Manager */
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@ -490,7 +466,6 @@ static NTSTATUS rpc_service_start_internal(const DOM_SID *domain_sid,
WERROR result = WERR_GENERAL_FAILURE;
NTSTATUS status;
uint32 state = 0;
const char *server_name;
if (argc != 1 ) {
d_printf("Usage: net rpc service status <service>\n");
@ -498,11 +473,8 @@ static NTSTATUS rpc_service_start_internal(const DOM_SID *domain_sid,
}
/* Open the Service Control Manager */
CLI_SERVER_NAME_SLASH(mem_ctx, server_name, pipe_hnd);
NT_STATUS_HAVE_NO_MEMORY(server_name);
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
server_name,
pipe_hnd->cli->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,