summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2010-01-06 23:16:12 +0200
committerAndrew Tridgell <tridge@samba.org>2010-01-08 13:03:03 +1100
commita7b3891fb5e20fd3a5b9cc9df37d70693836c0e0 (patch)
treed5f1d0b5de853b22322789ab0c3451335529d7e6
parentf7756c87bb8bd1eba8d7f92cfbc797db42d3de4a (diff)
downloadsamba-a7b3891fb5e20fd3a5b9cc9df37d70693836c0e0.tar.gz
samba-a7b3891fb5e20fd3a5b9cc9df37d70693836c0e0.tar.bz2
samba-a7b3891fb5e20fd3a5b9cc9df37d70693836c0e0.zip
s4/dsdb_schema: GET_UINT32_DS() macro to use supplied default value instead of 0
-rw-r--r--source4/dsdb/schema/schema_init.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index ccdf97cf2d..87599a9223 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -945,7 +945,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
} \
} while (0)
-#define GET_UINT32_DS(s, r, attr, p, elem) do { \
+#define GET_UINT32_DS(s, r, attr, p, elem, def_val) do { \
struct drsuapi_DsReplicaAttribute *_a; \
_a = dsdb_find_object_attr_name(s, r, attr, NULL); \
if (_a && _a->value_ctr.num_values >= 1 \
@@ -953,7 +953,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
&& _a->value_ctr.values[0].blob->length == 4) { \
(p)->elem = IVAL(_a->value_ctr.values[0].blob->data,0);\
} else { \
- (p)->elem = 0; \
+ (p)->elem = def_val; \
} \
} while (0)
@@ -1011,7 +1011,7 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb,
GET_STRING_DS(schema, r, "name", mem_ctx, attr, cn, true);
GET_STRING_DS(schema, r, "lDAPDisplayName", mem_ctx, attr, lDAPDisplayName, true);
- GET_UINT32_DS(schema, r, "attributeID", attr, attributeID_id);
+ GET_UINT32_DS(schema, r, "attributeID", attr, attributeID_id, 0xFFFFFFFF);
status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, attr->attributeID_id,
mem_ctx, &attr->attributeID_oid);
if (!W_ERROR_IS_OK(status)) {
@@ -1021,18 +1021,18 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb,
return status;
}
GET_GUID_DS(schema, r, "schemaIDGUID", mem_ctx, attr, schemaIDGUID);
- GET_UINT32_DS(schema, r, "mAPIID", attr, mAPIID);
+ GET_UINT32_DS(schema, r, "mAPIID", attr, mAPIID, 0);
GET_GUID_DS(schema, r, "attributeSecurityGUID", mem_ctx, attr, attributeSecurityGUID);
attr->objectGUID = r->identifier->guid;
- GET_UINT32_DS(schema, r, "searchFlags", attr, searchFlags);
- GET_UINT32_DS(schema, r, "systemFlags", attr, systemFlags);
+ GET_UINT32_DS(schema, r, "searchFlags", attr, searchFlags, 0);
+ GET_UINT32_DS(schema, r, "systemFlags", attr, systemFlags, 0);
GET_BOOL_DS(schema, r, "isMemberOfPartialAttributeSet", attr, isMemberOfPartialAttributeSet, false);
- GET_UINT32_DS(schema, r, "linkID", attr, linkID);
+ GET_UINT32_DS(schema, r, "linkID", attr, linkID, 0);
- GET_UINT32_DS(schema, r, "attributeSyntax", attr, attributeSyntax_id);
+ GET_UINT32_DS(schema, r, "attributeSyntax", attr, attributeSyntax_id, 0xFFFFFFFF);
status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, attr->attributeSyntax_id,
mem_ctx, &attr->attributeSyntax_oid);
if (!W_ERROR_IS_OK(status)) {
@@ -1041,7 +1041,7 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb,
win_errstr(status)));
return status;
}
- GET_UINT32_DS(schema, r, "oMSyntax", attr, oMSyntax);
+ GET_UINT32_DS(schema, r, "oMSyntax", attr, oMSyntax, 0);
GET_BLOB_DS(schema, r, "oMObjectClass", mem_ctx, attr, oMObjectClass);
GET_BOOL_DS(schema, r, "isSingleValued", attr, isSingleValued, true);
@@ -1049,7 +1049,7 @@ WERROR dsdb_attribute_from_drsuapi(struct ldb_context *ldb,
GET_UINT32_PTR_DS(schema, r, "rangeUpper", attr, rangeUpper);
GET_BOOL_DS(schema, r, "extendedCharsAllowed", attr, extendedCharsAllowed, false);
- GET_UINT32_DS(schema, r, "schemaFlagsEx", attr, schemaFlagsEx);
+ GET_UINT32_DS(schema, r, "schemaFlagsEx", attr, schemaFlagsEx, 0);
GET_BLOB_DS(schema, r, "msDs-Schema-Extensions", mem_ctx, attr, msDs_Schema_Extensions);
GET_BOOL_DS(schema, r, "showInAdvancedViewOnly", attr, showInAdvancedViewOnly, false);
@@ -1084,7 +1084,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb,
GET_STRING_DS(schema, r, "name", mem_ctx, obj, cn, true);
GET_STRING_DS(schema, r, "lDAPDisplayName", mem_ctx, obj, lDAPDisplayName, true);
- GET_UINT32_DS(schema, r, "governsID", obj, governsID_id);
+ GET_UINT32_DS(schema, r, "governsID", obj, governsID_id, 0xFFFFFFFF);
status = dsdb_schema_pfm_oid_from_attid(schema->prefixmap, obj->governsID_id,
mem_ctx, &obj->governsID_oid);
if (!W_ERROR_IS_OK(status)) {
@@ -1097,7 +1097,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb,
obj->objectGUID = r->identifier->guid;
- GET_UINT32_DS(schema, r, "objectClassCategory", obj, objectClassCategory);
+ GET_UINT32_DS(schema, r, "objectClassCategory", obj, objectClassCategory, 0);
GET_STRING_DS(schema, r, "rDNAttID", mem_ctx, obj, rDNAttID, false);
attr = dsdb_find_object_attr_name(schema, r, "defaultObjectCategory", NULL);
@@ -1114,7 +1114,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb,
}
obj->defaultObjectCategory = (char *)blob.data;
- GET_UINT32_DS(schema, r, "subClassOf", obj, subClassOf_id);
+ GET_UINT32_DS(schema, r, "subClassOf", obj, subClassOf_id, 0);
GET_UINT32_LIST_DS(schema, r, "systemAuxiliaryClass", mem_ctx, obj, systemAuxiliaryClass_ids);
GET_UINT32_LIST_DS(schema, r, "auxiliaryClass", mem_ctx, obj, auxiliaryClass_ids);
@@ -1129,7 +1129,7 @@ WERROR dsdb_class_from_drsuapi(struct ldb_context *ldb,
GET_STRING_DS(schema, r, "defaultSecurityDescriptor", mem_ctx, obj, defaultSecurityDescriptor, false);
- GET_UINT32_DS(schema, r, "schemaFlagsEx", obj, schemaFlagsEx);
+ GET_UINT32_DS(schema, r, "schemaFlagsEx", obj, schemaFlagsEx, 0);
GET_BLOB_DS(schema, r, "msDs-Schema-Extensions", mem_ctx, obj, msDs_Schema_Extensions);
GET_BOOL_DS(schema, r, "showInAdvancedViewOnly", obj, showInAdvancedViewOnly, false);