2 ldb database library - Samba3 compatibility backend
4 Copyright (C) Jelmer Vernooij 2005
6 ** NOTE! The following LGPL license applies to the ldb
7 ** library. This does NOT imply that all of Samba is released
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This library 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 GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "ldb/ldb_map/ldb_map.h"
27 #include "ldb/include/ldb.h"
28 #include "ldb/include/ldb_private.h"
32 * sambaSIDList -> member (special!)
33 * sambaDomainName -> name
39 * sambaAcctFlags -> systemFlags ?
40 * sambaPasswordHistory -> ntPwdHistory*/
48 * sambaAlgorithmicRidBase
59 * sambaUserWorkstations
63 /* sambaNextRid -> nextRid */
64 const struct ldb_map_attribute attr_nextRid = {
65 .local_name = "nextRid",
67 .u.rename.remote_name = "sambaNextRid",
70 /* sambaBadPasswordTime -> badPasswordtime*/
71 const struct ldb_map_attribute attr_badPasswordTime = {
72 .local_name = "badPasswordTime",
74 .u.rename.remote_name = "sambaBadPasswordTime",
77 /* sambaLMPassword -> lmPwdHash*/
78 const struct ldb_map_attribute attr_lmPwdHash = {
79 .local_name = "lmPwdHash",
81 .u.rename.remote_name = "sambaLMPassword",
84 /* sambaGroupType -> groupType */
85 const struct ldb_map_attribute attr_groupType = {
86 .local_name = "groupType",
88 .u.rename.remote_name = "sambaGroupType",
91 /* sambaNTPassword -> ntPwdHash*/
92 const struct ldb_map_attribute attr_ntPwdHash = {
93 .local_name = "badPwdCount",
95 .u.rename.remote_name = "sambaNTPassword",
98 /* sambaPrimaryGroupSID -> primaryGroupID */
99 const struct ldb_map_attribute attr_primaryGroupID = {
100 .local_name = "primaryGroupID",
102 .u.convert.remote_name = "sambaPrimaryGroupSID",
103 .u.convert.convert_local = NULL, /* FIXME: Add domain SID */
104 .u.convert.convert_remote = NULL, /* FIXME: Extract RID */
107 /* sambaBadPasswordCount -> badPwdCount */
108 const struct ldb_map_attribute attr_badPwdCount = {
109 .local_name = "badPwdCount",
111 .u.rename.remote_name = "sambaBadPasswordCount",
114 /* sambaLogonTime -> lastLogon*/
115 const struct ldb_map_attribute attr_lastLogon = {
116 .local_name = "lastLogon",
118 .u.rename.remote_name = "sambaLogonTime",
121 /* sambaLogoffTime -> lastLogoff*/
122 const struct ldb_map_attribute attr_lastLogoff = {
123 .local_name = "lastLogoff",
125 .u.rename.remote_name = "sambaLogoffTime",
128 /* gidNumber -> unixName */
129 const struct ldb_map_attribute attr_unixName_gid = {
130 .local_name = "unixName",
132 .u.convert.remote_name = "gidNumber",
133 .u.convert.convert_local = NULL, /* FIXME: Lookup gid */
134 .u.convert.convert_remote = NULL, /* FIXME: Lookup groupname */
137 /* uid -> unixName */
138 const struct ldb_map_attribute attr_unixName_uid = {
139 .local_name = "unixName",
141 .u.convert.remote_name = "uid",
142 .u.convert.convert_local = NULL, /* FIXME: Lookup uid */
143 .u.convert.convert_remote = NULL, /* FIXME: Lookup username */
146 /* displayName -> name */
147 const struct ldb_map_attribute attr_name = {
148 .local_name = "name",
150 .u.rename.remote_name = "displayName",
154 const struct ldb_map_attribute attr_cn = {
160 const struct ldb_map_attribute attr_description = {
161 .local_name = "description",
165 /* sambaSID -> objectSid*/
166 const struct ldb_map_attribute attr_objectSid = {
167 .local_name = "objectSid",
169 .u.rename.remote_name = "sambaSID",
172 /* sambaPwdLastSet -> pwdLastSet*/
173 const struct ldb_map_attribute attr_pwdLastSet = {
174 .local_name = "pwdLastSet",
176 .u.rename.remote_name = "sambaPwdLastSet",
179 const struct ldb_map_objectclass samba3_objectclasses[] = {
180 { "group", "sambaGroupMapping" },
181 { "user", "sambaSAMAccount" },
182 { "domain", "sambaDomain" },
185 const struct ldb_map_mappings samba3_mappings =
198 &attr_primaryGroupID,
203 &attr_badPasswordTime,
208 /* the init function */
209 #ifdef HAVE_DLOPEN_DISABLED
210 struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
212 struct ldb_module *ldb_samba3_module_init(struct ldb_context *ldb, const char *options[])
215 return ldb_map_init(ldb, &samba3_mappings, options);