[pbs-devel] [PATCH v8 pxar 14/69] format/encoder/decoder: new pxar entry type `Version`

Christian Ebner c.ebner at proxmox.com
Mon Jun 3 14:10:56 CEST 2024


On 6/3/24 13:54, Christian Ebner wrote:
> On 6/3/24 13:25, Fabian Grünbichler wrote:
>> On May 28, 2024 11:42 am, Christian Ebner wrote:
>>> Introduces a new pxar format entry type `Version` and the associated
>>> encoder and decoder methods. The format version entry is only allowed
>>> once, as the first entry of the pxar archive, marked with a
>>> `PXAR_FORMAT_VERSION` header followed by the encoded version number.
>>> If not present, the default format version 1 is assumed as encoding
>>> format for the archive.
>>>
>>> The entry allows to early detect incompatibility with an encoded
>>> archive and bail or switch mode based on the encountered version.
>>>
>>> The format version entry is not backwards compatible to pxar format
>>> version 1.
>>>
>>> Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
>>
>> it seems there are still some checks missing for this, if I build
>> patched PBS versions with an added Version 3 but lacking decode support,
>> I get the expected error in a lot of places, but can for example use the
>> `pxar-file-download` endpoint to download files from the archive, even
>> though the server should choke on the archive since it's using an
>> unknown value in the version header/entry..
>>
>> ideally they'd be added here in pxar (since who knows, the next format
>> break might be entirely transparent to PBS :))
>>
> 
> Okay, agreed! I will add an additional check to the decoder which fails 
> if the encoded variant is not known.

Oh, I seem to have misinterpreted this. There already is a check in 
place which fails if the format version variant is not known.

But when accessing an archive via the `Accessor`, the format version 
entry is not read, as the `Accessor`s entry point is the last goodbye 
table at the end, therefore ignoring the format version and prelude 
entries altogether.

Will have a look on how I might catch these cases as well on the pxar side.




More information about the pbs-devel mailing list