Hello community, here is the log from the commit of package openldap2 for openSUSE:Factory checked in at 2018-04-29 19:36:20 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openldap2 (Old) and /work/SRC/openSUSE:Factory/.openldap2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openldap2" Sun Apr 29 19:36:20 2018 rev:133 rq:601027 version:unknown Changes: -------- --- /work/SRC/openSUSE:Factory/openldap2/openldap2.changes 2018-04-07 20:54:24.588139463 +0200 +++ /work/SRC/openSUSE:Factory/.openldap2.new/openldap2.changes 2018-04-29 19:36:54.695373808 +0200 @@ -1,0 +2,10 @@ +Tue Apr 24 16:35:09 UTC 2018 - zsolt.kal...@suse.com + +- bsc#1085064 Packaging issues have been discovered around the + openldap_update_modules_path.sh which has been corrected: + - the spec file was wrongly configured, therefore the script has + never been called + - the script should create the symlinks first, as slapcat is + useless on a system which is already affected. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openldap2.spec ++++++ --- /var/tmp/diff_new_pack.0gFsUK/_old 2018-04-29 19:36:55.499344326 +0200 +++ /var/tmp/diff_new_pack.0gFsUK/_new 2018-04-29 19:36:55.499344326 +0200 @@ -445,7 +445,7 @@ cp %{_libdir}/sasl2/slapd.conf /etc/sasl2/slapd.conf fi -if [ ${1:-0} -gt 1 ! -e /var/adm/openldap_modules_path_updated ] ; then +if [ ${1:-0} -gt 1 ] && [ ! -f /var/adm/openldap_modules_path_updated ] ; then /usr/sbin/openldap_update_modules_path.sh fi %{fillup_only -n openldap ldap} ++++++ openldap_update_modules_path.sh ++++++ --- /var/tmp/diff_new_pack.0gFsUK/_old 2018-04-29 19:36:55.655338605 +0200 +++ /var/tmp/diff_new_pack.0gFsUK/_new 2018-04-29 19:36:55.659338458 +0200 @@ -1,5 +1,4 @@ -#!/bin/bash -# This script has been created to update the OpenLDAP modules path in cn=config +s script has been created to update the OpenLDAP modules path in cn=config # For details of changing the configuration items' location read these: # https://www.openldap.org/lists/openldap-software/200812/msg00080.html # This script writes over the config entry of backend databases location, which files are necessary to run LDAP. The procedure has been created upon this description: @@ -7,29 +6,61 @@ # Author: Zsolt KALMAR (SUSE Linux GmbH) zkal...@suse.com +# define variables conf_dir='/etc/openldap/slapd.d' +if [ ! -d ${conf_dir} ] || [ ! -f ${conf_dir}/cn=config.ldif ] +then + exit 0 +fi + + tmp_file='/tmp/ldap_conf_tmp.ldif' backup='/tmp/slapd.d' res=0 +# common functions +create_symlinks () { +if [ ! -f /usr/lib/openldap/back_bdb.so ]; then ln -s /usr/lib64/openldap/back_bdb.so /usr/lib/openldap/back_bdb.so; fi +if [ ! -f /usr/lib/openldap/back_hdb.so ]; then ln -s /usr/lib64/openldap/back_hdb.so /usr/lib/openldap/back_hdb.so; fi +if [ ! -f /usr/lib/openldap/back_mdb.so ]; then ln -s /usr/lib64/openldap/back_mdb.so /usr/lib/openldap/back_mdb.so; fi +if [ ! -f /usr/lib/openldap/syncprov.so ]; then ln -s /usr/lib64/openldap/syncprov.so /usr/lib/openldap/syncprov.so; fi +#logger -p user.info "Update openLDAP: symlinks have been created." +} + +cleanup () { +rm -f /usr/lib/openldap/back_bdb.so +rm -f /usr/lib/openldap/back_hdb.so +rm -f /usr/lib/openldap/back_mdb.so +rm -f /usr/lib/openldap/syncprov.so rm -f ${tmp_file} +#logger -p user.info "Update openLDAP: symlinks have been removed." +} -# Check if the configuration is containing the inappropriate entry +rm -f ${tmp_file} -/usr/sbin/slapcat -n0 -F ${conf_dir} -l ${tmp_file} -o ldif-wrap=no -res=$? +# Check if the configuration is containing the inappropriate entry +create_symlinks +res=0 +if [ -f /usr/sbin/slapcat ] +then + /usr/sbin/slapcat -n0 -F ${conf_dir} -l ${tmp_file} -o ldif-wrap=no + res=$? +fi if [ $res -ne 0 ] then - logger -p user.error "Creating ${tmp_file} has failed." + #logger -p user.error "LDAP Update script: Creating ${tmp_file} has failed during the search of faulty openLDAP entry." exit 1 +#else + #logger -p user.info "LDAP Update script: ${tmp_file} has been created." fi entry_cnt=`cat ${tmp_file} | grep ^[^#\;] | grep olcModulePath | wc -l` if [ $entry_cnt -eq 0 ] then - logger -p user.info "The current LDAP configuration does not contain the wrong item. Stop applying this script. Bye." + #logger -p user.info "LDAP Update script: The current LDAP configuration does not contain the wrong item. Stop applying this script. Bye." + cleanup exit 0 fi @@ -37,20 +68,23 @@ # Make sure the LDAP is not running: /usr/bin/systemctl stop slapd.service +#logger -p user.info "LDAP Update script: openLDAP has been stopped." # Creating symlinks for the modules required for the slapcat and slapadd -ln -s /usr/lib64/openldap/back_bdb.so /usr/lib/openldap/back_bdb.so -ln -s /usr/lib64/openldap/back_hdb.so /usr/lib/openldap/back_hdb.so -ln -s /usr/lib64/openldap/back_mdb.so /usr/lib/openldap/back_mdb.so -ln -s /usr/lib64/openldap/syncprov.so /usr/lib/openldap/syncprov.so +create_symlinks # Export the config to a text -/usr/sbin/slapcat -n0 -F ${conf_dir} -l ${tmp_file} -o ldif-wrap=no -res=$? +res=0 +if [ -f /usr/sbin/slapcat ] +then + /usr/sbin/slapcat -n0 -F ${conf_dir} -l ${tmp_file} -o ldif-wrap=no + res=$? +fi if [ $res -ne 0 ] then - logger -p user.error "Creating ${tmp_file} has failed." + #logger -p user.error "LDAP Update script: Creating ${tmp_file} has failed." + cleanup exit 1 fi @@ -61,8 +95,10 @@ if [ $res -ne 0 ] then - logger -p user.error "LDAP Update script: Backing up ${conf_dir} has failed." + #logger -p user.error "LDAP Update script: Backing up ${conf_dir} has failed." exit 1 +#else + #logger -p user.info "LDAP Update script: Back up has been created of openLDAP configuration." fi # Remove the configuration item "olcModulePath" @@ -71,8 +107,10 @@ if [ $res -ne 0 ] then - logger -p user.error "LDAP Update script: Removing of entry in ${tmp_file} has failed." + #logger -p user.error "LDAP Update script: Removing of entry in ${tmp_file} has failed." exit 1 +#else + #logger -p user.info "LDAP Update script: olcModulesPath entry has been removed." fi # Remove the current configuration @@ -85,14 +123,11 @@ # Catch result code of slapadd if [ $res -ne 0 ] then - logger -p user.error "LDAP Update script: Implementing new configuration has failed." + #logger -p user.error "LDAP Update script: Implementing new configuration has failed." exit 1 else -# Remove temporary symlinks - rm -rf /usr/lib/openldap/back_bdb.so - rm -rf /usr/lib/openldap/back_hdb.so - rm -rf /usr/lib/openldap/back_mdb.so - rm -rf /usr/lib/openldap/syncprov.so + #logger -p user.info "LDAP Update script: Implementing new configuration has been succeeded." + cleanup fi # Start the SLAPD with the new configuration @@ -101,9 +136,10 @@ if [ $res -ne 0 ] then - logger -p user.error "LDAP Update script: Starting updated LDAP server has been failed." + #logger -p user.error "LDAP Update script: Starting updated LDAP server has been failed." exit 1 else + #logger -p user.info "LDAP Update script: Updated LDAP server has been successfully started." # Remove backups rm -rf ${backup} rm -rf ${tmp_file}