public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* com1 access denied - win xp
@ 2004-05-20 16:49 Michael Wood
  2004-05-20 17:45 ` Igor Pechtchanski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Wood @ 2004-05-20 16:49 UTC (permalink / raw)
  To: cygwin

Hi-ya,

I get an "Access is denied" error message when attempting to create a 
serial port connection through Cygwin, running on Win XP.

In cygwin, when I execute:
	ls -l COM1

I get the following:
	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1

However, when I execute:
	chmod a+rw COM1

the command exits normally (no error message), but the permissions on 
COM1 stay the same. Furthermore, I do not particularly understand why if 
I am the owner of COM1 (as illustrated by the 'ls -l'), why I would get 
a permission error.

I have successfully created and used a connection on the serial port on 
the same machine through a VMWare session running a Linux Red Hat image. 
I used a very similar procedure above, in that I simply changed the 
permissions on "/dev/ttyS0" to grant all users read and write 
permissions to the serial port.

Help would be greatly appreciated.

- Mike



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: com1 access denied - win xp
  2004-05-20 16:49 com1 access denied - win xp Michael Wood
@ 2004-05-20 17:45 ` Igor Pechtchanski
  2004-05-21  0:10   ` Igor Pechtchanski
  2004-05-20 18:27 ` Dave Korn
  2004-05-20 20:44 ` Brian Ford
  2 siblings, 1 reply; 7+ messages in thread
From: Igor Pechtchanski @ 2004-05-20 17:45 UTC (permalink / raw)
  To: Michael Wood; +Cc: cygwin

On Thu, 20 May 2004, Michael Wood wrote:

> [snip]
> I have successfully created and used a connection on the serial port on
> the same machine through a VMWare session running a Linux Red Hat image.
> I used a very similar procedure above, in that I simply changed the
> permissions on "/dev/ttyS0" to grant all users read and write
> permissions to the serial port.
>
> Help would be greatly appreciated.
> - Mike

Mike,

Given that you used "/dev/ttyS0" on Linux, why not try using the same on
Cygwin?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: com1 access denied - win xp
  2004-05-20 16:49 com1 access denied - win xp Michael Wood
  2004-05-20 17:45 ` Igor Pechtchanski
@ 2004-05-20 18:27 ` Dave Korn
  2004-05-24 20:30   ` Michael Wood
  2004-05-20 20:44 ` Brian Ford
  2 siblings, 1 reply; 7+ messages in thread
From: Dave Korn @ 2004-05-20 18:27 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: cygwin-owner On Behalf Of Michael Wood
> Sent: 20 May 2004 17:23

> Hi-ya,
> 
> I get an "Access is denied" error message when attempting to create a 
> serial port connection through Cygwin, running on Win XP.
> 
> In cygwin, when I execute:
> 	ls -l COM1
> 
> I get the following:
> 	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1
> 
> However, when I execute:
> 	chmod a+rw COM1
> 
> the command exits normally (no error message), but the permissions on 
> COM1 stay the same. Furthermore, I do not particularly 
> understand why if 
> I am the owner of COM1 (as illustrated by the 'ls -l'), why I 
> would get 
> a permission error.
> 
> I have successfully created and used a connection on the 
> serial port on 
> the same machine through a VMWare session running a Linux Red 
> Hat image. 
> I used a very similar procedure above, in that I simply changed the 
> permissions on "/dev/ttyS0" to grant all users read and write 
> permissions to the serial port.
> 
> Help would be greatly appreciated.
> 
> - Mike


#1.  Why not use /dev/ttyS0 again?  Cygwin is a posix compatible layer and
/dev/ttyS0 should work pretty much the same.  BTW, which directory are you
in when you do those commands on COM1?  Did you "cd /dev" or do you expect
it to just work anywhere, and if so, why?

#2.  'doze has some pretty funny ideas about files having the same name as
dos-devices (COMx:, PRN:, LPTx: etc).  It doesn't like it at all.
Presumably somewhere between cygwin and 'doze a bit of confusion is creeping
in.

#3.  I notice that if you're in /dev and you do "ls -la com1", you get the
right answer.  But remember, under Posix, capitalisation matters, so "com1"
and "COM1" are two different files.  Under 'doze, unfortunately, it doesn't.
So probably Cygwin knows that /dev/com1 is the serial port, thinks that
/dev/COM1 is something different because the case doesn't match, assumes
it's an ordinary file and passes the name through to the underlying 'doze
file-handling calls, which disagree with cygwin and think that it IS a
serial port, and then everybody gets confused.

#4.  When I do "ls -la COM1", I just get:

dk@mace /> ls -la COM1
----------    0 ???????? ????????        0 Jan  1  1970 COM1

no matter what directory I'm in.  Bizarre.  When I'm do "ls -la /dev/com1",
I get the proper answer:

dk@mace /> ls -la /dev/com1
crw-rw-rw-    1 dk       Domain U 117,   1 May 20 19:05 /dev/com1

but capitalizing it never works, not even in the /dev directory.

dk@mace /> ls -la /dev/COM1
----------    0 ???????? ????????        0 Jan  1  1970 /dev/COM1

#5.  Anyway, the answer to your problem is that you were using the wrong
filename.  The solution is to use the correct filename; either /dev/com1 or
/dev/ttyS0.  And as to why there's a messed up COM1 in there, that's a
little bugette you've stumbled across.

    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: com1 access denied - win xp
  2004-05-20 16:49 com1 access denied - win xp Michael Wood
  2004-05-20 17:45 ` Igor Pechtchanski
  2004-05-20 18:27 ` Dave Korn
@ 2004-05-20 20:44 ` Brian Ford
  2004-05-21  1:30   ` Brian Ford
  2 siblings, 1 reply; 7+ messages in thread
From: Brian Ford @ 2004-05-20 20:44 UTC (permalink / raw)
  To: Michael Wood; +Cc: cygwin

On Thu, 20 May 2004, Michael Wood wrote:

> I get an "Access is denied" error message when attempting to create a
> serial port connection through Cygwin, running on Win XP.
>
> In cygwin, when I execute:
> 	ls -l COM1
>
> I get the following:
> 	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1

Not related, but note the mkgroup- in the group field.  That means your
group is not part of /etc/group.  Please see "man mkgroup" to fix this.

I get the following with the latest snapshot:

-rwxrwxrwx    1 Administ SYSTEM          0 Dec 31  1969 COM1*

which may or may not make more sense to you.

> However, when I execute:
> 	chmod a+rw COM1
>
> the command exits normally (no error message), but the permissions on
> COM1 stay the same.

AFAIK, you can't change the POSIX derived permissions of DOS devices.

> Furthermore, I do not particularly understand why if I am the owner of
> COM1 (as illustrated by the 'ls -l'), why I would get a permission
> error.

That may depend on the version of Cygwin you are using.  Please see:

http://cygwin.com/problems.html

for the required information in a problem report.

> I have successfully created and used a connection on the serial port on
> the same machine through a VMWare session running a Linux Red Hat image.
> I used a very similar procedure above, in that I simply changed the
> permissions on "/dev/ttyS0" to grant all users read and write
> permissions to the serial port.

Does this help?

http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN806

Don't use a DOS device if you want POSIX behavior.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: com1 access denied - win xp
  2004-05-20 17:45 ` Igor Pechtchanski
