1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

Added SVC_START_SERVICE rpc. An NT PDC will attempt to start the NETLOGON

service on its BDC's prior to initiating SAM replication. For now just
return success.
This commit is contained in:
Matthew Chapman -
parent 900238a661
commit 113d03a38a
4 changed files with 109 additions and 0 deletions

View File

@ -2591,6 +2591,8 @@ void svc_io_q_open_service(char *desc, SVC_Q_OPEN_SERVICE *q_u, prs_struct *ps,
void make_svc_r_open_service(SVC_R_OPEN_SERVICE *r_u, POLICY_HND *hnd,
uint32 status) ;
void svc_io_r_open_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps, int depth);
void svc_io_q_start_service(char *desc, SVC_Q_START_SERVICE *q_s, prs_struct *ps, int depth);
void svc_io_r_start_service(char *desc, SVC_R_START_SERVICE *r_s, prs_struct *ps, int depth);
void make_svc_query_svc_cfg(QUERY_SERVICE_CONFIG *q_u,
uint32 service_type, uint32 start_type,
uint32 error_control,

View File

@ -31,6 +31,7 @@
#define SVC_QUERY_SVC_CONFIG 0x11
#define SVC_QUERY_DISP_NAME 0x14
#define SVC_OPEN_SERVICE 0x10
#define SVC_START_SERVICE 0x13
#define SVC_CLOSE 0x00
@ -72,6 +73,27 @@ typedef struct r_svc_open_service_info
} SVC_R_OPEN_SERVICE;
#define MAX_SVC_ARGS 4
/* SVC_Q_START_SERVICE */
typedef struct q_svc_start_service_info
{
POLICY_HND pol;
uint32 argc;
uint32 ptr_argv;
uint32 argc2;
UNISTR2 argv[MAX_SVC_ARGS];
} SVC_Q_START_SERVICE;
/* SVC_R_START_SERVICE */
typedef struct r_svc_start_service_info
{
uint32 status;
} SVC_R_START_SERVICE;
/* QUERY_SERVICE_CONFIG */
typedef struct query_service_config_info

View File

@ -162,6 +162,54 @@ void svc_io_r_open_service(char *desc, SVC_R_OPEN_SERVICE *r_u, prs_struct *ps,
prs_uint32("status ", ps, depth, &(r_u->status));
}
/*******************************************************************
reads or writes a SVC_Q_START_SERVICE structure.
********************************************************************/
void svc_io_q_start_service(char *desc, SVC_Q_START_SERVICE *q_s, prs_struct *ps, int depth)
{
if (q_s == NULL) return;
prs_debug(ps, depth, desc, "svc_io_q_start_service");
depth++;
prs_align(ps);
smb_io_pol_hnd("", &(q_s->pol), ps, depth);
prs_align(ps);
prs_uint32("argc ", ps, depth, &(q_s->argc ));
prs_uint32("ptr_argv", ps, depth, &(q_s->ptr_argv));
if (q_s->ptr_argv != 0)
{
int i;
prs_uint32("argc2 ", ps, depth, &(q_s->argc2));
if (q_s->argc2 > MAX_SVC_ARGS)
{
q_s->argc = q_s->argc2 = MAX_SVC_ARGS;
}
for (i = 0; i < q_s->argc2; i++)
{
smb_io_unistr2("", &(q_s->argv[i]), 1, ps, depth);
}
}
}
/*******************************************************************
reads or writes a structure.
********************************************************************/
void svc_io_r_start_service(char *desc, SVC_R_START_SERVICE *r_s, prs_struct *ps, int depth)
{
if (r_s == NULL) return;
prs_debug(ps, depth, desc, "svc_io_r_start_service");
depth++;
prs_uint32("status", ps, depth, &(r_s->status));
}
/*******************************************************************
make_svc_query_svc_cfg
********************************************************************/

View File

@ -125,6 +125,42 @@ static void api_svc_open_service( uint16 vuid, prs_struct *data,
svc_reply_open_service(&q_u, rdata);
}
/*******************************************************************
svc_reply_start_service
********************************************************************/
static void svc_reply_start_service(SVC_Q_START_SERVICE *q_s,
prs_struct *rdata)
{
SVC_R_START_SERVICE r_s;
DEBUG(5,("svc_start_service: %d\n", __LINE__));
r_s.status = 0x0;
if (find_lsa_policy_by_hnd(&q_s->pol) == -1)
{
r_s.status = 0xC000000 | NT_STATUS_INVALID_HANDLE;
}
/* start the service here */
/* store the response in the SMB stream */
svc_io_r_start_service("", &r_s, rdata, 0);
DEBUG(5,("svc_start_service: %d\n", __LINE__));
}
/*******************************************************************
api_svc_start_service
********************************************************************/
static void api_svc_start_service( uint16 vuid, prs_struct *data,
prs_struct *rdata )
{
SVC_Q_START_SERVICE q_u;
svc_io_q_start_service("", &q_u, data, 0);
svc_reply_start_service(&q_u, rdata);
}
/*******************************************************************
svc_reply_open_sc_man
********************************************************************/
@ -338,6 +374,7 @@ static struct api_struct api_svc_cmds[] =
{ "SVC_OPEN_SERVICE" , SVC_OPEN_SERVICE , api_svc_open_service },
{ "SVC_ENUM_SVCS_STATUS", SVC_ENUM_SVCS_STATUS, api_svc_enum_svcs_status },
{ "SVC_QUERY_DISP_NAME" , SVC_QUERY_DISP_NAME , api_svc_query_disp_name },
{ "SVC_START_SERVICE" , SVC_START_SERVICE , api_svc_start_service },
{ NULL , 0 , NULL }
};