public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Christian Franke <Christian.Franke@t-online.de>
To: cygwin-developers@cygwin.com
Subject: Re: Cygwin AF_UNIX emulation
Date: Sat, 18 Oct 2014 15:05:00 -0000	[thread overview]
Message-ID: <544281A1.1050203@t-online.de> (raw)
In-Reply-To: <20141018103553.GW2681@calimero.vinschen.de>

Corinna Vinschen wrote:
> On Oct 17 21:29, Christian Franke wrote:
>> Corinna Vinschen wrote:
>>> On Oct 16 23:34, Christian Franke wrote:
>>>> Nasty detail: At least postfix sets the all AF_UNIX sockets to rw-rw-rw- and
>>>> relies only on directory permissions (private: rwx------, public: rwx--x---)
>>>> for access control. This is not effective on Cygwin. Due to the rw-rw-rw-,
>>>> the 'secret' is world readable on Cygwin and another Cygwin specific patch
>>>> is required :-)
>>> Yeah, thanks to Windows which enables the "Bypass Traverse checking"
>>> privilege for everyone :(  At one point in 2005 I toyed with traverse
>>> checking but eventually gave up in 2006 and reverted the stuff.
>> This does not appear as an Se*Privilege in the token, correct?
> It's in the token, and it's an ugly amalgamation of two unrelated
> mechanisms(*):
>
>    SE_CHANGE_NOTIFY_NAME
>
>      Required to receive notifications of changes to files or
>      directories. This privilege also causes the system to skip all
>      traversal access checks. It is enabled by default for all users.
>
>      User Right: Bypass traverse checking.

An unexpected "feature", IMO.

Hmm.... after removing this privilege, Cygwin returns garbage stat() 
info, for any path below the 'forbidden directory':

$ uname -srvm
CYGWIN_NT-6.1-WOW64 1.7.33s(0.278/5/3) 20141017 14:39:49 i686

$ cd /var/spool/postfix/

$ ls -ld private
drwx------+ 1 postfix none 0 Oct 18 16:39 private

$ ls -l private
ls: cannot open directory private: Permission denied

$ ls -l private/smtp
srw-rw-rw- 1 postfix none 0 Oct 18 16:39 private/smtp

$ cygdrop -p ChangeNotify ls -l private/smtp
-rw-r----- 1 Unknown+User Unknown+Group 6991943424855812584 Jun 23 1909 
private/smtp

$ ls -l private/no/such/path
ls: cannot access private/no/such/path: No such file or directory

$ cygdrop -p ChangeNotify ls -l private/no/such/path
-rw-r----- 1 Unknown+User Unknown+Group 6991943424855812584 Jun 23 1909 
private/no/such/path

$ cygdrop -p ChangeNotify ls -l /tmp/no/such/path
ls: cannot access /tmp/no/such/path: No such file or directory


>> BTW: I could ITP postfix in one week or so. It would rely on the SO_PEERCRED
>> workaround for now. Any objections?
> Uh, we're not having a Cygwin release it could work with for now.
> It might be better to wait until then, if that's ok with you.

Of course.

My intention was to get the initial packing issues fixed early such that 
the actual upload could be done when a the first compatible Cygwin 
release is available.


> I'm planning to release 1.7.33(**) in November at the latest.  I'm
> not going to stall this release until we have another solution for
> the aforementioned problems, the SO_PEERCRED wourkaround should
> suffice for now.

OK.


> (**) Or 1.9.0. I'm not sure yet if we should bump the DLL major 
> version due to the massive changes to user and group handling or not. 

During testing postfix with recent snapshots, I found nothing that 
needed to be changed in my existing installations which have complete 
/etc/passwd and group files. The only visible difference is that Cygwin 
now reports groups not seen before (like 4="INTERAKTIV").

So keeping 1.7.* might be OK.

Christian

  reply	other threads:[~2014-10-18 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 21:34 Christian Franke
2014-10-17 11:49 ` Corinna Vinschen
2014-10-17 19:29   ` Christian Franke
2014-10-18 10:35     ` Corinna Vinschen
2014-10-18 15:05       ` Christian Franke [this message]
2014-10-20 10:44         ` Corinna Vinschen
2014-10-20 10:44       ` 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=544281A1.1050203@t-online.de \
    --to=christian.franke@t-online.de \
    --cc=cygwin-developers@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).