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=Upv9JAV9ZTLoXoGGzIywg0rLr7naiRGbdfF0bs2uo8JN8kFS31ikP
	Lq+qqgxEqzWPBpaX5zvHlv+TtgXDEnujeReAquKS6BpT0X0otnPjS5swGo3W07rv
	Mwlt16+yfFXf36cBZw4+Ic5Xr3M0U0A+LjznhXylWqIaaYLhez4RzY=
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=mBCn+r7EbqcMJVk7eL846Dxt/1E=; b=mF5XBG1LHiNRpRa2u0SrHUcBSMIN
	5VPXHrc83EtFEAmZwWvcf2IzL3UucNsJuahhaegiwcNOXIt3VV0FS05ItMvezk4n
	XcJhEQnMrf+JA+ruIle2DrRtnoWGtZs0qYRq7MCQO4T3ObiMqCEKQM64zp3sKTD9
	K+5ejrulkjPQ6dE=
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: Tue, 26 Aug 2014 22:56:43 +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: <20140826205643.GD5740@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>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;	protocol="application/pgp-signature"; boundary="jL2BoiuKMElzg3CS"
Content-Disposition: inline
In-Reply-To: <53FCD9EC.1080703@t-online.de>
User-Agent: Mutt/1.5.23 (2014-03-12)

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

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 you
> >have fun to look into that?  We have waited so long for postfix, I guess
> >a couple more weeks won't really hurt.
>=20
> OK, will try that

Cool!  Don't hesitate to discuss implementation details on the
cygwin-developers list.

> Postfix apparently pushes Cygwin to its limits. With a test cygwin1.dll
> where the secret+cred exchange is fully disabled, postfix starts up but
> queuing of mail fails.
>=20
> This is because fchmod() is called on a file rename()d after open():
>=20
> fd =3D open("tempfile", ., 0600);
> // use fd's inode number and current time to create unique "queuefile".
> rename("tempfile", "queuefile");
> write(fd, "SOME MAIL....", .);
> fchmod(fd, 0700); // fails with ENOENT on Cygwin (because it does a
> chmod("tempfile",.)?)
> close(fd);

I fixed that in CVS (and I'm just generating a snapshot).  The problem
was that the functions reading and writing security descriptors didn't
use the special "reopen by handle" semantics of the NtOpenFile call if
a reopen was necessary.  Rather they just tried to open the file by name
again, just with different open flags.  I fixed that, as well as another
occurence of the same problem when trying to read and write extended
attributes.

This won't work on filesystems which don't support reopen semantics,
which is Netapp and NWFS.  I have an idea how to workaround that for
these FSes, but that's not high priority.

> A workaround using chmod("queuefile", 0700) helped here. Then smtp client,
> smtpd server (direct or via smarthost), sendmail emulation and local
> delivery to maildir works. Running as service with uid/gid switching is n=
ot
> tested yet.
>=20
> It will likely take some time to look into all these details before first
> ITP.
> (Therefore let's forget the "cygcheck -m" patch for now :-).

Ok, no worries there :)


Thanks,
Corinna

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

--jL2BoiuKMElzg3CS
Content-Type: application/pgp-signature

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

iQIcBAEBAgAGBQJT/PSLAAoJEPU2Bp2uRE+ge9wQAJB1M0pyQL7d8XMaibRyJ603
G/XJ3imy4lYmr6cQFWUjEx47EZZtRwfdUWXTQHYhzaNVREhIP70dnupxrY61ggyz
66UkmUUXzjzFvx3MOrwFG3rpg3d+MFUuQbx4b7JUr1MQIsH9tv3HiicjP6g7Omn1
EXoxIf9Z0s+g1rhtYuUEz1nGI80wKONW0IAd4sacfmvBBdSUaEH0vSFXeD8At/+1
kHzL+glkxAdDEPc86HQ3gZGphQ6x0y6Ab8ECM/AhOhGuFXtEhRp7J/P4rmxMLe5T
bxZ0/TD7jEsI1r7pgoibXsirSWmmdubBbiqIQXfr3cXlTU9H16Sex87v16IkCVU/
5EbVff4yp0tr+j5yvrqIZDf37nXS89D18WH4shLxZdBeGJpPEtpJjpg+5g8slxZv
MNt7k++3kzVyD6vBxriFAEd54A5Y+VKFPO8bxKIOrzHeozEEZvUAhulYwLUyLiR5
KHx8UUe8f9wrARGDeGHY19CPP+5cqfHwKS9Zh9XdpgE0A0dAianrYOjfvnjwFuEB
Zy+MHAD7J76tOf/LBJoMVRkpJZxgQyg6wsD+IN8vMtOt7nqBELP+zmmvJ9BPTpxH
+KrxMlusNG+ubEh0iX+pSOZNkic3U1z/1vT6MkX7PMRdeBzmwUkaCCWD1HHVmhEE
zNfu2QDNlFa8WEARfL3I
=7X2f
-----END PGP SIGNATURE-----

--jL2BoiuKMElzg3CS--
