public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Why /usr/bin/*.dll must be executable?
@ 2012-04-20 13:03 De-Jian Zhao
  2012-04-20 13:05 ` De-Jian Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 13:03 UTC (permalink / raw)
  To: CygwinList

Hi,

When I type "cyg" and Tab, many executables starting with "cyg" are 
listed (Display all 262 possibilities? (y or n) y). I find that many of 
them are *.dll libraries under /usr/bin/. This is inconvenient to find 
the real executable applications (*.exe). Since *.dll files are only 
libraries, they are not necessary to have the attribute of "x". Thus, I 
run the command "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is 
corrupted. I closed the terminal and failed to restart Cygwin. I started 
my  older version of Cygwin (I did not deleted it after installing a new 
version), and added "x" to the previous *.dll files. The dead Cygwin 
revived.

I am confused why /usr/bin/*.dll should be executable. I thought they 
were only library files. When I tried to run a dll file, bash says 
"cannot execute binary file". Are there some hidden stories?

The error messages are as follows:

Administrator@acer /usr/bin
$ chmod a-x *.dll

Administrator@acer /usr/bin
$ lh
      18 [main] -bash 4512 fork: child -1 - forked process died 
unexpectedly, retry 0, exit code -1073741790, errno 11
-bash: fork: retry: Resource temporarily unavailable
2020930 [main] -bash 4512 fork: child -1 - forked process died 
unexpectedly, retry 0, exit code -1073741790, errno 11
-bash: fork: retry: Resource temporarily unavailable
4039235 [main] -bash 4512 fork: child -1 - forked process died 
unexpectedly, retry 0, exit code -1073741790, errno 11
-bash: fork: retry: Resource temporarily unavailable
8057832 [main] -bash 4512 fork: child -1 - forked process died 
unexpectedly, retry 0, exit code -1073741790, errno 11
-bash: fork: retry: Resource temporarily unavailable
16074662 [main] -bash 4512 fork: child -1 - forked process died 
unexpectedly, retry 0, exit code -1073741790, errno 11
-bash: fork: Resource temporarily unavailable


DJ

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 13:03 Why /usr/bin/*.dll must be executable? De-Jian Zhao
@ 2012-04-20 13:05 ` De-Jian Zhao
  2012-04-20 13:08 ` Václav Zeman
  2012-04-20 19:06 ` Jon TURNEY
  2 siblings, 0 replies; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 13:05 UTC (permalink / raw)
  To: CygwinList

On 2012-4-20 21:02, De-Jian Zhao wrote:
> Hi,
>
> When I type "cyg" and Tab, many executables starting with "cyg" are 
> listed (Display all 262 possibilities? (y or n) y). I find that many 
> of them are *.dll libraries under /usr/bin/. This is inconvenient to 
> find the real executable applications (*.exe). Since *.dll files are 
> only libraries, they are not necessary to have the attribute of "x". 
> Thus, I run the command "chmod a-x /usr/bin/*.dll". Unexpectedly, 
> cygwin is corrupted. I closed the terminal and failed to restart 
> Cygwin. I started my  older version of Cygwin (I did not deleted it 
> after installing a new version), and added "x" to the previous *.dll 
> files. The dead Cygwin revived.
>
> I am confused why /usr/bin/*.dll should be executable. I thought they 
> were only library files. When I tried to run a dll file, bash says 
> "cannot execute binary file". Are there some hidden stories?
>
> The error messages are as follows:
>
> Administrator@acer /usr/bin
> $ chmod a-x *.dll
>
> Administrator@acer /usr/bin
> $ lh
>      18 [main] -bash 4512 fork: child -1 - forked process died 
> unexpectedly, retry 0, exit code -1073741790, errno 11
> -bash: fork: retry: Resource temporarily unavailable
> 2020930 [main] -bash 4512 fork: child -1 - forked process died 
> unexpectedly, retry 0, exit code -1073741790, errno 11
> -bash: fork: retry: Resource temporarily unavailable
> 4039235 [main] -bash 4512 fork: child -1 - forked process died 
> unexpectedly, retry 0, exit code -1073741790, errno 11
> -bash: fork: retry: Resource temporarily unavailable
> 8057832 [main] -bash 4512 fork: child -1 - forked process died 
> unexpectedly, retry 0, exit code -1073741790, errno 11
> -bash: fork: retry: Resource temporarily unavailable
> 16074662 [main] -bash 4512 fork: child -1 - forked process died 
> unexpectedly, retry 0, exit code -1073741790, errno 11
> -bash: fork: Resource temporarily unavailable
>
>
> DJ
>

lh is an alias to 'ls -lh'.

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 13:03 Why /usr/bin/*.dll must be executable? De-Jian Zhao
  2012-04-20 13:05 ` De-Jian Zhao
@ 2012-04-20 13:08 ` Václav Zeman
  2012-04-20 16:18   ` De-Jian Zhao
  2012-04-23 19:01   ` Warren Young
  2012-04-20 19:06 ` Jon TURNEY
  2 siblings, 2 replies; 29+ messages in thread
From: Václav Zeman @ 2012-04-20 13:08 UTC (permalink / raw)
  To: cygwin

On 20 April 2012 15:02, De-Jian Zhao wrote:
> Hi,
>
> When I type "cyg" and Tab, many executables starting with "cyg" are listed
> (Display all 262 possibilities? (y or n) y). I find that many of them are
> *.dll libraries under /usr/bin/. This is inconvenient to find the real
> executable applications (*.exe). Since *.dll files are only libraries, they
> are not necessary to have the attribute of "x". Thus, I run the command
> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed the
> terminal and failed to restart Cygwin. I started my  older version of Cygwin
> (I did not deleted it after installing a new version), and added "x" to the
> previous *.dll files. The dead Cygwin revived.
>
> I am confused why /usr/bin/*.dll should be executable. I thought they were
> only library files. When I tried to run a dll file, bash says "cannot
> execute binary file". Are there some hidden stories?
DLLs are executables thus they need the +x bit. This is a Windows thing.

>[...]

-- 
VZ

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 13:08 ` Václav Zeman
@ 2012-04-20 16:18   ` De-Jian Zhao
  2012-04-20 16:28     ` Corinna Vinschen
  2012-04-23 19:01   ` Warren Young
  1 sibling, 1 reply; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 16:18 UTC (permalink / raw)
  To: cygwin; +Cc: vhaisman

On 2012-4-20 21:07, Václav Zeman wrote:
> On 20 April 2012 15:02, De-Jian Zhao wrote:
>> Hi,
>>
>> When I type "cyg" and Tab, many executables starting with "cyg" are listed
>> (Display all 262 possibilities? (y or n) y). I find that many of them are
>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>> executable applications (*.exe). Since *.dll files are only libraries, they
>> are not necessary to have the attribute of "x". Thus, I run the command
>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed the
>> terminal and failed to restart Cygwin. I started my  older version of Cygwin
>> (I did not deleted it after installing a new version), and added "x" to the
>> previous *.dll files. The dead Cygwin revived.
>>
>> I am confused why /usr/bin/*.dll should be executable. I thought they were
>> only library files. When I tried to run a dll file, bash says "cannot
>> execute binary file". Are there some hidden stories?
> DLLs are executables thus they need the +x bit. This is a Windows thing.
>

If this is a windows thing, removing the x bit should not affect Cygwin. 
Instead, Cygwin is corrupted after removing the x bit.

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 16:18   ` De-Jian Zhao
@ 2012-04-20 16:28     ` Corinna Vinschen
  2012-04-20 17:25       ` Nellis, Kenneth
  2012-04-20 17:32       ` De-Jian Zhao
  0 siblings, 2 replies; 29+ messages in thread
From: Corinna Vinschen @ 2012-04-20 16:28 UTC (permalink / raw)
  To: cygwin

On Apr 21 00:17, De-Jian Zhao wrote:
> On 2012-4-20 21:07, Václav Zeman wrote:
> >On 20 April 2012 15:02, De-Jian Zhao wrote:
> >>Hi,
> >>
> >>When I type "cyg" and Tab, many executables starting with "cyg" are listed
> >>(Display all 262 possibilities? (y or n) y). I find that many of them are
> >>*.dll libraries under /usr/bin/. This is inconvenient to find the real
> >>executable applications (*.exe). Since *.dll files are only libraries, they
> >>are not necessary to have the attribute of "x". Thus, I run the command
> >>"chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed the
> >>terminal and failed to restart Cygwin. I started my  older version of Cygwin
> >>(I did not deleted it after installing a new version), and added "x" to the
> >>previous *.dll files. The dead Cygwin revived.
> >>
> >>I am confused why /usr/bin/*.dll should be executable. I thought they were
> >>only library files. When I tried to run a dll file, bash says "cannot
> >>execute binary file". Are there some hidden stories?
> >DLLs are executables thus they need the +x bit. This is a Windows thing.
> >
> 
> If this is a windows thing, removing the x bit should not affect
> Cygwin. Instead, Cygwin is corrupted after removing the x bit.

Windows requires the x bit for DLLs to be loadable as executable code
into the address space of a process.  As Václav wrote, it's a Windows
thing.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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

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

* RE: Why /usr/bin/*.dll must be executable?
  2012-04-20 16:28     ` Corinna Vinschen
@ 2012-04-20 17:25       ` Nellis, Kenneth
  2012-04-20 17:29         ` Larry Hall (Cygwin)
  2012-04-20 17:32       ` De-Jian Zhao
  1 sibling, 1 reply; 29+ messages in thread
From: Nellis, Kenneth @ 2012-04-20 17:25 UTC (permalink / raw)
  To: cygwin

From: Corinna Vinschen
> Windows requires the x bit for DLLs to be loadable as executable code
> into the address space of a process.  As Václav wrote, it's a Windows
> thing.

So, I had to play with "chmod -x cyg*.dll" and, of course, it 
totally hosed Cygwin. I recovered by reinstalling from scratch 
only after realizing that ATTRIB did not have an option to re-
establish X--we're talking XP here.  So, as this is a Windows 
thing, wondering how, through Windows, I could restore execute 
access to the DLLs.

--Ken Nellis

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:25       ` Nellis, Kenneth
@ 2012-04-20 17:29         ` Larry Hall (Cygwin)
  2012-04-20 17:37           ` De-Jian Zhao
  2012-04-20 17:40           ` Nellis, Kenneth
  0 siblings, 2 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 17:29 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:25 PM, Nellis, Kenneth wrote:
> From: Corinna Vinschen
>> Windows requires the x bit for DLLs to be loadable as executable code
>> into the address space of a process.  As Václav wrote, it's a Windows
>> thing.
>
> So, I had to play with "chmod -x cyg*.dll" and, of course, it
> totally hosed Cygwin. I recovered by reinstalling from scratch
> only after realizing that ATTRIB did not have an option to re-
> establish X--we're talking XP here.  So, as this is a Windows
> thing, wondering how, through Windows, I could restore execute
> access to the DLLs.

What's wrong with "chmod +x cyg*.dll"?


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 16:28     ` Corinna Vinschen
  2012-04-20 17:25       ` Nellis, Kenneth
@ 2012-04-20 17:32       ` De-Jian Zhao
  2012-04-20 17:41         ` Larry Hall (Cygwin)
  1 sibling, 1 reply; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 17:32 UTC (permalink / raw)
  To: cygwin

On 2012-4-21 0:27, Corinna Vinschen wrote:
> On Apr 21 00:17, De-Jian Zhao wrote:
>> On 2012-4-20 21:07, Václav Zeman wrote:
>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>> Hi,
>>>>
>>>> When I type "cyg" and Tab, many executables starting with "cyg" are listed
>>>> (Display all 262 possibilities? (y or n) y). I find that many of them are
>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>>>> executable applications (*.exe). Since *.dll files are only libraries, they
>>>> are not necessary to have the attribute of "x". Thus, I run the command
>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed the
>>>> terminal and failed to restart Cygwin. I started my  older version of Cygwin
>>>> (I did not deleted it after installing a new version), and added "x" to the
>>>> previous *.dll files. The dead Cygwin revived.
>>>>
>>>> I am confused why /usr/bin/*.dll should be executable. I thought they were
>>>> only library files. When I tried to run a dll file, bash says "cannot
>>>> execute binary file". Are there some hidden stories?
>>> DLLs are executables thus they need the +x bit. This is a Windows thing.
>>>
>> If this is a windows thing, removing the x bit should not affect
>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
> Windows requires the x bit for DLLs to be loadable as executable code
> into the address space of a process.  As Václav wrote, it's a Windows
> thing.

Can Windows see the rwx bits assigned by Cygwin to the files? I tried 
removing the x bit of an executable file blastall.exe (chmod a-x 
blastall.exe); the file can not be executed under Cygwin, but still can 
be executed under cmd console of Windows. It seems that Windows does not 
honor the rwx bits assigned by Cygwin.

Is there a detailed description of the starting process of Cygwin 
system? Or, how does Cygwin interact with *.dll files?

After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and 
perl could not be started any more. This could be cured by ran "chmod 
a+x /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary 
executables will communicate with their corresponding *.dll files when 
executed. The *.dll provide the required functions and subroutines and 
that's enough. There is no need to mark *.dll with an x bit.

I have no strong background of computer science. Maybe there is some 
basic knowledge beyond my imagination. Hope you can help disclose it to 
me. Thanks.


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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:29         ` Larry Hall (Cygwin)
@ 2012-04-20 17:37           ` De-Jian Zhao
  2012-04-20 17:46             ` Larry Hall (Cygwin)
  2012-04-20 17:40           ` Nellis, Kenneth
  1 sibling, 1 reply; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 17:37 UTC (permalink / raw)
  To: cygwin

On 2012-4-21 1:29, Larry Hall (Cygwin) wrote:
> On 4/20/2012 1:25 PM, Nellis, Kenneth wrote:
>> From: Corinna Vinschen
>>> Windows requires the x bit for DLLs to be loadable as executable code
>>> into the address space of a process.  As Václav wrote, it's a Windows
>>> thing.
>>
>> So, I had to play with "chmod -x cyg*.dll" and, of course, it
>> totally hosed Cygwin. I recovered by reinstalling from scratch
>> only after realizing that ATTRIB did not have an option to re-
>> establish X--we're talking XP here.  So, as this is a Windows
>> thing, wondering how, through Windows, I could restore execute
>> access to the DLLs.
>
> What's wrong with "chmod +x cyg*.dll"?
>

It doesn't work any more. You cannot restart a new terminal, either. You 
will be trapped here.


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

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

* RE: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:29         ` Larry Hall (Cygwin)
  2012-04-20 17:37           ` De-Jian Zhao
@ 2012-04-20 17:40           ` Nellis, Kenneth
  1 sibling, 0 replies; 29+ messages in thread
From: Nellis, Kenneth @ 2012-04-20 17:40 UTC (permalink / raw)
  To: cygwin

From: Larry Hall (Cygwin)
> What's wrong with "chmod +x cyg*.dll"?

As I said, Cygwin was hosed, so I couldn't enter
that command. 

--Ken Nellis

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:32       ` De-Jian Zhao
@ 2012-04-20 17:41         ` Larry Hall (Cygwin)
  2012-04-20 17:47           ` De-Jian Zhao
  0 siblings, 1 reply; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 17:41 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:32 PM, De-Jian Zhao wrote:
> On 2012-4-21 0:27, Corinna Vinschen wrote:
>> On Apr 21 00:17, De-Jian Zhao wrote:
>>> On 2012-4-20 21:07, Václav Zeman wrote:
>>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>>> Hi,
>>>>>
>>>>> When I type "cyg" and Tab, many executables starting with "cyg" are listed
>>>>> (Display all 262 possibilities? (y or n) y). I find that many of them are
>>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>>>>> executable applications (*.exe). Since *.dll files are only libraries,
>>>>> they
>>>>> are not necessary to have the attribute of "x". Thus, I run the command
>>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed
>>>>> the
>>>>> terminal and failed to restart Cygwin. I started my older version of
>>>>> Cygwin
>>>>> (I did not deleted it after installing a new version), and added "x" to
>>>>> the
>>>>> previous *.dll files. The dead Cygwin revived.
>>>>>
>>>>> I am confused why /usr/bin/*.dll should be executable. I thought they were
>>>>> only library files. When I tried to run a dll file, bash says "cannot
>>>>> execute binary file". Are there some hidden stories?
>>>> DLLs are executables thus they need the +x bit. This is a Windows thing.
>>>>
>>> If this is a windows thing, removing the x bit should not affect
>>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
>> Windows requires the x bit for DLLs to be loadable as executable code
>> into the address space of a process. As Václav wrote, it's a Windows
>> thing.
>
> Can Windows see the rwx bits assigned by Cygwin to the files? I tried
> removing the x bit of an executable file blastall.exe (chmod a-x
> blastall.exe); the file can not be executed under Cygwin, but still can be
> executed under cmd console of Windows. It seems that Windows does not honor
> the rwx bits assigned by Cygwin.
>
> Is there a detailed description of the starting process of Cygwin system?
> Or, how does Cygwin interact with *.dll files?
>
> After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and perl
> could not be started any more. This could be cured by ran "chmod a+x
> /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary executables
> will communicate with their corresponding *.dll files when executed. The
> *.dll provide the required functions and subroutines and that's enough.
> There is no need to mark *.dll with an x bit.
>
> I have no strong background of computer science. Maybe there is some basic
> knowledge beyond my imagination. Hope you can help disclose it to me. Thanks.

Cygwin DLLs are no different than native Windows DLLs when it comes to
loading them.  The Windows loader is responsible for loading them.  So
we're stuck with whatever restrictions the Windows loader imposes on
Windows apps.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:37           ` De-Jian Zhao
@ 2012-04-20 17:46             ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 17:46 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:37 PM, De-Jian Zhao wrote:
> On 2012-4-21 1:29, Larry Hall (Cygwin) wrote:
>> On 4/20/2012 1:25 PM, Nellis, Kenneth wrote:
>>> From: Corinna Vinschen
>>>> Windows requires the x bit for DLLs to be loadable as executable code
>>>> into the address space of a process. As Václav wrote, it's a Windows
>>>> thing.
>>>
>>> So, I had to play with "chmod -x cyg*.dll" and, of course, it
>>> totally hosed Cygwin. I recovered by reinstalling from scratch
>>> only after realizing that ATTRIB did not have an option to re-
>>> establish X--we're talking XP here. So, as this is a Windows
>>> thing, wondering how, through Windows, I could restore execute
>>> access to the DLLs.
>>
>> What's wrong with "chmod +x cyg*.dll"?
>>
>
> It doesn't work any more. You cannot restart a new terminal, either. You
> will be trapped here.

Ah, I didn't realize that Ken did this in /bin.  You could use cacls in
this case as an alternative to reinstalling.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:41         ` Larry Hall (Cygwin)
@ 2012-04-20 17:47           ` De-Jian Zhao
  2012-04-20 17:58             ` Larry Hall (Cygwin)
  2012-04-20 18:05             ` Larry Hall (Cygwin)
  0 siblings, 2 replies; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 17:47 UTC (permalink / raw)
  To: cygwin

On 2012-4-21 1:40, Larry Hall (Cygwin) wrote:
> On 4/20/2012 1:32 PM, De-Jian Zhao wrote:
>> On 2012-4-21 0:27, Corinna Vinschen wrote:
>>> On Apr 21 00:17, De-Jian Zhao wrote:
>>>> On 2012-4-20 21:07, Václav Zeman wrote:
>>>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>>>> Hi,
>>>>>>
>>>>>> When I type "cyg" and Tab, many executables starting with "cyg" 
>>>>>> are listed
>>>>>> (Display all 262 possibilities? (y or n) y). I find that many of 
>>>>>> them are
>>>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the 
>>>>>> real
>>>>>> executable applications (*.exe). Since *.dll files are only 
>>>>>> libraries,
>>>>>> they
>>>>>> are not necessary to have the attribute of "x". Thus, I run the 
>>>>>> command
>>>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I 
>>>>>> closed
>>>>>> the
>>>>>> terminal and failed to restart Cygwin. I started my older version of
>>>>>> Cygwin
>>>>>> (I did not deleted it after installing a new version), and added 
>>>>>> "x" to
>>>>>> the
>>>>>> previous *.dll files. The dead Cygwin revived.
>>>>>>
>>>>>> I am confused why /usr/bin/*.dll should be executable. I thought 
>>>>>> they were
>>>>>> only library files. When I tried to run a dll file, bash says 
>>>>>> "cannot
>>>>>> execute binary file". Are there some hidden stories?
>>>>> DLLs are executables thus they need the +x bit. This is a Windows 
>>>>> thing.
>>>>>
>>>> If this is a windows thing, removing the x bit should not affect
>>>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
>>> Windows requires the x bit for DLLs to be loadable as executable code
>>> into the address space of a process. As Václav wrote, it's a Windows
>>> thing.
>>
>> Can Windows see the rwx bits assigned by Cygwin to the files? I tried
>> removing the x bit of an executable file blastall.exe (chmod a-x
>> blastall.exe); the file can not be executed under Cygwin, but still 
>> can be
>> executed under cmd console of Windows. It seems that Windows does not 
>> honor
>> the rwx bits assigned by Cygwin.
>>
>> Is there a detailed description of the starting process of Cygwin 
>> system?
>> Or, how does Cygwin interact with *.dll files?
>>
>> After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and 
>> perl
>> could not be started any more. This could be cured by ran "chmod a+x
>> /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary 
>> executables
>> will communicate with their corresponding *.dll files when executed. The
>> *.dll provide the required functions and subroutines and that's enough.
>> There is no need to mark *.dll with an x bit.
>>
>> I have no strong background of computer science. Maybe there is some 
>> basic
>> knowledge beyond my imagination. Hope you can help disclose it to me. 
>> Thanks.
>
> Cygwin DLLs are no different than native Windows DLLs when it comes to
> loading them.  The Windows loader is responsible for loading them.  So
> we're stuck with whatever restrictions the Windows loader imposes on
> Windows apps.
>

Yes. But does Windows loader can see the x bit assigned by Cygwin, a 
quite different OS?

At least, *.exe does not respect or even is blind to the -x operation of 
Cygwin, as abovementioned.


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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:47           ` De-Jian Zhao
@ 2012-04-20 17:58             ` Larry Hall (Cygwin)
  2012-04-20 18:21               ` De-Jian Zhao
  2012-04-20 18:05             ` Larry Hall (Cygwin)
  1 sibling, 1 reply; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 17:58 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:47 PM, De-Jian Zhao wrote:
> On 2012-4-21 1:40, Larry Hall (Cygwin) wrote:
>> On 4/20/2012 1:32 PM, De-Jian Zhao wrote:
>>> On 2012-4-21 0:27, Corinna Vinschen wrote:
>>>> On Apr 21 00:17, De-Jian Zhao wrote:
>>>>> On 2012-4-20 21:07, Václav Zeman wrote:
>>>>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> When I type "cyg" and Tab, many executables starting with "cyg" are
>>>>>>> listed
>>>>>>> (Display all 262 possibilities? (y or n) y). I find that many of them
>>>>>>> are
>>>>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>>>>>>> executable applications (*.exe). Since *.dll files are only libraries,
>>>>>>> they
>>>>>>> are not necessary to have the attribute of "x". Thus, I run the command
>>>>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I closed
>>>>>>> the
>>>>>>> terminal and failed to restart Cygwin. I started my older version of
>>>>>>> Cygwin
>>>>>>> (I did not deleted it after installing a new version), and added "x" to
>>>>>>> the
>>>>>>> previous *.dll files. The dead Cygwin revived.
>>>>>>>
>>>>>>> I am confused why /usr/bin/*.dll should be executable. I thought they
>>>>>>> were
>>>>>>> only library files. When I tried to run a dll file, bash says "cannot
>>>>>>> execute binary file". Are there some hidden stories?
>>>>>> DLLs are executables thus they need the +x bit. This is a Windows thing.
>>>>>>
>>>>> If this is a windows thing, removing the x bit should not affect
>>>>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
>>>> Windows requires the x bit for DLLs to be loadable as executable code
>>>> into the address space of a process. As Václav wrote, it's a Windows
>>>> thing.
>>>
>>> Can Windows see the rwx bits assigned by Cygwin to the files? I tried
>>> removing the x bit of an executable file blastall.exe (chmod a-x
>>> blastall.exe); the file can not be executed under Cygwin, but still can be
>>> executed under cmd console of Windows. It seems that Windows does not honor
>>> the rwx bits assigned by Cygwin.
>>>
>>> Is there a detailed description of the starting process of Cygwin system?
>>> Or, how does Cygwin interact with *.dll files?
>>>
>>> After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and perl
>>> could not be started any more. This could be cured by ran "chmod a+x
>>> /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary executables
>>> will communicate with their corresponding *.dll files when executed. The
>>> *.dll provide the required functions and subroutines and that's enough.
>>> There is no need to mark *.dll with an x bit.
>>>
>>> I have no strong background of computer science. Maybe there is some basic
>>> knowledge beyond my imagination. Hope you can help disclose it to me.
>>> Thanks.
>>
>> Cygwin DLLs are no different than native Windows DLLs when it comes to
>> loading them. The Windows loader is responsible for loading them. So
>> we're stuck with whatever restrictions the Windows loader imposes on
>> Windows apps.
>>
>
> Yes. But does Windows loader can see the x bit assigned by Cygwin, a quite
> different OS?

Cygwin is not an O/S.  The basis for Cygwin is the emulation _DLL_, 
cygwin1.dll.  Cygwin executables and DLLs are Windows binaries, subject
to whatever limitations the Windows loader has.  That's it.  If you're
not happy about that, you should complain to MS about it.


-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:47           ` De-Jian Zhao
  2012-04-20 17:58             ` Larry Hall (Cygwin)
@ 2012-04-20 18:05             ` Larry Hall (Cygwin)
  1 sibling, 0 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 18:05 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:47 PM, De-Jian Zhao wrote:

<snip>

Oh and...

> At least, *.exe does not respect or even is blind to the -x operation of
> Cygwin, as abovementioned.

Cygwin creates its Windows ACLs to support POSIX permisssions.  See the
Cygwin Users Guide for more: <http://cygwin.com/cygwin-ug-net/ntsec.html>.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 17:58             ` Larry Hall (Cygwin)
@ 2012-04-20 18:21               ` De-Jian Zhao
  2012-04-20 18:43                 ` Larry Hall (Cygwin)
  2012-04-20 22:10                 ` Mike Kaganski
  0 siblings, 2 replies; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-20 18:21 UTC (permalink / raw)
  To: cygwin

On 2012-4-21 1:57, Larry Hall (Cygwin) wrote:
> On 4/20/2012 1:47 PM, De-Jian Zhao wrote:
>> On 2012-4-21 1:40, Larry Hall (Cygwin) wrote:
>>> On 4/20/2012 1:32 PM, De-Jian Zhao wrote:
>>>> On 2012-4-21 0:27, Corinna Vinschen wrote:
>>>>> On Apr 21 00:17, De-Jian Zhao wrote:
>>>>>> On 2012-4-20 21:07, Václav Zeman wrote:
>>>>>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> When I type "cyg" and Tab, many executables starting with "cyg" 
>>>>>>>> are
>>>>>>>> listed
>>>>>>>> (Display all 262 possibilities? (y or n) y). I find that many 
>>>>>>>> of them
>>>>>>>> are
>>>>>>>> *.dll libraries under /usr/bin/. This is inconvenient to find 
>>>>>>>> the real
>>>>>>>> executable applications (*.exe). Since *.dll files are only 
>>>>>>>> libraries,
>>>>>>>> they
>>>>>>>> are not necessary to have the attribute of "x". Thus, I run the 
>>>>>>>> command
>>>>>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. 
>>>>>>>> I closed
>>>>>>>> the
>>>>>>>> terminal and failed to restart Cygwin. I started my older 
>>>>>>>> version of
>>>>>>>> Cygwin
>>>>>>>> (I did not deleted it after installing a new version), and 
>>>>>>>> added "x" to
>>>>>>>> the
>>>>>>>> previous *.dll files. The dead Cygwin revived.
>>>>>>>>
>>>>>>>> I am confused why /usr/bin/*.dll should be executable. I 
>>>>>>>> thought they
>>>>>>>> were
>>>>>>>> only library files. When I tried to run a dll file, bash says 
>>>>>>>> "cannot
>>>>>>>> execute binary file". Are there some hidden stories?
>>>>>>> DLLs are executables thus they need the +x bit. This is a 
>>>>>>> Windows thing.
>>>>>>>
>>>>>> If this is a windows thing, removing the x bit should not affect
>>>>>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
>>>>> Windows requires the x bit for DLLs to be loadable as executable code
>>>>> into the address space of a process. As Václav wrote, it's a Windows
>>>>> thing.
>>>>
>>>> Can Windows see the rwx bits assigned by Cygwin to the files? I tried
>>>> removing the x bit of an executable file blastall.exe (chmod a-x
>>>> blastall.exe); the file can not be executed under Cygwin, but still 
>>>> can be
>>>> executed under cmd console of Windows. It seems that Windows does 
>>>> not honor
>>>> the rwx bits assigned by Cygwin.
>>>>
>>>> Is there a detailed description of the starting process of Cygwin 
>>>> system?
>>>> Or, how does Cygwin interact with *.dll files?
>>>>
>>>> After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" 
>>>> and perl
>>>> could not be started any more. This could be cured by ran "chmod a+x
>>>> /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary 
>>>> executables
>>>> will communicate with their corresponding *.dll files when 
>>>> executed. The
>>>> *.dll provide the required functions and subroutines and that's 
>>>> enough.
>>>> There is no need to mark *.dll with an x bit.
>>>>
>>>> I have no strong background of computer science. Maybe there is 
>>>> some basic
>>>> knowledge beyond my imagination. Hope you can help disclose it to me.
>>>> Thanks.
>>>
>>> Cygwin DLLs are no different than native Windows DLLs when it comes to
>>> loading them. The Windows loader is responsible for loading them. So
>>> we're stuck with whatever restrictions the Windows loader imposes on
>>> Windows apps.
>>>
>>
>> Yes. But does Windows loader can see the x bit assigned by Cygwin, a 
>> quite
>> different OS?
>
> Cygwin is not an O/S.  The basis for Cygwin is the emulation _DLL_, 
> cygwin1.dll.  Cygwin executables and DLLs are Windows binaries, 
> subject to whatever limitations the Windows loader has.  That's it.  
> If you're not happy about that, you should complain to MS about it.
>
Then, what limitations does the Windows loader have?
As far as I know, there is no x bits for windows, right? How does the 
"chmod a-x" affect the file behavior under Windows if this is a Windows 
thing? I am completely confused. When I ran "chmod a-x *.dll", I assumed 
that these dll files were not executed directly under Cygwin or Windows; 
they were just some files storing the required functions or something; 
removing the x bits should not affect the behavior of Cygwin and 
Windows. If have run "chmod a-x" on the Windows system dll files, that 
will lead to the corruption of Windows, right? Thank God. I didn't do that.



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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 18:21               ` De-Jian Zhao
@ 2012-04-20 18:43                 ` Larry Hall (Cygwin)
  2012-04-20 22:10                 ` Mike Kaganski
  1 sibling, 0 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-20 18:43 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 2:21 PM, De-Jian Zhao wrote:
> On 2012-4-21 1:57, Larry Hall (Cygwin) wrote:
>> On 4/20/2012 1:47 PM, De-Jian Zhao wrote:
>>> On 2012-4-21 1:40, Larry Hall (Cygwin) wrote:
>>>> On 4/20/2012 1:32 PM, De-Jian Zhao wrote:
>>>>> On 2012-4-21 0:27, Corinna Vinschen wrote:
>>>>>> On Apr 21 00:17, De-Jian Zhao wrote:
>>>>>>> On 2012-4-20 21:07, Václav Zeman wrote:
>>>>>>>> On 20 April 2012 15:02, De-Jian Zhao wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> When I type "cyg" and Tab, many executables starting with "cyg" are
>>>>>>>>> listed
>>>>>>>>> (Display all 262 possibilities? (y or n) y). I find that many of them
>>>>>>>>> are
>>>>>>>>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>>>>>>>>> executable applications (*.exe). Since *.dll files are only libraries,
>>>>>>>>> they
>>>>>>>>> are not necessary to have the attribute of "x". Thus, I run the
>>>>>>>>> command
>>>>>>>>> "chmod a-x /usr/bin/*.dll". Unexpectedly, cygwin is corrupted. I
>>>>>>>>> closed
>>>>>>>>> the
>>>>>>>>> terminal and failed to restart Cygwin. I started my older version of
>>>>>>>>> Cygwin
>>>>>>>>> (I did not deleted it after installing a new version), and added
>>>>>>>>> "x" to
>>>>>>>>> the
>>>>>>>>> previous *.dll files. The dead Cygwin revived.
>>>>>>>>>
>>>>>>>>> I am confused why /usr/bin/*.dll should be executable. I thought they
>>>>>>>>> were
>>>>>>>>> only library files. When I tried to run a dll file, bash says "cannot
>>>>>>>>> execute binary file". Are there some hidden stories?
>>>>>>>> DLLs are executables thus they need the +x bit. This is a Windows
>>>>>>>> thing.
>>>>>>>>
>>>>>>> If this is a windows thing, removing the x bit should not affect
>>>>>>> Cygwin. Instead, Cygwin is corrupted after removing the x bit.
>>>>>> Windows requires the x bit for DLLs to be loadable as executable code
>>>>>> into the address space of a process. As Václav wrote, it's a Windows
>>>>>> thing.
>>>>>
>>>>> Can Windows see the rwx bits assigned by Cygwin to the files? I tried
>>>>> removing the x bit of an executable file blastall.exe (chmod a-x
>>>>> blastall.exe); the file can not be executed under Cygwin, but still can be
>>>>> executed under cmd console of Windows. It seems that Windows does not
>>>>> honor
>>>>> the rwx bits assigned by Cygwin.
>>>>>
>>>>> Is there a detailed description of the starting process of Cygwin system?
>>>>> Or, how does Cygwin interact with *.dll files?
>>>>>
>>>>> After starting Cygwin, I ran "chmod a-x /usr/bin/cygperl5_10.dll" and perl
>>>>> could not be started any more. This could be cured by ran "chmod a+x
>>>>> /usr/bin/cygperl5_10.dll". It seems to me that the Cygwin binary
>>>>> executables
>>>>> will communicate with their corresponding *.dll files when executed. The
>>>>> *.dll provide the required functions and subroutines and that's enough.
>>>>> There is no need to mark *.dll with an x bit.
>>>>>
>>>>> I have no strong background of computer science. Maybe there is some basic
>>>>> knowledge beyond my imagination. Hope you can help disclose it to me.
>>>>> Thanks.
>>>>
>>>> Cygwin DLLs are no different than native Windows DLLs when it comes to
>>>> loading them. The Windows loader is responsible for loading them. So
>>>> we're stuck with whatever restrictions the Windows loader imposes on
>>>> Windows apps.
>>>>
>>>
>>> Yes. But does Windows loader can see the x bit assigned by Cygwin, a quite
>>> different OS?
>>
>> Cygwin is not an O/S. The basis for Cygwin is the emulation _DLL_,
>> cygwin1.dll. Cygwin executables and DLLs are Windows binaries, subject to
>> whatever limitations the Windows loader has. That's it. If you're not
>> happy about that, you should complain to MS about it.
>>
> Then, what limitations does the Windows loader have?

You might want to do a search to find some information about the Windows
loader.  This isn't really the forum to learn about such things.

> As far as I know, there is no x bits for windows, right?

Windows doesn't use POSIX (rwx) permissions.  It uses ACLs (Access Control
Lists) for permissions.  Cygwin uses the ACLs to simulate POSIX permissions
for POSIX apps under it's control.  Setting or unsetting "x" is telling
Windows you want to change the executable permissions of the file in
question.

> How does the "chmod
> a-x" affect the file behavior under Windows if this is a Windows thing? I am
> completely confused. When I ran "chmod a-x *.dll", I assumed that these dll
> files were not executed directly under Cygwin or Windows; they were just
> some files storing the required functions or something; removing the x bits
> should not affect the behavior of Cygwin and Windows. If have run "chmod
> a-x" on the Windows system dll files, that will lead to the corruption of
> Windows, right? Thank God. I didn't do that.

Corruption is not a term I would use but if you're asking me if it's safe
for you to go around and change the permissions of any and all files on
your system, I would have to recommend against you doing so.

Changing the permissions of files on your system isn't something you should
do lightly.  Think of it as playing around in the registry.  If you don't
know the consequences, don't do it.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 13:03 Why /usr/bin/*.dll must be executable? De-Jian Zhao
  2012-04-20 13:05 ` De-Jian Zhao
  2012-04-20 13:08 ` Václav Zeman
@ 2012-04-20 19:06 ` Jon TURNEY
  2012-04-21  3:37   ` De-Jian Zhao
  2012-04-23 19:02   ` Warren Young
  2 siblings, 2 replies; 29+ messages in thread
From: Jon TURNEY @ 2012-04-20 19:06 UTC (permalink / raw)
  To: cygwin; +Cc: dejian.zhao

On 20/04/2012 14:02, De-Jian Zhao wrote:
> When I type "cyg" and Tab, many executables starting with "cyg" are listed
> (Display all 262 possibilities? (y or n) y). I find that many of them are
> *.dll libraries under /usr/bin/. This is inconvenient to find the real
> executable applications (*.exe).

'export EXECIGNORE=*.dll' is a cygwin extension to bash to tell it you don't
want to see those pesky dlls.

See /usr/share/doc/Cygwin/bash.README

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 18:21               ` De-Jian Zhao
  2012-04-20 18:43                 ` Larry Hall (Cygwin)
@ 2012-04-20 22:10                 ` Mike Kaganski
  2012-04-22  2:29                   ` Larry Hall (Cygwin)
  1 sibling, 1 reply; 29+ messages in thread
From: Mike Kaganski @ 2012-04-20 22:10 UTC (permalink / raw)
  To: cygwin

On 4/21/2012 5:21 AM, De-Jian Zhao wrote:
> ...
> Then, what limitations does the Windows loader have?
> As far as I know, there is no x bits for windows, right? How does the 
> "chmod a-x" affect the file behavior under Windows if this is a 
> Windows thing? I am completely confused. When I ran "chmod a-x *.dll", 
> I assumed that these dll files were not executed directly under Cygwin 
> or Windows; they were just some files storing the required functions 
> or something; removing the x bits should not affect the behavior of 
> Cygwin and Windows. If have run "chmod a-x" on the Windows system dll 
> files, that will lead to the corruption of Windows, right? Thank God. 
> I didn't do that.
>
>
>
> -- 
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
The term "Executable" is not limited to the files that are run directly. 
It rather shows that this file contains executable code, and in case of 
DLLs, this is almost always true (unless they are resource-only DLLs; 
note that sometimes unaware programmers create DLLs wich contain only 
resources, but fail to create proper resource-only DLLs, ant they still 
contain loading and unloading code).
Any code that may be executed (directly or indirectly) must have "x" 
under *nix. Windows had tried to make somewhat similar (with the same 
security concerns in mind) in its NT family, but it had to deal with 
file systems that have no notion of "executability" (FAT), so the notion 
was introduced in NTFS, but is not honored (thus, "execute" ACL 
permission is useless in Windows).
As Cygwin tries to emulate *nix, I suppose, it explicitly checks 
executable bit on loading files. So it's not correct to state that "this 
is completely Windows loader thing", but this thing is conceptually 
correct, so live with it.

-- 
Best regards, Mike.


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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 19:06 ` Jon TURNEY
@ 2012-04-21  3:37   ` De-Jian Zhao
  2012-04-23 19:02   ` Warren Young
  1 sibling, 0 replies; 29+ messages in thread
From: De-Jian Zhao @ 2012-04-21  3:37 UTC (permalink / raw)
  To: cygwin; +Cc: Jon TURNEY

On 2012-4-21 3:06, Jon TURNEY wrote:
> On 20/04/2012 14:02, De-Jian Zhao wrote:
>> When I type "cyg" and Tab, many executables starting with "cyg" are listed
>> (Display all 262 possibilities? (y or n) y). I find that many of them are
>> *.dll libraries under /usr/bin/. This is inconvenient to find the real
>> executable applications (*.exe).
> 'export EXECIGNORE=*.dll' is a cygwin extension to bash to tell it you don't
> want to see those pesky dlls.
>
> See /usr/share/doc/Cygwin/bash.README
>
Cool! That's just what I need! Thanks, Jon.


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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 22:10                 ` Mike Kaganski
@ 2012-04-22  2:29                   ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-22  2:29 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 6:10 PM, Mike Kaganski wrote:
<snip>

> Any code that may be executed (directly or indirectly) must have "x" under
> *nix. Windows had tried to make somewhat similar (with the same security
> concerns in mind) in its NT family, but it had to deal with file systems
> that have no notion of "executability" (FAT), so the notion was introduced
> in NTFS, but is not honored (thus, "execute" ACL permission is useless in
> Windows).

Huh?  It is honored on NTFS.  I'm assuming that's what you meant.

> As Cygwin tries to emulate *nix, I suppose, it explicitly checks executable
> bit on loading files. So it's not correct to state that "this is completely
> Windows loader thing", but this thing is conceptually correct, so live with it.

As I said before, Cygwin doesn't run executables.  Cygwin is not an O/S.
Windows is the O/S.  It has the job of running executables, loading them,
following any dependencies (DLLs), and loading those.  While Cygwin does
emulate POSIX permissions using Windows ACE/ACLs, it is up to Windows to
enforce these permissions.  But setting permissions is not the same as
having some control over the loading executables.  Sorry.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 13:08 ` Václav Zeman
  2012-04-20 16:18   ` De-Jian Zhao
@ 2012-04-23 19:01   ` Warren Young
  2012-04-23 20:16     ` Larry Hall (Cygwin)
  1 sibling, 1 reply; 29+ messages in thread
From: Warren Young @ 2012-04-23 19:01 UTC (permalink / raw)
  To: Cygwin-L

On 4/20/2012 7:07 AM, Václav Zeman wrote:
> This is a Windows thing.

Another aspect of the Windows Thing which I have not seen discussed yet 
is the DLL load path: http://goo.gl/VA8yC

Since Windows looks for DLLs first in the *.exe directory, this is the 
most reliable place to put them.

Options 2-5 in the list at the page linked above don't really apply 
here.  Cygwin purposely keeps itself nice and segregated from the rest 
of the system, so installing DLLs under c:\Windows isn't an option, and 
CWD is simply useless for our purpose here.

The only thing stopping us from using the final option in the article 
(i.e. putting cyg*.dll somewhere else in the PATH) is that it would put 
the DLLs off in the most fragile location allowed under the rules and it 
wouldn't solve the OP's problem anyway.  The DLLs would still appear in 
file name completion lists, since that also searches the PATH.

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-20 19:06 ` Jon TURNEY
  2012-04-21  3:37   ` De-Jian Zhao
@ 2012-04-23 19:02   ` Warren Young
  2012-04-23 19:26     ` David Sastre Medina
  1 sibling, 1 reply; 29+ messages in thread
From: Warren Young @ 2012-04-23 19:02 UTC (permalink / raw)
  To: cygwin

On 4/20/2012 1:06 PM, Jon TURNEY wrote:
>
> 'export EXECIGNORE=*.dll' is a cygwin extension to bash to tell it you don't
> want to see those pesky dlls.

Is there a good reason this isn't in the stock /etc/bash.bashrc?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-23 19:02   ` Warren Young
@ 2012-04-23 19:26     ` David Sastre Medina
  0 siblings, 0 replies; 29+ messages in thread
From: David Sastre Medina @ 2012-04-23 19:26 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

On Mon, Apr 23, 2012 at 01:02:39PM -0600, Warren Young wrote:
> On 4/20/2012 1:06 PM, Jon TURNEY wrote:
> >
> >'export EXECIGNORE=*.dll' is a cygwin extension to bash to tell it you don't
> >want to see those pesky dlls.
> 
> Is there a good reason this isn't in the stock /etc/bash.bashrc?

Not that I can think of.
Added for the next release of base-files.

-- 
Primary key fingerprint: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-23 19:01   ` Warren Young
@ 2012-04-23 20:16     ` Larry Hall (Cygwin)
  2012-04-23 22:13       ` Warren Young
  2012-04-23 23:55       ` Richard Troy
  0 siblings, 2 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-23 20:16 UTC (permalink / raw)
  To: cygwin

On 4/23/2012 3:01 PM, Warren Young wrote:
> Options 2-5 in the list at the page linked above don't really apply here.
> Cygwin purposely keeps itself nice and segregated from the rest of the
> system, so installing DLLs under c:\Windows isn't an option, and CWD is
> simply useless for our purpose here.

While the windows and system directories aren't a great place to be putting
DLLs that don't belong to the O/S in some way (and indeed Windows tries to
discourage it actively in recent versions by keeping it off limits to
users without sufficient privileges), why do you think Cygwin apps
wouldn't see a DLL it needed if it were in one of these locations?

I'm in full agreement that the 16-bit system directory and "current"
directory aren't useful or appropriate options in the context of
locations for Cygwin DLLs.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-23 20:16     ` Larry Hall (Cygwin)
@ 2012-04-23 22:13       ` Warren Young
  2012-04-23 23:55       ` Richard Troy
  1 sibling, 0 replies; 29+ messages in thread
From: Warren Young @ 2012-04-23 22:13 UTC (permalink / raw)
  To: cygwin

On 4/23/2012 2:15 PM, Larry Hall (Cygwin) wrote:
> On 4/23/2012 3:01 PM, Warren Young wrote:
>> Options 2-5 in the list at the page linked above don't really apply here.
>> Cygwin purposely keeps itself nice and segregated from the rest of the
>> system, so installing DLLs under c:\Windows isn't an option, and CWD is
>> simply useless for our purpose here.
>
> While the windows and system directories aren't a great place to be putting
> DLLs that don't belong to the O/S in some way (and indeed Windows tries to
> discourage it actively in recent versions by keeping it off limits to
> users without sufficient privileges), why do you think Cygwin apps
> wouldn't see a DLL it needed if it were in one of these locations?

I'm not saying it wouldn't work, I'm just saying that installing Cygwin 
DLLs under %SYSTEMROOT% would cross the grain of the Cygwin installation 
philosophy.  It would complicate uninstallation, perhaps to the point 
that someone decides we now need an automatic uninstaller.

As it is, manual uninstallation is easy and rare enough that the biggest 
problem we see with it is people not finding the FAQ item.

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-23 20:16     ` Larry Hall (Cygwin)
  2012-04-23 22:13       ` Warren Young
@ 2012-04-23 23:55       ` Richard Troy
  2012-04-24  0:19         ` Warren Young
  1 sibling, 1 reply; 29+ messages in thread
From: Richard Troy @ 2012-04-23 23:55 UTC (permalink / raw)
  To: cygwin


On Mon, 23 Apr 2012, Larry Hall (Cygwin) wrote:
>
> On 4/23/2012 3:01 PM, Warren Young wrote:
> > Options 2-5 in the list at the page linked above don't really apply here.
> > Cygwin purposely keeps itself nice and segregated from the rest of the
> > system, so installing DLLs under c:\Windows isn't an option, and CWD is
> > simply useless for our purpose here.
>
> While the windows and system directories aren't a great place to be putting
> DLLs that don't belong to the O/S in some way (and indeed Windows tries to
> discourage it actively in recent versions by keeping it off limits to
> users without sufficient privileges), why do you think Cygwin apps
> wouldn't see a DLL it needed if it were in one of these locations?
>
> I'm in full agreement that the 16-bit system directory and "current"
> directory aren't useful or appropriate options in the context of
> locations for Cygwin DLLs.
>
>

Hmmm... I was following this thread hoping to learn something about a
problem I was trying to solve wherein I launch a Cygwin-GNU-compiled
program and it failed with "error while loading shared libraries: ?:
cannot open shared object file: No such file or directory".

(I think the question mark stands where there would ordinarily be the name
of some DLL, but I only received the question mark.)

...It seemed reasonable to think the problem may be related to where the
.dll files go, PATH, or some other clue given on the web page cited
earlier in this thread regarding the search order for shared libraries,
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx#search_order_for_desktop_applications)
but I eventually traced it to something that seems bizarre to me: the use
of --login on a call to bash. Pre-Windows 7, this code was known to work
fine without the login switch and it drove me banannas until tried
--login. I'm wondering; what on earth would --login have to do with where
the dlls are found?


Thanks,
Richard




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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-23 23:55       ` Richard Troy
@ 2012-04-24  0:19         ` Warren Young
  2012-04-24 16:49           ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 29+ messages in thread
From: Warren Young @ 2012-04-24  0:19 UTC (permalink / raw)
  To: Cygwin-L

On 4/23/2012 6:12 PM, Richard Troy wrote:
>
>  what on earth would --login have to do with where
> the dlls are found?

Without that, you don't run the profile files[*], so you get the Windows 
PATH[**]  which is clearly insufficient in your situation.

Somewhere in one of these files is a line of code that adds the 
directory containing the problem DLL to your PATH.

[*]  /etc/profile, ~/.bash_profile, ~/.profile, ~/.bash_login...
[**] System control panel > Advanced > Environment Variables

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

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

* Re: Why /usr/bin/*.dll must be executable?
  2012-04-24  0:19         ` Warren Young
@ 2012-04-24 16:49           ` Larry Hall (Cygwin)
  0 siblings, 0 replies; 29+ messages in thread
From: Larry Hall (Cygwin) @ 2012-04-24 16:49 UTC (permalink / raw)
  To: cygwin

On 4/23/2012 8:19 PM, Warren Young wrote:
> On 4/23/2012 6:12 PM, Richard Troy wrote:
>>
>> what on earth would --login have to do with where
>> the dlls are found?
>
> Without that, you don't run the profile files[*], so you get the Windows
> PATH[**] which is clearly insufficient in your situation.
>
> Somewhere in one of these files is a line of code that adds the directory
> containing the problem DLL to your PATH.

And the path needed to find DLLs that are provided by the distribution
is added in '/etc/profile'.  The template for this file can be found in
'/etc/defaults/etc'.  This file is sourced by default for a login shell.

I can't explain why you might see a difference on W7 with this though,
unless your non-W7 machines added Cygwin paths in the Windows environment
(via cygwin.bat, the control panel that Warren pointed out, or other
scripting files that are part of the your process Richard).

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

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

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

end of thread, other threads:[~2012-04-24 16:49 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-20 13:03 Why /usr/bin/*.dll must be executable? De-Jian Zhao
2012-04-20 13:05 ` De-Jian Zhao
2012-04-20 13:08 ` Václav Zeman
2012-04-20 16:18   ` De-Jian Zhao
2012-04-20 16:28     ` Corinna Vinschen
2012-04-20 17:25       ` Nellis, Kenneth
2012-04-20 17:29         ` Larry Hall (Cygwin)
2012-04-20 17:37           ` De-Jian Zhao
2012-04-20 17:46             ` Larry Hall (Cygwin)
2012-04-20 17:40           ` Nellis, Kenneth
2012-04-20 17:32       ` De-Jian Zhao
2012-04-20 17:41         ` Larry Hall (Cygwin)
2012-04-20 17:47           ` De-Jian Zhao
2012-04-20 17:58             ` Larry Hall (Cygwin)
2012-04-20 18:21               ` De-Jian Zhao
2012-04-20 18:43                 ` Larry Hall (Cygwin)
2012-04-20 22:10                 ` Mike Kaganski
2012-04-22  2:29                   ` Larry Hall (Cygwin)
2012-04-20 18:05             ` Larry Hall (Cygwin)
2012-04-23 19:01   ` Warren Young
2012-04-23 20:16     ` Larry Hall (Cygwin)
2012-04-23 22:13       ` Warren Young
2012-04-23 23:55       ` Richard Troy
2012-04-24  0:19         ` Warren Young
2012-04-24 16:49           ` Larry Hall (Cygwin)
2012-04-20 19:06 ` Jon TURNEY
2012-04-21  3:37   ` De-Jian Zhao
2012-04-23 19:02   ` Warren Young
2012-04-23 19:26     ` David Sastre Medina

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