Repository navigation
Commit 1a86b0f
fix(rp1): keep RP1 for option values that may split and for 2&>log
The operand scan still accepted two kinds of words that do not prove which
word is the image:
- An option value that the shell can turn into several arguments or none.
With DOCKER_ENV='MODE=dev ubuntu', `docker run --rm -e $DOCKER_ENV
alpine:3.20` runs ubuntu, and alpine:3.20 becomes the container command.
Every option, option value and redirection target read before the image
now has to stay one argument: no unquoted expansion ($ENV, -e$ENV,
--env=$ENV, $(pwd)), brace expansion ({A,B}=1, X{1..2}), or glob, and
no "$@" or "${arr[@]}". A command substitution in double quotes counts
only when it is plain words, because a quote inside it ("$(echo " x ")")
ends the double-quoted string early here, and a case pattern can hide
its closing ). Otherwise the image is unresolved and the command is
still reported. Redirection targets get the same check because the scan
can end them early too (2>${LOG:-a b}).
- A number before &> or &>>. Those operators take no file descriptor, so
in `docker run --rm 2&>log alpine:3.20` the 2 is an argument and the
image. The descriptor prefix now applies only to the other operators;
`&>log alpine:3.20` still reads alpine:3.20 as the image.
Signed-off-by: Ilai Goldschmidt <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent b25acf8 commit 1a86b0f
2 files changed
Lines changed: 138 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | | - | |
| 198 | + | |
198 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| |||
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
366 | 420 | | |
367 | 421 | | |
368 | 422 | | |
369 | 423 | | |
370 | 424 | | |
371 | 425 | | |
372 | 426 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
376 | 431 | | |
377 | 432 | | |
378 | 433 | | |
| |||
383 | 438 | | |
384 | 439 | | |
385 | 440 | | |
386 | | - | |
387 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
388 | 445 | | |
389 | 446 | | |
390 | 447 | | |
391 | 448 | | |
392 | 449 | | |
393 | 450 | | |
394 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
395 | 458 | | |
396 | 459 | | |
397 | | - | |
398 | | - | |
399 | 460 | | |
400 | 461 | | |
401 | 462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| 281 | + | |
| 282 | + | |
281 | 283 | | |
282 | 284 | | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| |||
306 | 309 | | |
307 | 310 | | |
308 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
309 | 369 | | |
310 | 370 | | |
311 | 371 | | |
| |||
322 | 382 | | |
323 | 383 | | |
324 | 384 | | |
| 385 | + | |
| 386 | + | |
325 | 387 | | |
326 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
327 | 394 | | |
328 | 395 | | |
329 | 396 | | |
| |||
0 commit comments