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"
33 * sambaSIDList -> member (special!)
36 /* sambaTrustPassword */
38 /* sambaDomainName -> name */
44 /* sambaAccountPolicy: FIXME */
46 /* sambaSidEntry: FIXME */
54 * sambaAlgorithmicRidBase
57 /* sambaKickoffTime -> ???*/
58 /* sambaPwdCanChange -> ???*/
59 /* sambaPwdMustChange -> ???*/
60 /* sambaAcctFlags -> systemFlags ?*/
61 /* sambaHomePath -> ???*/
62 /* sambaHomeDrive -> ???*/
63 /* sambaLogonScript -> ???*/
64 /* sambaProfilePath -> ???*/
65 /* sambaUserWorkstations -> ???*/
66 /* sambaDomainName -> ???*/
67 /* sambaMungedDial -> ???*/
68 /* sambaPasswordHistory -> ntPwdHistory*/
69 /* sambaLogonHours -> ???*/
71 /* sambaNextRid -> nextRid */
72 const struct ldb_map_attribute attr_nextRid = {
73 .local_name = "nextRid",
75 .u.rename.remote_name = "sambaNextRid",
78 /* sambaBadPasswordTime -> badPasswordtime*/
79 const struct ldb_map_attribute attr_badPasswordTime = {
80 .local_name = "badPasswordTime",
82 .u.rename.remote_name = "sambaBadPasswordTime",
85 /* sambaLMPassword -> lmPwdHash*/
86 const struct ldb_map_attribute attr_lmPwdHash = {
87 .local_name = "lmPwdHash",
89 .u.rename.remote_name = "sambaLMPassword",
92 /* sambaGroupType -> groupType */
93 const struct ldb_map_attribute attr_groupType = {
94 .local_name = "groupType",
96 .u.rename.remote_name = "sambaGroupType",
99 /* sambaNTPassword -> ntPwdHash*/
100 const struct ldb_map_attribute attr_ntPwdHash = {
101 .local_name = "badPwdCount",
103 .u.rename.remote_name = "sambaNTPassword",
106 /* sambaPrimaryGroupSID -> primaryGroupID */
107 const struct ldb_map_attribute attr_primaryGroupID = {
108 .local_name = "primaryGroupID",
110 .u.convert.remote_name = "sambaPrimaryGroupSID",
111 .u.convert.convert_local = NULL, /* FIXME: Add domain SID */
112 .u.convert.convert_remote = NULL, /* FIXME: Extract RID */
115 /* sambaBadPasswordCount -> badPwdCount */
116 const struct ldb_map_attribute attr_badPwdCount = {
117 .local_name = "badPwdCount",
119 .u.rename.remote_name = "sambaBadPasswordCount",
122 /* sambaLogonTime -> lastLogon*/
123 const struct ldb_map_attribute attr_lastLogon = {
124 .local_name = "lastLogon",
126 .u.rename.remote_name = "sambaLogonTime",
129 /* sambaLogoffTime -> lastLogoff*/
130 const struct ldb_map_attribute attr_lastLogoff = {
131 .local_name = "lastLogoff",
133 .u.rename.remote_name = "sambaLogoffTime",
136 /* gidNumber -> unixName */
137 const struct ldb_map_attribute attr_unixName_gid = {
138 .local_name = "unixName",
140 .u.convert.remote_name = "gidNumber",
141 .u.convert.convert_local = NULL, /* FIXME: Lookup gid */
142 .u.convert.convert_remote = NULL, /* FIXME: Lookup groupname */
145 /* uid -> unixName */
146 const struct ldb_map_attribute attr_unixName_uid = {
147 .local_name = "unixName",
149 .u.convert.remote_name = "uid",
150 .u.convert.convert_local = NULL, /* FIXME: Lookup uid */
151 .u.convert.convert_remote = NULL, /* FIXME: Lookup username */
154 /* displayName -> name */
155 const struct ldb_map_attribute attr_name = {
156 .local_name = "name",
158 .u.rename.remote_name = "displayName",
162 const struct ldb_map_attribute attr_cn = {
168 const struct ldb_map_attribute attr_description = {
169 .local_name = "description",
173 /* sambaSID -> objectSid*/
174 const struct ldb_map_attribute attr_objectSid = {
175 .local_name = "objectSid",
177 .u.rename.remote_name = "sambaSID",
180 /* sambaPwdLastSet -> pwdLastSet*/
181 const struct ldb_map_attribute attr_pwdLastSet = {
182 .local_name = "pwdLastSet",
184 .u.rename.remote_name = "sambaPwdLastSet",
187 const struct ldb_map_objectclass samba3_objectclasses[] = {
188 { "group", "sambaGroupMapping" },
189 { "user", "sambaSAMAccount" },
190 { "domain", "sambaDomain" },
193 const struct ldb_map_mappings samba3_mappings =
206 &attr_primaryGroupID,
211 &attr_badPasswordTime,
216 /* the init function */
217 #ifdef HAVE_DLOPEN_DISABLED
218 struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
220 struct ldb_module *ldb_samba3_module_init(struct ldb_context *ldb, const char *options[])
223 return ldb_map_init(ldb, &samba3_mappings, options);