mirror of
https://github.com/samba-team/samba.git
synced 2025-12-16 00:23:52 +03:00
This patch changes a lot of the code in ldb_dn.c, and also
removes and add a number of manipulation functions around.
The aim is to avoid validating a dn if not necessary as the
validation code is necessarily slow. This is mainly to speed up
internal operations where input is not user generated and so we
can assume the DNs need no validation. The code is designed to
keep the data as a string if possible.
The code is not yet 100% perfect, but pass all the tests so far.
A memleak is certainly present, I'll work on that next.
Simo.
(This used to be commit a580c871d3)
55 lines
1.1 KiB
Bash
Executable File
55 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
|
|
export PATH
|
|
SCHEMA_NEEDED="core nis cosine inetorgperson openldap"
|
|
|
|
# setup needed schema files
|
|
for f in $SCHEMA_NEEDED; do
|
|
if [ ! -r tests/schema/$f.schema ]; then
|
|
mkdir -p tests/schema
|
|
if [ -r /etc/ldap/schema/$f.schema ]; then
|
|
ln -s /etc/ldap/schema/$f.schema tests/schema/$f.schema
|
|
continue;
|
|
fi
|
|
if [ -r /etc/openldap/schema/$f.schema ]; then
|
|
ln -s /etc/openldap/schema/$f.schema tests/schema/$f.schema
|
|
continue;
|
|
fi
|
|
|
|
echo "SKIPPING TESTS: you need the following OpenLDAP schema files"
|
|
for f in $SCHEMA_NEEDED; do
|
|
echo " $f.schema"
|
|
done
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
if [ -z "$LDBDIR" ]; then
|
|
LDBDIR=`dirname $0`/..
|
|
export LDBDIR
|
|
fi
|
|
|
|
LDB_URL=`$LDBDIR/tests/ldapi_url.sh`
|
|
export LDB_URL
|
|
|
|
PATH=bin:$PATH
|
|
export PATH
|
|
|
|
LDB_SPECIALS=0
|
|
export LDB_SPECIALS
|
|
|
|
if $LDBDIR/tests/init_slapd.sh &&
|
|
$LDBDIR/tests/start_slapd.sh &&
|
|
$LDBDIR/tests/test-generic.sh; then
|
|
echo "ldap tests passed";
|
|
ret=0
|
|
else
|
|
echo "ldap tests failed";
|
|
ret=$?
|
|
fi
|
|
|
|
#$LDBDIR/tests/kill_slapd.sh
|
|
|
|
exit $ret
|