diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-14 09:41:42 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-10-15 08:36:01 +1100 |
commit | a0e9814c0d50ee822188e2bd6be8c4879aaebacc (patch) | |
tree | 79670d9c58f88ae6007b17ab240a1e64ed33c05e /source4/dsdb | |
parent | c2533f94b561e9b22d621b7515c6606d39ffec89 (diff) | |
download | samba-a0e9814c0d50ee822188e2bd6be8c4879aaebacc.tar.gz samba-a0e9814c0d50ee822188e2bd6be8c4879aaebacc.tar.bz2 samba-a0e9814c0d50ee822188e2bd6be8c4879aaebacc.zip |
s4:dsdb - remove "samdb_result_uint", "samdb_result_int64", "samdb_result_uint64" and "samdb_result_string"
We have ldb_msg_find_attr_as_* calls which do exactly the same. Therefore this
reduces only code redundancies.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/common/util.c | 53 | ||||
-rw-r--r-- | source4/dsdb/common/util_samr.c | 2 | ||||
-rw-r--r-- | source4/dsdb/kcc/kcc_deleted.c | 2 | ||||
-rw-r--r-- | source4/dsdb/kcc/kcc_topology.c | 38 | ||||
-rw-r--r-- | source4/dsdb/samdb/cracknames.c | 14 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 24 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samldb.c | 6 | ||||
-rw-r--r-- | source4/dsdb/schema/schema_init.c | 6 |
8 files changed, 59 insertions, 86 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 0a002197f5..1b732c2a33 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -111,7 +111,7 @@ const char *samdb_search_string_v(struct ldb_context *sam_ldb, return NULL; } - return samdb_result_string(res[0], attr_name, NULL); + return ldb_msg_find_attr_as_string(res[0], attr_name, NULL); } /* @@ -235,7 +235,7 @@ unsigned int samdb_search_uint(struct ldb_context *sam_ldb, return default_value; } - return samdb_result_uint(res[0], attr_name, default_value); + return ldb_msg_find_attr_as_uint(res[0], attr_name, default_value); } /* @@ -263,7 +263,7 @@ int64_t samdb_search_int64(struct ldb_context *sam_ldb, return default_value; } - return samdb_result_int64(res[0], attr_name, default_value); + return ldb_msg_find_attr_as_int64(res[0], attr_name, default_value); } /* @@ -309,38 +309,13 @@ int samdb_search_string_multiple(struct ldb_context *sam_ldb, } for (i=0;i<count;i++) { - (*strs)[i] = samdb_result_string(res[i], attr_name, NULL); + (*strs)[i] = ldb_msg_find_attr_as_string(res[i], attr_name, NULL); } (*strs)[count] = NULL; return count; } -/* - pull a uint from a result set. -*/ -unsigned int samdb_result_uint(const struct ldb_message *msg, const char *attr, unsigned int default_value) -{ - return ldb_msg_find_attr_as_uint(msg, attr, default_value); -} - -/* - pull a (signed) int64 from a result set. -*/ -int64_t samdb_result_int64(const struct ldb_message *msg, const char *attr, int64_t default_value) -{ - return ldb_msg_find_attr_as_int64(msg, attr, default_value); -} - -/* - pull a string from a result set. -*/ -const char *samdb_result_string(const struct ldb_message *msg, const char *attr, - const char *default_value) -{ - return ldb_msg_find_attr_as_string(msg, attr, default_value); -} - struct ldb_dn *samdb_result_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, const struct ldb_message *msg, const char *attr, struct ldb_dn *default_value) { @@ -477,16 +452,6 @@ NTTIME samdb_result_account_expires(const struct ldb_message *msg) } /* - pull a uint64_t from a result set. -*/ -uint64_t samdb_result_uint64(const struct ldb_message *msg, const char *attr, - uint64_t default_value) -{ - return ldb_msg_find_attr_as_uint64(msg, attr, default_value); -} - - -/* construct the allow_password_change field from the PwdLastSet attribute and the domain password settings */ @@ -496,7 +461,7 @@ NTTIME samdb_result_allow_password_change(struct ldb_context *sam_ldb, struct ldb_message *msg, const char *attr) { - uint64_t attr_time = samdb_result_uint64(msg, attr, 0); + uint64_t attr_time = ldb_msg_find_attr_as_uint64(msg, attr, 0); int64_t minPwdAge; if (attr_time == 0) { @@ -521,7 +486,7 @@ NTTIME samdb_result_force_password_change(struct ldb_context *sam_ldb, struct ldb_dn *domain_dn, struct ldb_message *msg) { - int64_t attr_time = samdb_result_int64(msg, "pwdLastSet", 0); + int64_t attr_time = ldb_msg_find_attr_as_int64(msg, "pwdLastSet", 0); uint32_t userAccountControl = ldb_msg_find_attr_as_uint(msg, "userAccountControl", 0); @@ -3024,7 +2989,7 @@ int samdb_ntds_options(struct ldb_context *ldb, uint32_t *options) goto failed; } - *options = samdb_result_uint(res->msgs[0], "options", 0); + *options = ldb_msg_find_attr_as_uint(res->msgs[0], "options", 0); talloc_free(tmp_ctx); @@ -3051,7 +3016,7 @@ const char* samdb_ntds_object_category(TALLOC_CTX *tmp_ctx, struct ldb_context * goto failed; } - return samdb_result_string(res->msgs[0], "objectCategory", NULL); + return ldb_msg_find_attr_as_string(res->msgs[0], "objectCategory", NULL); failed: DEBUG(1,("Failed to find our own NTDS Settings objectCategory in the ldb!\n")); @@ -4204,7 +4169,7 @@ const char *samdb_dn_to_dnshostname(struct ldb_context *ldb, return NULL; } - return samdb_result_string(res->msgs[0], "dNSHostName", NULL); + return ldb_msg_find_attr_as_string(res->msgs[0], "dNSHostName", NULL); } /* diff --git a/source4/dsdb/common/util_samr.c b/source4/dsdb/common/util_samr.c index c50b33c58a..72d42cbf8e 100644 --- a/source4/dsdb/common/util_samr.c +++ b/source4/dsdb/common/util_samr.c @@ -196,7 +196,7 @@ NTSTATUS dsdb_add_user(struct ldb_context *ldb, /* Change the account control to be the correct account type. * The default is for a workstation account */ - user_account_control = samdb_result_uint(msg, "userAccountControl", 0); + user_account_control = ldb_msg_find_attr_as_uint(msg, "userAccountControl", 0); user_account_control = (user_account_control & ~(UF_NORMAL_ACCOUNT | UF_INTERDOMAIN_TRUST_ACCOUNT | diff --git a/source4/dsdb/kcc/kcc_deleted.c b/source4/dsdb/kcc/kcc_deleted.c index 1726fa4f31..3ff4a0a3fd 100644 --- a/source4/dsdb/kcc/kcc_deleted.c +++ b/source4/dsdb/kcc/kcc_deleted.c @@ -84,7 +84,7 @@ NTSTATUS kccsrv_check_deleted(struct kccsrv_service *s, TALLOC_CTX *mem_ctx) const char *tstring; time_t whenChanged = 0; - tstring = samdb_result_string(res->msgs[i], "whenChanged", NULL); + tstring = ldb_msg_find_attr_as_string(res->msgs[i], "whenChanged", NULL); if (tstring) { whenChanged = ldb_string_to_time(tstring); } diff --git a/source4/dsdb/kcc/kcc_topology.c b/source4/dsdb/kcc/kcc_topology.c index 94ed7a81a1..51c09fd62f 100644 --- a/source4/dsdb/kcc/kcc_topology.c +++ b/source4/dsdb/kcc/kcc_topology.c @@ -262,8 +262,8 @@ static int kcctpl_sort_bridgeheads(const void *bridgehead1, bh1 = (const struct ldb_message *) bridgehead1; bh2 = (const struct ldb_message *) bridgehead2; - bh1_opts = samdb_result_int64(bh1, "options", 0); - bh2_opts = samdb_result_int64(bh2, "options", 0); + bh1_opts = ldb_msg_find_attr_as_int64(bh1, "options", 0); + bh2_opts = ldb_msg_find_attr_as_int64(bh2, "options", 0); cmp_gc = (bh1_opts & NTDSDSA_OPT_IS_GC) - (bh2_opts & NTDSDSA_OPT_IS_GC); @@ -618,9 +618,9 @@ static NTSTATUS kcctpl_create_edge(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, edge->vertex_ids.data[i] = guid; } - edge->repl_info.cost = samdb_result_int64(site_link, "cost", 0); - edge->repl_info.options = samdb_result_int64(site_link, "options", 0); - edge->repl_info.interval = samdb_result_int64(site_link, + edge->repl_info.cost = ldb_msg_find_attr_as_int64(site_link, "cost", 0); + edge->repl_info.options = ldb_msg_find_attr_as_int64(site_link, "options", 0); + edge->repl_info.interval = ldb_msg_find_attr_as_int64(site_link, "replInterval", 0); /* TODO: edge->repl_info.schedule = site_link!schedule */ edge->type = type; @@ -850,7 +850,7 @@ static NTSTATUS kcctpl_setup_graph(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, talloc_free(tmp_ctx); return NT_STATUS_INTERNAL_DB_CORRUPTION; } - site_opts = samdb_result_int64(site, "options", 0); + site_opts = ldb_msg_find_attr_as_int64(site, "options", 0); transports_dn = kcctpl_transports_dn(ldb, tmp_ctx); if (!transports_dn) { @@ -918,7 +918,7 @@ static NTSTATUS kcctpl_setup_graph(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, graph->edges.count++; } - transport_opts = samdb_result_int64(transport, "options", 0); + transport_opts = ldb_msg_find_attr_as_int64(transport, "options", 0); if (!(transport_opts & NTDSTRANSPORT_OPT_BRIDGES_REQUIRED) && !(site_opts & NTDSSETTINGS_OPT_W2K3_BRIDGES_REQUIRED)) { struct kcctpl_multi_edge_set *edge_set, *new_data; @@ -1040,7 +1040,7 @@ static NTSTATUS kcctpl_bridgehead_dc_failed(struct ldb_context *ldb, settings = res->msgs[0]; - settings_opts = samdb_result_int64(settings, "options", 0); + settings_opts = ldb_msg_find_attr_as_int64(settings, "options", 0); if (settings_opts & NTDSSETTINGS_OPT_IS_TOPL_DETECT_STALE_DISABLED) { failed = false; } else if (true) { /* TODO: how to get kCCFailedLinks and @@ -1155,7 +1155,7 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct kccsrv_service *service, el = ldb_msg_find_element(transport, "bridgeheadServerListBL"); - transport_name = samdb_result_string(transport, "name", NULL); + transport_name = ldb_msg_find_attr_as_string(transport, "name", NULL); if (!transport_name) { DEBUG(1, (__location__ ": failed to find name attribute of " "object %s\n", ldb_dn_get_linearized(transport->dn))); @@ -1164,7 +1164,7 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct kccsrv_service *service, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - transport_address_attr = samdb_result_string(transport, + transport_address_attr = ldb_msg_find_attr_as_string(transport, "transportAddressAttribute", NULL); if (!transport_address_attr) { @@ -1176,7 +1176,7 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct kccsrv_service *service, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - site_opts = samdb_result_int64(site, "options", 0); + site_opts = ldb_msg_find_attr_as_int64(site, "options", 0); for (i = 0; i < res->count; i++) { struct ldb_message *dc, *new_data; @@ -1252,7 +1252,7 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct kccsrv_service *service, } } - behavior_version = samdb_result_int64(dc, + behavior_version = ldb_msg_find_attr_as_int64(dc, "msDS-Behavior-Version", 0); /* TODO: cr!nCName corresponds to default NC */ if (service->am_rodc && true && behavior_version < DS_BEHAVIOR_WIN2008) { @@ -1262,7 +1262,7 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct kccsrv_service *service, ret = ldb_search(service->samdb, tmp_ctx, &parent_res, parent_dn, LDB_SCOPE_BASE, parent_attrs , NULL); - dc_transport_address = samdb_result_string(parent_res->msgs[0], + dc_transport_address = ldb_msg_find_attr_as_string(parent_res->msgs[0], transport_address_attr, NULL); @@ -1444,7 +1444,7 @@ static NTSTATUS kcctpl_color_vertices(struct kccsrv_service *service, partial_replica_okay = (site_vertex->color == BLACK); - cr_flags = samdb_result_int64(cross_ref, "systemFlags", 0); + cr_flags = ldb_msg_find_attr_as_int64(cross_ref, "systemFlags", 0); for (i = 0; i < graph->vertices.count; i++) { struct kcctpl_vertex *vertex; @@ -1486,7 +1486,7 @@ static NTSTATUS kcctpl_color_vertices(struct kccsrv_service *service, transport = res->msgs[j]; - transport_name = samdb_result_string(transport, + transport_name = ldb_msg_find_attr_as_string(transport, "name", NULL); if (!transport_name) { DEBUG(1, (__location__ ": failed to find name " @@ -2873,7 +2873,7 @@ static NTSTATUS kcctpl_create_connection(struct kccsrv_service *service, uint8_t conn_schedule[84]; struct ldb_dn *conn_transport_type; - conn_opts = samdb_result_int64(connection, + conn_opts = ldb_msg_find_attr_as_int64(connection, "options", 0); conn_transport_type = samdb_result_dn(service->samdb, tmp_ctx, @@ -2984,7 +2984,7 @@ static NTSTATUS kcctpl_create_connection(struct kccsrv_service *service, uint64_t conn_opts; struct ldb_dn *conn_transport_type; - conn_opts = samdb_result_int64(connection, + conn_opts = ldb_msg_find_attr_as_int64(connection, "options", 0); conn_transport_type = samdb_result_dn(service->samdb, tmp_ctx, @@ -3396,8 +3396,8 @@ static NTSTATUS kcctpl_create_intersite_connections(struct kccsrv_service *servi NTSTATUS status; cross_ref = res->msgs[i]; - cr_enabled = samdb_result_uint(cross_ref, "enabled", -1); - cr_flags = samdb_result_int64(cross_ref, "systemFlags", 0); + cr_enabled = ldb_msg_find_attr_as_uint(cross_ref, "enabled", -1); + cr_flags = ldb_msg_find_attr_as_int64(cross_ref, "systemFlags", 0); if ((cr_enabled == 0) || !(cr_flags & FLAG_CR_NTDS_NC)) { continue; } diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c index 3fac49fe54..6df140fed3 100644 --- a/source4/dsdb/samdb/cracknames.c +++ b/source4/dsdb/samdb/cracknames.c @@ -811,7 +811,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ return WERR_OK; } - info1->dns_domain_name = samdb_result_string(domain_res->msgs[0], "dnsRoot", NULL); + info1->dns_domain_name = ldb_msg_find_attr_as_string(domain_res->msgs[0], "dnsRoot", NULL); W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name); info1->status = DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY; } else { @@ -939,7 +939,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ return WERR_OK; } case DRSUAPI_DS_NAME_FORMAT_CANONICAL: { - info1->result_name = samdb_result_string(result, "canonicalName", NULL); + info1->result_name = ldb_msg_find_attr_as_string(result, "canonicalName", NULL); info1->status = DRSUAPI_DS_NAME_STATUS_OK; return WERR_OK; } @@ -979,10 +979,10 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ info1->status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE; return WERR_OK; } - _dom = samdb_result_string(domain_res->msgs[0], "nETBIOSName", NULL); + _dom = ldb_msg_find_attr_as_string(domain_res->msgs[0], "nETBIOSName", NULL); W_ERROR_HAVE_NO_MEMORY(_dom); } else { - _acc = samdb_result_string(result, "sAMAccountName", NULL); + _acc = ldb_msg_find_attr_as_string(result, "sAMAccountName", NULL); if (!_acc) { info1->status = DRSUAPI_DS_NAME_STATUS_NO_MAPPING; return WERR_OK; @@ -1043,7 +1043,7 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ info1->status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE; return WERR_OK; } - _dom = samdb_result_string(domain_res2->msgs[0], "nETBIOSName", NULL); + _dom = ldb_msg_find_attr_as_string(domain_res2->msgs[0], "nETBIOSName", NULL); W_ERROR_HAVE_NO_MEMORY(_dom); } } @@ -1066,9 +1066,9 @@ static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ return WERR_OK; } case DRSUAPI_DS_NAME_FORMAT_DISPLAY: { - info1->result_name = samdb_result_string(result, "displayName", NULL); + info1->result_name = ldb_msg_find_attr_as_string(result, "displayName", NULL); if (!info1->result_name) { - info1->result_name = samdb_result_string(result, "sAMAccountName", NULL); + info1->result_name = ldb_msg_find_attr_as_string(result, "sAMAccountName", NULL); } if (!info1->result_name) { info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND; diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 488b8b7d33..c9748af698 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1658,10 +1658,13 @@ static int setup_io(struct ph_context *ac, io->ac = ac; - io->u.userAccountControl = samdb_result_uint(searched_msg, "userAccountControl", 0); + io->u.userAccountControl = ldb_msg_find_attr_as_uint(searched_msg, + "userAccountControl", 0); io->u.pwdLastSet = samdb_result_nttime(searched_msg, "pwdLastSet", 0); - io->u.sAMAccountName = samdb_result_string(searched_msg, "sAMAccountName", NULL); - io->u.user_principal_name = samdb_result_string(searched_msg, "userPrincipalName", NULL); + io->u.sAMAccountName = ldb_msg_find_attr_as_string(searched_msg, + "sAMAccountName", NULL); + io->u.user_principal_name = ldb_msg_find_attr_as_string(searched_msg, + "userPrincipalName", NULL); io->u.is_computer = ldb_msg_check_string_attribute(searched_msg, "objectClass", "computer"); if (io->u.sAMAccountName == NULL) { @@ -2091,11 +2094,16 @@ static int get_domain_data_callback(struct ldb_request *req, } /* Setup the "domain data" structure */ - ac->status->domain_data.pwdProperties = samdb_result_uint(ares->message, "pwdProperties", -1); - ac->status->domain_data.pwdHistoryLength = samdb_result_uint(ares->message, "pwdHistoryLength", -1); - ac->status->domain_data.maxPwdAge = samdb_result_int64(ares->message, "maxPwdAge", -1); - ac->status->domain_data.minPwdAge = samdb_result_int64(ares->message, "minPwdAge", -1); - ac->status->domain_data.minPwdLength = samdb_result_uint(ares->message, "minPwdLength", -1); + ac->status->domain_data.pwdProperties = + ldb_msg_find_attr_as_uint(ares->message, "pwdProperties", -1); + ac->status->domain_data.pwdHistoryLength = + ldb_msg_find_attr_as_uint(ares->message, "pwdHistoryLength", -1); + ac->status->domain_data.maxPwdAge = + ldb_msg_find_attr_as_int64(ares->message, "maxPwdAge", -1); + ac->status->domain_data.minPwdAge = + ldb_msg_find_attr_as_int64(ares->message, "minPwdAge", -1); + ac->status->domain_data.minPwdLength = + ldb_msg_find_attr_as_uint(ares->message, "minPwdLength", -1); ac->status->domain_data.store_cleartext = ac->status->domain_data.pwdProperties & DOMAIN_PASSWORD_STORE_CLEARTEXT; diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 385be493b3..3f1dd49072 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -950,7 +950,7 @@ static int samldb_prim_group_set(struct samldb_ctx *ac) uint32_t rid; struct dom_sid *sid; - rid = samdb_result_uint(ac->msg, "primaryGroupID", (uint32_t) -1); + rid = ldb_msg_find_attr_as_uint(ac->msg, "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* we aren't affected of any primary group set */ return LDB_SUCCESS; @@ -1000,7 +1000,7 @@ static int samldb_prim_group_change(struct samldb_ctx *ac) /* Finds out the DN of the old primary group */ - rid = samdb_result_uint(res->msgs[0], "primaryGroupID", (uint32_t) -1); + rid = ldb_msg_find_attr_as_uint(res->msgs[0], "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* User objects do always have a mandatory "primaryGroupID" * attribute. If this doesn't exist then the object is of the @@ -1021,7 +1021,7 @@ static int samldb_prim_group_change(struct samldb_ctx *ac) /* Finds out the DN of the new primary group */ - rid = samdb_result_uint(ac->msg, "primaryGroupID", (uint32_t) -1); + rid = ldb_msg_find_attr_as_uint(ac->msg, "primaryGroupID", (uint32_t) -1); if (rid == (uint32_t) -1) { /* we aren't affected of any primary group change */ return LDB_SUCCESS; diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index ba12f523e8..54fc6b840b 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -493,7 +493,7 @@ static int dsdb_schema_setup_ldb_schema_attribute(struct ldb_context *ldb, #define GET_BOOL_LDB(msg, attr, p, elem, strict) do { \ const char *str; \ - str = samdb_result_string(msg, attr, NULL);\ + str = ldb_msg_find_attr_as_string(msg, attr, NULL);\ if (str == NULL) { \ if (strict) { \ d_printf("%s: %s == NULL\n", __location__, attr); \ @@ -512,11 +512,11 @@ static int dsdb_schema_setup_ldb_schema_attribute(struct ldb_context *ldb, } while (0) #define GET_UINT32_LDB(msg, attr, p, elem) do { \ - (p)->elem = samdb_result_uint(msg, attr, 0);\ + (p)->elem = ldb_msg_find_attr_as_uint(msg, attr, 0);\ } while (0) #define GET_UINT32_PTR_LDB(msg, attr, mem_ctx, p, elem) do { \ - uint64_t _v = samdb_result_uint64(msg, attr, UINT64_MAX);\ + uint64_t _v = ldb_msg_find_attr_as_uint64(msg, attr, UINT64_MAX);\ if (_v == UINT64_MAX) { \ (p)->elem = NULL; \ } else if (_v > UINT32_MAX) { \ |