summaryrefslogtreecommitdiff
path: root/source4/lib/samba3
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-25 15:25:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:35 -0500
commit9bf5e494f7ccbb2a9587dce961a99fa07392bf97 (patch)
tree556785b1c4fcf4f184d796c6e8a0f3e32b7daff6 /source4/lib/samba3
parent05065108f4da76e6152b9f75fc266d15c316c32d (diff)
downloadsamba-9bf5e494f7ccbb2a9587dce961a99fa07392bf97.tar.gz
samba-9bf5e494f7ccbb2a9587dce961a99fa07392bf97.tar.bz2
samba-9bf5e494f7ccbb2a9587dce961a99fa07392bf97.zip
r9616: Finish ldb_map module (still needs a lot of testing though...)
Add initial mapping table for ldb_samba3. Contains most attributes. (This used to be commit b73441b04d048919e95ee7f7bcae330c4dafefe7)
Diffstat (limited to 'source4/lib/samba3')
-rw-r--r--source4/lib/samba3/ldb_samba3.c214
1 files changed, 165 insertions, 49 deletions
diff --git a/source4/lib/samba3/ldb_samba3.c b/source4/lib/samba3/ldb_samba3.c
index 030b051938..53d8964d0d 100644
--- a/source4/lib/samba3/ldb_samba3.c
+++ b/source4/lib/samba3/ldb_samba3.c
@@ -28,74 +28,190 @@
#include "ldb/include/ldb_private.h"
/*
- * sambaGroupMapping -> group
* gidNumber -> ???
* sambaSID -> member
- * sambaGroupType -> groupType
- * displayName -> name
- * description -> description
* sambaSIDList -> member (special!)
*/
-/*
- * sambaTrustPassword
- */
+/* sambaTrustPassword */
-/* sambaDomain
- * sambaDomainName
- * sambaSID
- * sambaNextRid
- * sambaNextGroupRid
- * sambaNextUserRid
- * sambaAlgorithmicRidBase
- */
+/* sambaDomainName -> name */
-/* sambaUnixIdPool
- */
+/* sambaUnixIdPool */
/* sambaIdmapEntry */
-/* sambaAccountPolicy */
+/* sambaAccountPolicy: FIXME */
/* sambaSidEntry: FIXME */
-/* sambaSamAccount -> user:
- * uid -> unixName (magic!)
- * sambaSID -> objectSid
- * cn -> cn
- * sambaLMPassword -> lmPwdHash
- * sambaNTPassword -> ntPwdHash
- * sambaPwdLastSet -> pwdLastSet
- * sambaLogonTime -> lastLogon
- * sambaLogoffTime -> lastLogoff
- * sambaKickoffTime -> ???
- * sambaPwdCanChange -> ???
- * sambaPwdMustChange -> ???
- * sambaAcctFlags -> systemFlags ?
- * displayName -> name
- * sambaHomePath -> ???
- * sambaHomeDrive -> ???
- * sambaLogonScript -> ???
- * sambaProfilePath -> ???
- * description -> description
- * sambaUserWorkstations -> ???
- * sambaPrimaryGroupSID -> primaryGroupID
- * sambaDomainName -> ???
- * sambaMungedDial -> ???
- * sambaBadPasswordCount -> badPwdcount
- * sambaBadPasswordTime -> badPasswordtime
- * sambaPasswordHistory -> ntPwdHistory
- * sambaLogonHours -> ???
- */
-
/* Not necessary:
* sambaConfig
* sambaShare
* sambaConfigOption
+ * sambaNextGroupRid
+ * sambaNextUserRid
+ * sambaAlgorithmicRidBase
*/
-
-struct ldb_map_mappings samba3_mappings;
+/* sambaKickoffTime -> ???*/
+/* sambaPwdCanChange -> ???*/
+/* sambaPwdMustChange -> ???*/
+/* sambaAcctFlags -> systemFlags ?*/
+/* sambaHomePath -> ???*/
+/* sambaHomeDrive -> ???*/
+/* sambaLogonScript -> ???*/
+/* sambaProfilePath -> ???*/
+/* sambaUserWorkstations -> ???*/
+/* sambaDomainName -> ???*/
+/* sambaMungedDial -> ???*/
+/* sambaPasswordHistory -> ntPwdHistory*/
+/* sambaLogonHours -> ???*/
+
+/* sambaNextRid -> nextRid */
+const struct ldb_map_attribute attr_nextRid = {
+ .local_name = "nextRid",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaNextRid",
+};
+
+/* sambaBadPasswordTime -> badPasswordtime*/
+const struct ldb_map_attribute attr_badPasswordTime = {
+ .local_name = "badPasswordTime",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaBadPasswordTime",
+};
+
+/* sambaLMPassword -> lmPwdHash*/
+const struct ldb_map_attribute attr_lmPwdHash = {
+ .local_name = "lmPwdHash",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaLMPassword",
+};
+
+/* sambaGroupType -> groupType */
+const struct ldb_map_attribute attr_groupType = {
+ .local_name = "groupType",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaGroupType",
+};
+
+/* sambaNTPassword -> ntPwdHash*/
+const struct ldb_map_attribute attr_ntPwdHash = {
+ .local_name = "badPwdCount",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaNTPassword",
+};
+
+/* sambaPrimaryGroupSID -> primaryGroupID */
+const struct ldb_map_attribute attr_primaryGroupID = {
+ .local_name = "primaryGroupID",
+ .type = MAP_CONVERT,
+ .u.convert.remote_name = "sambaPrimaryGroupSID",
+ .u.convert.convert_local = NULL, /* FIXME: Add domain SID */
+ .u.convert.convert_remote = NULL, /* FIXME: Extract RID */
+};
+
+/* sambaBadPasswordCount -> badPwdCount */
+const struct ldb_map_attribute attr_badPwdCount = {
+ .local_name = "badPwdCount",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaBadPasswordCount",
+};
+
+/* sambaLogonTime -> lastLogon*/
+const struct ldb_map_attribute attr_lastLogon = {
+ .local_name = "lastLogon",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaLogonTime",
+};
+
+/* sambaLogoffTime -> lastLogoff*/
+const struct ldb_map_attribute attr_lastLogoff = {
+ .local_name = "lastLogoff",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaLogoffTime",
+};
+
+/* gidNumber -> unixName */
+const struct ldb_map_attribute attr_unixName_gid = {
+ .local_name = "unixName",
+ .type = MAP_CONVERT,
+ .u.convert.remote_name = "gidNumber",
+ .u.convert.convert_local = NULL, /* FIXME: Lookup gid */
+ .u.convert.convert_remote = NULL, /* FIXME: Lookup groupname */
+};
+
+/* uid -> unixName */
+const struct ldb_map_attribute attr_unixName_uid = {
+ .local_name = "unixName",
+ .type = MAP_CONVERT,
+ .u.convert.remote_name = "uid",
+ .u.convert.convert_local = NULL, /* FIXME: Lookup uid */
+ .u.convert.convert_remote = NULL, /* FIXME: Lookup username */
+};
+
+/* displayName -> name */
+const struct ldb_map_attribute attr_name = {
+ .local_name = "name",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "displayName",
+};
+
+/* cn */
+const struct ldb_map_attribute attr_cn = {
+ .local_name = "cn",
+ .type = MAP_KEEP,
+};
+
+/* description */
+const struct ldb_map_attribute attr_description = {
+ .local_name = "description",
+ .type = MAP_KEEP,
+};
+
+/* sambaSID -> objectSid*/
+const struct ldb_map_attribute attr_objectSid = {
+ .local_name = "objectSid",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaSID",
+};
+
+/* sambaPwdLastSet -> pwdLastSet*/
+const struct ldb_map_attribute attr_pwdLastSet = {
+ .local_name = "pwdLastSet",
+ .type = MAP_RENAME,
+ .u.rename.remote_name = "sambaPwdLastSet",
+};
+
+const struct ldb_map_objectclass samba3_objectclasses[] = {
+ { "group", "sambaGroupMapping" },
+ { "user", "sambaSAMAccount" },
+ { "domain", "sambaDomain" },
+};
+
+const struct ldb_map_mappings samba3_mappings =
+{
+ .name = "samba3",
+ {
+ &attr_objectSid,
+ &attr_pwdLastSet,
+ &attr_description,
+ &attr_cn,
+ &attr_unixName_uid,
+ &attr_unixName_gid,
+ &attr_name,
+ &attr_lastLogoff,
+ &attr_lastLogon,
+ &attr_primaryGroupID,
+ &attr_badPwdCount,
+ &attr_ntPwdHash,
+ &attr_lmPwdHash,
+ &attr_groupType,
+ &attr_badPasswordTime,
+ &attr_nextRid,
+ }
+};
/* the init function */
#ifdef HAVE_DLOPEN_DISABLED