Mail Archives: cygwin/2012/04/20/14:43:47
X-Recipient: | archive-cygwin AT delorie DOT com
|
X-SWARE-Spam-Status: | No, hits=1.6 required=5.0 tests=AWL,BAYES_00,BOTNET,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,TW_RW
|
X-Spam-Check-By: | sourceware.org
|
MIME-version: | 1.0
|
Message-id: | <4F91AE30.4020509@cygwin.com>
|
Date: | Fri, 20 Apr 2012 14:42:56 -0400
|
From: | "Larry Hall (Cygwin)" <reply-to-list-only-lh AT cygwin DOT com>
|
Reply-to: | cygwin AT cygwin DOT com
|
User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1
|
To: | cygwin AT cygwin DOT com
|
Subject: | Re: Why /usr/bin/*.dll must be executable?
|
References: | <4F915E65 DOT 8070608 AT gmail DOT com> <CAKw7uVjf6kt2O=u4EB4xDGgF5wCvqRmtO6v_bc51R7Qj2RFZLw AT mail DOT gmail DOT com> <4F918C2A DOT 2080300 AT gmail DOT com> <20120420162718 DOT GK22155 AT calimero DOT vinschen DOT de> <4F919DA6 DOT 7000700 AT gmail DOT com> <4F919F9C DOT 1080307 AT cygwin DOT com> <4F91A11C DOT 5000300 AT gmail DOT com> <4F91A392 DOT 7070108 AT cygwin DOT com> <4F91A912 DOT 9000103 AT gmail DOT com>
|
In-reply-to: | <4F91A912.9000103@gmail.com>
|
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm
|
List-Id: | <cygwin.cygwin.com>
|
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
|
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
- Raw text -