delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/07/07/07:07:44

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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=fLc9J0YL3VXnYyD3vkA+0GHZtrG4WiJt6cEagAGItDOyxC3Rc5d6t
boavJ7UtBkCFCywbO1vhQXUs2Pdaal0ncZvq6RDv68BDYTP2OkPJ6avd4iPiTCBX
G8mpG2u8SrvKdmjGsGBIFA9df6mZ16iICROBHcvakDKMjb5MeLb4jY=
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:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=tKIjkjzwlCVnMu7tz2G5D4NzJ1M=; b=L/IF/6qhD4IfNnob+zU/RDzUvt/+
zE+JIb73K6l1DBrq8FpS1wL01oAWfxwv+KZDE1kBCzeqKMaNTie1QuW/cC7sSyQH
yF7j5+jGNVDNeY56VPpz7FiOrp5OLnifLYoL01kFkvgB0lsTvvDNFophE8C3acEi
jOjVdNe+/zxX63Q=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Mon, 7 Jul 2014 13:07:14 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: timeout in LDAP access
Message-ID: <20140707110714.GJ1803@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20140618083304 DOT GV23700 AT calimero DOT vinschen DOT de> <20140618180102 DOT GA27055 AT calimero DOT vinschen DOT de> <FEEBC1A4-B147-45C1-A5AC-F5B9108E998F AT Denis-Excoffier DOT org> <20140623090959 DOT GA1803 AT calimero DOT vinschen DOT de> <C2FB35D9-AE47-4461-8A94-20605D5EB996 AT Denis-Excoffier DOT org> <20140624155851 DOT GJ1803 AT calimero DOT vinschen DOT de> <20140625101526 DOT GO1803 AT calimero DOT vinschen DOT de> <E760D646-FFCB-434C-B990-7783DC011326 AT Denis-Excoffier DOT org> <20140625211355 DOT GA25116 AT calimero DOT vinschen DOT de> <E3509AAC-C4A0-4293-988F-E94BF2421180 AT free DOT fr>
MIME-Version: 1.0
In-Reply-To: <E3509AAC-C4A0-4293-988F-E94BF2421180@free.fr>
User-Agent: Mutt/1.5.23 (2014-03-12)

--DRp5/Sds4nAqvQzf
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Jul  3 22:56, Denis Excoffier wrote:
> On 2014-06-25 23:13 Corinna Vinschen wrote:
> >=20
> > You asked for errors being propagated up the chain to the
> > getpwent/getgrent calls and that's exactly what happens now.  There are
> > a lot of LDAP error codes.  How is Cygwin supposed to handle every one
> > of them?  Do we need a list of ignorable and non-ignorable error codes?
> I don=E2=80=99t know. IMHO:
> - a server which is down can be ignored (unless explicitly requested)
> - a timeout, when some output has already been received, must be reported
> - all servers should be treated independently since they are independent
> For the time being, i have added LDAP_SERVER_DOWN in map_ldaperr_to_errno
> at the same place as LDAP_SUCCESS.

I'm wondering if that's the right thing to do.  It feels wrong to
convert a valid error to LDAP_SUCCESS.

Taking a step back, the only reason to ignore such an error would be, if
trying to connect to a domain fails.  If this error occurs somewhere in
the middle, during enumerating a domain, it's a legit error.

I changed pg_ent::enumerate_ad accordingly.

> >> More than that, i added system_printf("starting open in domain %W", do=
main)
> >> immediately at the beginning of cyg_ldap::open, and run =E2=80=98geten=
t passwd=E2=80=99 now during
> >> one minute (wait 60s, then Control-C). I got 1080 =E2=80=98starting op=
en in domain (null)=E2=80=99
> >> messages on stderr and 1016 normal passwd entries on stdout. The discr=
epancy
> >> 1016 vs 1080 is ok because stdout was not properly flushed out.
> >=20
> > 60 seconds for 1016 user entries?  That sounds incredibly slow.
> I=E2=80=99m pretty sure that this is due to the non-buffering
> of stderr. In fact, system_printf() is incredibly slow ;-)

Oh, right.  I didn't realize the 60 secs are the time it takes while
stracing.  No worries here.

> > The open function is called for every account, but that doesn't mean it
> > really needs opening.  That's what the early return is for.  The code
> > starts like this:
> >  [...]
> > Did you add the system_printf before the "/* Already open? */" comment,
> > by any chance?
> You=E2=80=99re right. It was before. Now i have it after and there is onl=
y one
> such message for the primary domain.
>=20
> However, for the non-primary domains the result is the same: i get as
> many cyg_ldap::open()s as accounts. Even more strange, for all these open=
=E2=80=99s
> (except the first one) the domain variable is printed as (null). Perhaps
> something uncontrolled within pg_ent::enumerate_ad()? Simple suggestion, i
> was not able to understand the logic there.

I can't reproduce this.

For enumerating a non-primary domain, I get exactly two calls to
cyg_ldap::open which actually do a connect.  The first call opens the
domain for enumeration.  The second call opens the primary domain (NULL)
to fetch the POSIX offset value for the foreign domain (see my document
explaining the POSIX offset stuff), unless the application or one of
its parent processes already fetched the POSIX offset for this domain.

I don't observer any further calls to connect in this scenario.


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--DRp5/Sds4nAqvQzf
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTun9iAAoJEPU2Bp2uRE+gqSQQAJHlw1YOWS97F9IlR8RFNsoD
F5ABw+0hXnRU4/2W6TKkbBPtXDhe+qq6aKzkAxwsY+S2LeAZFF5jfxz2mStlr894
jFTYsZ7msLRYeB1vB+DqEIbMVkLW8v0GcYP1xyg1rimy2loX8ssjyLtJnMDMbNQv
FickZKS8VQW0uBPa/n+8q1WZrsWxPKmvtB1RAjf8oe+ElAZiYCaKC+JUtUkPp09+
BKrOmmfA7Q+q3RunlIwAzO3ojRKNRU4UMsiaS1hukuKmP+k4xroemfEAFrylRhpa
SZfptlDJXGdnijpsZI5L+W44E9pU8pCvlDRgTsyeMPO38elQNuXcvfw3SpXMKLvd
GKhQY+vJGKQN3wbD3sxn9GU36k1ul9NL7jJRUgLK0dO/IIzwXNaUEQfkEMqOu03i
1OvKjXuE71FotjgO+uaxuPXwGIf/sYgJqZ25HfFi4u80fAQ1enEnNDhV39lfC2U2
PYoJHv9p5eDYaw/I3cRw5pQyXL0IyAbE4Q/lqwKGncJQKY9R1vs++dET7aDQjptK
m/VHAXxzWD8O8wrtJkvBBel7o4MiK7I733LYmTlZWhuxgVNcnszu8G/akvmDyPpc
YmrAdautEm3z2X31cdgdBGP7CB/GvqDxGBZ7476Ioehp06jzfeHYjffvfW+1GNvl
tlGbksRYg+Z/dYBl+sot
=Gv9u
-----END PGP SIGNATURE-----

--DRp5/Sds4nAqvQzf--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019