Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Wolfgang Bumiller
On Tue, Jun 06, 2023 at 12:45:57PM +0200, Thomas Lamprecht wrote: > Am 06/06/2023 um 11:41 schrieb Dominik Csapak: > >>>   +my $untaint_recursive; > >> > >> I got flash backs w.r.t. refcount cycles here keeping all variables, and  > >> thus memory > >> inside the body alive forever, don't we need 

Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Thomas Lamprecht
Am 06/06/2023 um 13:19 schrieb Dominik Csapak: > ---8<--- > use Storable qw(dclone); > > my $normalize; > $normalize = sub {...}; > > my $data = /* create large hash here, with nested data */; > > while(1) { >     my $newdata = dclone($data); >     $newdata = $normalize->($newdata); > } >

Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Dominik Csapak
On 6/6/23 12:45, Thomas Lamprecht wrote: Am 06/06/2023 um 11:41 schrieb Dominik Csapak:   +my $untaint_recursive; I got flash backs w.r.t. refcount cycles here keeping all variables, and thus  memory inside the body alive forever, don't we need a weaken? E.g., like we had to do in 

Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Thomas Lamprecht
Am 06/06/2023 um 11:41 schrieb Dominik Csapak: >>>   +my $untaint_recursive; >> >> I got flash backs w.r.t. refcount cycles here keeping all variables, and  >> thus memory >> inside the body alive forever, don't we need a weaken? >> >> E.g., like we had to do in PVE::Status::Graphite's assemble. >

Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Dominik Csapak
On 6/6/23 11:12, Thomas Lamprecht wrote: Am 06/06/2023 um 10:39 schrieb Dominik Csapak: a few things were missing for it to work: * on the cli, we have to get the option as an array if the type is an array * the untainting must be done recursively, otherwise, the regex matching converts

Re: [pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Thomas Lamprecht
Am 06/06/2023 um 10:39 schrieb Dominik Csapak: > a few things were missing for it to work: > * on the cli, we have to get the option as an array if the type is an > array > * the untainting must be done recursively, otherwise, the regex matching > converts an array hash into the string

[pve-devel] [PATCH common v2 1/3] JSONSchema: add support for array parameter in api calls, cli and config

2023-06-06 Thread Dominik Csapak
a few things were missing for it to work: * on the cli, we have to get the option as an array if the type is an array * the untainting must be done recursively, otherwise, the regex matching converts an array hash into the string 'ARRAY(0x123412341234)' * JSONSchema::parse_config did not