Comment 40 for bug 15270

Revision history for this message
In , Torsten Landschoff (torsten) wrote : Re: Bug#255276: slapd/slapcat hang in endless loops

On Fri, May 27, 2005 at 09:10:50AM +0800, Eugene Konev wrote:

> >> +# Find out slapd db directories
> >> +SLAPD_DBDIRS=`sed -ne 's/^directory[[:space:]]\+"*\([^"]\+\).*/\1/p' \
> >> + "$SLAPD_CONF" `
> >> +
>
> TL> I'd rather gather this list at the time when it is needed. Apart from
> TL> that I don't really grok that sed expression :)
>
> It has only possible failure if path contains double quotes in it, which
> is very unlikely situation. And this:

Yes, I was able to parse it finally :)

> TL> +# Find bdb environment dirs
> TL> +find_bdb_envs() {
> TL> + local d
> TL> + for d in `awk '/directory/ {print $2}' < "$SLAPD_CONF"`; do
> TL> + if [ -d "$d" -a -f "$d/objectClass.bdb" ]; then
> TL> + echo $d
> TL> + fi
> TL> + done
> TL> +}
>
> will happily skip entries like:
> directory "/var/lib/ldap"
> (note the quotes), which are by default in sarge install.

Yep. I was using eval to strip them and removed that before sending the
email as it can have really serious results depending on your
slapd.conf.

Greetings

 Torsten