summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/samba
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-27 16:33:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:41 -0500
commite8635da74d4b55b51c1be4fb090a86f8b8a64e78 (patch)
tree2ca2bd392aca7cdab86ee951cf5192eea4c7ddf3 /source4/lib/ldb/samba
parent7e3838dd2d8647e9c621a08c61a2a22ef1d94bb2 (diff)
downloadsamba-e8635da74d4b55b51c1be4fb090a86f8b8a64e78.tar.gz
samba-e8635da74d4b55b51c1be4fb090a86f8b8a64e78.tar.bz2
samba-e8635da74d4b55b51c1be4fb090a86f8b8a64e78.zip
r9686: Another round of bugfixes. Works somewhat now, when running under valgrind ;-)
(This used to be commit 786379064f0ed779b965330fb3b74deaca75ce99)
Diffstat (limited to 'source4/lib/ldb/samba')
-rw-r--r--source4/lib/ldb/samba/samba3sam.c40
1 files changed, 33 insertions, 7 deletions
diff --git a/source4/lib/ldb/samba/samba3sam.c b/source4/lib/ldb/samba/samba3sam.c
index 6c98ffc5c1..7c1e61ca4d 100644
--- a/source4/lib/ldb/samba/samba3sam.c
+++ b/source4/lib/ldb/samba/samba3sam.c
@@ -60,7 +60,33 @@
* sambaMungedDial
* sambaLogonHours */
+static struct ldb_message_element *convert_sid_rid(TALLOC_CTX *ctx, const char *remote_attr, const struct ldb_message_element *el)
+{
+ printf("Converting SID TO RID *\n");
+
+ return talloc_memdup(ctx, el, sizeof(*el));
+}
+
+static struct ldb_message_element *convert_rid_sid(TALLOC_CTX *ctx, const char *remote_attr, const struct ldb_message_element *el)
+{
+ printf("Converting RID TO SID *\n");
+
+ return talloc_memdup(ctx, el, sizeof(*el));
+}
+static struct ldb_message_element *convert_unix_id2name(TALLOC_CTX *ctx, const char *remote_attr, const struct ldb_message_element *el)
+{
+ printf("Converting UNIX ID to name\n");
+
+ return talloc_memdup(ctx, el, sizeof(*el));
+}
+
+static struct ldb_message_element *convert_unix_name2id(TALLOC_CTX *ctx, const char *remote_attr, const struct ldb_message_element *el)
+{
+ printf("Converting UNIX name to ID\n");
+
+ return talloc_memdup(ctx, el, sizeof(*el));
+}
const struct ldb_map_objectclass samba3_objectclasses[] = {
{ "group", "sambaGroupMapping" },
@@ -110,8 +136,8 @@ const struct ldb_map_attribute samba3_attributes[] =
.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 */
+ .u.convert.convert_local = convert_rid_sid,
+ .u.convert.convert_remote = convert_sid_rid,
},
/* sambaBadPasswordCount -> badPwdCount */
@@ -140,8 +166,8 @@ const struct ldb_map_attribute samba3_attributes[] =
.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 */
+ .u.convert.convert_local = convert_unix_id2name,
+ .u.convert.convert_remote = convert_unix_name2id,
},
/* uid -> unixName */
@@ -149,8 +175,8 @@ const struct ldb_map_attribute samba3_attributes[] =
.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 */
+ .u.convert.convert_local = convert_unix_id2name,
+ .u.convert.convert_remote = convert_unix_name2id,
},
/* displayName -> name */
@@ -194,5 +220,5 @@ struct ldb_module *init_module(struct ldb_context *ldb, const char *options[])
struct ldb_module *ldb_samba3sam_module_init(struct ldb_context *ldb, const char *options[])
#endif
{
- return ldb_map_init(ldb, &samba3_attributes, &samba3_objectclasses, options);
+ return ldb_map_init(ldb, samba3_attributes, samba3_objectclasses, options);
}