r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / rpc_server / srv_lsa_ds.c
blobdb741a1b64a92dfae1b5b4c7f26cdd9c9e1fe5c0
1 /*
2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Gerald Carter 2003
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 /* This is the interface for the registry functions. */
23 #include "includes.h"
25 #undef DBGC_CLASS
26 #define DBGC_CLASS DBGC_RPC_SRV
28 /*******************************************************************
29 ********************************************************************/
31 static BOOL api_dsrole_get_primary_dominfo(pipes_struct *p)
33 DS_Q_GETPRIMDOMINFO q_u;
34 DS_R_GETPRIMDOMINFO r_u;
35 prs_struct *data = &p->in_data.data;
36 prs_struct *rdata = &p->out_data.rdata;
38 ZERO_STRUCT(q_u);
39 ZERO_STRUCT(r_u);
41 /* grab the request */
42 if ( !ds_io_q_getprimdominfo("", &q_u, data, 0) )
43 return False;
45 /* construct reply. */
46 r_u.status = _dsrole_get_primary_dominfo( p, &q_u, &r_u );
48 if ( !ds_io_r_getprimdominfo("", &r_u, rdata, 0) )
49 return False;
51 return True;
54 /*******************************************************************
55 stub functions for unimplemented RPC
56 *******************************************************************/
58 static BOOL api_dsrole_stub( pipes_struct *p )
60 DEBUG(0,("api_dsrole_stub: Hmmm....didn't know this RPC existed...\n"));
62 return False;
66 /*******************************************************************
67 array of \PIPE\lsass (new windows 2000 UUID) operations
68 ********************************************************************/
69 static struct api_struct api_lsa_ds_cmds[] = {
70 { "DS_NOP", DS_NOP, api_dsrole_stub },
71 { "DS_GETPRIMDOMINFO", DS_GETPRIMDOMINFO, api_dsrole_get_primary_dominfo }
75 void lsa_ds_get_pipe_fns( struct api_struct **fns, int *n_fns )
77 *fns = api_lsa_ds_cmds;
78 *n_fns = sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct);
82 NTSTATUS rpc_lsa_ds_init(void)
84 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsa_ds", "lsa_ds", api_lsa_ds_cmds,
85 sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct));