Commit Graph
2 Commits
Author SHA1 Message Date
Devika Verma d7b3f12915 fix(permissions): env and git config ask; the card's grant button follows the shell (OPE-232)
- Bare `env` asks, as `printenv` already does.
- `git config` is no longer read-only: settings can hold credentials.
- On PowerShell, a recursive Get-ChildItem piped into a cmdlet that reads the listed
  files asks; piped into Select-Object, Sort-Object or Measure-Object it still runs.
- The card offers "Allow read-only commands for this session" using the engine's shell
  kind, so on Windows it matches what the grant covers.
2026-10-28 22:29:10 +05:30
Devika Verma b45f47df83 fix(permissions): the read-only session grant knows its shell and fails closed (OPE-232)
The "Allow read-only commands for this session" check now:

- takes the shell kind: bash on macOS / Linux, PowerShell on Windows. For PowerShell only
  a plain command with literal arguments is eligible; variables, sub-expressions,
  script blocks, array and hash literals, argument lists, escapes and call, redirection
  or sequence operators reject;
- treats a command on more than one line as more than one command, and rejects it;
- accepts only formatting environment prefixes (locale, time zone, colour, width);
- names paths carried by flags (`--file=PATH`, `-fPATH`, `-Path:PATH`) as read targets;
- judges paths from the persistent shell's current folder when the engine knows it, and
  asks once another shell command has been cleared earlier in the same batch;
- expands wildcards and checks every match against the folders.

Ordinary read-only commands keep running unprompted on all three platforms.
2026-10-28 22:29:10 +05:30