[PATCH] Two small cleanups

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Two small cleanups

Volker Lendecke-3
Hi!

Review appreciated!

Thanks, Volker

patch.txt (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Two small cleanups

Jeremy Allison
On Tue, Mar 07, 2017 at 02:24:24PM +0100, Volker Lendecke wrote:
> Hi!
>
> Review appreciated!

LGTM - pushed !

> From c7a706ce7c5fa47cccd3289f42a036ae5fc72308 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <[hidden email]>
> Date: Tue, 21 Feb 2017 18:41:59 +0100
> Subject: [PATCH 1/2] winbind: Remove unused wcache_tdc_fetch_domainbysid
>
> Signed-off-by: Volker Lendecke <[hidden email]>
> ---
>  source3/winbindd/winbindd_cache.c | 41 ---------------------------------------
>  source3/winbindd/winbindd_proto.h |  1 -
>  2 files changed, 42 deletions(-)
>
> diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
> index 5787441..4bb0195 100644
> --- a/source3/winbindd/winbindd_cache.c
> +++ b/source3/winbindd/winbindd_cache.c
> @@ -4727,47 +4727,6 @@ struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const cha
>  /*********************************************************************
>   ********************************************************************/
>  
> -struct winbindd_tdc_domain*
> - wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx,
> -     const struct dom_sid *sid)
> -{
> - struct winbindd_tdc_domain *dom_list = NULL;
> - size_t num_domains = 0;
> - int i;
> - struct winbindd_tdc_domain *d = NULL;
> -
> - DEBUG(10,("wcache_tdc_fetch_domainbysid: Searching for domain %s\n",
> -  sid_string_dbg(sid)));
> -
> - if (!init_wcache()) {
> - return NULL;
> - }
> -
> - /* fetch the list */
> -
> - wcache_tdc_fetch_list(&dom_list, &num_domains);
> -
> - for (i = 0; i<num_domains; i++) {
> - if (dom_sid_equal(sid, &(dom_list[i].sid))) {
> - DEBUG(10, ("wcache_tdc_fetch_domainbysid: "
> -   "Found domain %s for SID %s\n",
> -   dom_list[i].domain_name,
> -   sid_string_dbg(sid)));
> -
> - d = wcache_tdc_dup_domain(ctx, &dom_list[i]);
> - break;
> - }
> - }
> -
> -        TALLOC_FREE(dom_list);
> -
> - return d;
> -}
> -
> -
> -/*********************************************************************
> - ********************************************************************/
> -
>  void wcache_tdc_clear( void )
>  {
>   if ( !init_wcache() )
> diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
> index 09be4b2..c5d934e 100644
> --- a/source3/winbindd/winbindd_proto.h
> +++ b/source3/winbindd/winbindd_proto.h
> @@ -192,7 +192,6 @@ bool winbindd_cache_validate_and_initialize(void);
>  bool wcache_tdc_fetch_list( struct winbindd_tdc_domain **domains, size_t *num_domains );
>  bool wcache_tdc_add_domain( struct winbindd_domain *domain );
>  struct winbindd_tdc_domain * wcache_tdc_fetch_domain( TALLOC_CTX *ctx, const char *name );
> -struct winbindd_tdc_domain* wcache_tdc_fetch_domainbysid(TALLOC_CTX *ctx, const struct dom_sid *sid);
>  void wcache_tdc_clear( void );
>  bool wcache_store_seqnum(const char *domain_name, uint32_t seqnum,
>   time_t last_seq_check);
> --
> 2.1.4
>
>
> From 1c1ac6e64ca7e291e502fd7abc38c98ae73d0a29 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <[hidden email]>
> Date: Tue, 7 Mar 2017 14:06:52 +0100
> Subject: [PATCH 2/2] winbind: Add a debug message for out-of-range IDs
>
> Signed-off-by: Volker Lendecke <[hidden email]>
> ---
>  source3/winbindd/winbindd_dual_srv.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/source3/winbindd/winbindd_dual_srv.c b/source3/winbindd/winbindd_dual_srv.c
> index 763ebb8..02b1adb 100644
> --- a/source3/winbindd/winbindd_dual_srv.c
> +++ b/source3/winbindd/winbindd_dual_srv.c
> @@ -190,6 +190,10 @@ NTSTATUS _wbint_Sids2UnixIDs(struct pipes_struct *p,
>   struct id_map *m = id_map_ptrs[i];
>  
>   if (!idmap_unix_id_is_in_range(m->xid.id, dom)) {
> + DBG_DEBUG("id %"PRIu32" is out of range "
> +  "%"PRIu32"-%"PRIu32" for domain %s\n",
> +  m->xid.id, dom->low_id, dom->high_id,
> +  dom->name);
>   m->status = ID_UNMAPPED;
>   }
>  
> --
> 2.1.4
>