#!/bin/sh # # Basic testing of id mapping with idmap_ad # if [ $# -ne 6 ]; then echo Usage: $0 DOMAIN DC_SERVER DC_PASSWORD TRUST_DOMAIN TRUST_SERVER TRUST_PASSWORD exit 1 fi DOMAIN="$1" DC_SERVER="$2" DC_PASSWORD="$3" TRUST_DOMAIN="$4" TRUST_SERVER="$5" TRUST_PASSWORD="$6" wbinfo="$VALGRIND $BINDIR/wbinfo" ldbmodify="$VALGRIND $BINDIR/ldbmodify" ldbsearch="$VALGRIND $BINDIR/ldbsearch" failed=0 . `dirname $0`/../../testprogs/blackbox/subunit.sh DOMAIN_SID=$($wbinfo -n "$DOMAIN/" | cut -f 1 -d " ") if [ $? -ne 0 ] ; then echo "Could not find domain SID" | subunit_fail_test "test_idmap_ad" exit 1 fi TRUST_DOMAIN_SID=$($wbinfo -n "$TRUST_DOMAIN/" | cut -f 1 -d " ") if [ $? -ne 0 ] ; then echo "Could not find trusted domain SID" | subunit_fail_test "test_idmap_ad" exit 1 fi BASE_DN=$($ldbsearch -H ldap://$DC_SERVER -b "" -s base defaultNamingContext | awk '/^defaultNamingContext/ {print $2}') if [ $? -ne 0 ] ; then echo "Could not find base DN" | subunit_fail_test "test_idmap_ad" exit 1 fi TRUST_BASE_DN=$($ldbsearch -H ldap://$TRUST_SERVER -b "" -s base defaultNamingContext | awk '/^defaultNamingContext/ {print $2}') if [ $? -ne 0 ] ; then echo "Could not find trusted base DN" | subunit_fail_test "test_idmap_ad" exit 1 fi # # Add POSIX ids to AD # cat <