#!/bin/sh # # Test for 'samba-tool computer edit' if [ $# -lt 3 ]; then cat <$tmpeditor <<-'EOF' #!/usr/bin/env bash computer_ldif="$1" SED=$(which sed) $SED -i -e 's/userAccountControl: 4098/userAccountControl: 4096/' $computer_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool \ computer edit ${TEST_MACHINE} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } # Test edit computer - add base64 attributes add_attribute_base64() { # create editor.sh cat >$tmpeditor < \${computer_ldif}.tmp echo "displayName:: $display_name_b64" >> \${computer_ldif}.tmp mv \${computer_ldif}.tmp \$computer_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \ ${TEST_MACHINE} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } get_attribute_base64() { ${ldbsearch} "(sAMAccountName=${TEST_MACHINE}\$)" displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } delete_attribute() { # create editor.sh cat >$tmpeditor <> \${computer_ldif}.tmp mv \${computer_ldif}.tmp \$computer_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \ ${TEST_MACHINE} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } # Test edit computer - add base64 attribute value including control character add_attribute_base64_control() { # create editor.sh cat >$tmpeditor < \${computer_ldif}.tmp echo "displayName:: $display_name_con_b64" >> \${computer_ldif}.tmp mv \${computer_ldif}.tmp \$computer_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer edit \ ${TEST_MACHINE} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } get_attribute_base64_control() { $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \ ${TEST_MACHINE} --attributes=displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } get_attribute_force_no_base64() { # LDB_FLAG_FORCE_NO_BASE64_LDIF should be used here. $PYTHON ${STpath}/source4/scripting/bin/samba-tool computer show \ ${TEST_MACHINE} --attributes=displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } # Test edit computer - change base64 attribute value including control character change_attribute_base64_control() { # create editor.sh cat >$tmpeditor <$tmpeditor <