X-Recipient: archive-cygwin@delorie.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=jhg/hTZy7e1AH+TX8MpkIrxPdCwmJ3RtPqrbn+nwNX6IWKiUmOouU
	WNAfPxnKJU7XfiXWXIxMBj/+XQfLrykW8a92i0IKV6dUEJ2jixRNYEkyAhRtdkpm
	spz4MnsSYFhn28hJIzmhSq0wtGsDnpbAU7zyVTOmi9BGHP0ij+so18=
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=ZlwNT8RE9iBpCcxlB5YcKeEP4pY=; b=rx7YjImrHq2wzFJDh4MKX/88r3Px
	TlRN3ydYYFPhpFy5mPR7ocHlKEEOmwpleKzOecaHUAP6JAUxdzJ5TH09LP+CT9dp
	Bp2LvXMkbyA5MjKWC0B+9hgO4AYEvaKVIv+CZ6MYk88f8954YFENuh1GdtVc6zax
	IzHUiML+rBuTN5E=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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: Wed, 8 Oct 2014 14:39:34 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: connect() hangs on a listen()ing AF_UNIX socket
Message-ID: <20141008123934.GC29235@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <53F61B70.2020600@t-online.de> <20140821164402.GB21065@calimero.vinschen.de> <53F6450C.3070007@t-online.de> <20140822093923.GA12878@calimero.vinschen.de> <53F78CB1.9080406@t-online.de> <20140822201622.GM32314@calimero.vinschen.de> <53FCD9EC.1080703@t-online.de> <20140826205643.GD5740@calimero.vinschen.de> <5424259D.2090304@t-online.de>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="7gGkHNMELEOhSGF6"
Content-Disposition: inline
In-Reply-To: <5424259D.2090304@t-online.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

On Sep 25 16:24, Christian Franke wrote:
> Corinna Vinschen wrote:
> >On Aug 26 21:03, Christian Franke wrote:
> >>Corinna Vinschen wrote:
> >>>Sounds like a nice idea.  We should try that.  I'm just not sure how
> >>>much time I have left to work on this before my vaca next month.  Do y=
ou
> >>>have fun to look into that?  We have waited so long for postfix, I gue=
ss
> >>>a couple more weeks won't really hurt.
> >>OK, will try that
> >Cool!  Don't hesitate to discuss implementation details on the
> >cygwin-developers list.
>=20
> Unfortunately, a very first prototype did not work. If receiving of
> secret+cred is delayed until first send()/recv(), postfix hangs in first
> send() after the connect(). During startup, the postfix master calls
> connect() and first client send() before corresponding server accept() is
> called.

Yeah, that's tricky.  The handshake at send/recv time requires some
ordering which we can't enforce.  Too bad.

In theory, if the SO_PEERCRED stuff wouldn't be required for openssh,
we could really do without the handshake.  The peers are restricted to
the local machine anyway, and as with all communication, the peers have
to know the protocol.

> So I decided to provide a intermediate solution for now, see:
> https://cygwin.com/ml/cygwin-patches/2014-q3/msg00015.html

Thanks!  I'll look into it in the next couple of days.

> For the long term, this approach may work or not:
> Remove the complete handshake over TCP. Maintain a table of current TCP
> connections in the socket "file". The table contains pid, TCP port and
> credentials for the server which did the (first) listen() call and for all
> connected clients. Some hashes could be added to check for validity.

Yeah, we should try to come up with another technique.  Off the top of
my head I'm not sure if the above is feasible, but we should certainly
discuss this further.


Corinna

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

--7gGkHNMELEOhSGF6
Content-Type: application/pgp-signature

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

iQIcBAEBAgAGBQJUNTCFAAoJEPU2Bp2uRE+gn6AQAI9q5qAe3mPvsIVbWrCIiISE
M8EqsDientB/L3hhA8NqX2IxN4mEoFqmaGcMfgVKxI0e+yl9CxwAqUoOjuEH29Fx
pl8r1pqy552GQsQwTUQSXN8zZalt1rUmz0NUgNRh69JJXm/732zsDvmn/xV+sQAl
93MFbvG6euilcbxrSda9dJeTnSzL/KiT60zmy5EWxElsM2bZoH1TOBIQ7c+kp+CU
hWVGlK4xv7g7KL8yxPdGsLyDgAa3x032wYrm9Bb9WbBLjhfA8JgNbF/eOmD8afXl
uzINW+Dvfsj5qdfumfbryx80YlfmLGP1TAcUiop95QZkKJH4CcXpGms1C4YsSRfn
BUXQ/vMCm5QYGD7xtyhaQyqr01WonnUxGiZwKfIX7cnbRV9O4VZN+s98uHHTy4pj
P6QyuSm6nIvnbyPCwQl9E47jlk0OOK52frQ4L5gElryE/ON6ci9Lnq9D7+YkniYg
e4yd3ifRAJat2S4OE7BZ+Yct3kLz6FUfopwY15sG7GZ6PlQwSrlPRg9g/dY+W4Ez
FZYTRj3uKdWGh3vLncQZA0ixY8g0bJRMIfd1Fgs1SMjB8rmETt4PwQ7348rUwvru
jvn+I3dKoQ3IqHISpWapVyzd+Fg4yWxtSIyrFwc3jBdo26a6rRP/T8Tg+DIV78ir
GkLHfYrwSXRQRitgNF/U
=H3DE
-----END PGP SIGNATURE-----

--7gGkHNMELEOhSGF6--
