Ticket #47299 - allow cmdline scripts to work with non-root user
https://fedorahosted.org/389/ticket/47299
Reviewed by: nhosoi (Thanks!)
Branch: 389-ds-base-1.3.1
Fix Description: Handle the case where the directory server userid is a real
user on the system, and allow that user to run the command line scripts against
that server without using sudo. I also centralized the handling of the
initconfig (/etc/sysconfig/dirsrv-*) files in DSSharedLib and DSUtil.pm.
I changed the way the scripts work - the sh scripts need the "normalized"
server id and the CONFIG_DIR (/etc/dirsrv/slapd-$servid) - we first find the
initconfig file for the given instance, then we just source it - CONFIG_DIR
is one of the settings in the file - no need to parse in sh because source
does that.
In perl, do the same thing, except have to parse the initconfig file to get
the CONFIG_DIR.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 6fb5b261d8a97a761b52e57bf8ccdc203c74ea8c)