[PATCH] Two small cleanups
Volker Lendecke
vl at samba.org
Thu Mar 16 15:29:40 UTC 2017
On Thu, Mar 16, 2017 at 10:56:17AM +0100, Ralph Böhme via samba-technical wrote:
> Hi!
>
> Attached are two small cleanups for winbindd.
>
> Please review & push if happy. Thanks!
Attached with my Review. While there -- I've added a patch on top to
squash. When touching code anyway I would appreciated to change it to
<80 chars per line.
Volker
-------------- next part --------------
>From 5d667c2d486a001a2b3278f3042850899bd92e20 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 16 Mar 2017 09:32:55 +0100
Subject: [PATCH 1/3] winbindd: use NULL for pointer check in get_cache()
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
---
source3/winbindd/winbindd_cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index bafeb9bf3da..f0c19fbe2f7 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -162,7 +162,7 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
--jerry
*/
- if (!domain->backend) {
+ if (domain->backend == NULL) {
#ifdef HAVE_ADS
struct winbindd_domain *our_domain = domain;
--
2.11.0
>From 48744381ede2a8eaa53d7d38b2d147bfa7181757 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 16 Mar 2017 10:36:14 +0100
Subject: [PATCH 2/3] winbindd: untangle reconnect_methods vs
reconnect_ads_methods
No change in behaviour. The previous logic just seemed a bit clumsy
because of the ifdefs.
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Volker Lendecke <vl at samba.org>
---
source3/winbindd/winbindd_cache.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index f0c19fbe2f7..0ef7c1632d8 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -162,8 +162,8 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
--jerry
*/
- if (domain->backend == NULL) {
#ifdef HAVE_ADS
+ if (domain->backend == NULL) {
struct winbindd_domain *our_domain = domain;
/* find our domain first so we can figure out if we
@@ -177,13 +177,13 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
&& !lp_winbind_rpc_only()) {
DEBUG(5,("get_cache: Setting ADS methods for domain %s\n", domain->name));
domain->backend = &reconnect_ads_methods;
- } else {
-#endif /* HAVE_ADS */
- DEBUG(5,("get_cache: Setting MS-RPC methods for domain %s\n", domain->name));
- domain->backend = &reconnect_methods;
-#ifdef HAVE_ADS
}
+ }
#endif /* HAVE_ADS */
+
+ if (domain->backend == NULL) {
+ DEBUG(5,("get_cache: Setting MS-RPC methods for domain %s\n", domain->name));
+ domain->backend = &reconnect_methods;
}
if (ret)
--
2.11.0
>From 3aeac94ddec9ba3362c3fc435cef9a2c26dbd528 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 16 Mar 2017 15:27:36 +0000
Subject: [PATCH 3/3] SQ -- fix formatting
---
source3/winbindd/winbindd_cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 0ef7c1632d8..e50fc39e02b 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -182,7 +182,8 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain)
#endif /* HAVE_ADS */
if (domain->backend == NULL) {
- DEBUG(5,("get_cache: Setting MS-RPC methods for domain %s\n", domain->name));
+ DBG_INFO("get_cache: Setting MS-RPC methods for domain %s\n",
+ domain->name);
domain->backend = &reconnect_methods;
}
--
2.11.0
More information about the samba-technical
mailing list