summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_netlog_nt.c60
-rw-r--r--source3/rpc_server/srv_ntsvcs.c148
-rw-r--r--source3/rpc_server/srv_ntsvcs_nt.c51
3 files changed, 61 insertions, 198 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 038690d0f1..16d370ce6d 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -90,28 +90,24 @@ static void init_netlogon_info3(struct netr_NETLOGON_INFO_3 *r,
WERROR _netr_LogonControl(pipes_struct *p,
struct netr_LogonControl *r)
{
- struct netr_NETLOGON_INFO_1 *info1;
- uint32_t flags = 0x0;
- uint32_t pdc_connection_status = W_ERROR_V(WERR_OK);
-
- /* Setup the Logon Control response */
+ struct netr_LogonControl2Ex l;
switch (r->in.level) {
- case 1:
- info1 = TALLOC_ZERO_P(p->mem_ctx, struct netr_NETLOGON_INFO_1);
- if (!info1) {
- return WERR_NOMEM;
- }
- init_netlogon_info1(info1,
- flags,
- pdc_connection_status);
- r->out.info->info1 = info1;
- break;
- default:
- return WERR_UNKNOWN_LEVEL;
+ case 1:
+ break;
+ case 2:
+ return WERR_NOT_SUPPORTED;
+ default:
+ return WERR_UNKNOWN_LEVEL;
}
- return WERR_OK;
+ l.in.logon_server = r->in.logon_server;
+ l.in.function_code = r->in.function_code;
+ l.in.level = r->in.level;
+ l.in.data = NULL;
+ l.out.query = r->out.info;
+
+ return _netr_LogonControl2Ex(p, &l);
}
/****************************************************************************
@@ -132,6 +128,24 @@ static void send_sync_message(void)
WERROR _netr_LogonControl2(pipes_struct *p,
struct netr_LogonControl2 *r)
{
+ struct netr_LogonControl2Ex l;
+
+ l.in.logon_server = r->in.logon_server;
+ l.in.function_code = r->in.function_code;
+ l.in.level = r->in.level;
+ l.in.data = r->in.data;
+ l.out.query = r->out.query;
+
+ return _netr_LogonControl2Ex(p, &l);
+}
+
+/****************************************************************
+ _netr_LogonControl2Ex
+****************************************************************/
+
+WERROR _netr_LogonControl2Ex(pipes_struct *p,
+ struct netr_LogonControl2Ex *r)
+{
uint32 flags = 0x0;
uint32 pdc_connection_status = 0x0;
uint32 logon_attempts = 0x0;
@@ -1142,16 +1156,6 @@ NTSTATUS _netr_DatabaseRedo(pipes_struct *p,
/****************************************************************
****************************************************************/
-WERROR _netr_LogonControl2Ex(pipes_struct *p,
- struct netr_LogonControl2Ex *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
-****************************************************************/
-
WERROR _netr_DsRGetDCName(pipes_struct *p,
struct netr_DsRGetDCName *r)
{
diff --git a/source3/rpc_server/srv_ntsvcs.c b/source3/rpc_server/srv_ntsvcs.c
deleted file mode 100644
index 840da3eec4..0000000000
--- a/source3/rpc_server/srv_ntsvcs.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Unix SMB/CIFS implementation.
- * RPC Pipe client / server routines
- * Copyright (C) Gerald Carter 2005.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "includes.h"
-#include "librpc/gen_ndr/srv_ntsvcs.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_RPC_SRV
-
-/*******************************************************************
- ********************************************************************/
-
-static bool proxy_ntsvcs_call(pipes_struct *p, uint8_t opnum)
-{
- struct api_struct *fns;
- int n_fns;
-
- ntsvcs_get_pipe_fns(&fns, &n_fns);
-
- if (opnum >= n_fns) {
- return false;
- }
-
- if (fns[opnum].opnum != opnum) {
- smb_panic("NTSVCS function table not sorted");
- }
-
- return fns[opnum].fn(p);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_version(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETVERSION);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_list_size(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICELISTSIZE);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_list(pipes_struct *p)
-{
- NTSVCS_Q_GET_DEVICE_LIST q_u;
- NTSVCS_R_GET_DEVICE_LIST r_u;
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!ntsvcs_io_q_get_device_list("", &q_u, data, 0))
- return False;
-
- r_u.status = _ntsvcs_get_device_list(p, &q_u, &r_u);
-
- if(!ntsvcs_io_r_get_device_list("", &r_u, rdata, 0))
- return False;
-
- return True;
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_validate_device_instance(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_VALIDATEDEVICEINSTANCE);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_device_reg_property(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETDEVICEREGPROP);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_get_hw_profile_info(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_GETHWPROFINFO);
-}
-
-/*******************************************************************
- ********************************************************************/
-
-static bool api_ntsvcs_hw_profile_flags(pipes_struct *p)
-{
- return proxy_ntsvcs_call(p, NDR_PNP_HWPROFFLAGS);
-}
-
-/*******************************************************************
- \PIPE\svcctl commands
- ********************************************************************/
-
-static struct api_struct api_ntsvcs_cmds[] =
-{
- { "NTSVCS_GET_VERSION" , NTSVCS_GET_VERSION , api_ntsvcs_get_version },
- { "NTSVCS_GET_DEVICE_LIST_SIZE" , NTSVCS_GET_DEVICE_LIST_SIZE , api_ntsvcs_get_device_list_size },
- { "NTSVCS_GET_DEVICE_LIST" , NTSVCS_GET_DEVICE_LIST , api_ntsvcs_get_device_list },
- { "NTSVCS_VALIDATE_DEVICE_INSTANCE" , NTSVCS_VALIDATE_DEVICE_INSTANCE , api_ntsvcs_validate_device_instance },
- { "NTSVCS_GET_DEVICE_REG_PROPERTY" , NTSVCS_GET_DEVICE_REG_PROPERTY , api_ntsvcs_get_device_reg_property },
- { "NTSVCS_GET_HW_PROFILE_INFO" , NTSVCS_GET_HW_PROFILE_INFO , api_ntsvcs_get_hw_profile_info },
- { "NTSVCS_HW_PROFILE_FLAGS" , NTSVCS_HW_PROFILE_FLAGS , api_ntsvcs_hw_profile_flags }
-};
-
-
-void ntsvcs2_get_pipe_fns( struct api_struct **fns, int *n_fns )
-{
- *fns = api_ntsvcs_cmds;
- *n_fns = sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct);
-}
-
-NTSTATUS rpc_ntsvcs2_init(void)
-{
- return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION,
- "ntsvcs", "ntsvcs",
- &ndr_table_ntsvcs.syntax_id,
- api_ntsvcs_cmds,
- sizeof(api_ntsvcs_cmds) / sizeof(struct api_struct));
-}
diff --git a/source3/rpc_server/srv_ntsvcs_nt.c b/source3/rpc_server/srv_ntsvcs_nt.c
index f2c85bbd3e..681c543c24 100644
--- a/source3/rpc_server/srv_ntsvcs_nt.c
+++ b/source3/rpc_server/srv_ntsvcs_nt.c
@@ -65,29 +65,46 @@ WERROR _PNP_GetDeviceListSize(pipes_struct *p,
return WERR_OK;
}
+/****************************************************************
+ _PNP_GetDeviceList
+****************************************************************/
-/********************************************************************
-********************************************************************/
-
-WERROR _ntsvcs_get_device_list( pipes_struct *p, NTSVCS_Q_GET_DEVICE_LIST *q_u, NTSVCS_R_GET_DEVICE_LIST *r_u )
+WERROR _PNP_GetDeviceList(pipes_struct *p,
+ struct PNP_GetDeviceList *r)
{
- fstring device;
char *devicepath;
+ uint32_t size = 0;
- if ( !q_u->devicename )
- return WERR_ACCESS_DENIED;
+ DATA_BLOB blob;
+ struct lsa_StringLarge s;
+ enum ndr_err_code ndr_err;
- rpcstr_pull(device, q_u->devicename->buffer, sizeof(device), q_u->devicename->uni_str_len*2, 0);
+ if ( !r->in.filter )
+ return WERR_ACCESS_DENIED;
- if (!(devicepath = get_device_path(p->mem_ctx, device))) {
+ if (!(devicepath = get_device_path(p->mem_ctx, r->in.filter))) {
return WERR_NOMEM;
}
+ size = strlen(devicepath) + 2;
+
+ if (*r->in.length < size) {
+ return WERR_CM_BUFFER_SMALL;
+ }
+
+ s.string = r->in.filter;
+
/* This has to be DOUBLE NULL terminated */
+ ndr_err = ndr_push_struct_blob(&blob, p->mem_ctx, NULL, &s,
+ (ndr_push_flags_fn_t)ndr_push_lsa_StringLarge);
+ if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ return ntstatus_to_werror(ndr_map_error2ntstatus(ndr_err));
+ }
- init_unistr2( &r_u->devicepath, devicepath, UNI_STR_DBLTERMINATE );
- TALLOC_FREE(devicepath);
- r_u->needed = r_u->devicepath.uni_str_len;
+ r->out.buffer = (uint16_t *)talloc_memdup(p->mem_ctx, blob.data, blob.length);
+ if (!r->out.buffer) {
+ return WERR_NOMEM;
+ }
return WERR_OK;
}
@@ -271,16 +288,6 @@ WERROR _PNP_EnumerateSubKeys(pipes_struct *p,
/****************************************************************
****************************************************************/
-WERROR _PNP_GetDeviceList(pipes_struct *p,
- struct PNP_GetDeviceList *r)
-{
- p->rng_fault_state = true;
- return WERR_NOT_SUPPORTED;
-}
-
-/****************************************************************
-****************************************************************/
-
WERROR _PNP_GetDepth(pipes_struct *p,
struct PNP_GetDepth *r)
{