Bug 176302 - crash in PTA plugin when bind returned controls
crash in PTA plugin when bind returned controls
Status: CLOSED CURRENTRELEASE
Product: Red Hat Directory Server
Classification: Red Hat
Component: Server - Plugins (Show other bugs)
7.2
All Linux
medium Severity medium
: DS8.0
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 152373 240316
  Show dependency treegraph
 
Reported: 2005-12-20 20:18 EST by Noriko Hosoi
Modified: 2016-05-06 10:29 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-06 10:29:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
more problems with the server response controls (1.65 KB, patch)
2006-11-21 04:30 EST, Ulf Weltman
no flags Details | Diff

  None (edit)
Description Noriko Hosoi 2005-12-20 20:18:53 EST
Description of problem:
Report from ULF:
The mux will crash if the farm returns controls such as when binding as a locked
account.
I think we are passing the ***LDAPControl when it needs the **LDAPControl.

Index: ldap2/ldapserver/ldap/servers/plugins/passthru/ptpreop.c
===================================================================
RCS file:
/repository/source/ldap2/ldapserver/ldap/servers/plugins/passthru/ptpreop.c,v
retrieving revision 1.1.1.1
diff -U4 -r1.1.1.1 ptpreop.c
--- ptpreop.c   2005/07/08 23:25:37     1.1.1.1
+++ ptpreop.c   2005/12/21 00:49:12
@@ -252,9 +252,9 @@
       /*
        * Send a result to our client.
        */
       if ( resctrls != NULL ) {
-           (void)slapi_pblock_set( pb, SLAPI_RESCONTROLS, &resctrls );
+           (void)slapi_pblock_set( pb, SLAPI_RESCONTROLS, resctrls );
       }
       slapi_send_ldap_result( pb, rc, matcheddn, errmsg, 0, urls );
    }


Program terminated with signal 11, Segmentation fault.
SEGV_UNKNOWN - Unknown Error
#0  0x800003ffff75bc6c in write_controls (ber=0x80000001004de5e8,
   ctrls=0x800003fffd88fc48) at control.c:429
#1  0x800003ffff76048c in send_ldap_result_ext (pb=0x8000000100613890, err=19,
   matched=0x80000001004d5690 "",
   text=0x80000001004d60c8 "Exceed password retry limit. Please try later.",
   nentries=0, urls=0x0, ber=0x80000001004de5e8) at result.c:522
#2  0x800003ffff75f764 in send_ldap_result (pb=0x8000000100613890, err=19,
   matched=0x80000001004d5690 "",
   text=0x80000001004d60c8 "Exceed password retry limit. Please try later.",
   nentries=0, urls=0x0) at result.c:227
#3  0x800003ffff7515a0 in slapi_send_ldap_result (pb=0x8000000100613890,
   err=19, matched=0x80000001004d5690 "",
   text=0x80000001004d60c8 "Exceed password retry limit. Please try later.",
   nentries=0, urls=0x0) at plugin.c:609
#4  0x800003fffe2081d8 in passthru_bindpreop (pb=0x8000000100613890)
   at ptpreop.c:259
#5  0x800003ffff752fb0 in plugin_call_func (list=0x80000001002fc270,
   operation=401, pb=0x8000000100613890, call_one=0) at plugin.c:1361
#6  0x800003ffff752ddc in plugin_call_list (list=0x8000000100101698,
   operation=401, pb=0x8000000100613890) at plugin.c:1323
#7  0x800003ffff750800 in plugin_call_plugins (pb=0x8000000100613890,
   whichfunction=401) at plugin.c:319
#8  0x400000000003b8ec in do_bind (pb=0x8000000100613890) at bind.c:482
#9  0x400000000003f9fc in connection_dispatch_operation (
   conn=0x8000000100704118, op=0x800000010076e2a0, pb=0x8000000100613890)
   at connection.c:462
#10 0x4000000000041b68 in connection_threadmain () at connection.c:2117
#11 0x800003ffff3ab6c0 in _pt_root (arg=0x800000010002a800 "")
   at ../../../../pr/src/pthreads/ptthread.c:214
#12 0x800003ffff7dafc0 in __pthread_body+0x50 () from /lib/pa20_64/libpthread.1
#13 0x800003ffff7e587c in __pthread_start+0x14 ()
  from /lib/pa20_64/libpthread.1
Comment 1 Rich Megginson 2006-02-08 13:55:21 EST
Reviewed by: Pete (Thanks!)
Files: ldapserver/ldap/servers/plugins/passthru/ptpreop.c
Branch: HEAD
Fix Description: Fix by Ulf.  We are passing the ***LDAPControl when it 
needs the **LDAPControl.
Platforms tested: Fedora Core 4
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Checking in ptpreop.c;
/cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/ptpreop.c,v  <--  ptpreop.c
new revision: 1.5; previous revision: 1.4
done
Comment 2 Ulf Weltman 2006-11-21 04:30:26 EST
Created attachment 141744 [details]
more problems with the server response controls

Rich, there is one more bug in this area.  The result controls array is added
to the pb if the results are to be sent, and then it's freed, but then the op
cleanup frees it again.  It should only be freed if it didn't get added to the
pb, if the op was abandoned.

This patch adds to the previous patch that you already committed.
Comment 3 Rich Megginson 2006-11-21 09:02:44 EST
Yep, looks good.
Comment 4 Chandrasekar Kannan 2007-07-25 14:49:58 EDT
DS7.2 is not a valid milestone anymore. Anything thats set to DS7.2 should be
set to DS8.0. Will make further changes per bug council on 07/24/2007, after this.
Comment 5 Ulf Weltman 2007-10-08 16:23:00 EDT
The first part of this fix was checked in, but the second one (also trivial) is
still needed.
Comment 6 Nathan Kinder 2007-10-08 16:49:56 EDT
Checked fix from comment #2 into ldapserver (HEAD).  Reviewed by Rich & myself.

Checking in ptpreop.c;
/cvs/dirsec/ldapserver/ldap/servers/plugins/passthru/ptpreop.c,v  <--  ptpreop.c
new revision: 1.7; previous revision: 1.6
done

Note You need to log in before you can comment on or make changes to this bug.