One more try to fix the GNU Make dependency
[Samba/gebeck_regimport.git] / examples / sam / sam_skel.c
blobda3a3758947507a0bc6a4c20b0362cfdadcc42f4
1 /*
2 Unix SMB/CIFS implementation.
3 this is a skeleton for SAM backend modules.
5 Copyright (C) Stefan (metze) Metzmacher 2002
6 Copyright (C) Jelmer Vernooij 2002
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include "includes.h"
25 static int sam_skel_debug_level = DBGC_SAM;
27 #undef DBGC_CLASS
28 #define DBGC_CLASS sam_skel_debug_level
30 /* define the version of the SAM interface */
31 SAM_MODULE_VERSIONING_MAGIC
33 /* General API */
35 NTSTATUS sam_skel_get_sec_desc(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, const DOM_SID *sid, SEC_DESC **sd)
37 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
38 return NT_STATUS_NOT_IMPLEMENTED;
41 NTSTATUS sam_skel_set_sec_desc(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, const DOM_SID *sid, const SEC_DESC *sd)
43 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
44 return NT_STATUS_NOT_IMPLEMENTED;
48 NTSTATUS sam_skel_lookup_sid(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, const DOM_SID *sid, char **name, uint32 *type)
50 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
51 return NT_STATUS_NOT_IMPLEMENTED;
54 NTSTATUS sam_skel_lookup_name(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, const char *name, DOM_SID **sid, uint32 *type)
56 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
57 return NT_STATUS_NOT_IMPLEMENTED;
61 /* Domain API */
63 NTSTATUS sam_skel_update_domain(const SAM_METHODS *sam_methods, const SAM_DOMAIN_HANDLE *domain)
65 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
66 return NT_STATUS_NOT_IMPLEMENTED;
69 NTSTATUS sam_skel_get_domain_handle(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, SAM_DOMAIN_HANDLE **domain)
71 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
72 return NT_STATUS_NOT_IMPLEMENTED;
76 /* Account API */
78 NTSTATUS sam_skel_create_account(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *group_name, uint16 acct_ctrl, SAM_ACCOUNT_HANDLE **account)
80 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
81 return NT_STATUS_NOT_IMPLEMENTED;
84 NTSTATUS sam_skel_add_account(const SAM_METHODS *sam_methods, const SAM_ACCOUNT_HANDLE *account)
86 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
87 return NT_STATUS_NOT_IMPLEMENTED;
90 NTSTATUS sam_skel_update_account(const SAM_METHODS *sam_methods, const SAM_ACCOUNT_HANDLE *account)
92 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
93 return NT_STATUS_NOT_IMPLEMENTED;
96 NTSTATUS sam_skel_delete_account(const SAM_METHODS *sam_methods, const SAM_ACCOUNT_HANDLE *account)
98 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
99 return NT_STATUS_NOT_IMPLEMENTED;
102 NTSTATUS sam_skel_enum_accounts(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint16 acct_ctrl, uint32 *account_count, SAM_ACCOUNT_ENUM **accounts)
104 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
105 return NT_STATUS_NOT_IMPLEMENTED;
109 NTSTATUS sam_skel_get_account_by_sid(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *accountsid, SAM_ACCOUNT_HANDLE **account)
111 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
112 return NT_STATUS_NOT_IMPLEMENTED;
115 NTSTATUS sam_skel_get_account_by_name(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *name, SAM_ACCOUNT_HANDLE **account)
117 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
118 return NT_STATUS_NOT_IMPLEMENTED;
122 /* Group API */
124 NTSTATUS sam_skel_create_group(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *account_name, uint16 group_ctrl, SAM_GROUP_HANDLE **group)
126 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
127 return NT_STATUS_NOT_IMPLEMENTED;
130 NTSTATUS sam_skel_add_group(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group)
132 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
133 return NT_STATUS_NOT_IMPLEMENTED;
136 NTSTATUS sam_skel_update_group(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group)
138 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
139 return NT_STATUS_NOT_IMPLEMENTED;
142 NTSTATUS sam_skel_delete_group(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group)
144 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
145 return NT_STATUS_NOT_IMPLEMENTED;
148 NTSTATUS sam_skel_enum_groups(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint16 group_ctrl, uint32 *groups_count, SAM_GROUP_ENUM **groups)
150 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
151 return NT_STATUS_NOT_IMPLEMENTED;
154 NTSTATUS sam_skel_get_group_by_sid(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const DOM_SID *groupsid, SAM_GROUP_HANDLE **group)
156 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
157 return NT_STATUS_NOT_IMPLEMENTED;
160 NTSTATUS sam_skel_get_group_by_name(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, uint32 access_desired, const char *name, SAM_GROUP_HANDLE **group)
162 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
163 return NT_STATUS_NOT_IMPLEMENTED;
167 NTSTATUS sam_skel_add_member_to_group(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member)
169 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
170 return NT_STATUS_NOT_IMPLEMENTED;
173 NTSTATUS sam_skel_delete_member_from_group(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group, const SAM_GROUP_MEMBER *member)
175 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
176 return NT_STATUS_NOT_IMPLEMENTED;
179 NTSTATUS sam_skel_enum_groupmembers(const SAM_METHODS *sam_methods, const SAM_GROUP_HANDLE *group, uint32 *members_count, SAM_GROUP_MEMBER **members)
181 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
182 return NT_STATUS_NOT_IMPLEMENTED;
186 NTSTATUS sam_skel_get_groups_of_sid(const SAM_METHODS *sam_methods, const NT_USER_TOKEN *access_token, const DOM_SID **sids, uint16 group_ctrl, uint32 *group_count, SAM_GROUP_ENUM **groups)
188 DEBUG(0,("sam_skel: %s was called!\n",__FUNCTION__));
189 return NT_STATUS_NOT_IMPLEMENTED;
192 NTSTATUS sam_init(SAM_METHODS *sam_methods, const char *module_params)
194 /* Functions your SAM module doesn't provide should be set
195 * to NULL */
197 sam_methods->sam_get_sec_desc = sam_skel_get_sec_desc;
198 sam_methods->sam_set_sec_desc = sam_skel_set_sec_desc;
200 sam_methods->sam_lookup_sid = sam_skel_lookup_sid;
201 sam_methods->sam_lookup_name = sam_skel_lookup_name;
203 /* Domain API */
205 sam_methods->sam_update_domain = sam_skel_update_domain;
206 sam_methods->sam_get_domain_handle = sam_skel_get_domain_handle;
208 /* Account API */
210 sam_methods->sam_create_account = sam_skel_create_account;
211 sam_methods->sam_add_account = sam_skel_add_account;
212 sam_methods->sam_update_account = sam_skel_update_account;
213 sam_methods->sam_delete_account = sam_skel_delete_account;
214 sam_methods->sam_enum_accounts = sam_skel_enum_accounts;
216 sam_methods->sam_get_account_by_sid = sam_skel_get_account_by_sid;
217 sam_methods->sam_get_account_by_name = sam_skel_get_account_by_name;
219 /* Group API */
221 sam_methods->sam_create_group = sam_skel_create_group;
222 sam_methods->sam_add_group = sam_skel_add_group;
223 sam_methods->sam_update_group = sam_skel_update_group;
224 sam_methods->sam_delete_group = sam_skel_delete_group;
225 sam_methods->sam_enum_groups = sam_skel_enum_groups;
226 sam_methods->sam_get_group_by_sid = sam_skel_get_group_by_sid;
227 sam_methods->sam_get_group_by_name = sam_skel_get_group_by_name;
229 sam_methods->sam_add_member_to_group = sam_skel_add_member_to_group;
230 sam_methods->sam_delete_member_from_group = sam_skel_delete_member_from_group;
231 sam_methods->sam_enum_groupmembers = sam_skel_enum_groupmembers;
233 sam_methods->sam_get_groups_of_sid = sam_skel_get_groups_of_sid;
235 sam_methods->free_private_data = NULL;
238 sam_skel_debug_level = debug_add_class("sam_skel");
239 if (sam_skel_debug_level == -1) {
240 sam_skel_debug_level = DBGC_SAM;
241 DEBUG(0, ("sam_skel: Couldn't register custom debugging class!\n"));
242 } else DEBUG(2, ("sam_skel: Debug class number of 'sam_skel': %d\n", sam_skel_debug_level));
244 if(module_params)
245 DEBUG(0, ("Starting 'sam_skel' with parameters '%s' for domain %s\n", module_params, sam_methods->domain_name));
246 else
247 DEBUG(0, ("Starting 'sam_skel' for domain %s without paramters\n", sam_methods->domain_name));
249 return NT_STATUS_OK;