X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; q=dns; s=default; b=Otdc4Brv0xMCqGCmYWVaWXryraXU M2LNp40nGatWEb92Sm7cZnd1l/DV0aMfmewPGNjPrjFEBG198zrLCXE9Pfz7Pf72 gGCOTh+z3BnyjqHVa4Bl0UF7dHlho6ReujeLMbv4y+TaTTubSN4v8TaJUi9wugcc fdDrJv+axciE6XI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; s=default; bh=lDrawARSARxCldy25Mjfo7FwGGQ=; b=OQ dX9FS79NukdmZWs5A3Dppt4tSJMxLJMPBeo7cQWFaTrLtTsDmA7yE1T3WLIbD3YU SHJ61iXVgTLtra1EiRr1DT3m9JdVY91aYgMai/G15RgeKatDmR85/10EwzXAI7sw qCZ7N4qGgeR5DWrqYKwlgb/QVUsctUn579paNkOyI= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: smtp5-g21.free.fr Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: timeout in LDAP access From: Denis Excoffier In-Reply-To: <20140625101526.GO1803@calimero.vinschen.de> Date: Wed, 25 Jun 2014 22:44:21 +0200 Message-Id: References: <20140617100011 DOT GL23700 AT calimero DOT vinschen DOT de> <20140618083304 DOT GV23700 AT calimero DOT vinschen DOT de> <20140618180102 DOT GA27055 AT calimero DOT vinschen DOT de> <20140623090959 DOT GA1803 AT calimero DOT vinschen DOT de> <20140624155851 DOT GJ1803 AT calimero DOT vinschen DOT de> <20140625101526 DOT GO1803 AT calimero DOT vinschen DOT de> To: cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s5PKig9h005237 On 2014-06-25 12:15, Corinna Vinschen wrote: >> Stay tuned. I'm rewriting the LDAP access code to perform all critical >> LDAP calls in interruptible threads. The Windows LDAP calls don't >> provide any kind of synchronization, only timeouts. I hoped to get away >> with short timeouts but it seems I hoped in vain. >> >> So the next iteration of this code will not use any timeout other than >> the default LDAP network timeout of 2 minutes, but the calls will be >> interruptible by signals. >> > > No more artificial timeouts, but the LDAP calls will be interruptible by > a signal now. > > Also, if an error occurs during ad enumeration, getpwent/getgrent will > return NULL with errno set accordingly. > > Please test, I did. Again, i instrumented ldap.cc by replacing all debug_printf() calls with system_printf() because my /usr/bin/strace does not work. Again, i tested with ‘getent passwd > result’ and 'db_enum: all’. I got the following message: [ldap_init] getent 6024 cyg_ldap::connect_non_ssl: ldap_bind(xxxxxx.zzz) 0x51 and getent stops after the 376000 users in my own domain. No timeout occurred but the enumeration was stopped by LDAP_SERVER_DOWN (0x51) [the xxxxxx.zzz domain name has been edited here but it was completely new to me, never seen before]. Also, there was a large delay (more than 2 min, say at least 8 minutes) between the end of output and the end of getent. I got one single system_printf message (see above). More than that, i added system_printf("starting open in domain %W", domain) immediately at the beginning of cyg_ldap::open, and run ‘getent passwd’ now during one minute (wait 60s, then Control-C). I got 1080 ‘starting open in domain (null)’ messages on stderr and 1016 normal passwd entries on stdout. The discrepancy 1016 vs 1080 is ok because stdout was not properly flushed out. It seems that - domain is printed as ‘(null)’? Strange - there are as many open() calls as passwd entries in the output? Also strange - EIO (or equivalent) is produced for LDAP_SERVER_DOWN, it probably should be better if this were not the case? I suppose it will need more testing, but i’m currently unavailable for tests, by the way until Friday 08:00 UTC. Regards, Denis Excoffier. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple