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/samdb/ldb_modules/password_hash.c | |
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/samdb/ldb_modules/password_hash.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/password_hash.c | 24 |
1 files changed, 16 insertions, 8 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; |