[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to limit autofill of executables in 'cygwin-bash' to a list of '
From: |
Chet Ramey |
Subject: |
Re: how to limit autofill of executables in 'cygwin-bash' to a list of 'extensions' |
Date: |
Mon, 12 Jul 2010 21:36:06 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.7) Gecko/20100111 Lightning/1.0b1 Thunderbird/3.0.1 |
On 7/12/10 6:18 PM, Linda Walsh wrote:
> I have a long standing problem under cygwin in that when I type
> a prefix of 1 or more executables and hit the expand character (ESC),
> it lists out all the DLL's in my system path.
>
> I NEVER want to execute libraries directly. Many or most are
> not executables -- yet bash lists them. In Windows, the
> 'exec' bit doesn't mean it is an executable -- it means
> it is executable code that can be loaded into an executable
> segment of memory. Files that don't have that bit set get
> loaded into memory (on properly configured systems) that
> has a "NX:Not eXecutable" bit set, that disallows execution.
>
> Anyway -- it's more of an OS thing than a strictly a user
> thing -- and Windows uses a registry String value:
> [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session
> Manager\Environment\PathExt]
> (example value = ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC")
> (
> cygwin bash on win64:
> #>
> PATHEXT="$(<'/proc/registry64/HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Control/Session
> Manager/Environment/PATHEXT')"
> )
>
> to control what files are executable.
> Not saying this is a bash bug -- as it's really more of how bash
> should be configured on windows platforms (I suppose the same would
> be true for any MING versions of bash as well), but how can bash
> be setup to only display the executables appropriate for the given OS?
You have to modify the source. findcmd.c:executable_file and
findcmd.c:file_status are the functions to change. Bash just uses
the standard exec bit.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/