s3:groupdb/proto.h: add GPL/Copyright header
[samba.git] / source3 / groupdb / proto.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *  Group Mapping Database
4  *
5  *  Copyright (C) Andrew Tridgell              1992-2006
6  *  Copyright (C) Jean Fran├žois Micouleau      1998-2001
7  *  Copyright (C) Gerald Carter                2006
8  *  Copyright (C) Volker Lendecke              2006
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 3 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23
24 /* The following definitions come from groupdb/mapping.c  */
25
26 NTSTATUS add_initial_entry(gid_t gid, const char *sid, enum lsa_SidType sid_name_use, const char *nt_name, const char *comment);
27 bool get_domain_group_from_sid(struct dom_sid sid, GROUP_MAP *map);
28 int smb_create_group(const char *unix_group, gid_t *new_gid);
29 int smb_delete_group(const char *unix_group);
30 int smb_set_primary_group(const char *unix_group, const char* unix_user);
31 int smb_add_user_group(const char *unix_group, const char *unix_user);
32 int smb_delete_user_group(const char *unix_group, const char *unix_user);
33 NTSTATUS pdb_default_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
34                                  struct dom_sid sid);
35 NTSTATUS pdb_default_getgrgid(struct pdb_methods *methods, GROUP_MAP *map,
36                                  gid_t gid);
37 NTSTATUS pdb_default_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
38                                  const char *name);
39 NTSTATUS pdb_default_add_group_mapping_entry(struct pdb_methods *methods,
40                                                 GROUP_MAP *map);
41 NTSTATUS pdb_default_update_group_mapping_entry(struct pdb_methods *methods,
42                                                    GROUP_MAP *map);
43 NTSTATUS pdb_default_delete_group_mapping_entry(struct pdb_methods *methods,
44                                                    struct dom_sid sid);
45 NTSTATUS pdb_default_enum_group_mapping(struct pdb_methods *methods,
46                                            const struct dom_sid *sid, enum lsa_SidType sid_name_use,
47                                            GROUP_MAP **pp_rmap, size_t *p_num_entries,
48                                            bool unix_only);
49 NTSTATUS pdb_default_create_alias(struct pdb_methods *methods,
50                                   const char *name, uint32 *rid);
51 NTSTATUS pdb_default_delete_alias(struct pdb_methods *methods,
52                                   const struct dom_sid *sid);
53 struct acct_info;
54 NTSTATUS pdb_default_get_aliasinfo(struct pdb_methods *methods,
55                                    const struct dom_sid *sid,
56                                    struct acct_info *info);
57 NTSTATUS pdb_default_set_aliasinfo(struct pdb_methods *methods,
58                                    const struct dom_sid *sid,
59                                    struct acct_info *info);
60 NTSTATUS pdb_default_add_aliasmem(struct pdb_methods *methods,
61                                   const struct dom_sid *alias, const struct dom_sid *member);
62 NTSTATUS pdb_default_del_aliasmem(struct pdb_methods *methods,
63                                   const struct dom_sid *alias, const struct dom_sid *member);
64 NTSTATUS pdb_default_enum_aliasmem(struct pdb_methods *methods,
65                                    const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
66                                    struct dom_sid **pp_members,
67                                    size_t *p_num_members);
68 NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
69                                        TALLOC_CTX *mem_ctx,
70                                        const struct dom_sid *domain_sid,
71                                        const struct dom_sid *members,
72                                        size_t num_members,
73                                        uint32 **pp_alias_rids,
74                                        size_t *p_num_alias_rids);
75 NTSTATUS pdb_nop_getgrsid(struct pdb_methods *methods, GROUP_MAP *map,
76                                  struct dom_sid sid);
77 NTSTATUS pdb_nop_getgrgid(struct pdb_methods *methods, GROUP_MAP *map,
78                                  gid_t gid);
79 NTSTATUS pdb_nop_getgrnam(struct pdb_methods *methods, GROUP_MAP *map,
80                                  const char *name);
81 NTSTATUS pdb_nop_add_group_mapping_entry(struct pdb_methods *methods,
82                                                 GROUP_MAP *map);
83 NTSTATUS pdb_nop_update_group_mapping_entry(struct pdb_methods *methods,
84                                                    GROUP_MAP *map);
85 NTSTATUS pdb_nop_delete_group_mapping_entry(struct pdb_methods *methods,
86                                                    struct dom_sid sid);
87 NTSTATUS pdb_nop_enum_group_mapping(struct pdb_methods *methods,
88                                            enum lsa_SidType sid_name_use,
89                                            GROUP_MAP **rmap, size_t *num_entries,
90                                            bool unix_only);
91 bool pdb_get_dom_grp_info(const struct dom_sid *sid, struct acct_info *info);
92 bool pdb_set_dom_grp_info(const struct dom_sid *sid, const struct acct_info *info);
93 NTSTATUS pdb_create_builtin_alias(uint32 rid);
94
95 /* The following definitions come from groupdb/mapping_tdb.c  */
96
97 const struct mapping_backend *groupdb_tdb_init(void);