delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/11/27/11:37:04

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
To: cygwin AT cygwin DOT com
From: Jason Curl <j DOT m DOT curl AT optusnet DOT com DOT au>
Subject: Cygwin files and devices philosophy
Date: Sat, 27 Nov 2004 17:36:43 +0100
Lines: 40
Message-ID: <coaaes$q1c$1@sea.gmane.org>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: 1cust45.tnt7.muc2.deu.da.uu.net
User-Agent: Mozilla Thunderbird 0.9 (Windows/20041103)
X-IsSubscribed: yes

Hello,

I have a general question for the developers of cygwin.

When I open the file "\\.\COM37" this is not opened by cygwin as a 
serial port, but rather as a file. The reasoning (that I'm not 
disputing) is cygwin should have more of a posix/unix flavour. And so 
specific functionality to treat this as a COM port was removed.

So what "should ideally" happen when I open the file?

1. The file should be opened and no error

2. The file should be rejected by cygwin, as the paths don't look "posix".

If we take 1, it makes the rules simpler. Maybe this was provided 
because we really do want to open this and get a handle. Maybe we want 
to open a network device instead of a hardware device (which has similar 
sematics).

For point 2, this might be considered valid because the path is not 
POSIX and may confuse programs where the file to open is part of a 
command line argument.

In my case, I provide an option for a terminal program what device 
should be used to open the file. I don't want to restrict what devices 
are or are not allowed, except by using function calls to the Posix API 
to determine if the required functionality can be met.

However, if a user passes '\\.\COM37' it opens, isatty() is successful 
and my software hangs. Should it be up to my program to filter out nasty 
devices, or the underlying API? Needless to say, that this file doesn't 
behave as a tty because the fhandler_disk functions are being used. But 
other functions that I would expect to fail, don't.

I ask, so that I may understand in what direction cygwin developers 
prefer so I can modify my software in the appropriate way. I'd like it 
not to have any specific knowledge of cygwin, but it will if need be.

Could something of this nature lead to a security vulnerability in cygwin?


--
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