The branch, v3-0-test has been updated
       via  a2329ec0eea66108f44dae3853e578dbbf835f96 (commit)
       via  06f19e52489b3253ea4292795e4c73fa94cfd392 (commit)
      from  cc97e2a0d51f52a79982ac265f073d3829c1357a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-0-test


- Log -----------------------------------------------------------------
commit a2329ec0eea66108f44dae3853e578dbbf835f96
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Sat Nov 22 00:43:43 2008 +0100

    winbindd: make all winbind rpc-methods static.
    
    Now that the methods are no longer needed in winbindd_ads,
    we can make them static again.
    
    Michael

commit 06f19e52489b3253ea4292795e4c73fa94cfd392
Author: Michael Adam <[EMAIL PROTECTED]>
Date:   Sat Nov 22 00:42:54 2008 +0100

    winbindd_ads: use the reconnect methods instead of the rpc methods directly
    
    Some of the ads methods just point to the rpc methods.
    This makes winbindd_ads use the reconnect methods instead of
    calling the rpc methods directly in order to prevent
    negative cache entries for e.g. name_to_sid, when the dc
    has closed the connection without sending a reset.
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/nsswitch/winbindd_ads.c |   80 +++++++++++++++++++++++++++++++++++++---
 source/nsswitch/winbindd_rpc.c |   61 +++++++++++++++---------------
 2 files changed, 105 insertions(+), 36 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/nsswitch/winbindd_ads.c b/source/nsswitch/winbindd_ads.c
index 01f9413..8cb5f39 100644
--- a/source/nsswitch/winbindd_ads.c
+++ b/source/nsswitch/winbindd_ads.c
@@ -390,6 +390,46 @@ static NTSTATUS enum_local_groups(struct winbindd_domain 
*domain,
        return NT_STATUS_OK;
 }
 
+/* convert a single name to a sid in a domain - use rpc methods */
+static NTSTATUS name_to_sid(struct winbindd_domain *domain,
+                           TALLOC_CTX *mem_ctx,
+                           const char *domain_name,
+                           const char *name,
+                           DOM_SID *sid,
+                           enum lsa_SidType *type)
+{
+       return reconnect_methods.name_to_sid(domain, mem_ctx,
+                                            domain_name, name,
+                                            sid, type);
+}
+
+/* convert a domain SID to a user or group name - use rpc methods */
+static NTSTATUS sid_to_name(struct winbindd_domain *domain,
+                           TALLOC_CTX *mem_ctx,
+                           const DOM_SID *sid,
+                           char **domain_name,
+                           char **name,
+                           enum lsa_SidType *type)
+{
+       return reconnect_methods.sid_to_name(domain, mem_ctx, sid,
+                                            domain_name, name, type);
+}
+
+/* convert a list of rids to names - use rpc methods */
+static NTSTATUS rids_to_names(struct winbindd_domain *domain,
+                             TALLOC_CTX *mem_ctx,
+                             const DOM_SID *sid,
+                             uint32 *rids,
+                             size_t num_rids,
+                             char **domain_name,
+                             char ***names,
+                             enum lsa_SidType **types)
+{
+       return reconnect_methods.rids_to_names(domain, mem_ctx, sid,
+                                              rids, num_rids,
+                                              domain_name, names, types);
+}
+
 /* convert a DN to a name, SID and name type 
    this might become a major speed bottleneck if groups have
    lots of users, in which case we could cache the results
@@ -831,6 +871,18 @@ done:
        return status;
 }
 
+/* Lookup aliases a user is member of - use rpc methods */
+static NTSTATUS lookup_useraliases(struct winbindd_domain *domain,
+                                  TALLOC_CTX *mem_ctx,
+                                  uint32 num_sids, const DOM_SID *sids,
+                                  uint32 *num_aliases, uint32 **alias_rids)
+{
+       return reconnect_methods.lookup_useraliases(domain, mem_ctx,
+                                                   num_sids, sids,
+                                                   num_aliases,
+                                                   alias_rids);
+}
+
 /*
   find the members of a group, given a group rid and domain
  */
@@ -1035,6 +1087,22 @@ static NTSTATUS sequence_number(struct winbindd_domain 
*domain, uint32 *seq)
        return ads_ntstatus(rc);
 }
 
