call initgroups before becomming the user; patch from Fabio Cecchi
[Samba/gebeck_regimport.git] / source3 / rpcclient / cmd_epmapper.c
blobe2eecb6f04966e601aff5c9f51b78f0a505bfa4e
1 /*
2 Unix SMB/CIFS implementation.
3 RPC pipe client
5 Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "includes.h"
23 #include "rpcclient.h"
26 static NTSTATUS cmd_epm_map(struct cli_state *cli,
27 TALLOC_CTX *mem_ctx,
28 int argc, const char **argv)
30 EPM_HANDLE handle, entry_handle;
31 EPM_TOWER *towers;
32 EPM_FLOOR floors[5];
33 uint8 addr[4] = {0,0,0,0};
34 uint32 numtowers;
35 /* need to allow all this stuff to be passed in, but
36 for now, it demonstrates the call */
37 RPC_UUID if_uuid = {0xe3514235, 0x4b06, 0x11d1, \
38 { 0xab, 0x04, 0x00, 0xc0, \
39 0x4f, 0xc2, 0xdc, 0xd2 }},
40 syn_uuid = {0x8a885d04, 0x1ceb, 0x11c9, \
41 { 0x9f, 0xe8, 0x08, 0x00, \
42 0x2b, 0x10, 0x48, 0x60 }};
44 NTSTATUS result;
46 ZERO_STRUCT(handle);
47 numtowers = 1;
48 init_epm_floor_uuid(&floors[0], &if_uuid, 4);
49 init_epm_floor_uuid(&floors[1], &syn_uuid, 2);
50 init_epm_floor_rpc(&floors[2]);
52 /* sample for netbios named pipe query
53 init_epm_floor_np(&floors[3], "\\PIPE\\lsass");
54 init_epm_floor_nb(&floors[4], "\\\\psflinux");
56 init_epm_floor_tcp(&floors[3], 135);
57 init_epm_floor_ip(&floors[4], addr);
58 towers = talloc(mem_ctx, sizeof(EPM_TOWER));
59 init_epm_tower(mem_ctx, towers, floors, 5);
61 result = cli_epm_map(cli, mem_ctx, &handle, &towers, &entry_handle, &numtowers);
63 return result;
66 struct cmd_set epm_commands[] = {
68 { "EPMAPPER" },
70 { "map", RPC_RTYPE_NTSTATUS, cmd_epm_map, NULL, PI_EPM, "map endpoint", "" },
71 { NULL }