idmap_tdb: If one SID fails to map, try the rest
[samba.git] / source3 / libads / ldap_schema.h
1 /*
2    Unix SMB/CIFS implementation.
3    ads (active directory) utility library
4    Copyright (C) Guenther Deschner 2005-2007
5    Copyright (C) Gerald (Jerry) Carter 2006
6
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 3 of the License, or
10    (at your option) any later version.
11
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.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef _LIBADS_LDAP_SCHEMA_H_
22 #define _LIBADS_LDAP_SCHEMA_H_
23
24 /* used to remember the names of the posix attributes in AD */
25 /* see the rfc2307 & sfu nss backends */
26
27 struct posix_schema {
28         char *posix_homedir_attr;
29         char *posix_shell_attr;
30         char *posix_uidnumber_attr;
31         char *posix_gidnumber_attr;
32         char *posix_gecos_attr;
33         char *posix_uid_attr;
34 };
35
36 enum wb_posix_mapping {
37         WB_POSIX_MAP_UNKNOWN    = -1,
38         WB_POSIX_MAP_TEMPLATE   = 0,
39         WB_POSIX_MAP_SFU        = 1,
40         WB_POSIX_MAP_SFU20      = 2,
41         WB_POSIX_MAP_RFC2307    = 3,
42         WB_POSIX_MAP_UNIXINFO   = 4
43 };
44
45 /* The following definitions come from libads/ldap_schema.c  */
46
47 const char *ads_get_attrname_by_guid(ADS_STRUCT *ads,
48                                      const char *schema_path,
49                                      TALLOC_CTX *mem_ctx,
50                                      const struct GUID *schema_guid);
51 ADS_STATUS ads_schema_path(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, char **schema_path);
52 ADS_STATUS ads_check_posix_schema_mapping(TALLOC_CTX *mem_ctx,
53                                           ADS_STRUCT *ads,
54                                           enum wb_posix_mapping map_type,
55                                           struct posix_schema **s ) ;
56
57 #endif /* _LIBADS_LDAP_SCHEMA_H_ */