+/* find the lockout policy of a domain - use rpc methods */
+static NTSTATUS lockout_policy(struct winbindd_domain *domain,
+                              TALLOC_CTX *mem_ctx,
+                              SAM_UNK_INFO_12 *policy)
+{
+       return reconnect_methods.lockout_policy(domain, mem_ctx, policy);
+}
+
+/* find the password policy of a domain - use rpc methods */
+static NTSTATUS password_policy(struct winbindd_domain *domain,
+                               TALLOC_CTX *mem_ctx,
+                               SAM_UNK_INFO_1 *policy)
+{
+       return reconnect_methods.password_policy(domain, mem_ctx, policy);
+}
+
 /* get a list of trusted domains */
 static NTSTATUS trusted_domains(struct winbindd_domain *domain,
                                TALLOC_CTX *mem_ctx,
@@ -1113,16 +1181,16 @@ struct winbindd_methods ads_methods = {
        query_user_list,
        enum_dom_groups,
        enum_local_groups,
-       msrpc_name_to_sid,
-       msrpc_sid_to_name,
-       msrpc_rids_to_names,
+       name_to_sid,
+       sid_to_name,
+       rids_to_names,
        query_user,
        lookup_usergroups,
-       msrpc_lookup_useraliases,
+       lookup_useraliases,
        lookup_groupmem,
        sequence_number,
-       msrpc_lockout_policy,
-       msrpc_password_policy,
+       lockout_policy,
+       password_policy,
        trusted_domains,
 };
 
diff --git a/source/nsswitch/winbindd_rpc.c b/source/nsswitch/winbindd_rpc.c
index 3c79670..b258cb3 100644
--- a/source/nsswitch/winbindd_rpc.c
+++ b/source/nsswitch/winbindd_rpc.c
@@ -235,12 +235,12 @@ static NTSTATUS enum_local_groups(struct winbindd_domain 
*domain,
 }
 
 /* convert a single name to a sid in a domain */
-NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
-                           TALLOC_CTX *mem_ctx,
-                           const char *domain_name,
-                           const char *name,
-                           DOM_SID *sid,
-                           enum lsa_SidType *type)
+static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
+                                 TALLOC_CTX *mem_ctx,
+                                 const char *domain_name,
+                                 const char *name,
+                                 DOM_SID *sid,
+                                 enum lsa_SidType *type)
 {
        NTSTATUS result;
        DOM_SID *sids = NULL;
@@ -286,12 +286,12 @@ NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
 /*
   convert a domain SID to a user or group name
 */
-NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
-                           TALLOC_CTX *mem_ctx,
-                           const DOM_SID *sid,
-                           char **domain_name,
-                           char **name,
-                           enum lsa_SidType *type)
+static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
+                                 TALLOC_CTX *mem_ctx,
+                                 const DOM_SID *sid,
+                                 char **domain_name,
+                                 char **name,
+                                 enum lsa_SidType *type)
 {
        char **domains;
        char **names;
@@ -322,14 +322,14 @@ NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
        return NT_STATUS_OK;
 }
 
-NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
-                            TALLOC_CTX *mem_ctx,
-                            const DOM_SID *sid,
-                            uint32 *rids,
-                            size_t num_rids,
-                            char **domain_name,
-                            char ***names,
-                            enum lsa_SidType **types)
+static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
+                                   TALLOC_CTX *mem_ctx,
+                                   const DOM_SID *sid,
+                                   uint32 *rids,
+                                   size_t num_rids,
+                                   char **domain_name,
+                                   char ***names,
+                                   enum lsa_SidType **types)
 {
        char **domains;
        NTSTATUS result;
@@ -530,10 +530,11 @@ static NTSTATUS lookup_usergroups(struct winbindd_domain 
*domain,
        return NT_STATUS_OK;
 }
 
-NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain,
-                                 TALLOC_CTX *mem_ctx,
-                                 uint32 num_sids, const DOM_SID *sids,
-                                 uint32 *num_aliases, uint32 **alias_rids)
+static NTSTATUS msrpc_lookup_useraliases(struct winbindd_domain *domain,
+                                        TALLOC_CTX *mem_ctx,
+                                        uint32 num_sids, const DOM_SID *sids,
+                                        uint32 *num_aliases,
+                                        uint32 **alias_rids)
 {
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
        POLICY_HND dom_pol;
@@ -955,9 +956,9 @@ static NTSTATUS trusted_domains(struct winbindd_domain 
*domain,
 }
 
 /* find the lockout policy for a domain */
-NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain, 
-                             TALLOC_CTX *mem_ctx,
-                             SAM_UNK_INFO_12 *lockout_policy)
+static NTSTATUS msrpc_lockout_policy(struct winbindd_domain *domain, 
+                                    TALLOC_CTX *mem_ctx,
+                                    SAM_UNK_INFO_12 *lockout_policy)
 {
        NTSTATUS result;
        struct rpc_pipe_client *cli;
@@ -987,9 +988,9 @@ NTSTATUS msrpc_lockout_policy(struct winbindd_domain 
*domain,
 }
 
 /* find the password policy for a domain */
-NTSTATUS msrpc_password_policy(struct winbindd_domain *domain, 
-                              TALLOC_CTX *mem_ctx,
-                              SAM_UNK_INFO_1 *password_policy)
+static NTSTATUS msrpc_password_policy(struct winbindd_domain *domain, 
+                                     TALLOC_CTX *mem_ctx,
+                                     SAM_UNK_INFO_1 *password_policy)
 {
        NTSTATUS result;
        struct rpc_pipe_client *cli;


-- 
Samba Shared Repository

Reply via email to