#!/bin/sh # # Test for 'samba-tool contact edit' if [ $# -lt 3 ]; then cat <$tmpeditor < \${contact_ldif}.tmp echo "displayName:: $display_name_b64" >> \${contact_ldif}.tmp mv \${contact_ldif}.tmp \$contact_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact edit \ ${TEST_USER} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } get_attribute_base64() { $samba_ldbsearch "(&(objectClass=contact)(name=${TEST_USER}))" \ displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } delete_attribute() { # create editor.sh cat >$tmpeditor <> \${contact_ldif}.tmp mv \${contact_ldif}.tmp \$contact_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact edit \ ${TEST_USER} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } # Test edit contact - add base64 attribute value including control character add_attribute_base64_control() { # create editor.sh cat >$tmpeditor < \${contact_ldif}.tmp echo "displayName:: $display_name_con_b64" >> \${contact_ldif}.tmp mv \${contact_ldif}.tmp \$contact_ldif EOF $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact edit \ ${TEST_USER} --editor=$tmpeditor \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } get_attribute_base64_control() { $PYTHON ${STpath}/source4/scripting/bin/samba-tool contact show \ ${TEST_USER} --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 contact show \ ${TEST_USER} --attributes=displayName \ -H "ldap://$SERVER" "-U$USERNAME" "--password=$PASSWORD" } # Test edit contact - change base64 attribute value including control character change_attribute_base64_control() { # create editor.sh cat >$tmpeditor <$tmpeditor <