Bug 700627

Summary: If nsslapd-port is modified, some command line tools in the server instance dir stop working
Product: [Retired] 389 Reporter: Noriko Hosoi <nhosoi>
Component: Command Line UtilitiesAssignee: Nathan Kinder <nkinder>
Status: CLOSED CURRENTRELEASE QA Contact: Chandrasekar Kannan <ckannan>
Severity: unspecified Docs Contact:
Priority: low    
Version: 1.2.8CC: benl, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.0-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-18 19:50:07 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: 690319    

Description Noriko Hosoi 2011-04-28 20:27:13 UTC
Description of problem:
The initial port number is hardcoded in the tools.  They'd better be dynamically retrieved from the config file.
# egrep 389 *
bak2db.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
db2bak.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
db2index.pl:    $indexes_list="ldapsearch  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -s one " .
db2index.pl:    $vlvindexes_list="ldapsearch  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -s sub -b \"cn=\"$instance\", cn=ldbm database,cn=plugins,cn=config\" \"objectclass=vlvIndex\" cn";
db2index.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
db2ldif.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
fixup-linkedattrs.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
fixup-memberof.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
ldif2db.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
ldif2ldap:ldapmodify  -a -p 389 -D "$1" -w "$2" -f $3
monitor:ldapsearch  -p 389 -b "$MDN" -s base "objectClass=*"
ns-accountstatus.pl:$defport= "389";
ns-accountstatus.pl:$port= "389";
ns-activate.pl:$defport= "389";
ns-activate.pl:$port= "389";
ns-inactivate.pl:$defport= "389";
ns-inactivate.pl:$port= "389";
ns-newpwpolicy.pl:$opt_p = "389";
schema-reload.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
syntax-validate.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );
usn-tombstone-cleanup.pl:open(FOO, "| ldapmodify  $vstr -h <host> -p 389 -D \"$rootdn\" -w \"$passwd\" -a" );

Comment 1 Rich Megginson 2011-04-29 15:51:12 UTC
I think it would be better if we just got rid of all instance specific stuff from our command line tools.  We need to move them to @sbindir@ or @bindir@ and make them so that you just pass in the instance to operate on, and have a default instance if none is specified.

Ideally, we should just get rid of /usr/lib[64]/dirsrv/slapd-INSTANCE - it is problematic since many admins want to mount /usr read-only except for package install - this is the reason that ipa uses /var instead.

Comment 4 Martin Kosek 2012-01-04 13:23:44 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/47

Comment 5 Nathan Kinder 2013-12-18 19:50:07 UTC
This was fixed in 389-ds-base-1.3.1.0-1.