HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/share/doc/python-ldap-2.4.15/Demo/rename.py
import ldap
from getpass import getpass

# Create LDAPObject instance
l = ldap.initialize('ldap://localhost:1389',trace_level=1)

print 'Password:'
cred = getpass()

try:

  # Set LDAP protocol version used
  l.set_option(ldap.OPT_PROTOCOL_VERSION,3)

  # Try a bind to provoke failure if protocol version is not supported
  l.bind_s('cn=root,dc=stroeder,dc=com',cred,ldap.AUTH_SIMPLE)

  print 'Using rename_s():'

  l.rename_s(
    'uid=fred,ou=Unstructured testing tree,dc=stroeder,dc=com',
    'cn=Fred Feuerstein',
    'dc=stroeder,dc=com',
    0
  )

  l.rename_s(
    'cn=Fred Feuerstein,dc=stroeder,dc=com',
    'uid=fred',
    'ou=Unstructured testing tree,dc=stroeder,dc=com',
    0
  )

  m = l.rename(
    'uid=fred,ou=Unstructured testing tree,dc=stroeder,dc=com',
    'cn=Fred Feuerstein',
    'dc=stroeder,dc=com',
    0
  )
  r = l.result(m,1)

  m = l.rename(
    'cn=Fred Feuerstein,dc=stroeder,dc=com',
    'uid=fred',
    'ou=Unstructured testing tree,dc=stroeder,dc=com',
    0
  )
  r = l.result(m,1)

finally:

  l.unbind_s()