@ 2004-05-21  0:10   ` Igor Pechtchanski
  0 siblings, 0 replies; 7+ messages in thread
From: Igor Pechtchanski @ 2004-05-21  0:10 UTC (permalink / raw)
  To: Michael Wood; +Cc: cygwin

On Thu, 20 May 2004, Michael Wood wrote:

> [snip]
> I have successfully created and used a connection on the serial port on
> the same machine through a VMWare session running a Linux Red Hat image.
> I used a very similar procedure above, in that I simply changed the
> permissions on "/dev/ttyS0" to grant all users read and write
> permissions to the serial port.
>
> Help would be greatly appreciated.
> - Mike

Mike,

Given that you used "/dev/ttyS0" on Linux, why not try using the same on
Cygwin?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: com1 access denied - win xp
  2004-05-20 20:44 ` Brian Ford
@ 2004-05-21  1:30   ` Brian Ford
  0 siblings, 0 replies; 7+ messages in thread
From: Brian Ford @ 2004-05-21  1:30 UTC (permalink / raw)
  To: Michael Wood; +Cc: cygwin

On Thu, 20 May 2004, Michael Wood wrote:

> I get an "Access is denied" error message when attempting to create a
> serial port connection through Cygwin, running on Win XP.
>
> In cygwin, when I execute:
> 	ls -l COM1
>
> I get the following:
> 	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1

Not related, but note the mkgroup- in the group field.  That means your
group is not part of /etc/group.  Please see "man mkgroup" to fix this.

I get the following with the latest snapshot:

-rwxrwxrwx    1 Administ SYSTEM          0 Dec 31  1969 COM1*

which may or may not make more sense to you.

> However, when I execute:
> 	chmod a+rw COM1
>
> the command exits normally (no error message), but the permissions on
> COM1 stay the same.

AFAIK, you can't change the POSIX derived permissions of DOS devices.

> Furthermore, I do not particularly understand why if I am the owner of
> COM1 (as illustrated by the 'ls -l'), why I would get a permission
> error.

That may depend on the version of Cygwin you are using.  Please see:

http://cygwin.com/problems.html

for the required information in a problem report.

> I have successfully created and used a connection on the serial port on
> the same machine through a VMWare session running a Linux Red Hat image.
> I used a very similar procedure above, in that I simply changed the
> permissions on "/dev/ttyS0" to grant all users read and write
> permissions to the serial port.

Does this help?

http://cygwin.com/cygwin-ug-net/using-specialnames.html#AEN806

Don't use a DOS device if you want POSIX behavior.

-- 
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained pilot...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: com1 access denied - win xp
  2004-05-20 18:27 ` Dave Korn
