[hackers] [sbase][PATCH] tar: sanitize: leading zeros should be recognized

2024-02-10 Thread Elie Le Vaillant
Most tar implementations (GNU, BusyBox, toybox, libarchive) recognize leading spaces as equivalent to leading zeroes in numeric fields. This leads to some archives begin recognized as malformed. This fixes it by replacing leading spaces by leading zeroes in sanitize(). Considering numeric fields ar

[hackers] [sbase][PATCH v2] tar: sanitize: leading zeros should be recognized

2024-02-10 Thread Elie Le Vaillant
Most tar implementations (GNU, BusyBox, toybox, libarchive) recognize leading spaces as equivalent to leading zeroes in numeric fields. This leads to some archives begin recognized as malformed. This fixes it by replacing leading spaces by leading zeroes in sanitize(), and in chktar(), too. --- ta

[hackers] Re: [sbase][PATCH v2] tar: sanitize: leading zeros should be recognized

2024-02-10 Thread Eolien55
Elie Le Vaillant wrote: > This leads to some archives begin recognized as malformed. See for example ftp://ftp.gnu.org/gnu/shtool/shtool-2.0.8.tar.gz. Although it is old, and does not follow the ustar specification (that forbids leading spaces), it is recognized by all the tar implementations I'v