Bug 593453 - Creating password policy with ns-newpolicy.pl on Replicated Server Causes Crash
Creating password policy with ns-newpolicy.pl on Replicated Server Causes Crash
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Replication - General (Show other bugs)
1.2.6
All Linux
high Severity high
: ---
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
:
Depends On:
Blocks: 434914 389_1.2.6
  Show dependency treegraph
 
Reported: 2010-05-18 15:53 EDT by Jenny Galipeau
Modified: 2015-12-07 11:43 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:43:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Jenny Galipeau 2010-05-18 15:53:04 EDT
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 Galipeau 2010-05-18 15:53:40 EDT
package version:
redhat-ds-base-8.2.0-2010051804.el4dsrv
Comment 2 Noriko Hosoi 2010-05-18 19:26:51 EDT
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 19:47:35 EDT
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 Galipeau 2010-05-20 10:07:45 EDT
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.