S4: ldb_map modules uses defines that are reserved
authorTorgeir Lerkerød <torgeir.lerkerod@gmail.com>
Tue, 20 Oct 2009 16:33:25 +0000 (18:33 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 21 Oct 2009 13:46:38 +0000 (15:46 +0200)
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>
source4/dsdb/samdb/ldb_modules/samba3sam.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/lib/ldb/ldb_map/ldb_map.c
source4/lib/ldb/ldb_map/ldb_map.h
source4/lib/ldb/ldb_map/ldb_map_inbound.c
source4/lib/ldb/ldb_map/ldb_map_outbound.c

index f5ddff95ed0e9c8bf29c5929de4b016ff7d807a7..61013d133e8c386e71ac4caf951f6bf8035cdc0b 100644 (file)
@@ -308,7 +308,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaNextRid -> nextRid */
        {
                .local_name = "nextRid",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaNextRid",
@@ -319,7 +319,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaBadPasswordTime -> badPasswordtime*/
        {
                .local_name = "badPasswordTime",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaBadPasswordTime",
@@ -330,7 +330,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaLMPassword -> lmPwdHash*/
        {
                .local_name = "dBCSPwd",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "sambaLMPassword",
@@ -343,7 +343,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaGroupType -> groupType */
        {
                .local_name = "groupType",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaGroupType",
@@ -354,7 +354,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaNTPassword -> ntPwdHash*/
        {
                .local_name = "ntpwdhash",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "sambaNTPassword",
@@ -367,7 +367,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaPrimaryGroupSID -> primaryGroupID */
        {
                .local_name = "primaryGroupID",
-               .type = MAP_GENERATE,
+               .type = LDB_MAP_GENERATE,
                .u = {
                        .generate = {
                                .remote_names = { "sambaPrimaryGroupSID", NULL },
@@ -380,7 +380,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaBadPasswordCount -> badPwdCount */
        {
                .local_name = "badPwdCount",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaBadPasswordCount",
@@ -391,7 +391,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaLogonTime -> lastLogon*/
        {
                .local_name = "lastLogon",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaLogonTime",
@@ -402,7 +402,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaLogoffTime -> lastLogoff*/
        {
                .local_name = "lastLogoff",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaLogoffTime",
@@ -413,7 +413,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* uid -> unixName */
        {
                .local_name = "unixName",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "uid",
@@ -424,7 +424,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* displayName -> name */
        {
                .local_name = "name",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "displayName",
@@ -435,13 +435,13 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* 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",
@@ -453,117 +453,117 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* 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",
@@ -576,7 +576,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* sambaPwdLastSet -> pwdLastSet */
        {
                .local_name = "pwdLastSet",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                .remote_name = "sambaPwdLastSet",
@@ -587,295 +587,295 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* 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",
@@ -888,7 +888,7 @@ const struct ldb_map_attribute samba3_attributes[] =
         * groups and accounts? */
        {
                .local_name = "unixName",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "gidNumber",
@@ -900,7 +900,7 @@ const struct ldb_map_attribute samba3_attributes[] =
        /* homeDirectory */
        {
                .local_name = "unixName",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "homeDirectory",
index 248d286ba6a2a40c225dd23909603fa6a75025f2..de88178e39f22d109f592b6b9fb9a2ebe9895602 100644 (file)
@@ -233,7 +233,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        /* objectGUID */
        {
                .local_name = "objectGUID",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "entryUUID", 
@@ -245,7 +245,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        /* invocationId */
        {
                .local_name = "invocationId",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "invocationId", 
@@ -257,7 +257,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        /* objectSid */
        {
                .local_name = "objectSid",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "objectSid", 
@@ -268,7 +268,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "name",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "samba4RDN"
@@ -277,7 +277,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "whenCreated",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "createTimestamp"
@@ -286,7 +286,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "whenChanged",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "modifyTimestamp"
@@ -295,7 +295,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "objectClasses",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "samba4ObjectClasses"
@@ -304,7 +304,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "dITContentRules",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "samba4DITContentRules"
@@ -313,7 +313,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "attributeTypes",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "samba4AttributeTypes"
@@ -322,7 +322,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "objectCategory",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "objectCategory", 
@@ -333,7 +333,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "distinguishedName",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "entryDN"
@@ -342,7 +342,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "primaryGroupID",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "primaryGroupID",
@@ -353,7 +353,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "groupType",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "groupType",
@@ -364,7 +364,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "userAccountControl",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "userAccountControl",
@@ -375,7 +375,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "sAMAccountType",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "sAMAccountType",
@@ -386,7 +386,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "systemFlags",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "systemFlags",
@@ -397,7 +397,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "usnChanged",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "entryCSN",
@@ -408,7 +408,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "usnCreated",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "createTimestamp",
@@ -419,7 +419,7 @@ static const struct ldb_map_attribute entryuuid_attributes[] =
        },
        {
                .local_name = "*",
-               .type = MAP_KEEP,
+               .type = LDB_MAP_KEEP,
        },
        {
                .local_name = NULL,
@@ -455,7 +455,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        /* objectGUID */
        {
                .local_name = "objectGUID",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "nsuniqueid", 
@@ -467,7 +467,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        /* objectSid */ 
        {
                .local_name = "objectSid",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "objectSid", 
@@ -478,7 +478,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "whenCreated",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "createTimestamp"
@@ -487,7 +487,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "whenChanged",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "modifyTimestamp"
@@ -496,7 +496,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "objectCategory",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                .remote_name = "objectCategory", 
@@ -507,7 +507,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "distinguishedName",
-               .type = MAP_RENAME,
+               .type = LDB_MAP_RENAME,
                .u = {
                        .rename = {
                                 .remote_name = "entryDN"
@@ -516,7 +516,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "primaryGroupID",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "primaryGroupID",
@@ -527,7 +527,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "groupType",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "groupType",
@@ -538,7 +538,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "userAccountControl",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "userAccountControl",
@@ -549,7 +549,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "sAMAccountType",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "sAMAccountType",
@@ -560,7 +560,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "systemFlags",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "systemFlags",
@@ -571,7 +571,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "usnChanged",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "modifyTimestamp",
@@ -582,7 +582,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "usnCreated",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "createTimestamp",
@@ -593,7 +593,7 @@ static const struct ldb_map_attribute nsuniqueid_attributes[] =
        },
        {
                .local_name = "*",
-               .type = MAP_KEEP,
+               .type = LDB_MAP_KEEP,
        },
        {
                .local_name = NULL,
index 68e9d3f392987cd78608e7faf276687edd7be561..ab9578bd884e6478de3e437f4c8c4b2c4eaef556 100644 (file)
@@ -314,23 +314,23 @@ const struct ldb_map_attribute *map_attr_find_remote(const struct ldb_map_contex
                }
 
                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;
@@ -356,7 +356,7 @@ bool map_attr_check_remote(const struct ldb_map_context *data, const char *attr)
        if (map == NULL) {
                return false;
        }
-       if (map->type == MAP_IGNORE) {
+       if (map->type == LDB_MAP_IGNORE) {
                return false;
        }
 
@@ -371,11 +371,11 @@ const char *map_attr_map_local(void *mem_ctx, const struct ldb_map_attribute *ma
        }
 
        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:
@@ -390,7 +390,7 @@ const char *map_attr_map_remote(void *mem_ctx, const struct ldb_map_attribute *m
                return talloc_strdup(mem_ctx, attr);
        }
 
-       if (map->type == MAP_KEEP) {
+       if (map->type == LDB_MAP_KEEP) {
                return talloc_strdup(mem_ctx, attr);
        }
 
@@ -429,7 +429,7 @@ int map_attrs_merge(struct ldb_module *module, void *mem_ctx,
 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);
        }
 
@@ -440,7 +440,7 @@ struct ldb_val ldb_val_map_local(struct ldb_module *module, void *mem_ctx,
 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);
        }
 
@@ -493,20 +493,20 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
 
                /* 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' "
@@ -514,8 +514,8 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
                                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;
 
@@ -568,20 +568,20 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
 
                /* 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' "
@@ -589,8 +589,8 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
                                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;
 
@@ -842,7 +842,7 @@ static struct ldb_message_element *map_objectclass_generate_local(struct ldb_mod
 
 static const struct ldb_map_attribute objectclass_convert_map = {
        .local_name = "objectClass",
-       .type = MAP_CONVERT,
+       .type = LDB_MAP_CONVERT,
        .u = {
                .convert = {
                        .remote_name = "objectClass",
@@ -957,7 +957,7 @@ failed:
 static const struct ldb_map_attribute builtin_attribute_maps[] = {
        {
                .local_name = "dn",
-               .type = MAP_CONVERT,
+               .type = LDB_MAP_CONVERT,
                .u = {
                        .convert = {
                                 .remote_name = "dn",
@@ -973,7 +973,7 @@ static const struct ldb_map_attribute builtin_attribute_maps[] = {
 
 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 = {
index 3c1fe808957d435f87333e3944fe4616ac4a978b..21937bcfb31eff3c92729d276d2343710721fce6 100644 (file)
@@ -59,11 +59,11 @@ struct ldb_map_attribute {
        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;
index 89037419fbca71fcbf1f34386c0620bc0eb2f7fc..5a237ef28cd8249b33b2238f0cca16d87837de5f 100644 (file)
@@ -79,10 +79,10 @@ static int ldb_msg_el_partition(struct ldb_module *module, struct ldb_message *l
        }
 
        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': "
@@ -91,12 +91,12 @@ static int ldb_msg_el_partition(struct ldb_module *module, struct ldb_message *l
                        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': "
index 45caffeeae028e9b1c55818ec59c4284f063eb8f..922d13991bb61499c6cbed9b77f30086c7574dc0 100644 (file)
@@ -124,19 +124,19 @@ static const char **map_attrs_collect_remote(struct ldb_module *module, void *me
                }
 
                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);
@@ -281,26 +281,26 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
        }
 
        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': "
@@ -309,8 +309,8 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
                        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);
@@ -319,7 +319,7 @@ static int ldb_msg_el_merge(struct ldb_module *module, struct ldb_message *local
                }
                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': "
@@ -353,7 +353,7 @@ static int ldb_msg_el_merge_wildcard(struct ldb_module *module, struct ldb_messa
        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++) {
@@ -772,7 +772,7 @@ int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx,
        }
        **new = *tree;
        
-       if (map->type == MAP_KEEP) {
+       if (map->type == LDB_MAP_KEEP) {
                /* Nothing to do here */
                return 0;
        }
@@ -814,7 +814,7 @@ int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx,
                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;
        }
@@ -897,7 +897,7 @@ static int map_subtree_collect_remote(struct ldb_module *module, void *mem_ctx,
                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",