Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 24 May 2003 11:15:56 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: ENOTSOCK errors with cygwin dll 1.3.21 and 1.3.22 Message-ID: <20030524091556.GY19367@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <008301c30494$3ac5ac50$0200a8c0 AT abackusdell2> <20030421202002 DOT GD11137 AT cygbert DOT vinschen DOT de> <002301c32163$cac78c60$0200a8c0 AT abackusdell2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <002301c32163$cac78c60$0200a8c0@abackusdell2> User-Agent: Mutt/1.4.1i On Fri, May 23, 2003 at 12:44:57PM -0700, Abraham Backus wrote: > Specifically: > * fhandler_socket.cc (fhandler_socket::dup): On NT systems avoid > using WinSock2 socket duplication methods. Add comment. > > This is what's causing me grief. > > I built the 1.3.22 sources, commenting out the line: > if (! wincap.has_security ()) > > and my inetd apps work ok again. > > I've been searching the web and archives to try and find out what's the > difference between WSADuplicateSocket and DuplicateHandle and I can't really > seem to find anything, other than an MS KB 150523 "BUG: Socket Inheritance > on Different Windows Platforms". I don't mind investigating further, but I > think I've come to a roadblock.... In the comment with the patch, it says > "Using WinSock2 methods for dup'ing sockets seem to collide with user > context switches under... some... conditions." Where can I find more > information on this user context collision problem? There's discussion on the cygwin-developers list. Basically what happened (before the above change was applied) was this: Start the following under SYSTEM account: fd = socket (); setuid (non-privileged-account); fd2 = dup (fd); close (fd2); <-- returns WSAENOTSOCK For some reason this does not happen if the process is started from a native windows process (e.g. cmd.exe) but it happens when the process is started from another Cygwin process. We still don't know why that happens (therefore the "...some..." comment) but using simple socket handle duplication instead of WinSock2 WSASocket/WSADuplicateSocket when duplication a socket resolved that problem. > I have WinXP Home SP1. Me, too. And note that it works for me! There was only one socket problem reported for Windows XP so far, KB article 319952 but it doesn't seem to be related. Sic. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- 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/