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
65 const struct ldb_map_objectclass samba3_objectclasses[] = {
66 { "group", "sambaGroupMapping" },
67 { "user", "sambaSAMAccount" },
68 { "domain", "sambaDomain" },
71 const struct ldb_map_attribute samba3_attributes[] =
73 /* sambaNextRid -> nextRid */
75 .local_name = "nextRid",
77 .u.rename.remote_name = "sambaNextRid",
80 /* sambaBadPasswordTime -> badPasswordtime*/
82 .local_name = "badPasswordTime",
84 .u.rename.remote_name = "sambaBadPasswordTime",
87 /* sambaLMPassword -> lmPwdHash*/
89 .local_name = "lmPwdHash",
91 .u.rename.remote_name = "sambaLMPassword",
94 /* sambaGroupType -> groupType */
96 .local_name = "groupType",
98 .u.rename.remote_name = "sambaGroupType",
101 /* sambaNTPassword -> ntPwdHash*/
103 .local_name = "badPwdCount",
105 .u.rename.remote_name = "sambaNTPassword",
108 /* sambaPrimaryGroupSID -> primaryGroupID */
110 .local_name = "primaryGroupID",
112 .u.convert.remote_name = "sambaPrimaryGroupSID",
113 .u.convert.convert_local = NULL, /* FIXME: Add domain SID */
114 .u.convert.convert_remote = NULL, /* FIXME: Extract RID */
117 /* sambaBadPasswordCount -> badPwdCount */
119 .local_name = "badPwdCount",
121 .u.rename.remote_name = "sambaBadPasswordCount",
124 /* sambaLogonTime -> lastLogon*/
126 .local_name = "lastLogon",
128 .u.rename.remote_name = "sambaLogonTime",
131 /* sambaLogoffTime -> lastLogoff*/
133 .local_name = "lastLogoff",
135 .u.rename.remote_name = "sambaLogoffTime",
138 /* gidNumber -> unixName */
140 .local_name = "unixName",
142 .u.convert.remote_name = "gidNumber",
143 .u.convert.convert_local = NULL, /* FIXME: Lookup gid */
144 .u.convert.convert_remote = NULL, /* FIXME: Lookup groupname */
147 /* uid -> unixName */
149 .local_name = "unixName",
151 .u.convert.remote_name = "uid",
152 .u.convert.convert_local = NULL, /* FIXME: Lookup uid */
153 .u.convert.convert_remote = NULL, /* FIXME: Lookup username */
156 /* displayName -> name */
158 .local_name = "name",
160 .u.rename.remote_name = "displayName",
171 .local_name = "description",
175 /* sambaSID -> objectSid*/
177 .local_name = "objectSid",
179 .u.rename.remote_name = "sambaSID",
182 /* sambaPwdLastSet -> pwdLastSet*/
184 .local_name = "pwdLastSet",
186 .u.rename.remote_name = "sambaPwdLastSet",
190 /* the init function */
191 #ifdef HAVE_DLOPEN_DISABLED
192 struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
194 struct ldb_module *ldb_samba3_module_init(struct ldb_context *ldb, const char *options[])
197 return ldb_map_init(ldb, &samba3_attributes, &samba3_objectclasses, options);