#!/bin/sh if [ $# -lt 2 ]; then cat < ${object}" r=`$ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectClass=*)' -b "${dn}" | grep 'dn: '` n=`echo "${r}" | grep 'dn: ' | wc -l` c=`echo "${r}" | grep "${object}" | wc -l` if [ $n -lt 1 ]; then echo "Object not found by WKGUID" failed=`expr $failed + 1` continue fi if [ $c -lt 1 ]; then echo "Wrong object found by WKGUID: [${r}]" failed=`expr $failed + 1` continue fi done return $failed } wellknown_object_test 22B70C67D56E4EFB91E9300FCA3DC1AA ForeignSecurityPrincipals st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi wellknown_object_test 2FBAC1870ADE11D297C400C04FD8D5CD Infrastructure st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi wellknown_object_test AB1D30F3768811D1ADED00C04FD8D5CD System st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi wellknown_object_test A361B2FFFFD211D1AA4B00C04FD7D83A Domain Controllers st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi wellknown_object_test AA312825768811D1ADED00C04FD8D5CD Computers st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi wellknown_object_test A9D1CA15768811D1ADED00C04FD8D5CD Users st=$? if [ x"$st" != x"0" ]; then failed=`expr $failed + $st` fi echo "Getting HEX GUID/SID of $BASEDN" HEXDN=`$ldbsearch $CONFIGURATION $options -b "$BASEDN" -H $p://$SERVER -s base "(objectClass=*)" --controls=extended_dn:1:0 distinguishedName | grep 'distinguishedName: ' | cut -d ' ' -f2-` HEXGUID=`echo "$HEXDN" | cut -d ';' -f1` echo "HEXGUID[$HEXGUID]" echo "Getting STR GUID/SID of $BASEDN" STRDN=`$ldbsearch $CONFIGURATION $options -b "$BASEDN" -H $p://$SERVER -s base "(objectClass=*)" --controls=extended_dn:1:1 distinguishedName | grep 'distinguishedName: ' | cut -d ' ' -f2-` echo "STRDN: $STRDN" STRGUID=`echo "$STRDN" | cut -d ';' -f1` echo "STRGUID[$STRGUID]" echo "Getting STR GUID/SID of $BASEDN" STRDN=`$ldbsearch $CONFIGURATION $options -b "$BASEDN" -H $p://$SERVER -s base "(objectClass=*)" --controls=extended_dn:1:1 | grep 'dn: ' | cut -d ' ' -f2-` echo "STRDN: $STRDN" STRSID=`echo "$STRDN" | cut -d ';' -f2` echo "STRSID[$STRSID]" SPECIALDNS="$HEXGUID $STRGUID $STRSID" for SPDN in $SPECIALDNS; do echo "Search for $SPDN" nentries=`$ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "$SPDN" '(objectClass=*)' | grep "dn: $BASEDN" | wc -l` if [ $nentries -lt 1 ]; then echo "Special search returned 0 items" failed=`expr $failed + 1` fi done echo "Search using OIDs instead of names" nentries1=`$ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectClass=user)' name | grep "^name: " | wc -l` nentries2=`$ldbsearch $options $CONFIGURATION -H $p://$SERVER '(2.5.4.0=1.2.840.113556.1.5.9)' name | grep "^name: " | wc -l` if [ $nentries1 -lt 1 ]; then echo "Error: Searching user via (objectClass=user): '$nentries1' < 1" failed=`expr $failed + 1` fi if [ $nentries2 -lt 1 ]; then echo "Error: Searching user via (2.5.4.0=1.2.840.113556.1.5.9) '$nentries2' < 1" failed=`expr $failed + 1` fi if [ x"$nentries1" != x"$nentries2" ]; then echo "Error: Searching user with OIDS[$nentries1] doesn't return the same as STRINGS[$nentries2]" failed=`expr $failed + 1` fi exit $failed