summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/include/rpc_svcctl.h21
-rw-r--r--source3/rpc_parse/parse_svc.c58
-rw-r--r--source3/rpc_server/srv_svcctl.c39
4 files changed, 122 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c5d867054e..f563daaef2 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2599,6 +2599,10 @@ void make_svc_r_query_svc_config(SVC_R_QUERY_SVC_CONFIG *r_c,
QUERY_SERVICE_CONFIG *cfg,
uint32 buf_size);
void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_struct *ps, int depth);
+void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth);
+void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d,
+ char *disp_name, uint32 status);
+void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth);
void make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd);
void svc_io_q_close(char *desc, SVC_Q_CLOSE *q_u, prs_struct *ps, int depth);
void svc_io_r_close(char *desc, SVC_R_CLOSE *r_u, prs_struct *ps, int depth);
diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h
index 8710a86276..c32ba87ba9 100644
--- a/source3/include/rpc_svcctl.h
+++ b/source3/include/rpc_svcctl.h
@@ -29,6 +29,7 @@
#define SVC_OPEN_SC_MAN 0x0f
#define SVC_ENUM_SVCS_STATUS 0x0e
#define SVC_QUERY_SVC_CONFIG 0x11
+#define SVC_QUERY_DISP_NAME 0x14
#define SVC_OPEN_SERVICE 0x10
#define SVC_CLOSE 0x00
@@ -158,6 +159,26 @@ typedef struct r_svc_query_svc_cfg_info
} SVC_R_QUERY_SVC_CONFIG;
+/* SVC_Q_QUERY_DISP_NAME */
+typedef struct q_svc_query_disp_name_info
+{
+ POLICY_HND scman_pol;
+ UNISTR2 uni_svc_name;
+ uint32 buf_size;
+
+} SVC_Q_QUERY_DISP_NAME;
+
+
+/* SVC_R_QUERY_DISP_NAME */
+typedef struct r_svc_query_disp_name_info
+{
+ UNISTR2 uni_disp_name;
+ uint32 buf_size;
+ uint32 status;
+
+} SVC_R_QUERY_DISP_NAME;
+
+
/* SVC_Q_CLOSE */
typedef struct q_svc_close_info
{
diff --git a/source3/rpc_parse/parse_svc.c b/source3/rpc_parse/parse_svc.c
index 9c1f0f3335..e8cdd35a2c 100644
--- a/source3/rpc_parse/parse_svc.c
+++ b/source3/rpc_parse/parse_svc.c
@@ -521,6 +521,64 @@ void svc_io_r_query_svc_config(char *desc, SVC_R_QUERY_SVC_CONFIG *r_u, prs_str
}
/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+void svc_io_q_query_disp_name(char *desc, SVC_Q_QUERY_DISP_NAME *q_u, prs_struct *ps, int depth)
+{
+ if (q_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_q_query_disp_name");
+ depth++;
+
+ prs_align(ps);
+
+ smb_io_pol_hnd("", &(q_u->scman_pol), ps, depth);
+ prs_align(ps);
+
+ smb_io_unistr2("uni_svc_name", &(q_u->uni_svc_name), 1, ps, depth);
+ prs_align(ps);
+
+ prs_uint32("buf_size", ps, depth, &(q_u->buf_size));
+}
+
+/*******************************************************************
+makes an SVC_R_QUERY_DISP_NAME structure.
+********************************************************************/
+void make_svc_r_query_disp_name(SVC_R_QUERY_DISP_NAME *r_d,
+ char *disp_name, uint32 status)
+{
+ uint32 len = strlen(disp_name);
+
+ if (r_d == NULL) return;
+
+ DEBUG(5,("make_svc_r_query_disp_name\n"));
+
+ make_unistr2(&(r_d->uni_disp_name), disp_name, len+1);
+ r_d->buf_size = len;
+
+ r_d->status = status;
+}
+
+/*******************************************************************
+reads or writes a structure.
+********************************************************************/
+void svc_io_r_query_disp_name(char *desc, SVC_R_QUERY_DISP_NAME *r_u, prs_struct *ps, int depth)
+{
+ if (r_u == NULL) return;
+
+ prs_debug(ps, depth, desc, "svc_io_r_query_disp_name");
+ depth++;
+
+ prs_align(ps);
+
+ smb_io_unistr2("uni_disp_name", &(r_u->uni_disp_name), 1, ps, depth);
+ prs_align(ps);
+
+ prs_uint32("buf_size", ps, depth, &(r_u->buf_size));
+ prs_uint32("status ", ps, depth, &(r_u->status ));
+}
+
+/*******************************************************************
makes an SVC_Q_CLOSE structure.
********************************************************************/
void make_svc_q_close(SVC_Q_CLOSE *q_c, POLICY_HND *hnd)
diff --git a/source3/rpc_server/srv_svcctl.c b/source3/rpc_server/srv_svcctl.c
index 56a0749776..d52816df80 100644
--- a/source3/rpc_server/srv_svcctl.c
+++ b/source3/rpc_server/srv_svcctl.c
@@ -291,6 +291,44 @@ static void api_svc_enum_svcs_status( uint16 vuid, prs_struct *data,
}
/*******************************************************************
+ svc_reply_query_disp_name
+ ********************************************************************/
+static void svc_reply_query_disp_name(SVC_Q_QUERY_DISP_NAME *q_u,
+ prs_struct *rdata)
+{
+ SVC_R_QUERY_DISP_NAME r_u;
+ fstring svc_name;
+ uint32 status = 0;
+
+ DEBUG(5,("svc_query_disp_name: %d\n", __LINE__));
+
+ if (find_lsa_policy_by_hnd(&q_u->scman_pol) == -1)
+ {
+ status = 0xC000000 | NT_STATUS_INVALID_HANDLE;
+ }
+
+ /* for now display name = service name */
+ unistr2_to_ascii(svc_name, &q_u->uni_svc_name, sizeof(svc_name)-1);
+ make_svc_r_query_disp_name(&r_u, svc_name, status);
+
+ /* store the response in the SMB stream */
+ svc_io_r_query_disp_name("", &r_u, rdata, 0);
+
+ DEBUG(5,("svc_query_disp_name: %d\n", __LINE__));
+}
+
+/*******************************************************************
+ api_svc_query_disp_name
+ ********************************************************************/
+static void api_svc_query_disp_name( uint16 vuid, prs_struct *data,
+ prs_struct *rdata )
+{
+ SVC_Q_QUERY_DISP_NAME q_u;
+ svc_io_q_query_disp_name("", &q_u, data, 0);
+ svc_reply_query_disp_name(&q_u, rdata);
+}
+
+/*******************************************************************
array of \PIPE\svcctl operations
********************************************************************/
static struct api_struct api_svc_cmds[] =
@@ -299,6 +337,7 @@ static struct api_struct api_svc_cmds[] =
{ "SVC_OPEN_SC_MAN" , SVC_OPEN_SC_MAN , api_svc_open_sc_man },
{ "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 },
{ NULL , 0 , NULL }
};