From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 25 May 2004 11:43:56 +0400 From: Klimchev Konstantin To: community@altlinux.ru Subject: Re: [Comm] Ldap scripting: bash vs perl Message-Id: <20040525114356.0da1db74@phantom.intranet.atk> In-Reply-To: <40B1C951.3030204@rmts.donpac.ru> References: <40B1C951.3030204@rmts.donpac.ru> X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i386-asplinux-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-BeenThere: community@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: community@altlinux.ru List-Id: Mailing list for ALT Linux users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 May 2004 07:44:02 -0000 Archived-At: List-Archive: List-Post: Добрый день! Попробовал и я (доступ к удаленной машине, в LDAP'е 3500 записей): Сразу оговариваюсь, что пытался свести к минимому операции с выборкой на локальной машине ==================================================================== 1) шелл time ldapsearch -LLL -hнекий_хост -x -wнекий_пароль -Dcn=manager,ou=mail,o=ATK-INET -bou=mail,o=ATK-INET "(&(objectclass=mailAccount)(accountStatus=blocked)(mail=ar*))" dn real 0m0.149s user 0m0.010s sys 0m0.000s =================================================================== 2) python #!/usr/bin/env python import ldap ldapConnection = ldap.open('некий_хост') ldapConnection.simple_bind_s('cn=manager,ou=mail,o=ATK-INET', 'некий_пароль') baseDN = 'ou=mail,o=ATK-INET' searchScope = ldap.SCOPE_SUBTREE _result = ldapConnection.search_s(baseDN, searchScope, '(&(objectclass=mailAccount)(accountStatus=blocked)(mail=ar*))', ['dn']) print _result ldapConnection.unbind_s() real 0m0.140s user 0m0.060s sys 0m0.010s =========================================================== -- Best Regards, Konstantin Klimchev (mailto:koka@atvc.ru jabber:koka@jabber.atvc.ru) ATK-Internet ISP, Arkhangelsk, Russia