Bug 593453

Summary: Creating password policy with ns-newpolicy.pl on Replicated Server Causes Crash
Product: [Retired] 389 Reporter: Jenny Severance <jgalipea>
Component: Replication - GeneralAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: high Docs Contact:
Priority: high    
Version: 1.2.6CC: nhosoi, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:43:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 434914, 543590    
Attachments:
Description Flags
git patch file (9.0) nkinder: review+

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.