diff options
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 24 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samldb.c | 6 |
2 files changed, 19 insertions, 11 deletions
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; |