mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 00:04:06 -09:00
In Buildroot there are multiple way to apply patches on a package [1]
- Adding `.patch` file in the package directory.
- Define `<pkg>_PATCH` variable with the location of the patch tar.gz.
It used to download Debian patches tarball.
- Implement custom patching logic with `PRE`/`POST` patches hooks.
To make the CycloneDX SBOM generation not dependant on downloading the
packages, the two last options have the downside of not appearing on the
generated SBOM.
The unzip package is downloading a tarball from the Debian mirror with
the `<pkg>_PATCH` method [2].
To improve the tracking of the patched vulnerabilities for the unzip
package this commit import the patches previously downloaded with the
`_PATCH` variable in the Buildroot tree.
This allows to add the `CVE:` trailer [3] on the patches that fix
vulnerabilities to better track which patch is fixing the vulnerability.
[1] https://buildroot.org/downloads/manual/manual.html#patch-policy
[2] https://snapshot.debian.org/archive/debian/20250311T215724Z/pool/main/u/unzip/unzip_6.0-29.debian.tar.xz
[3] 1167d0ff3d docs/manual: mention CVE trailer
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
24 lines
1.1 KiB
Diff
24 lines
1.1 KiB
Diff
From: "Steven M. Schweda" <sms@antinode.info>
|
|
Subject: Handle the PKWare verification bit of internal attributes
|
|
Bug-Debian: https://bugs.debian.org/630078
|
|
X-Debian-version: 6.0-5
|
|
Upstream: https://sources.debian.org/src/unzip/6.0-29/debian/patches/04-handle-pkware-verification-bit.patch
|
|
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
|
|
|
|
--- a/process.c
|
|
+++ b/process.c
|
|
@@ -1729,6 +1729,13 @@
|
|
else if (uO.L_flag > 1) /* let -LL force lower case for all names */
|
|
G.pInfo->lcflag = 1;
|
|
|
|
+ /* Handle the PKWare verification bit, bit 2 (0x0004) of internal
|
|
+ attributes. If this is set, then a verification checksum is in the
|
|
+ first 3 bytes of the external attributes. In this case all we can use
|
|
+ for setting file attributes is the last external attributes byte. */
|
|
+ if (G.crec.internal_file_attributes & 0x0004)
|
|
+ G.crec.external_file_attributes &= (ulg)0xff;
|
|
+
|
|
/* do Amigas (AMIGA_) also have volume labels? */
|
|
if (IS_VOLID(G.crec.external_file_attributes) &&
|
|
(G.pInfo->hostnum == FS_FAT_ || G.pInfo->hostnum == FS_HPFS_ ||
|