Re: [Freeipa-devel] [PATCH] reduce redundant checks in ldapsam_search_users()

2012-07-06 Thread Alexander Bokovoy

On Fri, 06 Jul 2012, Alexander Bokovoy wrote:

Hi,

Obvious clean up in ldapsam_search_users(): every branch is setting the
same base dn and nothing else.

Merged the line with talloc_strdup() call few lines after that.

--
/ Alexander Bokovoy
From bf06e39a143967d3d99dcfe3fcd4d7f2a5f0142c Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy aboko...@redhat.com
Date: Fri, 6 Jul 2012 12:48:27 +0300
Subject: [PATCH 2/2] reduce redundant checks in ldapsam_search_users() to a
 single statement

---
 daemons/ipa-sam/ipa_sam.c |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/daemons/ipa-sam/ipa_sam.c b/daemons/ipa-sam/ipa_sam.c
index 
29fc95e457179716c1c70c6f061b1cde9e3f472b..86ed3fbd3e6d1894fd398c3c1c94d34c2b7ec273
 100644
--- a/daemons/ipa-sam/ipa_sam.c
+++ b/daemons/ipa-sam/ipa_sam.c
@@ -1044,16 +1044,9 @@ static bool ldapsam_search_users(struct pdb_methods 
*methods,
 
state-connection = ldap_state-smbldap_state;
 
-   if ((acct_flags != 0)  ((acct_flags  ACB_NORMAL) != 0))
-   state-base = ldap_state-ipasam_privates-base_dn;
-   else if ((acct_flags != 0) 
-((acct_flags  (ACB_WSTRUST|ACB_SVRTRUST|ACB_DOMTRUST)) != 0))
-   state-base = ldap_state-ipasam_privates-base_dn;
-   else
-   state-base = ldap_state-ipasam_privates-base_dn;
+   state-base = talloc_strdup(search, 
ldap_state-ipasam_privates-base_dn);
 
state-acct_flags = acct_flags;
-   state-base = talloc_strdup(search, state-base);
state-scope = LDAP_SCOPE_SUBTREE;
state-filter = get_ldap_filter(search, *);
state-attrs = talloc_attrs(search, uid, LDAP_ATTRIBUTE_SID,
-- 
1.7.10.4

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Re: [Freeipa-devel] [PATCH] reduce redundant checks in ldapsam_search_users()

2012-07-06 Thread Sumit Bose
On Fri, Jul 06, 2012 at 01:18:28PM +0300, Alexander Bokovoy wrote:
 On Fri, 06 Jul 2012, Alexander Bokovoy wrote:
 Hi,
 
 Obvious clean up in ldapsam_search_users(): every branch is setting the
 same base dn and nothing else.
 Merged the line with talloc_strdup() call few lines after that.
 

ACK

bye,
Sumit

 -- 
 / Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] reduce redundant checks in ldapsam_search_users()

2012-07-06 Thread Alexander Bokovoy

On Fri, 06 Jul 2012, Sumit Bose wrote:

On Fri, Jul 06, 2012 at 01:18:28PM +0300, Alexander Bokovoy wrote:

On Fri, 06 Jul 2012, Alexander Bokovoy wrote:
Hi,

Obvious clean up in ldapsam_search_users(): every branch is setting the
same base dn and nothing else.
Merged the line with talloc_strdup() call few lines after that.



ACK

Pushed to master.

--
/ Alexander Bokovoy

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel