r25598: Add missing become_root/unbecome_root around calls of add_aliases.
[ira/wip.git] / examples / libmsrpc / cacusermgr / cacusermgr.h
1 /*
2  * Unix SMB/CIFS implementation. 
3  * cacusermgr definitions and includes.
4  *
5  * Copyright (C) Chris Nicholls     2005
6  * 
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation; either version 3 of the License, or (at your
10  * option) any later version.
11  * 
12  * This program is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  * 
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, see <http://www.gnu.org/licenses/>.  */
19
20 #ifndef CACUSERMGR_H_
21 #define CACUSERMGR_H_
22
23 #include "libmsrpc.h"
24 #include "includes.h"
25
26 /*used for the simple pager - mgr_page()*/
27 #define DEFAULT_SCREEN_LINES 20 
28
29 /**************
30  * prototypes *
31  **************/
32
33 /*util.c*/
34 void usage();
35 int process_cmd_line(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, int argc, char **argv);
36 void mgr_getline(fstring line);
37 void mgr_page(uint32 line_count);
38 uint32 rid_or_name(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *dom_hnd, uint32 *rid, char **name);
39 char *get_new_password(TALLOC_CTX *mem_ctx);
40 void printerr(const char *msg, NTSTATUS status);
41 void print_rid_list(uint32 *rids, char **names, uint32 num_rids);
42 void print_lookup_records(CacLookupRidsRecord *map, uint32 num_rids);
43 int list_groups(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *dom_hnd);
44 void list_privs(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, CacUserInfo *info);
45 void add_privs(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, CacUserInfo *info);
46 void list_users(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *dom_hnd);
47
48 void mgr_GetAuthDataFn(const char * pServer,
49                  const char * pShare,
50                  char * pWorkgroup,
51                  int maxLenWorkgroup,
52                  char * pUsername,
53                  int maxLenUsername,
54                  char * pPassword,
55                  int maxLenPassword);
56
57
58 /*mgr_group.c*/
59 void group_menu(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *dom_hnd, POLICY_HND *group_hnd);
60
61 /*mgr_user.c*/
62 void user_menu(CacServerHandle *hnd, TALLOC_CTX *mem_ctx, POLICY_HND *dom_hnd, POLICY_HND *user_hnd);
63
64 #endif /*CACUSERMGR_H_*/