On OpenSolaris MAP_RENAME and friends are defined in <sys/mman.h> e.g. mmap and friends. So on these systems MAP_* have a meaning. Cleaned up LDB name space by adding LDB_ in front of MAP_* e.g. MAP_RENAME => LDB_MAP_RENAME
Signed-off-by: Torgeir Lerkerød <torgeir.lerkerod@gmail.com>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
/* sambaNextRid -> nextRid */
{
.local_name = "nextRid",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaNextRid",
/* sambaBadPasswordTime -> badPasswordtime*/
{
.local_name = "badPasswordTime",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaBadPasswordTime",
/* sambaLMPassword -> lmPwdHash*/
{
.local_name = "dBCSPwd",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "sambaLMPassword",
/* sambaGroupType -> groupType */
{
.local_name = "groupType",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaGroupType",
/* sambaNTPassword -> ntPwdHash*/
{
.local_name = "ntpwdhash",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "sambaNTPassword",
/* sambaPrimaryGroupSID -> primaryGroupID */
{
.local_name = "primaryGroupID",
- .type = MAP_GENERATE,
+ .type = LDB_MAP_GENERATE,
.u = {
.generate = {
.remote_names = { "sambaPrimaryGroupSID", NULL },
/* sambaBadPasswordCount -> badPwdCount */
{
.local_name = "badPwdCount",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaBadPasswordCount",
/* sambaLogonTime -> lastLogon*/
{
.local_name = "lastLogon",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaLogonTime",
/* sambaLogoffTime -> lastLogoff*/
{
.local_name = "lastLogoff",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaLogoffTime",
/* uid -> unixName */
{
.local_name = "unixName",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "uid",
/* displayName -> name */
{
.local_name = "name",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "displayName",
/* cn */
{
.local_name = "cn",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
/* sAMAccountName -> cn */
{
.local_name = "sAMAccountName",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "uid",
/* objectCategory */
{
.local_name = "objectCategory",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* objectGUID */
{
.local_name = "objectGUID",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* objectVersion */
{
.local_name = "objectVersion",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* codePage */
{
.local_name = "codePage",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* dNSHostName */
{
.local_name = "dNSHostName",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* dnsDomain */
{
.local_name = "dnsDomain",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* dnsRoot */
{
.local_name = "dnsRoot",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* countryCode */
{
.local_name = "countryCode",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* nTMixedDomain */
{
.local_name = "nTMixedDomain",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* operatingSystem */
{
.local_name = "operatingSystem",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* operatingSystemVersion */
{
.local_name = "operatingSystemVersion",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* servicePrincipalName */
{
.local_name = "servicePrincipalName",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* msDS-Behavior-Version */
{
.local_name = "msDS-Behavior-Version",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* msDS-KeyVersionNumber */
{
.local_name = "msDS-KeyVersionNumber",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* msDs-masteredBy */
{
.local_name = "msDs-masteredBy",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* ou */
{
.local_name = "ou",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
/* dc */
{
.local_name = "dc",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
/* description */
{
.local_name = "description",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
/* sambaSID -> objectSid*/
{
.local_name = "objectSid",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "sambaSID",
/* sambaPwdLastSet -> pwdLastSet */
{
.local_name = "pwdLastSet",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "sambaPwdLastSet",
/* accountExpires */
{
.local_name = "accountExpires",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* adminCount */
{
.local_name = "adminCount",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* canonicalName */
{
.local_name = "canonicalName",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* createTimestamp */
{
.local_name = "createTimestamp",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* creationTime */
{
.local_name = "creationTime",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* dMDLocation */
{
.local_name = "dMDLocation",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* fSMORoleOwner */
{
.local_name = "fSMORoleOwner",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* forceLogoff */
{
.local_name = "forceLogoff",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* instanceType */
{
.local_name = "instanceType",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* invocationId */
{
.local_name = "invocationId",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* isCriticalSystemObject */
{
.local_name = "isCriticalSystemObject",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* localPolicyFlags */
{
.local_name = "localPolicyFlags",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* lockOutObservationWindow */
{
.local_name = "lockOutObservationWindow",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* lockoutDuration */
{
.local_name = "lockoutDuration",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* lockoutThreshold */
{
.local_name = "lockoutThreshold",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* logonCount */
{
.local_name = "logonCount",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* masteredBy */
{
.local_name = "masteredBy",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* maxPwdAge */
{
.local_name = "maxPwdAge",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* member */
{
.local_name = "member",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* memberOf */
{
.local_name = "memberOf",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* minPwdAge */
{
.local_name = "minPwdAge",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* minPwdLength */
{
.local_name = "minPwdLength",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* modifiedCount */
{
.local_name = "modifiedCount",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* modifiedCountAtLastProm */
{
.local_name = "modifiedCountAtLastProm",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* modifyTimestamp */
{
.local_name = "modifyTimestamp",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* nCName */
{
.local_name = "nCName",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* nETBIOSName */
{
.local_name = "nETBIOSName",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* oEMInformation */
{
.local_name = "oEMInformation",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* privilege */
{
.local_name = "privilege",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* pwdHistoryLength */
{
.local_name = "pwdHistoryLength",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* pwdProperties */
{
.local_name = "pwdProperties",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* rIDAvailablePool */
{
.local_name = "rIDAvailablePool",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* revision */
{
.local_name = "revision",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* ridManagerReference */
{
.local_name = "ridManagerReference",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* sAMAccountType */
{
.local_name = "sAMAccountType",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* sPNMappings */
{
.local_name = "sPNMappings",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* serverReference */
{
.local_name = "serverReference",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* serverState */
{
.local_name = "serverState",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* showInAdvancedViewOnly */
{
.local_name = "showInAdvancedViewOnly",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* subRefs */
{
.local_name = "subRefs",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* systemFlags */
{
.local_name = "systemFlags",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* uASCompat */
{
.local_name = "uASCompat",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* uSNChanged */
{
.local_name = "uSNChanged",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* uSNCreated */
{
.local_name = "uSNCreated",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* userPassword */
{
.local_name = "userPassword",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* userAccountControl */
{
.local_name = "userAccountControl",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* whenChanged */
{
.local_name = "whenChanged",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* whenCreated */
{
.local_name = "whenCreated",
- .type = MAP_IGNORE,
+ .type = LDB_MAP_IGNORE,
},
/* uidNumber */
{
.local_name = "unixName",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "uidNumber",
* groups and accounts? */
{
.local_name = "unixName",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "gidNumber",
/* homeDirectory */
{
.local_name = "unixName",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "homeDirectory",
/* objectGUID */
{
.local_name = "objectGUID",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "entryUUID",
/* invocationId */
{
.local_name = "invocationId",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "invocationId",
/* objectSid */
{
.local_name = "objectSid",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "objectSid",
},
{
.local_name = "name",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "samba4RDN"
},
{
.local_name = "whenCreated",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "createTimestamp"
},
{
.local_name = "whenChanged",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "modifyTimestamp"
},
{
.local_name = "objectClasses",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "samba4ObjectClasses"
},
{
.local_name = "dITContentRules",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "samba4DITContentRules"
},
{
.local_name = "attributeTypes",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "samba4AttributeTypes"
},
{
.local_name = "objectCategory",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "objectCategory",
},
{
.local_name = "distinguishedName",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "entryDN"
},
{
.local_name = "primaryGroupID",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "primaryGroupID",
},
{
.local_name = "groupType",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "groupType",
},
{
.local_name = "userAccountControl",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "userAccountControl",
},
{
.local_name = "sAMAccountType",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "sAMAccountType",
},
{
.local_name = "systemFlags",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "systemFlags",
},
{
.local_name = "usnChanged",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "entryCSN",
},
{
.local_name = "usnCreated",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "createTimestamp",
},
{
.local_name = "*",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
{
.local_name = NULL,
/* objectGUID */
{
.local_name = "objectGUID",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "nsuniqueid",
/* objectSid */
{
.local_name = "objectSid",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "objectSid",
},
{
.local_name = "whenCreated",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "createTimestamp"
},
{
.local_name = "whenChanged",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "modifyTimestamp"
},
{
.local_name = "objectCategory",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "objectCategory",
},
{
.local_name = "distinguishedName",
- .type = MAP_RENAME,
+ .type = LDB_MAP_RENAME,
.u = {
.rename = {
.remote_name = "entryDN"
},
{
.local_name = "primaryGroupID",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "primaryGroupID",
},
{
.local_name = "groupType",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "groupType",
},
{
.local_name = "userAccountControl",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "userAccountControl",
},
{
.local_name = "sAMAccountType",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "sAMAccountType",
},
{
.local_name = "systemFlags",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "systemFlags",
},
{
.local_name = "usnChanged",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "modifyTimestamp",
},
{
.local_name = "usnCreated",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "createTimestamp",
},
{
.local_name = "*",
- .type = MAP_KEEP,
+ .type = LDB_MAP_KEEP,
},
{
.local_name = NULL,
}
switch (map->type) {
- case MAP_IGNORE:
+ case LDB_MAP_IGNORE:
break;
- case MAP_KEEP:
+ case LDB_MAP_KEEP:
if (ldb_attr_cmp(map->local_name, name) == 0) {
return map;
}
break;
- case MAP_RENAME:
- case MAP_CONVERT:
+ case LDB_MAP_RENAME:
+ case LDB_MAP_CONVERT:
if (ldb_attr_cmp(map->u.rename.remote_name, name) == 0) {
return map;
}
break;
- case MAP_GENERATE:
+ case LDB_MAP_GENERATE:
for (j = 0; map->u.generate.remote_names && map->u.generate.remote_names[j]; j++) {
if (ldb_attr_cmp(map->u.generate.remote_names[j], name) == 0) {
return map;
if (map == NULL) {
return false;
}
- if (map->type == MAP_IGNORE) {
+ if (map->type == LDB_MAP_IGNORE) {
return false;
}
}
switch (map->type) {
- case MAP_KEEP:
+ case LDB_MAP_KEEP:
return talloc_strdup(mem_ctx, attr);
- case MAP_RENAME:
- case MAP_CONVERT:
+ case LDB_MAP_RENAME:
+ case LDB_MAP_CONVERT:
return talloc_strdup(mem_ctx, map->u.rename.remote_name);
default:
return talloc_strdup(mem_ctx, attr);
}
- if (map->type == MAP_KEEP) {
+ if (map->type == LDB_MAP_KEEP) {
return talloc_strdup(mem_ctx, attr);
}
struct ldb_val ldb_val_map_local(struct ldb_module *module, void *mem_ctx,
const struct ldb_map_attribute *map, const struct ldb_val *val)
{
- if (map && (map->type == MAP_CONVERT) && (map->u.convert.convert_local)) {
+ if (map && (map->type == LDB_MAP_CONVERT) && (map->u.convert.convert_local)) {
return map->u.convert.convert_local(module, mem_ctx, val);
}
struct ldb_val ldb_val_map_remote(struct ldb_module *module, void *mem_ctx,
const struct ldb_map_attribute *map, const struct ldb_val *val)
{
- if (map && (map->type == MAP_CONVERT) && (map->u.convert.convert_remote)) {
+ if (map && (map->type == LDB_MAP_CONVERT) && (map->u.convert.convert_remote)) {
return map->u.convert.convert_remote(module, mem_ctx, val);
}
/* Unknown attribute - leave this RDN as is and hope the best... */
if (map == NULL) {
- map_type = MAP_KEEP;
+ map_type = LDB_MAP_KEEP;
} else {
map_type = map->type;
}
switch (map_type) {
- case MAP_IGNORE:
- case MAP_GENERATE:
+ case LDB_MAP_IGNORE:
+ case LDB_MAP_GENERATE:
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
- "MAP_IGNORE/MAP_GENERATE attribute '%s' "
+ "LDB_MAP_IGNORE/LDB_MAP_GENERATE attribute '%s' "
"used in DN!", ldb_dn_get_component_name(dn, i));
goto failed;
- case MAP_CONVERT:
+ case LDB_MAP_CONVERT:
if (map->u.convert.convert_local == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"'convert_local' not set for attribute '%s' "
goto failed;
}
/* fall through */
- case MAP_KEEP:
- case MAP_RENAME:
+ case LDB_MAP_KEEP:
+ case LDB_MAP_RENAME:
name = map_attr_map_local(newdn, map, ldb_dn_get_component_name(dn, i));
if (name == NULL) goto failed;
/* Unknown attribute - leave this RDN as is and hope the best... */
if (map == NULL) {
- map_type = MAP_KEEP;
+ map_type = LDB_MAP_KEEP;
} else {
map_type = map->type;
}
switch (map_type) {
- case MAP_IGNORE:
- case MAP_GENERATE:
+ case LDB_MAP_IGNORE:
+ case LDB_MAP_GENERATE:
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
- "MAP_IGNORE/MAP_GENERATE attribute '%s' "
+ "LDB_MAP_IGNORE/LDB_MAP_GENERATE attribute '%s' "
"used in DN!", ldb_dn_get_component_name(dn, i));
goto failed;
- case MAP_CONVERT:
+ case LDB_MAP_CONVERT:
if (map->u.convert.convert_remote == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"'convert_remote' not set for attribute '%s' "
goto failed;
}
/* fall through */
- case MAP_KEEP:
- case MAP_RENAME:
+ case LDB_MAP_KEEP:
+ case LDB_MAP_RENAME:
name = map_attr_map_remote(newdn, map, ldb_dn_get_component_name(dn, i));
if (name == NULL) goto failed;
static const struct ldb_map_attribute objectclass_convert_map = {
.local_name = "objectClass",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "objectClass",
static const struct ldb_map_attribute builtin_attribute_maps[] = {
{
.local_name = "dn",
- .type = MAP_CONVERT,
+ .type = LDB_MAP_CONVERT,
.u = {
.convert = {
.remote_name = "dn",
static const struct ldb_map_attribute objectclass_attribute_map = {
.local_name = "objectClass",
- .type = MAP_GENERATE,
+ .type = LDB_MAP_GENERATE,
.convert_operator = map_objectclass_convert_operator,
.u = {
.generate = {
const char *local_name; /* local name */
enum ldb_map_attr_type {
- MAP_IGNORE, /* Ignore this local attribute. Doesn't exist remotely. */
- MAP_KEEP, /* Keep as is. Same name locally and remotely. */
- MAP_RENAME, /* Simply rename the attribute. Name changes, data is the same */
- MAP_CONVERT, /* Rename + convert data */
- MAP_GENERATE /* Use generate function for generating new name/data.
+ LDB_MAP_IGNORE, /* Ignore this local attribute. Doesn't exist remotely. */
+ LDB_MAP_KEEP, /* Keep as is. Same name locally and remotely. */
+ LDB_MAP_RENAME, /* Simply rename the attribute. Name changes, data is the same */
+ LDB_MAP_CONVERT, /* Rename + convert data */
+ LDB_MAP_GENERATE /* Use generate function for generating new name/data.
Used for generating attributes based on
multiple remote attributes. */
} type;
}
switch (map->type) {
- case MAP_IGNORE:
+ case LDB_MAP_IGNORE:
goto local;
- case MAP_CONVERT:
+ case LDB_MAP_CONVERT:
if (map->u.convert.convert_local == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Not mapping attribute '%s': "
goto local;
}
/* fall through */
- case MAP_KEEP:
- case MAP_RENAME:
+ case LDB_MAP_KEEP:
+ case LDB_MAP_RENAME:
el = ldb_msg_el_map_local(module, remote, map, old);
break;
- case MAP_GENERATE:
+ case LDB_MAP_GENERATE:
if (map->u.generate.generate_remote == NULL) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Not mapping attribute '%s': "
}
switch (map->type) {
- case MAP_IGNORE:
+ case LDB_MAP_IGNORE:
continue;
- case MAP_KEEP:
+ case LDB_MAP_KEEP:
name = attrs[i];
goto named;
- case MAP_RENAME:
- case MAP_CONVERT:
+ case LDB_MAP_RENAME:
+ case LDB_MAP_CONVERT:
name = map->u.rename.remote_name;
goto named;
- case MAP_GENERATE:
+ case LDB_MAP_GENERATE:
/* Add all remote names of "generate" attrs */
for (j = 0; map->u.generate.remote_names[j]; j++) {
result = talloc_realloc(mem_ctx, result, const char *, last+2);
}
switch (map->type) {
- case MAP_IGNORE:
+ case LDB_MAP_IGNORE:
break;
- case MAP_CONVERT:
+ case LDB_MAP_CONVERT:
remote_name = map->u.convert.remote_name;
break;
- case MAP_KEEP:
+ case LDB_MAP_KEEP:
remote_name = attr_name;
break;
- case MAP_RENAME:
+ case LDB_MAP_RENAME:
remote_name = map->u.rename.remote_name;
break;
- case MAP_GENERATE:
+ case LDB_MAP_GENERATE:
break;
}
switch (map->type) {
- case MAP_IGNORE:
+ case LDB_MAP_IGNORE:
return LDB_SUCCESS;
- case MAP_CONVERT:
+ case LDB_MAP_CONVERT:
if (map->u.convert.convert_remote == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"Skipping attribute '%s': "
return LDB_SUCCESS;
}
/* fall through */
- case MAP_KEEP:
- case MAP_RENAME:
+ case LDB_MAP_KEEP:
+ case LDB_MAP_RENAME:
old = ldb_msg_find_element(remote, remote_name);
if (old) {
el = ldb_msg_el_map_remote(module, local, map, attr_name, old);
}
break;
- case MAP_GENERATE:
+ case LDB_MAP_GENERATE:
if (map->u.generate.generate_local == NULL) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "ldb_map: "
"Skipping attribute '%s': "
int i, ret;
/* Perhaps we have a mapping for "*" */
- if (map && map->type == MAP_KEEP) {
+ if (map && map->type == LDB_MAP_KEEP) {
/* We copy everything over, and hope that anything with a
more specific rule is overwritten */
for (i = 0; i < remote->num_elements; i++) {
}
**new = *tree;
- if (map->type == MAP_KEEP) {
+ if (map->type == LDB_MAP_KEEP) {
/* Nothing to do here */
return 0;
}
return 0;
}
- if (map->type == MAP_RENAME) {
+ if (map->type == LDB_MAP_RENAME) {
/* Nothing more to do here, the attribute has been renamed */
return 0;
}
return map->convert_operator(module, mem_ctx, new, tree);
}
- if (map->type == MAP_GENERATE) {
+ if (map->type == LDB_MAP_GENERATE) {
ldb_debug(ldb, LDB_DEBUG_WARNING, "ldb_map: "
"Skipping attribute '%s': "
"'convert_operator' not set",