Commit c58f00a
init: Remove MAX_ARGS limit
init.c imposes limit of MAX_ARGS command line arguments. If there are
more arguments then they are silently ignored. Which is wrong and
dangerous, imagine one of those arguments being e.g. --dry-run or
--safe.
There is no reason to limit the number of the arguments to 32 (the value
of MAX_ARGS) declared in init.c. Common limits on the number of
arguments are much higher, if any. The arguments are passed in the
config file provided to the VM, it's the responsibility of the caller to
provide sane arguments. Which means we can lift the limit completely
and to allocate `argv' arrays to the exact size needed rather than to
the predefined maximum limit.
For example, the following command works fine for me with this patch,
while printing only the first 31 numbers previously:
podman run --runtime krun --rm -t \
docker.io/library/alpine echo $(seq 1 10000)
Fixes: #323
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>1 parent b7ecf07 commit c58f00a
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
624 | 623 | | |
625 | 624 | | |
626 | 625 | | |
| 626 | + | |
627 | 627 | | |
628 | | - | |
| 628 | + | |
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| 704 | + | |
704 | 705 | | |
705 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
706 | 712 | | |
707 | 713 | | |
708 | 714 | | |
709 | 715 | | |
710 | 716 | | |
711 | | - | |
| 717 | + | |
712 | 718 | | |
713 | 719 | | |
714 | 720 | | |
715 | | - | |
| 721 | + | |
716 | 722 | | |
717 | 723 | | |
718 | 724 | | |
| |||
0 commit comments