delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/05/12:15:29

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 5 May 2003 12:15:12 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Peter A. Castro" <doctor AT fruitbat DOT org>
cc: cygwin AT cygwin DOT com
Subject: Re: screen's usage of unix-domain sockets under Cygwin
In-Reply-To: <Pine.LNX.4.21.0305021736520.593-400000@gremlin.fruitbat.org>
Message-ID: <Pine.GSO.4.44.0305031212030.25128-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Fri, 2 May 2003, Peter A. Castro wrote:

> Hi,
>   I'm one of those people who makes use of 'screen' on unix systems, and,
> after reading about the various problems people were having getting
> screen to work under Cygwin, decided to take a closer look at it myself.
> I now understand what screen is doing, and why it's failing, but it's not
> a trivial fix.  Screen make some assumptions concerning unix-domain
> sockets (ie: a file-system based socket) that basically don't work under
> Cygwin.  However, they should!  I've gone through cygwin code and it
> looks like it should actually provide the necessary support, but it's not
> doing the right thing.
>   The symptom is that once a unix-domain socket is create, you can't
> change it's permissions (or any of it attributes), reguardless of weither
> it's actively being used or not.
>   To demonstrate, create a socket somewhere.  I've attached sample C
> source to create a socket (/tmp/foosock).  The socket will be created
> based on your current umask, of course.  Now, try changing the
> permissions on the socket, using chmod.  Notice that you can't change the
> permissions at all.  Not only that, but you can't change the ownerid or
> groupid.
>   Note that I am using CYGWIN="ntsec tty".  I am doing this on a plain,
> local NTFS filesystems (running NT4+SP6) and I'm not connected to any
> NTdomain; I'm logged in locally as "Administrator".  I can change
> permissions and ownership on any regular file in the same filesystem.
>   I've also attached an strace of the creating of the socket
> (mkfoosock.trc) and an strace of chmod trying to set the mode
> (chmod.trc).
>
> % strace --mask=all --output=mkfoosock.trc ./mkfoosock
> % ls -al /tmp/foosock
> srwxrwxrwt    1 Administ None            0 May  2 18:16 /tmp/foosock
> % strace --mask=all --output=chmod.trc chmod 600 /tmp/foosock
> % ls -al /tmp/foosock
> srwxrwxrwt    1 Administ None            0 May  2 18:16 /tmp/foosock
>
> Note that to Windows this file is marked as a (S)ystem file and isn't
> visible to most applications.
>
> I've examined the traces and looked through some of the cygwin specific
> code (winsup/cygwin/fhandler_socket.cc, security.cc, syscalls.cc), but
> without a debug environment, I can't really follow the flow effectively.
>
> Can someone who's got a debug environment setup, try tracing
> fhandler_socket::bind() and see if it actually creates the security
> descriptors correctly?  Then trace chmod to see why it can't change the
> security descriptor?
>
> If this can be solved, it'll go a long way towards making screen work
> under Cygwin and making the usability/security of unix-domain sockets
> better.  If noone can readily test-drive this, I'll just have to go
> figure out how to setup a debug env myself :|
>
> Thanks!

Peter,

Looks like you're using a stock release of Cygwin.  Before you go to the
trouble of building your own cygwin1.dll, could you try the latest
snapshot, and see if the problem still manifests with it?  Corinna says
that the chmod problem has been fixed since the day after the 1.3.22
release... :-)

<http://cygwin.com/ml/cygwin-cvs/2003-q1/msg00397.html>:
2003-03-19  Corinna Vinschen  <corinna AT vinschen DOT de>
       ...
       * syscalls.cc (chmod): Allow chmod'ing of socket files.

The chown problem has been fixed here:
<http://cygwin.com/ml/cygwin-cvs/2003-q2/msg00071.html>

So, do try the May 4 snapshot.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019