summaryrefslogtreecommitdiffstats
path: root/ldap
diff options
context:
space:
mode:
authorDavid Boreham <dboreham@redhat.com>2005-05-09 20:34:31 +0000
committerDavid Boreham <dboreham@redhat.com>2005-05-09 20:34:31 +0000
commitd723996cfb2af9ec04d92e471c996b0e0cc59893 (patch)
tree35266b8439b6994c09cc1d714850f72fcc49cac2 /ldap
parentc341fc3237c61f222650176ec1316b124b1c98a6 (diff)
downloadds-d723996cfb2af9ec04d92e471c996b0e0cc59893.tar.gz
ds-d723996cfb2af9ec04d92e471c996b0e0cc59893.tar.xz
ds-d723996cfb2af9ec04d92e471c996b0e0cc59893.zip
Fix for #156449 : mangle 'street' attribute to defeat our schema aliasing it with 'streetaddress'
Diffstat (limited to 'ldap')
-rw-r--r--ldap/servers/plugins/replication/windows_connection.c11
-rw-r--r--ldap/servers/plugins/replication/windows_protocol_util.c4
-rw-r--r--ldap/servers/plugins/replication/windowsrepl.h3
3 files changed, 15 insertions, 3 deletions
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c
index f0d41411..db5ba84d 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -523,7 +523,16 @@ windows_LDAPMessage2Entry(LDAP * ld, LDAPMessage * msg, int attrsonly) {
} else
{
struct berval ** aVal = ldap_get_values_len( ld, msg, a);
- slapi_entry_add_values( e, a, aVal);
+ char *type_to_use = NULL;
+ /* Work around the fact that we alias street and streetaddress, while Microsoft do not */
+ if (0 == strcasecmp(a,"streetaddress"))
+ {
+ type_to_use = FAKE_STREET_ATTR_NAME;
+ } else
+ {
+ type_to_use = a;
+ }
+ slapi_entry_add_values( e, type_to_use, aVal);
ldap_memfree(a);
ldap_value_free_len(aVal);
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 562a7c65..e57bf903 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -193,8 +193,8 @@ static windows_attribute_map user_attribute_map[] =
{ "maxStorage", "ntUserMaxStorage", bidirectional, always, normal},
{ "profilePath", "ntUserProfile", bidirectional, always, normal},
/* IETF schema has 'street' and 'streetaddress' as aliases, but Microsoft does not */
- { "street", "street", fromwindowsonly, always, normal},
{ "streetAddress", "street", towindowsonly, always, normal},
+ { FAKE_STREET_ATTR_NAME, "street", fromwindowsonly, always, normal},
{ "userParameters", "ntUserParms", bidirectional, always, normal},
{ "userWorkstations", "ntUserWorkstations", bidirectional, always, normal},
{ "sAMAccountName", "ntUserDomainId", bidirectional, always, normal},
@@ -212,8 +212,8 @@ static windows_attribute_map group_attribute_map[] =
{ "groupType", "ntGroupType", bidirectional, createonly, normal},
{ "sAMAccountName", "ntUserDomainId", bidirectional, always, normal},
/* IETF schema has 'street' and 'streetaddress' as aliases, but Microsoft does not */
- { "street", "street", fromwindowsonly, always, normal},
{ "streetAddress", "street", towindowsonly, always, normal},
+ { FAKE_STREET_ATTR_NAME, "street", fromwindowsonly, always, normal},
{ "member", "uniquemember", bidirectional, always, dnmap},
{NULL, NULL, -1}
};
diff --git a/ldap/servers/plugins/replication/windowsrepl.h b/ldap/servers/plugins/replication/windowsrepl.h
index 645c257f..791f9baf 100644
--- a/ldap/servers/plugins/replication/windowsrepl.h
+++ b/ldap/servers/plugins/replication/windowsrepl.h
@@ -90,3 +90,6 @@ ConnResult windows_conn_push_schema(Repl_Connection *conn, CSN **remotecsn);
void windows_conn_set_timeout(Repl_Connection *conn, long timeout);
void windows_conn_set_agmt_changed(Repl_Connection *conn);
+/* Used to work around a schema incompatibility between Microsoft and the IETF */
+#define FAKE_STREET_ATTR_NAME "in#place#of#streetaddress"
+