From 11777e6a3085a996ab2c5fa3db34d8834401c24e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 14 Aug 2003 21:14:28 +0000 Subject: Attempt at fixing bug #283. There however is no solution. There is a workaround documented in the bug report. This patch does: * add server support for the LSA_DS UUID on the lsarpc pipe * store a list of context_ids/api_structs in the pipe_struct so that we don't have to lookup the function table for a pipe. We just match the context_id. Note that a dce/rpc alter_context does not destroy the previous context so it is possible to have multiple bindings active on the same pipe. Observed from standalone win2k sp4 client. * added server code for DsROleGetPrimaryDOmainInfo() but disabled it since it causes problems enumerating users and groups from a 2ksp4 domain member in a Samba domain. (This used to be commit 96bc2abfcb0dd0912696fad76e43cb217b33e061) --- source3/rpc_server/srv_lsa_ds.c | 91 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 source3/rpc_server/srv_lsa_ds.c (limited to 'source3/rpc_server/srv_lsa_ds.c') diff --git a/source3/rpc_server/srv_lsa_ds.c b/source3/rpc_server/srv_lsa_ds.c new file mode 100644 index 0000000000..5996935b22 --- /dev/null +++ b/source3/rpc_server/srv_lsa_ds.c @@ -0,0 +1,91 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Copyright (C) Gerald Carter 2003 + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* This is the interface for the registry functions. */ + +#include "includes.h" + +#undef DBGC_CLASS +#define DBGC_CLASS DBGC_RPC_SRV + +/******************************************************************* + api_reg_open_entry + ********************************************************************/ + +static BOOL api_dsrole_get_primary_dominfo(pipes_struct *p) +{ + DS_Q_GETPRIMDOMINFO q_u; + DS_R_GETPRIMDOMINFO r_u; + prs_struct *data = &p->in_data.data; + prs_struct *rdata = &p->out_data.rdata; + + ZERO_STRUCT(q_u); + ZERO_STRUCT(r_u); + + /* grab the request */ + if ( !ds_io_q_getprimdominfo("", data, 0, &q_u) ) + return False; + + /* construct reply. */ + r_u.status = _dsrole_get_primary_dominfo( p, &q_u, &r_u ); + + if ( !ds_io_r_getprimdominfo("", rdata, 0, &r_u) ) + return False; + + return True; +} + +/******************************************************************* + stub functions for unimplemented RPC +*******************************************************************/ + +static BOOL api_dsrole_stub( pipes_struct *p ) +{ + DEBUG(0,("api_dsrole_stub: Hmmm....didn't know this RPC existsed?!??!\n")); + + return False; +} + + +/******************************************************************* + array of \PIPE\lsass (new windows 2000 UUID) operations +********************************************************************/ +static struct api_struct api_lsa_ds_cmds[] = { + { "DS_NOP", DS_NOP, api_dsrole_stub } + +#if 0 /* disabled due to breakage with viewing domain users and groups + on a Samba PDC from win2k clients --jerry CIFS 2003 */ + { "DS_GETPRIMDOMINFO", DS_GETPRIMDOMINFO, api_dsrole_get_primary_dominfo } +#endif + +}; + +void lsa_ds_get_pipe_fns( struct api_struct **fns, int *n_fns ) +{ + *fns = api_lsa_ds_cmds; + *n_fns = sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct); +} + + +NTSTATUS rpc_lsa_ds_init(void) +{ + return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsa_ds", "lsa_ds", api_lsa_ds_cmds, + sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct)); +} -- cgit