public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: connect() hangs on a listen()ing AF_UNIX socket
Date: Tue, 26 Aug 2014 20:56:00 -0000	[thread overview]
Message-ID: <20140826205643.GD5740@calimero.vinschen.de> (raw)
In-Reply-To: <53FCD9EC.1080703@t-online.de>

[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]

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 #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-08-26 20:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 16:17 Christian Franke
2014-08-21 16:44 ` Corinna Vinschen
2014-08-21 19:14   ` Christian Franke
2014-08-22  9:39     ` Corinna Vinschen
2014-08-22 18:32       ` Christian Franke
2014-08-22 20:16         ` Corinna Vinschen
2014-08-26 19:03           ` Christian Franke
2014-08-26 20:56             ` Corinna Vinschen [this message]
2014-08-27  8:58               ` Achim Gratz
2014-08-27  9:50                 ` Corinna Vinschen
2014-08-27 10:12                   ` Corinna Vinschen
2014-08-27 17:57                     ` Achim Gratz
2014-08-28  9:57                       ` Corinna Vinschen
2014-09-25 14:35               ` Christian Franke
2014-10-08 12:39                 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140826205643.GD5740@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).