Initial import
[samba] / source / rpc_server / srv_lsa_ds.c
1 /*
2  *  Unix SMB/CIFS implementation.
3  *  RPC Pipe client / server routines
4  *  Copyright (C) Gerald Carter         2003
5  *
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.
10  *  
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.
15  *  
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.
19  */
20
21 /* This is the interface for the registry functions. */
22
23 #include "includes.h"
24
25 #undef DBGC_CLASS
26 #define DBGC_CLASS DBGC_RPC_SRV
27
28 #if 0   /* disabled */
29 /*******************************************************************
30  api_reg_open_entry
31  ********************************************************************/
32
33 static BOOL api_dsrole_get_primary_dominfo(pipes_struct *p)
34 {
35         DS_Q_GETPRIMDOMINFO q_u;
36         DS_R_GETPRIMDOMINFO r_u;
37         prs_struct *data = &p->in_data.data;
38         prs_struct *rdata = &p->out_data.rdata;
39
40         ZERO_STRUCT(q_u);
41         ZERO_STRUCT(r_u);
42
43         /* grab the request */
44         if ( !ds_io_q_getprimdominfo("", data, 0, &q_u) )
45                 return False;
46
47         /* construct reply. */
48         r_u.status = _dsrole_get_primary_dominfo( p, &q_u, &r_u );
49
50         if ( !ds_io_r_getprimdominfo("", rdata, 0, &r_u) )
51                 return False;
52
53         return True;
54 }
55 #endif
56
57 /*******************************************************************
58  stub functions for unimplemented RPC
59 *******************************************************************/
60
61 static BOOL api_dsrole_stub( pipes_struct *p )
62 {
63         DEBUG(0,("api_dsrole_stub:  Hmmm....didn't know this RPC existed...\n"));
64
65         return False;
66 }
67
68
69 /*******************************************************************
70  array of \PIPE\lsass (new windows 2000 UUID)  operations
71 ********************************************************************/
72 static struct api_struct api_lsa_ds_cmds[] = {
73         { "DS_NOP",                     DS_NOP,                 api_dsrole_stub }
74
75 #if 0   /* disabled due to breakage with viewing domain users and groups 
76            on a Samba PDC from win2k clients  --jerry CIFS 2003 */
77         { "DS_GETPRIMDOMINFO",          DS_GETPRIMDOMINFO,      api_dsrole_get_primary_dominfo  }
78 #endif
79
80 };
81
82 void lsa_ds_get_pipe_fns( struct api_struct **fns, int *n_fns )
83 {
84         *fns = api_lsa_ds_cmds;
85         *n_fns = sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct);
86 }
87
88
89 NTSTATUS rpc_lsa_ds_init(void)
90 {
91         return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION, "lsa_ds", "lsa_ds", api_lsa_ds_cmds,
92                 sizeof(api_lsa_ds_cmds) / sizeof(struct api_struct));
93 }