5 Usage: test_old_enctypes.sh SERVER USERNAME PASSWORD NETBIOSNAME PREFIX_ABS
18 samba4bindir
="$BINDIR"
19 samba4srcdir
="$SRCDIR/source4"
21 samba_tool
="$samba4bindir/samba-tool"
23 . $
(dirname $0)/subunit.sh
24 . $
(dirname $0)/common_test_fns.inc
26 ldbmodify
=$
(system_or_builddir_binary ldbmodify
"${BINDIR}")
27 ldbsearch
=$
(system_or_builddir_binary ldbsearch
"${BINDIR}")
29 out
="${PREFIX_ABS}/tmpldbsearch.out"
30 $ldbsearch -H ldap
://$SERVER -U$USERNAME%$PASSWORD -d0 sAMAccountName
="$NETBIOSNAME\$" dn msDS-SupportedEncryptionTypes
>$out
31 testit_grep
"find my dn" msDS-SupportedEncryptionTypes
cat $out || failed
=$
(expr $failed + 1)
33 my_dn
=$
(cat $out |
sed -n 's/^dn: //p')
34 my_encs
=$
(cat $out |
sed -n 's/^msDS-SupportedEncryptionTypes: //p')
35 my_test_encs
=$
(expr $my_encs + 3)
37 ldif
="${PREFIX_ABS}/tmpldbmodify.ldif"
42 replace: msDS-SupportedEncryptionTypes
43 msDS-SupportedEncryptionTypes: $my_test_encs
46 testit
"Change msDS-SupportedEncryptionTypes to $my_test_encs" $VALGRIND $ldbmodify -H ldap
://$SERVER -U$USERNAME%$PASSWORD -d0 <$ldif || failed
=$
(expr $failed + 1)
47 kt
=${PREFIX_ABS}/tmp_host_out_keytab
48 testit
"Export keytab while old enctypes are supported" $samba_tool domain exportkeytab
--principal=$NETBIOSNAME\$
$kt
53 replace: msDS-SupportedEncryptionTypes
54 msDS-SupportedEncryptionTypes: $my_encs
57 testit
"Change msDS-SupportedEncryptionTypes back to $my_encs" $VALGRIND $ldbmodify -H ldap
://$SERVER -U$USERNAME%$PASSWORD -d0 <$ldif || failed
=$
(expr $failed + 1)