resholve icon indicating copy to clipboard operation
resholve copied to clipboard

check that a substituted program is executable?

Open abathur opened this issue 5 years ago • 1 comments

User request:

I wonder if resholved should check that a substituted program is executable

I'm not sure if there are gotchas here, but this seems like a good improvement.

abathur avatar Oct 22 '20 21:10 abathur

I guess one gotcha is: a non-executable script could still be sourced, or invoked as an argument to an interpreter. It may not be marked as executable because it's supposed to be sourced (and may cause some trouble if invoked directly?)

In that light, a simple global check won't work (at least, not without quickly ending up on a treadmill of new options for controlling when it blocks and not...).

I'm not sure if it'll be simple enough to justify, but context-sensitive resolution rules might support something like:

  • check command first-words
  • don't check 2nd args to . or source
  • don't check nth args to bash or some other shell

abathur avatar Nov 29 '20 22:11 abathur