[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Tue Aug 1 09:46:02 UTC 2017
The branch, master has been updated
via a70ab5f winbindd: Simplify two debug msgs
via 69187d9 winbindd: Simplify wcache_cached_creds_exist
via 9be8fc2 winbindd: Make wcache_lookup_usergroups static
via 7736e59 winbindd: Fix indentation
via 604f1ce winbindd: Make init_wcache static
via 91d4151 winbindd: Make wcache_lookup_useraliases static
via 8f0bd85 winbindd: Make wcache_name_to_sid static
via d8f85c0 winbindd: Make wcache_lookup_groupmem static
via bbdfb51 winbindd: Make wcache_flush_cache static
via 0f65bb7 winbindd: Fix a few signed/unsigned hickups
from d5750f0 dsdb: Fix dsdb_next_callback to correctly use ldb_module_done() etc
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit a70ab5f02026d5610558d529c599f2cda904d742
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jul 14 13:18:59 2017 +0200
winbindd: Simplify two debug msgs
With DBG_DEBUG we get the function name automatically, DEBUGADD is also
not necessary here
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Tue Aug 1 11:45:34 CEST 2017 on sn-devel-144
commit 69187d92e55c9d98e09a0ae90a66d7151ee588c1
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jul 13 15:52:35 2017 +0200
winbindd: Simplify wcache_cached_creds_exist
No need to fetch, use tdb_exists
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 9be8fc2c0ae6cb09813ff08a93e8d2c40cf6b2ef
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 14:56:32 2017 +0200
winbindd: Make wcache_lookup_usergroups static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 7736e592ffd0664c75a9c9c5c476b3cc9ed1de75
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 14:32:02 2017 +0200
winbindd: Fix indentation
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 604f1cede6753d5a3c8e247b7301c23d0b6bbfe0
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 13:32:33 2017 +0200
winbindd: Make init_wcache static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 91d4151bdf5e6d8905030e915068fff19e3a594b
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 13:14:44 2017 +0200
winbindd: Make wcache_lookup_useraliases static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 8f0bd85cfac6aad270f5df0e4d5127b37d00b3d2
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 13:12:45 2017 +0200
winbindd: Make wcache_name_to_sid static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit d8f85c0f330d7a78978d0e4c17f7cd0756ee1076
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 12:40:29 2017 +0200
winbindd: Make wcache_lookup_groupmem static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit bbdfb51296f7558a56ac0368d7a6e69cdb7ae2fb
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 12:40:29 2017 +0200
winbindd: Make wcache_flush_cache static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
commit 0f65bb7c5c026121c868d8a9104ecb563622c7ac
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 12 13:30:02 2017 +0200
winbindd: Fix a few signed/unsigned hickups
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe at gmail.com>
-----------------------------------------------------------------------
Summary of changes:
source3/winbindd/winbindd_cache.c | 69 +++++++++++++++++-----------------
source3/winbindd/winbindd_cred_cache.c | 10 ++---
source3/winbindd/winbindd_pam.c | 8 ++--
source3/winbindd/winbindd_proto.h | 22 -----------
4 files changed, 43 insertions(+), 66 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 98c69f8..ce5e5cd 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -52,6 +52,8 @@ extern struct winbindd_methods reconnect_ads_methods;
extern struct winbindd_methods builtin_passdb_methods;
extern struct winbindd_methods sam_passdb_methods;
+static void wcache_flush_cache(void);
+
/*
* JRA. KEEP THIS LIST UP TO DATE IF YOU ADD CACHE ENTRIES.
* Here are the list of entry types that are *not* stored
@@ -1267,7 +1269,7 @@ do_query:
NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid)
{
struct winbind_cache *cache = get_cache(domain);
- TDB_DATA data;
+ int ret;
fstring key_str, tmp;
uint32_t rid;
@@ -1285,12 +1287,11 @@ NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct
fstr_sprintf(key_str, "CRED/%s", sid_to_fstring(tmp, sid));
- data = tdb_fetch(cache->tdb, string_tdb_data(key_str));
- if (!data.dptr) {
+ ret = tdb_exists(cache->tdb, string_tdb_data(key_str));
+ if (ret != 0) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- SAFE_FREE(data.dptr);
return NT_STATUS_OK;
}
@@ -1762,11 +1763,11 @@ skip_save:
return status;
}
-NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
- const char *domain_name,
- const char *name,
- struct dom_sid *sid,
- enum lsa_SidType *type)
+static NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
+ const char *domain_name,
+ const char *name,
+ struct dom_sid *sid,
+ enum lsa_SidType *type)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry;
@@ -2319,11 +2320,11 @@ NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
return NT_STATUS_OK;
}
-NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- uint32_t *pnum_sids,
- struct dom_sid **psids)
+static NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *user_sid,
+ uint32_t *pnum_sids,
+ struct dom_sid **psids)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -2470,18 +2471,19 @@ static char *wcache_make_sidlist(TALLOC_CTX *mem_ctx, uint32_t num_sids,
return sidlist;
}
-NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx, uint32_t num_sids,
- const struct dom_sid *sids,
- uint32_t *pnum_aliases, uint32_t **paliases)
+static NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ uint32_t num_sids,
+ const struct dom_sid *sids,
+ uint32_t *pnum_aliases,
+ uint32_t **paliases)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
- uint32_t num_aliases;
+ uint32_t i, num_aliases;
uint32_t *aliases;
NTSTATUS status;
char *sidlist;
- int i;
if (cache->tdb == NULL) {
return NT_STATUS_NOT_FOUND;
@@ -2541,7 +2543,7 @@ NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
struct cache_entry *centry = NULL;
NTSTATUS status;
char *sidlist;
- int i;
+ uint32_t i;
bool old_status;
old_status = domain->online;
@@ -2601,12 +2603,12 @@ NTSTATUS wb_cache_lookup_useraliases(struct winbindd_domain *domain,
return status;
}
-NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *group_sid,
- uint32_t *num_names,
- struct dom_sid **sid_mem, char ***names,
- uint32_t **name_types)
+static NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
+ TALLOC_CTX *mem_ctx,
+ const struct dom_sid *group_sid,
+ uint32_t *num_names,
+ struct dom_sid **sid_mem, char ***names,
+ uint32_t **name_types)
{
struct winbind_cache *cache = get_cache(domain);
struct cache_entry *centry = NULL;
@@ -2764,7 +2766,7 @@ NTSTATUS wb_cache_trusted_domains(struct winbindd_domain *domain,
struct winbindd_tdc_domain *dom_list = NULL;
size_t num_domains = 0;
bool retval = false;
- int i;
+ size_t i;
bool old_status;
old_status = domain->online;
@@ -3108,7 +3110,7 @@ bool wcache_invalidate_cache_noinit(void)
return true;
}
-bool init_wcache(void)
+static bool init_wcache(void)
{
char *db_path;
@@ -3320,7 +3322,7 @@ static int traverse_fn_cleanup(TDB_CONTEXT *the_tdb, TDB_DATA kbuf,
}
/* flush the cache */
-void wcache_flush_cache(void)
+static void wcache_flush_cache(void)
{
char *db_path;
@@ -4321,8 +4323,7 @@ static bool add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom,
size_t *num_domains )
{
struct winbindd_tdc_domain *list = NULL;
- size_t idx;
- int i;
+ size_t i, idx;
bool set_only = false;
/* don't allow duplicates */
@@ -4423,7 +4424,7 @@ static int pack_tdc_domains( struct winbindd_tdc_domain *domains,
unsigned char *buffer = NULL;
int len = 0;
int buflen = 0;
- int i = 0;
+ size_t i = 0;
DEBUG(10,("pack_tdc_domains: Packing %d trusted domains\n",
(int)num_domains));
@@ -4693,7 +4694,7 @@ struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const cha
{
struct winbindd_tdc_domain *dom_list = NULL;
size_t num_domains = 0;
- int i;
+ size_t i;
struct winbindd_tdc_domain *d = NULL;
DEBUG(10,("wcache_tdc_fetch_domain: Searching for domain %s\n", name));
diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c
index 20b4d55..ed2dd10 100644
--- a/source3/winbindd/winbindd_cred_cache.c
+++ b/source3/winbindd/winbindd_cred_cache.c
@@ -118,9 +118,8 @@ static void krb5_ticket_refresh_handler(struct tevent_context *event_ctx,
struct WINBINDD_MEMORY_CREDS *cred_ptr = entry->cred_ptr;
#endif
- DEBUG(10,("krb5_ticket_refresh_handler called\n"));
- DEBUGADD(10,("event called for: %s, %s\n",
- entry->ccname, entry->username));
+ DBG_DEBUG("event called for: %s, %s\n",
+ entry->ccname, entry->username);
TALLOC_FREE(entry->event);
@@ -311,9 +310,8 @@ static void krb5_ticket_gain_handler(struct tevent_context *event_ctx,
struct winbindd_domain *domain = NULL;
#endif
- DEBUG(10,("krb5_ticket_gain_handler called\n"));
- DEBUGADD(10,("event called for: %s, %s\n",
- entry->ccname, entry->username));
+ DBG_DEBUG("event called for: %s, %s\n",
+ entry->ccname, entry->username);
TALLOC_FREE(entry->event);
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 37b0c09..11672f7 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1863,10 +1863,10 @@ sam_logon:
goto cached_logon;
}
- if (domain->online) {
- /* We're still online - fail. */
- goto done;
- }
+ if (domain->online) {
+ /* We're still online - fail. */
+ goto done;
+ }
}
cached_logon:
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 6d6fafcb..6aa0ed9 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -131,15 +131,8 @@ void wcache_invalidate_samlogon(struct winbindd_domain *domain,
const struct dom_sid *user_sid);
bool wcache_invalidate_cache(void);
bool wcache_invalidate_cache_noinit(void);
-bool init_wcache(void);
bool initialize_winbindd_cache(void);
void close_winbindd_cache(void);
-NTSTATUS wcache_lookup_groupmem(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *group_sid,
- uint32_t *num_names,
- struct dom_sid **sid_mem, char ***names,
- uint32_t **name_types);
bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
char **domain_name, char **name,
enum lsa_SidType *type);
@@ -155,11 +148,6 @@ void cache_name2sid_trusted(struct winbindd_domain *domain,
void cache_name2sid(struct winbindd_domain *domain,
const char *domain_name, const char *name,
enum lsa_SidType type, const struct dom_sid *sid);
-NTSTATUS wcache_name_to_sid(struct winbindd_domain *domain,
- const char *domain_name,
- const char *name,
- struct dom_sid *sid,
- enum lsa_SidType *type);
NTSTATUS wcache_query_user(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
const struct dom_sid *user_sid,
@@ -168,17 +156,7 @@ NTSTATUS wcache_query_user_fullname(struct winbindd_domain *domain,
TALLOC_CTX *mem_ctx,
const struct dom_sid *user_sid,
const char **full_name);
-NTSTATUS wcache_lookup_useraliases(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- uint32_t num_sids, const struct dom_sid *sids,
- uint32_t *pnum_aliases, uint32_t **paliases);
-NTSTATUS wcache_lookup_usergroups(struct winbindd_domain *domain,
- TALLOC_CTX *mem_ctx,
- const struct dom_sid *user_sid,
- uint32_t *pnum_sids,
- struct dom_sid **psids);
-void wcache_flush_cache(void);
NTSTATUS wcache_count_cached_creds(struct winbindd_domain *domain, int *count);
NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const struct dom_sid *sid) ;
bool set_global_winbindd_state_offline(void);
--
Samba Shared Repository
More information about the samba-cvs
mailing list