This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: connect() hangs on a listen()ing AF_UNIX socket


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.
> 
> 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.
> 
> This is because fchmod() is called on a file rename()d after open():
> 
> fd = 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 not
> tested yet.
> 
> 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

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

Attachment: pgpb6IiP6qeDt.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]