File: modrdn.rb

package info (click to toggle)
ruby-ldap 0.9.20-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 452 kB
  • sloc: ansic: 4,097; ruby: 1,525; makefile: 5
file content (23 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- ruby -*-
# This file is a part of test scripts of LDAP extension module.

$test = File.dirname($0)
require "#{$test}/conf"
require "./ldap"

conn = LDAP::Conn.new($HOST, $PORT)

begin
  conn.bind('cn=root, dc=localhost, dc=localdomain','seret')
rescue LDAP::ResultError => e
  $stderr.print("#{e.inspect} ... expected.\n")
  conn.bind('cn=root, dc=localhost, dc=localdomain','secret'){
    conn.perror("bind")
    conn.modrdn("cn=Takaaki Tateishi, dc=localhost, dc=localdomain",
                "cn=Takaaki-Tateishi",
                true)
    conn.perror("modrdn")
  }
  exit(0)
end
exit(1)