@ 2004-05-24 20:30   ` Michael Wood
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Wood @ 2004-05-24 20:30 UTC (permalink / raw)
  To: cygwin

Thanks for your speedy replies (and I apologize for not getting back to 
you until now).

I have determined simply from trying various combinations of things, 
that "COM1" is a name that is created within cygwin when a device is 
connected to the serial port and powered-on. The name "/dev/com1" always 
exists, and appears to be synonymous with "/dev/ttyS0", however neither 
can be used in place of "COM1" in the Cygwin shell to refer to the 
serial port. Both of these names also always return the correct 
"crw-rw-rw-" permissions for a "ls -l", where as a "ls -l COM1" results 
in "-rw-r--r--" when a device is plugged into the serial port and 
powered-on, otherwise the call simply hangs.

In the end, the important part is that the permissions above likely had 
nothing to do with my "Access Denied" error. This was caused by my Linux 
VMWare session running at the same time as my Cygwin shell. If I let the 
Linux VMWare session boot first and grab the serial port, then Cygwin 
couldn't see it (apparently) and vice versa. As soon as I shutdown the 
VMWare session, I could then gain access to the serial port using "COM1" 
through the Cygwin shell.

Thanks again for your replies guys.

- Mike

Dave Korn wrote:
>>-----Original Message-----
>>From: cygwin-owner On Behalf Of Michael Wood
>>Sent: 20 May 2004 17:23
> 
> 
>>Hi-ya,
>>
>>I get an "Access is denied" error message when attempting to create a 
>>serial port connection through Cygwin, running on Win XP.
>>
>>In cygwin, when I execute:
>>	ls -l COM1
>>
>>I get the following:
>>	-rw-r--r--    1 mwood    mkgroup-        0 Jan  1  1970 COM1
>>
>>However, when I execute:
>>	chmod a+rw COM1
>>
>>the command exits normally (no error message), but the permissions on 
>>COM1 stay the same. Furthermore, I do not particularly 
>>understand why if 
>>I am the owner of COM1 (as illustrated by the 'ls -l'), why I 
>>would get 
>>a permission error.
>>
>>I have successfully created and used a connection on the 
>>serial port on 
>>the same machine through a VMWare session running a Linux Red 
>>Hat image. 
>>I used a very similar procedure above, in that I simply changed the 
>>permissions on "/dev/ttyS0" to grant all users read and write 
>>permissions to the serial port.
>>
>>Help would be greatly appreciated.
>>
>>- Mike
> 
> 
> 
> #1.  Why not use /dev/ttyS0 again?  Cygwin is a posix compatible layer and
> /dev/ttyS0 should work pretty much the same.  BTW, which directory are you
> in when you do those commands on COM1?  Did you "cd /dev" or do you expect
> it to just work anywhere, and if so, why?

> 
> #2.  'doze has some pretty funny ideas about files having the same name as
> dos-devices (COMx:, PRN:, LPTx: etc).  It doesn't like it at all.
> Presumably somewhere between cygwin and 'doze a bit of confusion is creeping
> in.
> 
> #3.  I notice that if you're in /dev and you do "ls -la com1", you get the
> right answer.  But remember, under Posix, capitalisation matters, so "com1"
> and "COM1" are two different files.  Under 'doze, unfortunately, it doesn't.
> So probably Cygwin knows that /dev/com1 is the serial port, thinks that
> /dev/COM1 is something different because the case doesn't match, assumes
> it's an ordinary file and passes the name through to the underlying 'doze
> file-handling calls, which disagree with cygwin and think that it IS a
> serial port, and then everybody gets confused.
> 
> #4.  When I do "ls -la COM1", I just get:
> 
> dk@mace /> ls -la COM1
> ----------    0 ???????? ????????        0 Jan  1  1970 COM1
> 
> no matter what directory I'm in.  Bizarre.  When I'm do "ls -la /dev/com1",
> I get the proper answer:
> 
> dk@mace /> ls -la /dev/com1
> crw-rw-rw-    1 dk       Domain U 117,   1 May 20 19:05 /dev/com1
> 
> but capitalizing it never works, not even in the /dev directory.
> 
> dk@mace /> ls -la /dev/COM1
> ----------    0 ???????? ????????        0 Jan  1  1970 /dev/COM1
> 
> #5.  Anyway, the answer to your problem is that you were using the wrong
> filename.  The solution is to use the correct filename; either /dev/com1 or
> /dev/ttyS0.  And as to why there's a messed up COM1 in there, that's a
> little bugette you've stumbled across.
> 
>     cheers, 
>       DaveK



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-05-24 16:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-20 16:49 com1 access denied - win xp Michael Wood
2004-05-20 17:45 ` Igor Pechtchanski
2004-05-21  0:10   ` Igor Pechtchanski
2004-05-20 18:27 ` Dave Korn
2004-05-24 20:30   ` Michael Wood
2004-05-20 20:44 ` Brian Ford
2004-05-21  1:30   ` Brian Ford

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