Bug 10837 - winbind crash in idmap_rfc2307 module
Summary: winbind crash in idmap_rfc2307 module
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Winbind (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-24 22:14 UTC by Christof Schmitt
Modified: 2014-10-14 17:09 UTC (History)
1 user (show)

See Also:


Attachments
fix for this problem (1.17 KB, patch)
2014-09-24 22:14 UTC, Christof Schmitt
cs: review+
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christof Schmitt 2014-09-24 22:14:07 UTC
Created attachment 10304 [details]
fix for this problem

winbind can crash when using the idmap_rfc2307 module and the
call to ads_do_search_retry needs to establish a new connection
to the DC. In that case, the local pointer to the LDAP server
struct becomes invalid. The easiest fix is to update the
local pointer after the call to ads_do_search_retry (see attached
patch).
Comment 1 Volker Lendecke 2014-09-30 08:56:20 UTC
(In reply to comment #0)
> Created attachment 10304 [details]
> fix for this problem
> 
> winbind can crash when using the idmap_rfc2307 module and the
> call to ads_do_search_retry needs to establish a new connection
> to the DC. In that case, the local pointer to the LDAP server
> struct becomes invalid. The easiest fix is to update the
> local pointer after the call to ads_do_search_retry (see attached
> patch).

Hi, Christof!

There's a ton of calls like this. While your patch is very likely 100% correct, would it not be worthwhile to fix some more of that? The ads_*_search* interface just sucks badly :-(
Comment 2 Christof Schmitt 2014-10-01 15:08:07 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 10304 [details] [details]
> > fix for this problem
> > 
> > winbind can crash when using the idmap_rfc2307 module and the
> > call to ads_do_search_retry needs to establish a new connection
> > to the DC. In that case, the local pointer to the LDAP server
> > struct becomes invalid. The easiest fix is to update the
> > local pointer after the call to ads_do_search_retry (see attached
> > patch).
> 
> Hi, Christof!
> 
> There's a ton of calls like this. While your patch is very likely 100% correct,
> would it not be worthwhile to fix some more of that? The ads_*_search*
> interface just sucks badly :-(

I agree, but as discussed yesterday, i think it is worthwhile to
fix this bug first before attempting to improve the ads_* and ldap
libraries.
Comment 3 Christof Schmitt 2014-10-01 17:22:49 UTC
Reassigning for inclusion in 4.1 stream.
Comment 4 Karolin Seeger 2014-10-09 18:36:56 UTC
Pushed to autobuild-v4-1-test.
Comment 5 Christof Schmitt 2014-10-09 21:51:24 UTC
Thanks you. When opening this bugzilla, i as not sure of the state of the 4.2 branch. This patch also needs to get into 4.2.
Comment 6 Karolin Seeger 2014-10-13 18:27:16 UTC
(In reply to Christof Schmitt from comment #5)

Pushed to autobuild-v4-2-test.
Comment 7 Karolin Seeger 2014-10-13 19:08:11 UTC
(In reply to Karolin Seeger from comment #4)

Pushed to v4-1-test. Waiting for autobuild-v4-2-test.
Comment 8 Karolin Seeger 2014-10-14 17:09:38 UTC
Pushed to bith branches.
Closing out bug report.

Thanks!
Comment 9 Karolin Seeger 2014-10-14 17:09:59 UTC
(In reply to Karolin Seeger from comment #8)
both, of course... ;-)