summaryrefslogtreecommitdiff
path: root/source4/rpc_server/lsa
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-14 09:41:42 +0200
committerAndrew Bartlett <abartlet@samba.org>2010-10-15 08:36:01 +1100
commita0e9814c0d50ee822188e2bd6be8c4879aaebacc (patch)
tree79670d9c58f88ae6007b17ab240a1e64ed33c05e /source4/rpc_server/lsa
parentc2533f94b561e9b22d621b7515c6606d39ffec89 (diff)
downloadsamba-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/rpc_server/lsa')
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c15
-rw-r--r--source4/rpc_server/lsa/lsa_lookup.c4
2 files changed, 9 insertions, 10 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 2e4373471c..ac048ee63b 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -2008,11 +2008,11 @@ static NTSTATUS dcesrv_lsa_QueryTrustedDomainInfo(struct dcesrv_call_state *dce_
switch (r->in.level) {
case LSA_TRUSTED_DOMAIN_INFO_NAME:
info->name.netbios_name.string
- = samdb_result_string(msg, "flatname", NULL);
+ = ldb_msg_find_attr_as_string(msg, "flatname", NULL);
break;
case LSA_TRUSTED_DOMAIN_INFO_POSIX_OFFSET:
info->posix_offset.posix_offset
- = samdb_result_uint(msg, "posixOffset", 0);
+ = ldb_msg_find_attr_as_uint(msg, "posixOffset", 0);
break;
#if 0 /* Win2k3 doesn't implement this */
case LSA_TRUSTED_DOMAIN_INFO_BASIC:
@@ -2028,16 +2028,15 @@ static NTSTATUS dcesrv_lsa_QueryTrustedDomainInfo(struct dcesrv_call_state *dce_
case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO:
ZERO_STRUCT(info->full_info);
return fill_trust_domain_ex(mem_ctx, msg, &info->full_info.info_ex);
-
case LSA_TRUSTED_DOMAIN_INFO_FULL_INFO_2_INTERNAL:
ZERO_STRUCT(info->full_info2_internal);
info->full_info2_internal.posix_offset.posix_offset
- = samdb_result_uint(msg, "posixOffset", 0);
+ = ldb_msg_find_attr_as_uint(msg, "posixOffset", 0);
return fill_trust_domain_ex(mem_ctx, msg, &info->full_info2_internal.info.info_ex);
case LSA_TRUSTED_DOMAIN_SUPPORTED_ENCRYPTION_TYPES:
info->enc_types.enc_types
- = samdb_result_uint(msg, "msDs-supportedEncryptionTypes", KERB_ENCTYPE_RC4_HMAC_MD5);
+ = ldb_msg_find_attr_as_uint(msg, "msDs-supportedEncryptionTypes", KERB_ENCTYPE_RC4_HMAC_MD5);
break;
case LSA_TRUSTED_DOMAIN_INFO_CONTROLLERS:
@@ -2232,7 +2231,7 @@ static NTSTATUS dcesrv_lsa_EnumTrustDom(struct dcesrv_call_state *dce_call, TALL
}
for (i=0;i<count;i++) {
entries[i].sid = samdb_result_dom_sid(mem_ctx, domains[i], "securityIdentifier");
- entries[i].name.string = samdb_result_string(domains[i], "flatname", NULL);
+ entries[i].name.string = ldb_msg_find_attr_as_string(domains[i], "flatname", NULL);
}
/* sort the results by name */
@@ -4286,8 +4285,8 @@ static NTSTATUS dcesrv_lsa_lsaRSetForestTrustInformation(struct dcesrv_call_stat
tdo_dn = dom_res[i]->dn;
- trust_attributes = samdb_result_uint(dom_res[i],
- "trustAttributes", 0);
+ trust_attributes = ldb_msg_find_attr_as_uint(dom_res[i],
+ "trustAttributes", 0);
if (!(trust_attributes & NETR_TRUST_ATTRIBUTE_FOREST_TRANSITIVE)) {
return NT_STATUS_INVALID_PARAMETER;
}
diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c
index d024ea0dd2..73ea72ca6a 100644
--- a/source4/rpc_server/lsa/lsa_lookup.c
+++ b/source4/rpc_server/lsa/lsa_lookup.c
@@ -412,7 +412,7 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx,
continue;
}
- atype = samdb_result_uint(res[i], "sAMAccountType", 0);
+ atype = ldb_msg_find_attr_as_uint(res[i], "sAMAccountType", 0);
*rtype = ds_atype_map(atype);
if (*rtype == SID_NAME_UNKNOWN) {
@@ -530,7 +530,7 @@ static NTSTATUS dcesrv_lsa_lookup_sid(struct lsa_policy_state *state, TALLOC_CTX
}
}
- atype = samdb_result_uint(res[0], "sAMAccountType", 0);
+ atype = ldb_msg_find_attr_as_uint(res[0], "sAMAccountType", 0);
*rtype = ds_atype_map(atype);
return NT_STATUS_OK;