[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Oct 11 22:00:03 UTC 2016
The branch, master has been updated
via 9afdd95 winbindd: Remove now unused cache_methods
via c0cbb00 winbindd: Remove now unused domain->methods
via b69dce5 winbindd: Replace calls to domain->methods
via 148f151 winbindd: Make functions in cache_methods non-static
from 3031815 s3/vfs: remove now unused is_offline/set_offline VFS functions
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9afdd95ff5718fe5bddd54899b101ddfb117e91f
Author: Christof Schmitt <cs at samba.org>
Date: Fri Oct 7 16:44:11 2016 -0700
winbindd: Remove now unused cache_methods
Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Oct 11 23:59:18 CEST 2016 on sn-devel-144
commit c0cbb00007d5ce5b1d6bfa81960b0c2d8f65a019
Author: Christof Schmitt <cs at samba.org>
Date: Fri Oct 7 16:40:22 2016 -0700
winbindd: Remove now unused domain->methods
Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b69dce58958a764db3fefb2ea5f1ca830d4949a9
Author: Christof Schmitt <cs at samba.org>
Date: Fri Oct 7 16:31:40 2016 -0700
winbindd: Replace calls to domain->methods
domain->methods is always set to cache_methods; call those functions
directly instead of going through the indirection.
Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 148f1511b343ad7f393d72698d3f3afa9fe435ed
Author: Christof Schmitt <cs at samba.org>
Date: Fri Oct 7 16:19:07 2016 -0700
winbindd: Make functions in cache_methods non-static
This is in preparation for calling these directly instead of the
domain->methods indirection.
Signed-off-by: Christof Schmitt <cs at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/winbindd/winbindd.h | 9 +--
source3/winbindd/winbindd_cache.c | 148 ++++++++++++++++-------------------
source3/winbindd/winbindd_dual.c | 6 +-
source3/winbindd/winbindd_dual_srv.c | 60 +++++++-------
source3/winbindd/winbindd_misc.c | 3 +-
source3/winbindd/winbindd_ndr.c | 4 -
source3/winbindd/winbindd_pam.c | 16 +---
source3/winbindd/winbindd_proto.h | 68 ++++++++++++++++
source3/winbindd/winbindd_util.c | 33 +++-----
9 files changed, 188 insertions(+), 159 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 3d49e66..fce2e46 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -168,11 +168,10 @@ struct winbindd_domain {
bool can_do_ncacn_ip_tcp;
- /* Lookup methods for this domain (LDAP or RPC) */
- struct winbindd_methods *methods;
-
- /* the backend methods are used by the cache layer to find the right
- backend */
+ /*
+ * Lookup methods for this domain (LDAP or RPC). The backend
+ * methods are used by the cache layer.
+ */
struct winbindd_methods *backend;
/* Private data for the backends (used for connection cache) */
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 3e01ff0..c52e9ed 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -1453,10 +1453,10 @@ NTSTATUS wcache_save_creds(struct winbindd_domain *domain,
/* Query display info. This is the basic user list fn */
-static NTSTATUS query_user_list(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t *num_entries,
- struct wbint_userinfo **info)
+NTSTATUS wb_cache_query_user_list(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *num_entries,
+ struct wbint_userinfo **info)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -1604,10 +1604,10 @@ skip_save:
}
/* list all domain groups */
-static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t *num_entries,
- struct wb_acct_info **info)
+NTSTATUS wb_cache_enum_dom_groups(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *num_entries,
+ struct wb_acct_info **info)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -1699,10 +1699,10 @@ skip_save:
}
/* list all domain groups */
-static NTSTATUS enum_local_groups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t *num_entries,
- struct wb_acct_info **info)
+NTSTATUS wb_cache_enum_local_groups(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ uint32_t *num_entries,
+ struct wb_acct_info **info)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -1847,13 +1847,13 @@ NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
}
/* convert a single name to a sid in a domain */
-static NTSTATUS name_to_sid(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const char *domain_name,
- const char *name,
- uint32_t flags,
- struct dom_sid *sid,
- enum lsa_SidType *type)
+NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const char *domain_name,
+ const char *name,
+ uint32_t flags,
+ struct dom_sid *sid,
+ enum lsa_SidType *type)
{
NTSTATUS status;
bool old_status;
@@ -1961,12 +1961,12 @@ static NTSTATUS wcache_sid_to_name(struct winbindd_domain *domain,
/* convert a sid to a user or group name. The sid is guaranteed to be in the domain
given */
-static NTSTATUS sid_to_name(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *sid,
- char **domain_name,
- char **name,
- enum lsa_SidType *type)
+NTSTATUS wb_cache_sid_to_name(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *sid,
+ char **domain_name,
+ char **name,
+ enum lsa_SidType *type)
{
NTSTATUS status;
bool old_status;
@@ -2024,14 +2024,14 @@ static NTSTATUS sid_to_name(struct winbindd_domain *domain,
return status;
}
-static NTSTATUS rids_to_names(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *domain_sid,
- uint32_t *rids,
- size_t num_rids,
- char **domain_name,
- char ***names,
- enum lsa_SidType **types)
+NTSTATUS wb_cache_rids_to_names(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *domain_sid,
+ uint32_t *rids,
+ size_t num_rids,
+ char **domain_name,
+ char ***names,
+ enum lsa_SidType **types)
{
struct winbind_cache *cache = get_cache(domain);
size_t i;
@@ -2358,10 +2358,10 @@ NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
}
/* Lookup user information from a rid */
-static NTSTATUS query_user(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- struct wbint_userinfo *info)
+NTSTATUS wb_cache_query_user(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *user_sid,
+ struct wbint_userinfo *info)
{
NTSTATUS status;
bool old_status;
@@ -2467,10 +2467,11 @@ NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
}
/* Lookup groups a user is a member of. */
-static NTSTATUS lookup_usergroups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- uint32_t *num_groups, struct dom_sid **user_gids)
+NTSTATUS wb_cache_lookup_usergroups(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *user_sid,
+ uint32_t *num_groups,
+ struct dom_sid **user_gids)
{
struct cache_entry *centry = NULL;
NTSTATUS status;
@@ -2618,10 +2619,12 @@ NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
return status;
}
-static NTSTATUS lookup_useraliases(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t num_sids, const struct dom_sid *sids,
- uint32_t *num_aliases, uint32_t **alias_rids)
+NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ uint32_t num_sids,
+ const struct dom_sid *sids,
+ uint32_t *num_aliases,
+ uint32_t **alias_rids)
{
struct cache_entry *centry = NULL;
NTSTATUS status;
@@ -2751,13 +2754,14 @@ NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
return status;
}
-static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *group_sid,
- enum lsa_SidType type,
- uint32_t *num_names,
- struct dom_sid **sid_mem, char ***names,
- uint32_t **name_types)
+NTSTATUS wb_cache_lookup_groupmem(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *group_sid,
+ enum lsa_SidType type,
+ uint32_t *num_names,
+ struct dom_sid **sid_mem,
+ char ***names,
+ uint32_t **name_types)
{
struct cache_entry *centry = NULL;
NTSTATUS status;
@@ -2826,7 +2830,8 @@ skip_save:
}
/* find the sequence number for a domain */
-static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32_t *seq)
+NTSTATUS wb_cache_sequence_number(struct winbindd_domain *domain,
+ uint32_t *seq)
{
refresh_sequence_number(domain);
@@ -2838,9 +2843,9 @@ static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32_t *seq)
/* enumerate trusted domains
* (we need to have the list of trustdoms in the cache when we go offline) -
* Guenther */
-static NTSTATUS trusted_domains(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- struct netr_DomainTrustList *trusts)
+NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ struct netr_DomainTrustList *trusts)
{
NTSTATUS status;
struct winbind_cache *cache;
@@ -2946,9 +2951,9 @@ do_query:
}
/* get lockout policy */
-static NTSTATUS lockout_policy(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- struct samr_DomInfo12 *policy)
+NTSTATUS wb_cache_lockout_policy(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ struct samr_DomInfo12 *policy)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -3016,9 +3021,9 @@ do_query:
}
/* get password policy */
-static NTSTATUS password_policy(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- struct samr_DomInfo1 *policy)
+NTSTATUS wb_cache_password_policy(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ struct samr_DomInfo1 *policy)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -4973,25 +4978,6 @@ do_query:
#endif
-/* the cache backend methods are exposed via this structure */
-struct winbindd_methods cache_methods = {
- true,
- query_user_list,
- enum_dom_groups,
- enum_local_groups,
- name_to_sid,
- sid_to_name,
- rids_to_names,
- query_user,
- lookup_usergroups,
- lookup_useraliases,
- lookup_groupmem,
- sequence_number,
- lockout_policy,
- password_policy,
- trusted_domains
-};
-
static bool wcache_ndr_key(TALLOC_CTX *mem_ctx, const char *domain_name,
uint32_t opnum, const DATA_BLOB *req,
TDB_DATA *pkey)
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index c16b94e..c389e00 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -939,7 +939,6 @@ static void account_lockout_policy_handler(struct tevent_context *ctx,
struct winbindd_child *child =
(struct winbindd_child *)private_data;
TALLOC_CTX *mem_ctx = NULL;
- struct winbindd_methods *methods;
struct samr_DomInfo12 lockout_policy;
NTSTATUS result;
@@ -955,13 +954,12 @@ static void account_lockout_policy_handler(struct tevent_context *ctx,
return;
}
- methods = child->domain->methods;
-
mem_ctx = talloc_init("account_lockout_policy_handler ctx");
if (!mem_ctx) {
result = NT_STATUS_NO_MEMORY;
} else {
- result = methods->lockout_policy(child->domain, mem_ctx, &lockout_policy);
+ result = wb_cache_lockout_policy(child->domain, mem_ctx,
+ &lockout_policy);
}
TALLOC_FREE(mem_ctx);
diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
index aed2781..4a581d33 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -62,8 +62,8 @@ NTSTATUS _wbint_LookupSid(struct pipes_struct *p, struct wbint_LookupSid *r)
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->sid_to_name(domain, p->mem_ctx, r->in.sid,
- &dom_name, &name, &type);
+ status = wb_cache_sid_to_name(domain, p->mem_ctx, r->in.sid,
+ &dom_name, &name, &type);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -111,9 +111,9 @@ NTSTATUS _wbint_LookupName(struct pipes_struct *p, struct wbint_LookupName *r)
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->name_to_sid(
- domain, p->mem_ctx, r->in.domain, r->in.name, r->in.flags,
- r->out.sid, r->out.type);
+ status = wb_cache_name_to_sid(domain, p->mem_ctx, r->in.domain,
+ r->in.name, r->in.flags,
+ r->out.sid, r->out.type);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -276,8 +276,8 @@ NTSTATUS _wbint_QueryUser(struct pipes_struct *p, struct wbint_QueryUser *r)
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->query_user(domain, p->mem_ctx, r->in.sid,
- r->out.info);
+ status = wb_cache_query_user(domain, p->mem_ctx, r->in.sid,
+ r->out.info);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -292,9 +292,11 @@ NTSTATUS _wbint_LookupUserAliases(struct pipes_struct *p,
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->lookup_useraliases(
- domain, p->mem_ctx, r->in.sids->num_sids, r->in.sids->sids,
- &r->out.rids->num_rids, &r->out.rids->rids);
+ status = wb_cache_lookup_useraliases(domain, p->mem_ctx,
+ r->in.sids->num_sids,
+ r->in.sids->sids,
+ &r->out.rids->num_rids,
+ &r->out.rids->rids);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -309,9 +311,9 @@ NTSTATUS _wbint_LookupUserGroups(struct pipes_struct *p,
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->lookup_usergroups(
- domain, p->mem_ctx, r->in.sid,
- &r->out.sids->num_sids, &r->out.sids->sids);
+ status = wb_cache_lookup_usergroups(domain, p->mem_ctx, r->in.sid,
+ &r->out.sids->num_sids,
+ &r->out.sids->sids);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -326,7 +328,7 @@ NTSTATUS _wbint_QuerySequenceNumber(struct pipes_struct *p,
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->sequence_number(domain, r->out.sequence);
+ status = wb_cache_sequence_number(domain, r->out.sequence);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -345,9 +347,9 @@ NTSTATUS _wbint_LookupGroupMembers(struct pipes_struct *p,
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->lookup_groupmem(
- domain, p->mem_ctx, r->in.sid, r->in.type,
- &num_names, &sid_mem, &names, &name_types);
+ status = wb_cache_lookup_groupmem(domain, p->mem_ctx, r->in.sid,
+ r->in.type, &num_names, &sid_mem,
+ &names, &name_types);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -380,9 +382,9 @@ NTSTATUS _wbint_QueryUserList(struct pipes_struct *p,
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->query_user_list(
- domain, p->mem_ctx, &r->out.users->num_userinfos,
- &r->out.users->userinfos);
+ status = wb_cache_query_user_list(domain, p->mem_ctx,
+ &r->out.users->num_userinfos,
+ &r->out.users->userinfos);
reset_cm_connection_on_error(domain, status);
return status;
}
@@ -426,18 +428,18 @@ NTSTATUS _wbint_QueryGroupList(struct pipes_struct *p,
}
if (include_local_groups) {
- status = domain->methods->enum_local_groups(domain, talloc_tos(),
- &num_local_groups,
- &local_groups);
+ status = wb_cache_enum_local_groups(domain, talloc_tos(),
+ &num_local_groups,
+ &local_groups);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
}
- status = domain->methods->enum_dom_groups(domain, talloc_tos(),
- &num_dom_groups,
- &dom_groups);
+ status = wb_cache_enum_dom_groups(domain, talloc_tos(),
+ &num_dom_groups,
+ &dom_groups);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -611,9 +613,9 @@ NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct wbint_LookupRids *r)
return NT_STATUS_REQUEST_NOT_ACCEPTED;
}
- status = domain->methods->rids_to_names(
- domain, talloc_tos(), r->in.domain_sid, r->in.rids->rids,
- r->in.rids->num_rids, &domain_name, &names, &types);
+ status = wb_cache_rids_to_names(domain, talloc_tos(), r->in.domain_sid,
+ r->in.rids->rids, r->in.rids->num_rids,
+ &domain_name, &names, &types);
reset_cm_connection_on_error(domain, status);
if (!NT_STATUS_IS_OK(status)) {
return status;
diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c
index fab41a1..12c5faa 100644
--- a/source3/winbindd/winbindd_misc.c
+++ b/source3/winbindd/winbindd_misc.c
@@ -160,8 +160,7 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *
DEBUG(3, ("[%5lu]: list trusted domains\n",
(unsigned long)state->pid));
- result = domain->methods->trusted_domains(domain, state->mem_ctx,
- &trusts);
+ result = wb_cache_trusted_domains(domain, state->mem_ctx, &trusts);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(3, ("winbindd_dual_list_trusted_domains: trusted_domains returned %s\n",
diff --git a/source3/winbindd/winbindd_ndr.c b/source3/winbindd/winbindd_ndr.c
index 029e883..383de4e 100644
--- a/source3/winbindd/winbindd_ndr.c
+++ b/source3/winbindd/winbindd_ndr.c
@@ -81,7 +81,6 @@ extern struct winbindd_methods msrpc_methods;
extern struct winbindd_methods builtin_passdb_methods;
extern struct winbindd_methods sam_passdb_methods;
extern struct winbindd_methods reconnect_methods;
-extern struct winbindd_methods cache_methods;
void ndr_print_winbindd_methods(struct ndr_print *ndr,
const char *name,
@@ -110,8 +109,6 @@ void ndr_print_winbindd_methods(struct ndr_print *ndr,
ndr_print_string(ndr, name, "sam_passdb_methods");
} else if (r == &reconnect_methods) {
ndr_print_string(ndr, name, "reconnect_methods");
- } else if (r == &cache_methods) {
- ndr_print_string(ndr, name, "cache_methods");
} else {
ndr_print_string(ndr, name, "UNKNOWN");
}
@@ -147,7 +144,6 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
ndr_print_bool(ndr, "online", r->online);
ndr_print_time_t(ndr, "startup_time", r->startup_time);
ndr_print_bool(ndr, "startup", r->startup);
- ndr_print_winbindd_methods(ndr, "methods", r->methods);
ndr_print_winbindd_methods(ndr, "backend", r->backend);
ndr_print_ptr(ndr, "private_data", r->private_data);
ndr_print_string(ndr, "dcname", r->dcname);
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 8456876..9433ad1 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -402,7 +402,6 @@ static NTSTATUS fillup_password_policy(struct winbindd_domain *domain,
struct winbindd_response *response)
{
TALLOC_CTX *frame = talloc_stackframe();
- struct winbindd_methods *methods;
NTSTATUS status;
struct samr_DomInfo1 password_policy;
--
Samba Shared Repository
More information about the samba-cvs
mailing list