Bug 593453 - Creating password policy with ns-newpolicy.pl on Replicated Server Causes Crash
Summary: Creating password policy with ns-newpolicy.pl on Replicated Server Causes Crash
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Replication - General
Version: 1.2.6
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Noriko Hosoi
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 434914 389_1.2.6
TreeView+ depends on / blocked
 
Reported: 2010-05-18 19:53 UTC by Jenny Severance
Modified: 2015-12-07 16:43 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:43:35 UTC
Embargoed:


Attachments (Terms of Use)
git patch file (9.0) (1.80 KB, patch)
2010-05-18 23:26 UTC, Noriko Hosoi
nkinder: review+
Details | Diff

Description Jenny Severance 2010-05-18 19:53:04 UTC
Description of problem:
Running ns-pwpolicy.pl on against replicated server, cause the instance to crash.

Setup
RHEL 4 32-bit
Supplier and Consumer



Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. Added ou container and user and allowed replication
2. perl template-ns-newpwpolicy.pl -D "cn=Directory Manager" -w Secret -p 1389 -h host.example.com -S "ou=Accounting,dc=example,dc=com"

Debug:

Continuing.
[New Thread -1704776800 (LWP 19975)]
[Thread -1704776800 (LWP 19975) exited]
[New Thread -1704776800 (LWP 19976)]
[Thread -1704776800 (LWP 19976) exited]
[New Thread -1704776800 (LWP 19981)]
[Thread -1704776800 (LWP 19981) exited]
[New Thread -1704776800 (LWP 19990)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1337431136 (LWP 19757)]
0x00b03151 in normalize_mods2bvals (mods=0x903d018) at ldap/servers/slapd/util.c:433
433                             (*normmbvp)->bv_val = normed;
(gdb) bt
#0  0x00b03151 in normalize_mods2bvals (mods=0x903d018) at ldap/servers/slapd/util.c:433
#1  0x00b0326b in slapi_mods2entry (e=0xb0486328, 
    idn=0x9274228 "cn=cn=nsPwTemplateEntry\\2Cou=Accounting\\2Cdc=example\\2Cdc=com,cn=nsPwPolicyContainer,ou=Accounting,dc=example,dc=com", iattrs=0x903d018) at ldap/servers/slapd/util.c:264
#2  0x00cf0612 in cl5DBData2Entry (data=Variable "data" is not available.
) at ldap/servers/plugins/replication/cl5_api.c:2734
#3  0x00cf0757 in cl5GetNextOperationToReplay (iterator=0x903fe98, entry=0xb04862b0)
    at ldap/servers/plugins/replication/cl5_api.c:1958
#4  0x00d0bd45 in repl5_inc_run (prp=0x9241dc8) at ldap/servers/plugins/replication/repl5_inc_protocol.c:1777
#5  0x00d10292 in prot_thread_main (arg=0x9214050) at ldap/servers/plugins/replication/repl5_protocol.c:311
#6  0x035d78ad in PR_Select () from /usr/lib/libnspr4.so
#7  0x009875cc in start_thread () from /lib/tls/libpthread.so.0
#8  0x008f0fae in clone () from /lib/tls/libc.so.6
(gdb) 


  
Actual results:


Expected results:


Additional info:

Comment 1 Jenny Severance 2010-05-18 19:53:40 UTC
package version:
redhat-ds-base-8.2.0-2010051804.el4dsrv

Comment 2 Noriko Hosoi 2010-05-18 23:26:51 UTC
Created attachment 414983 [details]
git patch file (9.0)

File: ldap/servers/slapd/util.c
Fix description: normalized_mods->mod_bvalues is an array of
(struct berval *).  When slapi_dn_normalize_ext returns an
allocated memory (case rc > 0), a new struct berval should have
been allocated and the address of the normalized string (normed)
and its length (dnlen) should be set in the berval.
The struct berval allocation was missing in the previous fix
for "Update to New DN Format".

Comment 3 Noriko Hosoi 2010-05-18 23:47:35 UTC
Thanks to Nathan for reviewing the fix.

Pushed to master:
$ git merge work
Updating c12c48f..f999c42
Fast forward
 ldap/servers/slapd/util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
$ git push
Counting objects: 11, done.
Delta compression using 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 841 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   c12c48f..f999c42  master -> master

As well as to Directory_Server_8_2_Branch:
$ git push origin ds82-local:Directory_Server_8_2_Branch
Counting objects: 11, done.
Delta compression using 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 839 bytes, done.
Total 6 (delta 4), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
   351c6df..9b22aa3  ds82-local -> Directory_Server_8_2_Branch

Comment 4 Jenny Severance 2010-05-20 14:07:45 UTC
fix verified - RHEL 4

version:
redhat-ds-base-8.2.0-2010052004.el4dsrv

Adding new policy with template-ns-newpwpolicy.pl - no longer crashing server.


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