Commit 652cb0c0 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ignore undefined attrs (ITS#6600)

parent 44ad6eb8
......@@ -189,7 +189,11 @@ dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,
dc=com
mail: bjensen@mailgw.example.com
# Query 10: filter:(|(cn=*Jones)(sn=Jones)) attrs:cn sn title uid
# Query 10: filter:(|(cn=All Staff)(sn=All Staff)) attrs:sn cn title uid undefinedAttr
dn: cn=All Staff,ou=Groups,dc=example,dc=com
cn: All Staff
# Query 11: filter:(|(cn=*Jones)(sn=Jones)) attrs:cn sn title uid
dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
cn: James A Jones 1
cn: James Jones
......@@ -207,7 +211,7 @@ sn: Doe
uid: jjones
title: Senior Manager, Information Technology Division
# Query 11: filter:(sn=Smith) attrs:cn sn title uid
# Query 12: filter:(sn=Smith) attrs:cn sn title uid
dn: cn=Jennifer Smith,ou=Alumni Association,ou=People,dc=example,dc=com
cn: Jennifer Smith
cn: Jen Smith
......@@ -215,7 +219,7 @@ sn: Smith
uid: jen
title: Telemarketer, UM Alumni Association
# Query 12: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid
# Query 13: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid
dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,dc=example,dc
=com
cn: Bjorn Jensen
......@@ -225,7 +229,7 @@ postalAddress: Info Tech Division $ 535 W. William St. $ Anytown, MI 48103
mail: bjorn@mailgw.example.com
telephoneNumber: +1 313 555 0355
# Query 13: filter:(mail=jaj@mail.alumni.example.com) attrs:cn sn title uid
# Query 14: filter:(mail=jaj@mail.alumni.example.com) attrs:cn sn title uid
dn: cn=James A Jones 1,ou=Alumni Association,ou=People,dc=example,dc=com
cn: James A Jones 1
cn: James Jones
......@@ -234,7 +238,7 @@ sn: Jones
uid: jaj
title: Mad Cow Researcher, UM Alumni Association
# Query 14: filter:(mail=*example.com) attrs:cn sn title uid
# Query 15: filter:(mail=*example.com) attrs:cn sn title uid
dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,
dc=com
cn: Barbara Jensen
......@@ -243,8 +247,12 @@ sn:: IEplbnNlbiA=
uid: bjensen
title: Mythical Manager, Research Systems
# Query 15: filter:(uid=b*) attrs:mail
# Query 16: filter:(uid=b*) attrs:mail
dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,dc=example,
dc=com
mail: bjensen@mailgw.example.com
# Query 17: filter:(|(cn=All Staff)(sn=All Staff)) attrs:sn cn title uid undefinedAttr
dn: cn=All Staff,ou=Groups,dc=example,dc=com
cn: All Staff
......@@ -295,10 +295,24 @@ case $RC in
;;
esac
CNT=`expr $CNT + 1`
FILTER="(|(cn=All Staff)(sn=All Staff))"
ATTRS="sn cn title uid undefinedAttr"
echo "Query $CNT: filter:$FILTER attrs:$ATTRS"
echo "# Query $CNT: filter:$FILTER attrs:$ATTRS" >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
"$FILTER" $ATTRS >> $SEARCHOUT 2>> $TESTOUT
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
FIRST=$CNT
# queries 2-6,8-9 are cacheable
CACHEABILITY=011111011
# queries 2-6,8-10 are cacheable
CACHEABILITY=0111110111
grep CACHEABLE $LOG2 | awk '{
if ($2 == "NOT")
printf "Query %d not cacheable\n",NR
......@@ -431,11 +445,25 @@ case $RC in
;;
esac
#queries 10-12,15 are answerable, 13-14 are not
#actually, 12 would be answerable, but since 8 made mail=*example.com
CNT=`expr $CNT + 1`
FILTER="(|(cn=All Staff)(sn=All Staff))"
ATTRS="sn cn title uid undefinedAttr"
echo "Query $CNT: filter:$FILTER attrs:$ATTRS"
echo "# Query $CNT: filter:$FILTER attrs:$ATTRS" >> $SEARCHOUT
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
"$FILTER" $ATTRS >> $SEARCHOUT 2>> $TESTOUT
RC=$?
if test $RC != 0 ; then
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
#queries 11-13,16-17 are answerable, 14-15 are not
#actually, 14 would be answerable, but since 8 made mail=*example.com
#not answerable because of sizelimit, queries contained in it are no longer
#answerable as well
ANSWERABILITY=111001
ANSWERABILITY=1110011
grep ANSWERABLE $LOG2 | awk "BEGIN {FIRST=$FIRST}"'{
if (NR > FIRST) {
if ($2 == "NOT")
......@@ -462,9 +490,9 @@ else
fi
echo "Filtering ldapsearch results..."
$LDIFFILTER < $SEARCHOUT > $SEARCHFLT
$LDIFFILTER -s ldif=a < $SEARCHOUT > $SEARCHFLT
echo "Filtering original ldif..."
$LDIFFILTER < $PROXYCACHEOUT > $LDIFFLT
$LDIFFILTER -s ldif=a < $PROXYCACHEOUT > $LDIFFLT
echo "Comparing filter output..."
$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment