You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `cd` row reports the directory in which `cd` itself runs; the `cat` row
677
+
reports the successful `AndIf` continuation state. This is why consumers
678
+
should use the occurrence's `WorkingDirectory` for execution context and the
679
+
argument's `Resolved` value for path-zone policy rather than trying to infer
680
+
either from clause order.
681
+
565
682
The attributed argument is derived context:
566
683
567
684
- use it when evaluating where a clause operates;
@@ -582,6 +699,18 @@ write outside an allowed zone:
582
699
echo safe > /etc/profile.d/example.sh
583
700
```
584
701
702
+
With a Bash working directory of `/work`, representative results are:
703
+
704
+
| Input | Redirect alternative | Source | Relevant value | Complete? | Consumer consequence |
705
+
|---|---|---|---|---:|---|
706
+
|`echo safe > /etc/profile.d/example.sh`|`FileRedirectAnalysis` with `Mode = Output`|`Default`|`Target = Exact("/etc/profile.d/example.sh")`| yes | Apply write-path policy to the exact target. |
707
+
|`command 2>&1`|`DescriptorDuplicateRedirectAnalysis`|`Descriptor(2)`|`TargetDescriptor = 1`| yes | Apply descriptor policy; do not treat `1` as a path. |
708
+
|`command 2>&$FD`|`UnresolvedRedirectAnalysis`|`Unknown`| no proved target descriptor | no | Prompt or deny the occurrence. |
709
+
710
+
Those are runtime alternatives, not interpretations of a string prefix. In
711
+
particular, the incomplete third row cannot accidentally pass a rule written
712
+
for ordinary stderr-to-stdout duplication.
713
+
585
714
For a v0.2 compatibility consumer, walk `Clause.Redirects` independently of
586
715
`Args`:
587
716
@@ -714,6 +843,24 @@ invocation. By contrast, `& $(Write-Output Get-Date)` also retains an
714
843
incomplete dynamic outer occurrence because PowerShell invokes the produced
715
844
name.
716
845
846
+
Bash exposes the same execution-before-container ordering. For:
847
+
848
+
```bash
849
+
rm "$(find /tmp)"
850
+
```
851
+
852
+
the relevant projection is:
853
+
854
+
|`Commands` index | Command |`ImmediateRole`| Argument value |
855
+
|---:|---|---|---|
856
+
| 0 |`find /tmp`|`Substitution`|`/tmp` is `Exact("/tmp")`|
857
+
| 1 |`rm "$(find /tmp)"`|`Ordinary`| produced filename is `Unknown`|
858
+
859
+
The `find` occurrence is independently authorizable, but its presence does not
860
+
make the bytes it prints a statically known `rm` operand. A path-sensitive
861
+
policy therefore evaluates `find` and still prompts or denies `rm`. It does not
862
+
walk `Syntax` afterward and authorize `find` a second time.
863
+
717
864
Quoting also determines the scope of host-wrapper substitutions. In
718
865
`pwsh -Command "Write-Output $(Get-Date)"`, the parent evaluates `Get-Date`, so
719
866
the result contains that parent-scope occurrence plus an incomplete outer
@@ -750,6 +897,18 @@ The recoverable outcome is normally a user prompt with a one-time option, or a
750
897
deny. A false-negative approval match causes another prompt; a false-positive
751
898
match can silently execute something the operator did not authorize.
752
899
900
+
Two different result shapes reach that same safe outcome:
| PowerShell: `& $exe`|`IsUnparseable = false`; one occurrence with `IsComplete = false` and `Verb.IsDynamic = true`| The syntax is recognized, but the executable identity is not bounded. |
905
+
| Bash: `if true; then echo ok; fi`|`IsUnparseable = true`; `Commands` and `Clauses` are empty | The unsupported control construct may contain execution, so partial syntax is diagnostic only. |
906
+
907
+
`IsUnparseable = false` is therefore not an allow signal. It means only that
908
+
the whole input was not rejected as an unsupported or unsafe-to-project
909
+
construct; the consumer still checks every occurrence and every
0 commit comments