In the SAMBA 4 DCE/RPC NETLOGON server the SAM context references have generally
the type "void *". But we know that those context objects are based on the "struct
ldb_context" type. We've always to cast for using a SAM/LDB call.
This I didn't find very appealing and so I assigned the right (detailed) type to each "sam_ctx".
Therefore, the casts could disappear.
Also this change is only cosmetic.
}
/* pull the user attributes */
}
/* pull the user attributes */
- num_records = gendb_search((struct ldb_context *)sam_ctx,
- mem_ctx, NULL, &msgs,
+ num_records = gendb_search(sam_ctx, mem_ctx, NULL, &msgs,
trust_dom_attrs,
"(&(trustPartner=%s)(objectclass=trustedDomain))",
encoded_account);
trust_dom_attrs,
"(&(trustPartner=%s)(objectclass=trustedDomain))",
encoded_account);
}
/* pull the user attributes */
}
/* pull the user attributes */
- num_records = gendb_search((struct ldb_context *)sam_ctx, mem_ctx,
- NULL, &msgs, attrs,
+ num_records = gendb_search(sam_ctx, mem_ctx, NULL, &msgs, attrs,
"(&(sAMAccountName=%s)(objectclass=user))",
ldb_binary_encode_string(mem_ctx, account_name));
"(&(sAMAccountName=%s)(objectclass=user))",
ldb_binary_encode_string(mem_ctx, account_name));
struct netr_GetDcName *r)
{
const char * const attrs[] = { NULL };
struct netr_GetDcName *r)
{
const char * const attrs[] = { NULL };
+ struct ldb_context *sam_ctx;
struct ldb_message **res;
struct ldb_dn *domain_dn;
int ret;
struct ldb_message **res;
struct ldb_dn *domain_dn;
int ret;
return WERR_DS_SERVICE_UNAVAILABLE;
}
return WERR_DS_SERVICE_UNAVAILABLE;
}
- domain_dn = samdb_domain_to_dn((struct ldb_context *)sam_ctx, mem_ctx,
+ domain_dn = samdb_domain_to_dn(sam_ctx, mem_ctx,
r->in.domainname);
if (domain_dn == NULL) {
return WERR_DS_SERVICE_UNAVAILABLE;
}
r->in.domainname);
if (domain_dn == NULL) {
return WERR_DS_SERVICE_UNAVAILABLE;
}
- ret = gendb_search_dn((struct ldb_context *)sam_ctx, mem_ctx,
+ ret = gendb_search_dn(sam_ctx, mem_ctx,
domain_dn, &res, attrs);
if (ret != 1) {
return WERR_NO_SUCH_DOMAIN;
domain_dn, &res, attrs);
if (ret != 1) {
return WERR_NO_SUCH_DOMAIN;
struct netr_DsrEnumerateDomainTrusts *r)
{
struct netr_DomainTrustList *trusts;
struct netr_DsrEnumerateDomainTrusts *r)
{
struct netr_DomainTrustList *trusts;
+ struct ldb_context *sam_ctx;
int ret;
struct ldb_message **dom_res;
const char * const dom_attrs[] = { "objectSid", "objectGUID", NULL };
int ret;
struct ldb_message **dom_res;
const char * const dom_attrs[] = { "objectSid", "objectGUID", NULL };
return WERR_GENERAL_FAILURE;
}
return WERR_GENERAL_FAILURE;
}
- ret = gendb_search_dn((struct ldb_context *)sam_ctx, mem_ctx, NULL,
+ ret = gendb_search_dn(sam_ctx, mem_ctx, NULL,
&dom_res, dom_attrs);
if (ret == -1) {
return WERR_GENERAL_FAILURE;
&dom_res, dom_attrs);
if (ret == -1) {
return WERR_GENERAL_FAILURE;