public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Bash 4.4.12-3 erroneous behavior using [[ -f name ]] and other utilities
Date: Wed, 9 Sep 2020 11:31:03 -0600	[thread overview]
Message-ID: <c8e1e972-3cfd-928e-f169-d0965f3e0923@SystematicSw.ab.ca> (raw)
In-Reply-To: <cb4492da-43e9-f47f-4a2f-f98e388df439@cs.umass.edu>

On 2020-09-09 08:25, Eliot Moss wrote:
> On 9/9/2020 12:57 AM, JohnBush@EMail.com wrote:
>> I appreciate your reply outside the scope of the cygwin alias. Sorry I am
>> having issues with the alias.   I'll change to a gmail address soon because
>> I'll bet that the *mail.com* server is bogusifically filtering my outgoing mail.

Looking at your original content, you have unindented, unprefixed Unix commands
at the starts of lines, so the malware checker probably classifies your email
content as a potentially malicious surreptitious script hack.
Try indenting your command lines and prompt prefixing them and all should be well.

>> I understand the reasoning in transparifying the .exe suffix;  I suspected
>> this was an incurable windows host environment issue, but didn't fully fathom
>> how embedded this nuance is in the overall nature of everything.
>>
>> If I come up with a workaround, I will let you know.    I'm going to write a
>> simple C program that calls *lstat()*.   I hope this links beneath where the
>> error is produced in the command environment.   If my experiment works, I'll
>> send you the code.   If not, well, it's been nice chatting, and I will be out
>> of your hair. :-)
>>
>> Thanks also Eliot Moss who replied separately.

> I think the intention is that this be entirely transparent at the
> library interface.  It is a behavior intentionally placed deep within the
> libraries.  Maybe there's some edge case kind of way that will reveal that foo
> does not really exist and only foo.exe is there, but that would be because for
> some reason the Cygwin core could not hide it.
> So I expect writing your own C code to call lstat is not going to change
> things.  This is
> not a bash behavior but a Cygwin behavior, deep in the library code.
> 
> If you really really need to look and see the difference, then you can use
> Windows calls to do so -- but rather than going that route, why don't you lay
> out your use actual use case to the Cygwin community?  Why is it you think you
> need to see around this?  Often there are other ways to achieve your overall
> objective that go more smoothly.  At least that's my experience with situations
> where people are rubbing up against an intentional design ...

As anyone who has run a Cygwin strace knows, Cygwin suffix additions check for
.exe, .lnk, and .exe.lnk, and so you should not have a file or directory and
file with the same basename and one of those suffixes in the same directory.
The check is performed in symlink_check at a low level.

If the name is sufficiently long to be unique, you can bypass suffix addition
within a directory at the command line glob by prefixing the basename with a
wildcard:

$ ls /bin/*bash
ls: cannot access '/bin/*bash': No such file or directory
$ ls /bin/bash
/bin/bash
$ ls /bin/bash.exe
/bin/bash.exe

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

      parent reply	other threads:[~2020-09-09 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <de062d4d-908b-50de-2c32-0851098c62e7@EMail.com>
2020-09-08  6:24 ` JohnBush
2020-09-08 16:22   ` Brian Inglis
2020-09-08 16:34     ` Brian Inglis
2020-09-08 18:36   ` L A Walsh
     [not found]   ` <dc845fd2-437f-327d-46c3-338d7be36b09@cs.umass.edu>
     [not found]     ` <f6289c38-544d-0f91-3f54-402292b7a0a8@EMail.com>
     [not found]       ` <5F582F25.3040301@tlinx.org>
     [not found]         ` <e9f7ac1a-d47d-a136-10e9-9d72e07e98e4@EMail.com>
     [not found]           ` <cb4492da-43e9-f47f-4a2f-f98e388df439@cs.umass.edu>
2020-09-09 17:31             ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8e1e972-3cfd-928e-f169-d0965f3e0923@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).